From e6e05520ce1a2399656f4b02f573cc2422455561 Mon Sep 17 00:00:00 2001 From: pipedrive-bot Date: Fri, 5 Apr 2024 10:29:50 +0000 Subject: [PATCH] Build 2333 - version-minor --- .openapi-generator/FILES | 6 + CHANGELOG.md | 2 + README.md | 6 + docs/Api/DealsApi.md | 70 +++ docs/Api/OrganizationsApi.md | 70 +++ docs/Api/PersonsApi.md | 70 +++ docs/Model/ActivityTypeObjectResponse.md | 4 +- docs/Model/ChangelogResponse.md | 11 + docs/Model/ChangelogResponseAllOf.md | 10 + docs/Model/ChangelogResponseAllOfData.md | 16 + docs/Model/Field.md | 4 +- docs/Model/PaymentItem.md | 4 +- docs/Model/SubscriptionItem.md | 4 +- lib/Api/DealsApi.php | 322 +++++++++++++ lib/Api/OrganizationsApi.php | 322 +++++++++++++ lib/Api/PersonsApi.php | 322 +++++++++++++ lib/Model/ActivityTypeObjectResponse.php | 16 +- lib/Model/ChangelogResponse.php | 402 +++++++++++++++++ lib/Model/ChangelogResponseAllOf.php | 372 +++++++++++++++ lib/Model/ChangelogResponseAllOfData.php | 552 +++++++++++++++++++++++ lib/Model/Field.php | 16 +- lib/Model/PaymentItem.php | 16 +- lib/Model/SubscriptionItem.php | 16 +- 23 files changed, 2593 insertions(+), 40 deletions(-) create mode 100644 docs/Model/ChangelogResponse.md create mode 100644 docs/Model/ChangelogResponseAllOf.md create mode 100644 docs/Model/ChangelogResponseAllOfData.md create mode 100644 lib/Model/ChangelogResponse.php create mode 100644 lib/Model/ChangelogResponseAllOf.php create mode 100644 lib/Model/ChangelogResponseAllOfData.php diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index cfdd1f40..e4a7eada 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -181,6 +181,9 @@ docs/Model/CallLogResponse410.md docs/Model/CallLogResponse500.md docs/Model/CallLogsResponse.md docs/Model/CallLogsResponseAdditionalData.md +docs/Model/ChangelogResponse.md +docs/Model/ChangelogResponseAllOf.md +docs/Model/ChangelogResponseAllOfData.md docs/Model/ChannelObject.md docs/Model/ChannelObjectResponse.md docs/Model/ChannelObjectResponseData.md @@ -1025,6 +1028,9 @@ lib/Model/CallLogResponse410.php lib/Model/CallLogResponse500.php lib/Model/CallLogsResponse.php lib/Model/CallLogsResponseAdditionalData.php +lib/Model/ChangelogResponse.php +lib/Model/ChangelogResponseAllOf.php +lib/Model/ChangelogResponseAllOfData.php lib/Model/ChannelObject.php lib/Model/ChannelObjectResponse.php lib/Model/ChannelObjectResponseData.php diff --git a/CHANGELOG.md b/CHANGELOG.md index d76970ee..2f659f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Added documentation for new endpoints `/deals/{id}/changelog`, `/persons/{id}/changelog` and `/organizations/{id}/changelog`. ## [6.6.0](https://github.com/pipedrive/client-php/compare/6.5.1...6.6.0) (2024-04-02) diff --git a/README.md b/README.md index 56e960f8..242c3512 100644 --- a/README.md +++ b/README.md @@ -345,6 +345,7 @@ Class | Method | HTTP request | Description *DealsApi* | [**duplicateDeal**](docs/Api/DealsApi.md#duplicatedeal) | **POST** /deals/{id}/duplicate | Duplicate deal *DealsApi* | [**getDeal**](docs/Api/DealsApi.md#getdeal) | **GET** /deals/{id} | Get details of a deal *DealsApi* | [**getDealActivities**](docs/Api/DealsApi.md#getdealactivities) | **GET** /deals/{id}/activities | List activities associated with a deal +*DealsApi* | [**getDealChangelog**](docs/Api/DealsApi.md#getdealchangelog) | **GET** /deals/{id}/changelog | List updates about deal field values *DealsApi* | [**getDealFiles**](docs/Api/DealsApi.md#getdealfiles) | **GET** /deals/{id}/files | List files attached to a deal *DealsApi* | [**getDealFollowers**](docs/Api/DealsApi.md#getdealfollowers) | **GET** /deals/{id}/followers | List followers of a deal *DealsApi* | [**getDealMailMessages**](docs/Api/DealsApi.md#getdealmailmessages) | **GET** /deals/{id}/mailMessages | List mail messages associated with a deal @@ -441,6 +442,7 @@ Class | Method | HTTP request | Description *OrganizationsApi* | [**deleteOrganizations**](docs/Api/OrganizationsApi.md#deleteorganizations) | **DELETE** /organizations | Delete multiple organizations in bulk *OrganizationsApi* | [**getOrganization**](docs/Api/OrganizationsApi.md#getorganization) | **GET** /organizations/{id} | Get details of an organization *OrganizationsApi* | [**getOrganizationActivities**](docs/Api/OrganizationsApi.md#getorganizationactivities) | **GET** /organizations/{id}/activities | List activities associated with an organization +*OrganizationsApi* | [**getOrganizationChangelog**](docs/Api/OrganizationsApi.md#getorganizationchangelog) | **GET** /organizations/{id}/changelog | List updates about organization field values *OrganizationsApi* | [**getOrganizationDeals**](docs/Api/OrganizationsApi.md#getorganizationdeals) | **GET** /organizations/{id}/deals | List deals associated with an organization *OrganizationsApi* | [**getOrganizationFiles**](docs/Api/OrganizationsApi.md#getorganizationfiles) | **GET** /organizations/{id}/files | List files attached to an organization *OrganizationsApi* | [**getOrganizationFollowers**](docs/Api/OrganizationsApi.md#getorganizationfollowers) | **GET** /organizations/{id}/followers | List followers of an organization @@ -471,6 +473,7 @@ Class | Method | HTTP request | Description *PersonsApi* | [**deletePersons**](docs/Api/PersonsApi.md#deletepersons) | **DELETE** /persons | Delete multiple persons in bulk *PersonsApi* | [**getPerson**](docs/Api/PersonsApi.md#getperson) | **GET** /persons/{id} | Get details of a person *PersonsApi* | [**getPersonActivities**](docs/Api/PersonsApi.md#getpersonactivities) | **GET** /persons/{id}/activities | List activities associated with a person +*PersonsApi* | [**getPersonChangelog**](docs/Api/PersonsApi.md#getpersonchangelog) | **GET** /persons/{id}/changelog | List updates about person field values *PersonsApi* | [**getPersonDeals**](docs/Api/PersonsApi.md#getpersondeals) | **GET** /persons/{id}/deals | List deals associated with a person *PersonsApi* | [**getPersonFiles**](docs/Api/PersonsApi.md#getpersonfiles) | **GET** /persons/{id}/files | List files attached to a person *PersonsApi* | [**getPersonFollowers**](docs/Api/PersonsApi.md#getpersonfollowers) | **GET** /persons/{id}/followers | List followers of a person @@ -716,6 +719,9 @@ Class | Method | HTTP request | Description - [CallLogResponse500](docs/Model/CallLogResponse500.md) - [CallLogsResponse](docs/Model/CallLogsResponse.md) - [CallLogsResponseAdditionalData](docs/Model/CallLogsResponseAdditionalData.md) + - [ChangelogResponse](docs/Model/ChangelogResponse.md) + - [ChangelogResponseAllOf](docs/Model/ChangelogResponseAllOf.md) + - [ChangelogResponseAllOfData](docs/Model/ChangelogResponseAllOfData.md) - [ChannelObject](docs/Model/ChannelObject.md) - [ChannelObjectResponse](docs/Model/ChannelObjectResponse.md) - [ChannelObjectResponseData](docs/Model/ChannelObjectResponseData.md) diff --git a/docs/Api/DealsApi.md b/docs/Api/DealsApi.md index bf5e2c59..abef990c 100644 --- a/docs/Api/DealsApi.md +++ b/docs/Api/DealsApi.md @@ -16,6 +16,7 @@ Method | HTTP request | Description [**duplicateDeal()**](DealsApi.md#duplicateDeal) | **POST** /deals/{id}/duplicate | Duplicate deal [**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 [**getDealFiles()**](DealsApi.md#getDealFiles) | **GET** /deals/{id}/files | List files attached to a deal [**getDealFollowers()**](DealsApi.md#getDealFollowers) | **GET** /deals/{id}/followers | List followers of a deal [**getDealMailMessages()**](DealsApi.md#getDealMailMessages) | **GET** /deals/{id}/mailMessages | List mail messages associated with a deal @@ -835,6 +836,75 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getDealChangelog()` + +```php +getDealChangelog($id, $cursor, $limit): \Pipedrive\Model\ChangelogResponse +``` + +List updates about deal field values + +Lists updates about field values of a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\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 +$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getDealChangelog($id, $cursor, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealChangelog: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ChangelogResponse**](../Model/ChangelogResponse.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#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `getDealFiles()` ```php diff --git a/docs/Api/OrganizationsApi.md b/docs/Api/OrganizationsApi.md index c985596f..03bc597f 100644 --- a/docs/Api/OrganizationsApi.md +++ b/docs/Api/OrganizationsApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**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 [**getOrganizationDeals()**](OrganizationsApi.md#getOrganizationDeals) | **GET** /organizations/{id}/deals | List deals associated with an organization [**getOrganizationFiles()**](OrganizationsApi.md#getOrganizationFiles) | **GET** /organizations/{id}/files | List files attached to an organization [**getOrganizationFollowers()**](OrganizationsApi.md#getOrganizationFollowers) | **GET** /organizations/{id}/followers | List followers of an organization @@ -492,6 +493,75 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getOrganizationChangelog()` + +```php +getOrganizationChangelog($id, $cursor, $limit): \Pipedrive\Model\ChangelogResponse +``` + +List updates about organization field values + +Lists updates about field values of an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\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 +); +$id = 56; // int | The ID of the organization +$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getOrganizationChangelog($id, $cursor, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationChangelog: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ChangelogResponse**](../Model/ChangelogResponse.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#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `getOrganizationDeals()` ```php diff --git a/docs/Api/PersonsApi.md b/docs/Api/PersonsApi.md index b3d79b24..eb0a667b 100644 --- a/docs/Api/PersonsApi.md +++ b/docs/Api/PersonsApi.md @@ -13,6 +13,7 @@ Method | HTTP request | Description [**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 [**getPersonDeals()**](PersonsApi.md#getPersonDeals) | **GET** /persons/{id}/deals | List deals associated with a person [**getPersonFiles()**](PersonsApi.md#getPersonFiles) | **GET** /persons/{id}/files | List files attached to a person [**getPersonFollowers()**](PersonsApi.md#getPersonFollowers) | **GET** /persons/{id}/followers | List followers of a person @@ -634,6 +635,75 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getPersonChangelog()` + +```php +getPersonChangelog($id, $cursor, $limit): \Pipedrive\Model\ChangelogResponse +``` + +List updates about person field values + +Lists updates about field values of a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\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 +); +$id = 56; // int | The ID of the person +$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getPersonChangelog($id, $cursor, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonChangelog: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ChangelogResponse**](../Model/ChangelogResponse.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#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `getPersonDeals()` ```php diff --git a/docs/Model/ActivityTypeObjectResponse.md b/docs/Model/ActivityTypeObjectResponse.md index 646d9b62..72f0138b 100644 --- a/docs/Model/ActivityTypeObjectResponse.md +++ b/docs/Model/ActivityTypeObjectResponse.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **key_string** | **string** | A string that is generated by the API based on the given name of the activity type upon creation | [optional] **active_flag** | **bool** | The active flag of the activity type | [optional] **is_custom_flag** | **bool** | Whether the activity type is a custom one or not | [optional] -**add_time** | **string** | The creation time of the activity type | [optional] -**update_time** | **string** | The update time of the activity type | [optional] +**add_time** | **\DateTime** | The creation time of the activity type | [optional] +**update_time** | **\DateTime** | The update time of the activity type | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChangelogResponse.md b/docs/Model/ChangelogResponse.md new file mode 100644 index 00000000..04a27856 --- /dev/null +++ b/docs/Model/ChangelogResponse.md @@ -0,0 +1,11 @@ +# # ChangelogResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ChangelogResponseAllOfData[]**](ChangelogResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalDataWithCursorPagination**](AdditionalDataWithCursorPagination.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChangelogResponseAllOf.md b/docs/Model/ChangelogResponseAllOf.md new file mode 100644 index 00000000..e80fe5f6 --- /dev/null +++ b/docs/Model/ChangelogResponseAllOf.md @@ -0,0 +1,10 @@ +# # ChangelogResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ChangelogResponseAllOfData[]**](ChangelogResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalDataWithCursorPagination**](AdditionalDataWithCursorPagination.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChangelogResponseAllOfData.md b/docs/Model/ChangelogResponseAllOfData.md new file mode 100644 index 00000000..c1da6bc1 --- /dev/null +++ b/docs/Model/ChangelogResponseAllOfData.md @@ -0,0 +1,16 @@ +# # ChangelogResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_key** | **string** | The key of the field that was changed | [optional] +**old_value** | **string** | The value of the field before the change | [optional] +**new_value** | **string** | The value of the field after the change | [optional] +**actor_user_id** | **int** | The ID of the user who made the change | [optional] +**time** | **string** | The date and time of the change | [optional] +**change_source** | **string** | The source of change, for example 'app', 'mobile', 'api', etc. | [optional] +**change_source_user_agent** | **string** | The user agent from which the change was made | [optional] +**is_bulk_update_flag** | **bool** | Whether the change was made as part of a bulk update | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Field.md b/docs/Model/Field.md index 288781e0..6f13f41c 100644 --- a/docs/Model/Field.md +++ b/docs/Model/Field.md @@ -9,8 +9,8 @@ Name | Type | Description | Notes **name** | **string** | The name of the field | [optional] **order_nr** | **int** | The order number of the field | [optional] **field_type** | [**FieldTypeAsString**](FieldTypeAsString.md) | | [optional] -**add_time** | **string** | The creation time of the field | [optional] -**update_time** | **string** | The update time of the field | [optional] +**add_time** | **\DateTime** | The creation time of the field | [optional] +**update_time** | **\DateTime** | The update time of the field | [optional] **last_updated_by_user_id** | **int** | The ID of the user who created or most recently updated the field, only applicable for custom fields | [optional] **active_flag** | **bool** | The active flag of the field | [optional] **edit_flag** | **bool** | The edit flag of the field | [optional] diff --git a/docs/Model/PaymentItem.md b/docs/Model/PaymentItem.md index a2872bc9..792fcabf 100644 --- a/docs/Model/PaymentItem.md +++ b/docs/Model/PaymentItem.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **revenue_movement_type** | **string** | Represents the movement of revenue in comparison with the previous payment. Possible values are: `New` - first payment of the subscription. `Recurring` - no movement. `Expansion` - current payment amount > previous payment amount. `Contraction` - current payment amount < previous payment amount. `Churn` - last payment of the subscription. | [optional] **payment_type** | **string** | The type of the payment. Possible values are: `Recurring` - payments occur over fixed intervals of time, `Additional` - extra payment not the recurring payment of the recurring subscription, `Installment` - payment of the installment subscription. | [optional] **description** | **string** | The description of the payment | [optional] -**add_time** | **string** | The creation time of the payment | [optional] -**update_time** | **string** | The update time of the payment | [optional] +**add_time** | **\DateTime** | The creation time of the payment | [optional] +**update_time** | **\DateTime** | The update time of the payment | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionItem.md b/docs/Model/SubscriptionItem.md index 94b085d0..64c6807d 100644 --- a/docs/Model/SubscriptionItem.md +++ b/docs/Model/SubscriptionItem.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **end_date** | **\DateTime** | The end date of the subscription | [optional] **lifetime_value** | **double** | The total value of all payments | [optional] **final_status** | **string** | The final status of the subscription | [optional] -**add_time** | **string** | The creation time of the subscription | [optional] -**update_time** | **string** | The update time of the subscription | [optional] +**add_time** | **\DateTime** | The creation time of the subscription | [optional] +**update_time** | **\DateTime** | The update time of the subscription | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/DealsApi.php b/lib/Api/DealsApi.php index bb873fa4..f15a6fba 100644 --- a/lib/Api/DealsApi.php +++ b/lib/Api/DealsApi.php @@ -3810,6 +3810,328 @@ public function getDealActivitiesRequest($id, $start = 0, $limit = null, $done = ); } + /** + * Operation getDealChangelog + * + * List updates about deal field values + * + * @param int $id The ID of the deal (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 Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ChangelogResponse + */ + public function getDealChangelog($id, $cursor = null, $limit = null) + { + list($response) = $this->getDealChangelogWithHttpInfo($id, $cursor, $limit); + return $response; + } + + /** + * Operation getDealChangelogWithHttpInfo + * + * List updates about deal field values + * + * @param int $id The ID of the deal (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 Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ChangelogResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealChangelogWithHttpInfo($id, $cursor = null, $limit = null) + { + $request = $this->getDealChangelogRequest($id, $cursor, $limit); + + 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->getDealChangelogRequest($id, $cursor, $limit); + $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\Model\ChangelogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChangelogResponse', []), + $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\Model\ChangelogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChangelogResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ChangelogResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealChangelogAsync + * + * List updates about deal field values + * + * @param int $id The ID of the deal (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealChangelogAsync($id, $cursor = null, $limit = null): PromiseInterface + { + return $this->getDealChangelogAsyncWithHttpInfo($id, $cursor, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealChangelogAsyncWithHttpInfo + * + * List updates about deal field values + * + * @param int $id The ID of the deal (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealChangelogAsyncWithHttpInfo($id, $cursor = null, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ChangelogResponse'; + $request = $this->getDealChangelogRequest($id, $cursor, $limit); + + 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 'getDealChangelog' + * + * @param int $id The ID of the deal (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealChangelogRequest($id, $cursor = null, $limit = 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 getDealChangelog' + ); + } + + $resourcePath = '/deals/{id}/changelog'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // 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; + } + + + // 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 getDealFiles * diff --git a/lib/Api/OrganizationsApi.php b/lib/Api/OrganizationsApi.php index 11abdc9c..e855fa33 100644 --- a/lib/Api/OrganizationsApi.php +++ b/lib/Api/OrganizationsApi.php @@ -2268,6 +2268,328 @@ public function getOrganizationActivitiesRequest($id, $start = 0, $limit = null, ); } + /** + * Operation getOrganizationChangelog + * + * List updates about organization field values + * + * @param int $id The ID of the organization (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 Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ChangelogResponse + */ + public function getOrganizationChangelog($id, $cursor = null, $limit = null) + { + list($response) = $this->getOrganizationChangelogWithHttpInfo($id, $cursor, $limit); + return $response; + } + + /** + * Operation getOrganizationChangelogWithHttpInfo + * + * List updates about organization field values + * + * @param int $id The ID of the organization (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 Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ChangelogResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationChangelogWithHttpInfo($id, $cursor = null, $limit = null) + { + $request = $this->getOrganizationChangelogRequest($id, $cursor, $limit); + + 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->getOrganizationChangelogRequest($id, $cursor, $limit); + $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\Model\ChangelogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChangelogResponse', []), + $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\Model\ChangelogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChangelogResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ChangelogResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationChangelogAsync + * + * List updates about organization field values + * + * @param int $id The ID of the organization (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationChangelogAsync($id, $cursor = null, $limit = null): PromiseInterface + { + return $this->getOrganizationChangelogAsyncWithHttpInfo($id, $cursor, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationChangelogAsyncWithHttpInfo + * + * List updates about organization field values + * + * @param int $id The ID of the organization (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationChangelogAsyncWithHttpInfo($id, $cursor = null, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ChangelogResponse'; + $request = $this->getOrganizationChangelogRequest($id, $cursor, $limit); + + 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 'getOrganizationChangelog' + * + * @param int $id The ID of the organization (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationChangelogRequest($id, $cursor = null, $limit = 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 getOrganizationChangelog' + ); + } + + $resourcePath = '/organizations/{id}/changelog'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // 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; + } + + + // 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 getOrganizationDeals * diff --git a/lib/Api/PersonsApi.php b/lib/Api/PersonsApi.php index e36f43d4..05b4fdd4 100644 --- a/lib/Api/PersonsApi.php +++ b/lib/Api/PersonsApi.php @@ -2921,6 +2921,328 @@ public function getPersonActivitiesRequest($id, $start = 0, $limit = null, $done ); } + /** + * Operation getPersonChangelog + * + * List updates about person field values + * + * @param int $id The ID of the person (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 Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ChangelogResponse + */ + public function getPersonChangelog($id, $cursor = null, $limit = null) + { + list($response) = $this->getPersonChangelogWithHttpInfo($id, $cursor, $limit); + return $response; + } + + /** + * Operation getPersonChangelogWithHttpInfo + * + * List updates about person field values + * + * @param int $id The ID of the person (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 Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ChangelogResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonChangelogWithHttpInfo($id, $cursor = null, $limit = null) + { + $request = $this->getPersonChangelogRequest($id, $cursor, $limit); + + 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->getPersonChangelogRequest($id, $cursor, $limit); + $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\Model\ChangelogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChangelogResponse', []), + $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\Model\ChangelogResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChangelogResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ChangelogResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonChangelogAsync + * + * List updates about person field values + * + * @param int $id The ID of the person (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonChangelogAsync($id, $cursor = null, $limit = null): PromiseInterface + { + return $this->getPersonChangelogAsyncWithHttpInfo($id, $cursor, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonChangelogAsyncWithHttpInfo + * + * List updates about person field values + * + * @param int $id The ID of the person (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonChangelogAsyncWithHttpInfo($id, $cursor = null, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ChangelogResponse'; + $request = $this->getPersonChangelogRequest($id, $cursor, $limit); + + 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 'getPersonChangelog' + * + * @param int $id The ID of the person (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 Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonChangelogRequest($id, $cursor = null, $limit = 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 getPersonChangelog' + ); + } + + $resourcePath = '/persons/{id}/changelog'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // 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; + } + + + // 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 getPersonDeals * diff --git a/lib/Model/ActivityTypeObjectResponse.php b/lib/Model/ActivityTypeObjectResponse.php index 8ccf30bd..3ce0eef9 100644 --- a/lib/Model/ActivityTypeObjectResponse.php +++ b/lib/Model/ActivityTypeObjectResponse.php @@ -71,8 +71,8 @@ class ActivityTypeObjectResponse implements ModelInterface, ArrayAccess, JsonSer 'key_string' => 'string', 'active_flag' => 'bool', 'is_custom_flag' => 'bool', - 'add_time' => 'string', - 'update_time' => 'string' + 'add_time' => '\DateTime', + 'update_time' => '\DateTime' ]; /** @@ -91,8 +91,8 @@ class ActivityTypeObjectResponse implements ModelInterface, ArrayAccess, JsonSer 'key_string' => null, 'active_flag' => null, 'is_custom_flag' => null, - 'add_time' => 'datetime', - 'update_time' => 'datetime' + 'add_time' => 'date-time', + 'update_time' => 'date-time' ]; /** @@ -474,7 +474,7 @@ public function setIsCustomFlag($is_custom_flag): self /** * Gets add_time * - * @return string|null + * @return \DateTime|null */ public function getAddTime() { @@ -484,7 +484,7 @@ public function getAddTime() /** * Sets add_time * - * @param string|null $add_time The creation time of the activity type + * @param \DateTime|null $add_time The creation time of the activity type * * @return self */ @@ -498,7 +498,7 @@ public function setAddTime($add_time): self /** * Gets update_time * - * @return string|null + * @return \DateTime|null */ public function getUpdateTime() { @@ -508,7 +508,7 @@ public function getUpdateTime() /** * Sets update_time * - * @param string|null $update_time The update time of the activity type + * @param \DateTime|null $update_time The update time of the activity type * * @return self */ diff --git a/lib/Model/ChangelogResponse.php b/lib/Model/ChangelogResponse.php new file mode 100644 index 00000000..38c84869 --- /dev/null +++ b/lib/Model/ChangelogResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ChangelogResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChangelogResponse'; + + /** + * 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\Model\ChangelogResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalDataWithCursorPagination' + ]; + + /** + * 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 If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ChangelogResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ChangelogResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalDataWithCursorPagination|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalDataWithCursorPagination|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/Model/ChangelogResponseAllOf.php b/lib/Model/ChangelogResponseAllOf.php new file mode 100644 index 00000000..e4b2132d --- /dev/null +++ b/lib/Model/ChangelogResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ChangelogResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChangelogResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ChangelogResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalDataWithCursorPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '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 = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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['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 data + * + * @return \Pipedrive\Model\ChangelogResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ChangelogResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalDataWithCursorPagination|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalDataWithCursorPagination|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/Model/ChangelogResponseAllOfData.php b/lib/Model/ChangelogResponseAllOfData.php new file mode 100644 index 00000000..f1167c04 --- /dev/null +++ b/lib/Model/ChangelogResponseAllOfData.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ChangelogResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChangelogResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'field_key' => 'string', + 'old_value' => 'string', + 'new_value' => 'string', + 'actor_user_id' => 'int', + 'time' => 'string', + 'change_source' => 'string', + 'change_source_user_agent' => 'string', + 'is_bulk_update_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'field_key' => null, + 'old_value' => null, + 'new_value' => null, + 'actor_user_id' => null, + 'time' => null, + 'change_source' => null, + 'change_source_user_agent' => null, + 'is_bulk_update_flag' => 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 = [ + 'field_key' => 'field_key', + 'old_value' => 'old_value', + 'new_value' => 'new_value', + 'actor_user_id' => 'actor_user_id', + 'time' => 'time', + 'change_source' => 'change_source', + 'change_source_user_agent' => 'change_source_user_agent', + 'is_bulk_update_flag' => 'is_bulk_update_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'field_key' => 'setFieldKey', + 'old_value' => 'setOldValue', + 'new_value' => 'setNewValue', + 'actor_user_id' => 'setActorUserId', + 'time' => 'setTime', + 'change_source' => 'setChangeSource', + 'change_source_user_agent' => 'setChangeSourceUserAgent', + 'is_bulk_update_flag' => 'setIsBulkUpdateFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'field_key' => 'getFieldKey', + 'old_value' => 'getOldValue', + 'new_value' => 'getNewValue', + 'actor_user_id' => 'getActorUserId', + 'time' => 'getTime', + 'change_source' => 'getChangeSource', + 'change_source_user_agent' => 'getChangeSourceUserAgent', + 'is_bulk_update_flag' => 'getIsBulkUpdateFlag' + ]; + + /** + * 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['field_key'] = $data['field_key'] ?? null; + $this->container['old_value'] = $data['old_value'] ?? null; + $this->container['new_value'] = $data['new_value'] ?? null; + $this->container['actor_user_id'] = $data['actor_user_id'] ?? null; + $this->container['time'] = $data['time'] ?? null; + $this->container['change_source'] = $data['change_source'] ?? null; + $this->container['change_source_user_agent'] = $data['change_source_user_agent'] ?? null; + $this->container['is_bulk_update_flag'] = $data['is_bulk_update_flag'] ?? 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 field_key + * + * @return string|null + */ + public function getFieldKey() + { + return $this->container['field_key']; + } + + /** + * Sets field_key + * + * @param string|null $field_key The key of the field that was changed + * + * @return self + */ + public function setFieldKey($field_key): self + { + $this->container['field_key'] = $field_key; + + return $this; + } + + /** + * Gets old_value + * + * @return string|null + */ + public function getOldValue() + { + return $this->container['old_value']; + } + + /** + * Sets old_value + * + * @param string|null $old_value The value of the field before the change + * + * @return self + */ + public function setOldValue($old_value): self + { + $this->container['old_value'] = $old_value; + + return $this; + } + + /** + * Gets new_value + * + * @return string|null + */ + public function getNewValue() + { + return $this->container['new_value']; + } + + /** + * Sets new_value + * + * @param string|null $new_value The value of the field after the change + * + * @return self + */ + public function setNewValue($new_value): self + { + $this->container['new_value'] = $new_value; + + return $this; + } + + /** + * Gets actor_user_id + * + * @return int|null + */ + public function getActorUserId() + { + return $this->container['actor_user_id']; + } + + /** + * Sets actor_user_id + * + * @param int|null $actor_user_id The ID of the user who made the change + * + * @return self + */ + public function setActorUserId($actor_user_id): self + { + $this->container['actor_user_id'] = $actor_user_id; + + return $this; + } + + /** + * Gets time + * + * @return string|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param string|null $time The date and time of the change + * + * @return self + */ + public function setTime($time): self + { + $this->container['time'] = $time; + + return $this; + } + + /** + * Gets change_source + * + * @return string|null + */ + public function getChangeSource() + { + return $this->container['change_source']; + } + + /** + * Sets change_source + * + * @param string|null $change_source The source of change, for example 'app', 'mobile', 'api', etc. + * + * @return self + */ + public function setChangeSource($change_source): self + { + $this->container['change_source'] = $change_source; + + return $this; + } + + /** + * Gets change_source_user_agent + * + * @return string|null + */ + public function getChangeSourceUserAgent() + { + return $this->container['change_source_user_agent']; + } + + /** + * Sets change_source_user_agent + * + * @param string|null $change_source_user_agent The user agent from which the change was made + * + * @return self + */ + public function setChangeSourceUserAgent($change_source_user_agent): self + { + $this->container['change_source_user_agent'] = $change_source_user_agent; + + return $this; + } + + /** + * Gets is_bulk_update_flag + * + * @return bool|null + */ + public function getIsBulkUpdateFlag() + { + return $this->container['is_bulk_update_flag']; + } + + /** + * Sets is_bulk_update_flag + * + * @param bool|null $is_bulk_update_flag Whether the change was made as part of a bulk update + * + * @return self + */ + public function setIsBulkUpdateFlag($is_bulk_update_flag): self + { + $this->container['is_bulk_update_flag'] = $is_bulk_update_flag; + + 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/Model/Field.php b/lib/Model/Field.php index cd952a45..3221f42a 100644 --- a/lib/Model/Field.php +++ b/lib/Model/Field.php @@ -68,8 +68,8 @@ class Field implements ModelInterface, ArrayAccess, JsonSerializable 'name' => 'string', 'order_nr' => 'int', 'field_type' => '\Pipedrive\Model\FieldTypeAsString', - 'add_time' => 'string', - 'update_time' => 'string', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime', 'last_updated_by_user_id' => 'int', 'active_flag' => 'bool', 'edit_flag' => 'bool', @@ -101,8 +101,8 @@ class Field implements ModelInterface, ArrayAccess, JsonSerializable 'name' => null, 'order_nr' => null, 'field_type' => null, - 'add_time' => 'datetime', - 'update_time' => 'datetime', + 'add_time' => 'date-time', + 'update_time' => 'date-time', 'last_updated_by_user_id' => null, 'active_flag' => null, 'edit_flag' => null, @@ -480,7 +480,7 @@ public function setFieldType($field_type): self /** * Gets add_time * - * @return string|null + * @return \DateTime|null */ public function getAddTime() { @@ -490,7 +490,7 @@ public function getAddTime() /** * Sets add_time * - * @param string|null $add_time The creation time of the field + * @param \DateTime|null $add_time The creation time of the field * * @return self */ @@ -504,7 +504,7 @@ public function setAddTime($add_time): self /** * Gets update_time * - * @return string|null + * @return \DateTime|null */ public function getUpdateTime() { @@ -514,7 +514,7 @@ public function getUpdateTime() /** * Sets update_time * - * @param string|null $update_time The update time of the field + * @param \DateTime|null $update_time The update time of the field * * @return self */ diff --git a/lib/Model/PaymentItem.php b/lib/Model/PaymentItem.php index b3b5841e..38696ad3 100644 --- a/lib/Model/PaymentItem.php +++ b/lib/Model/PaymentItem.php @@ -74,8 +74,8 @@ class PaymentItem implements ModelInterface, ArrayAccess, JsonSerializable 'revenue_movement_type' => 'string', 'payment_type' => 'string', 'description' => 'string', - 'add_time' => 'string', - 'update_time' => 'string' + 'add_time' => '\DateTime', + 'update_time' => '\DateTime' ]; /** @@ -97,8 +97,8 @@ class PaymentItem implements ModelInterface, ArrayAccess, JsonSerializable 'revenue_movement_type' => null, 'payment_type' => null, 'description' => null, - 'add_time' => 'datetime', - 'update_time' => 'datetime' + 'add_time' => 'date-time', + 'update_time' => 'date-time' ]; /** @@ -646,7 +646,7 @@ public function setDescription($description): self /** * Gets add_time * - * @return string|null + * @return \DateTime|null */ public function getAddTime() { @@ -656,7 +656,7 @@ public function getAddTime() /** * Sets add_time * - * @param string|null $add_time The creation time of the payment + * @param \DateTime|null $add_time The creation time of the payment * * @return self */ @@ -670,7 +670,7 @@ public function setAddTime($add_time): self /** * Gets update_time * - * @return string|null + * @return \DateTime|null */ public function getUpdateTime() { @@ -680,7 +680,7 @@ public function getUpdateTime() /** * Sets update_time * - * @param string|null $update_time The update time of the payment + * @param \DateTime|null $update_time The update time of the payment * * @return self */ diff --git a/lib/Model/SubscriptionItem.php b/lib/Model/SubscriptionItem.php index e4c4e6f3..f4b0ffaf 100644 --- a/lib/Model/SubscriptionItem.php +++ b/lib/Model/SubscriptionItem.php @@ -77,8 +77,8 @@ class SubscriptionItem implements ModelInterface, ArrayAccess, JsonSerializable 'end_date' => '\DateTime', 'lifetime_value' => 'double', 'final_status' => 'string', - 'add_time' => 'string', - 'update_time' => 'string' + 'add_time' => '\DateTime', + 'update_time' => '\DateTime' ]; /** @@ -103,8 +103,8 @@ class SubscriptionItem implements ModelInterface, ArrayAccess, JsonSerializable 'end_date' => 'date', 'lifetime_value' => 'double', 'final_status' => null, - 'add_time' => 'datetime', - 'update_time' => 'datetime' + 'add_time' => 'date-time', + 'update_time' => 'date-time' ]; /** @@ -654,7 +654,7 @@ public function setFinalStatus($final_status): self /** * Gets add_time * - * @return string|null + * @return \DateTime|null */ public function getAddTime() { @@ -664,7 +664,7 @@ public function getAddTime() /** * Sets add_time * - * @param string|null $add_time The creation time of the subscription + * @param \DateTime|null $add_time The creation time of the subscription * * @return self */ @@ -678,7 +678,7 @@ public function setAddTime($add_time): self /** * Gets update_time * - * @return string|null + * @return \DateTime|null */ public function getUpdateTime() { @@ -688,7 +688,7 @@ public function getUpdateTime() /** * Sets update_time * - * @param string|null $update_time The update time of the subscription + * @param \DateTime|null $update_time The update time of the subscription * * @return self */