From 81e240545fabd43034b5a80679bc442ab24a1102 Mon Sep 17 00:00:00 2001 From: pipedrive-bot Date: Thu, 6 Aug 2026 12:43:14 +0000 Subject: [PATCH] Build 337 - version-minor --- CHANGELOG.md | 7 + docs/versions/v1/Api/DealsApi.md | 6 +- docs/versions/v1/Api/OrganizationsApi.md | 6 +- docs/versions/v1/Api/PersonsApi.md | 6 +- docs/versions/v1/Model/MailMessageData.md | 1 + .../v1/Model/MailMessageItemForList.md | 1 + docs/versions/v2/Api/OrganizationsApi.md | 16 +- docs/versions/v2/Api/PersonsApi.md | 20 +- .../v2/Model/ActivityFieldItemOptions.md | 2 +- docs/versions/v2/Model/DealFieldItem.md | 2 +- docs/versions/v2/Model/DeleteDealFieldData.md | 2 +- docs/versions/v2/Model/Person.md | 8 +- docs/versions/v2/Model/PersonItem.md | 8 +- docs/versions/v2/Model/PersonItemAddress.md | 18 + docs/versions/v2/Model/PersonItemEmail.md | 11 + docs/versions/v2/Model/PersonItemPhone.md | 11 + .../v2/Model/PostOrganizationRequestBody.md | 20 + .../v2/Model/PostPersonRequestBody.md | 23 + .../v2/Model/UpdateOrganizationRequestBody.md | 19 + .../v2/Model/UpdatePersonRequestBody.md | 22 + docs/versions/v2/README.md | 14 +- lib/versions/v1/Api/DealsApi.php | 33 +- lib/versions/v1/Api/OrganizationsApi.php | 33 +- lib/versions/v1/Api/PersonsApi.php | 33 +- lib/versions/v1/Model/MailMessageData.php | 30 + .../v1/Model/MailMessageItemForList.php | 30 + lib/versions/v2/Api/OrganizationsApi.php | 72 +- lib/versions/v2/Api/PersonsApi.php | 72 +- .../v2/Model/ActivityFieldItemOptions.php | 6 +- lib/versions/v2/Model/DealFieldItem.php | 7 +- lib/versions/v2/Model/DeleteDealFieldData.php | 7 +- .../v2/Model/OrganizationItemAddress.php | 1 + lib/versions/v2/Model/Person.php | 24 +- lib/versions/v2/Model/PersonItem.php | 24 +- lib/versions/v2/Model/PersonItemAddress.php | 616 ++++++++++++++ lib/versions/v2/Model/PersonItemEmail.php | 405 +++++++++ lib/versions/v2/Model/PersonItemIm.php | 6 +- lib/versions/v2/Model/PersonItemPhone.php | 405 +++++++++ .../v2/Model/PostOrganizationRequestBody.php | 675 +++++++++++++++ .../v2/Model/PostPersonRequestBody.php | 805 ++++++++++++++++++ .../Model/UpdateOrganizationRequestBody.php | 645 ++++++++++++++ .../v2/Model/UpdatePersonRequestBody.php | 775 +++++++++++++++++ 42 files changed, 4744 insertions(+), 183 deletions(-) create mode 100644 docs/versions/v2/Model/PersonItemAddress.md create mode 100644 docs/versions/v2/Model/PersonItemEmail.md create mode 100644 docs/versions/v2/Model/PersonItemPhone.md create mode 100644 docs/versions/v2/Model/PostOrganizationRequestBody.md create mode 100644 docs/versions/v2/Model/PostPersonRequestBody.md create mode 100644 docs/versions/v2/Model/UpdateOrganizationRequestBody.md create mode 100644 docs/versions/v2/Model/UpdatePersonRequestBody.md create mode 100644 lib/versions/v2/Model/PersonItemAddress.php create mode 100644 lib/versions/v2/Model/PersonItemEmail.php create mode 100644 lib/versions/v2/Model/PersonItemPhone.php create mode 100644 lib/versions/v2/Model/PostOrganizationRequestBody.php create mode 100644 lib/versions/v2/Model/PostPersonRequestBody.php create mode 100644 lib/versions/v2/Model/UpdateOrganizationRequestBody.php create mode 100644 lib/versions/v2/Model/UpdatePersonRequestBody.php diff --git a/CHANGELOG.md b/CHANGELOG.md index cd84907c..488ab001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ 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 `website`, `linkedin`, `industry`, `annual_revenue`, and `employee_count` as writable fields to v2 organization request body (`POST /api/v2/organizations`, `PATCH /api/v2/organizations/{id}`) +- Added `postal_address`, `notes`, `im`, `birthday`, and `job_title` as writable fields to v2 person request body (`POST /api/v2/persons`, `PATCH /api/v2/persons/{id}`) — these fields don't exist by default and are only created when contact sync is set up for the company +- Updated `POST /api/v2/persons` and `PATCH /api/v2/persons/{id}` descriptions to clarify that the `im`, `postal_address`, `notes`, `birthday`, and `job_title` fields require contact sync to be set up +### Fixed +- Removed `update_time` from `POST /api/v2/organizations` and `POST /api/v2/persons` request body schemas, and removed `add_time`/`update_time` from `PATCH /api/v2/organizations/{id}` and `PATCH /api/v2/persons/{id}` request body schemas — these are server-generated fields that were never meant to be accepted as input +- Added missing example values for `website`, `linkedin`, `industry`, `annual_revenue`, and `employee_count` to the v2 organization response example ## [17.3.0](https://github.com/pipedrive/client-php/compare17.2.1...17.3.0) (2026-04-06) diff --git a/docs/versions/v1/Api/DealsApi.md b/docs/versions/v1/Api/DealsApi.md index ac02c8a3..c25de86f 100644 --- a/docs/versions/v1/Api/DealsApi.md +++ b/docs/versions/v1/Api/DealsApi.md @@ -807,7 +807,7 @@ Name | Type | Description | Notes ## `getDealMailMessages()` ```php -getDealMailMessages($id, $start, $limit): \Pipedrive\versions\v1\Model\ListMailMessagesResponse +getDealMailMessages($id, $start, $limit, $include_body): \Pipedrive\versions\v1\Model\ListMailMessagesResponse ``` List mail messages associated with a deal @@ -839,9 +839,10 @@ $apiInstance = new Pipedrive\versions\v1\Api\DealsApi( $id = 56; // int | The ID of the deal $start = 0; // int | Pagination start $limit = 56; // int | Items shown per page +$include_body = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBooleanDefault0(); // \Pipedrive\versions\v1\Model\NumberBooleanDefault0 | Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. try { - $result = $apiInstance->getDealMailMessages($id, $start, $limit); + $result = $apiInstance->getDealMailMessages($id, $start, $limit, $include_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling DealsApi->getDealMailMessages: ', $e->getMessage(), PHP_EOL; @@ -855,6 +856,7 @@ Name | Type | Description | Notes **id** | **int**| The ID of the deal | **start** | **int**| Pagination start | [optional] [default to 0] **limit** | **int**| Items shown per page | [optional] + **include_body** | [**\Pipedrive\versions\v1\Model\NumberBooleanDefault0**](../Model/.md)| Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. | [optional] ### Return type diff --git a/docs/versions/v1/Api/OrganizationsApi.md b/docs/versions/v1/Api/OrganizationsApi.md index 5d44b77d..42751a57 100644 --- a/docs/versions/v1/Api/OrganizationsApi.md +++ b/docs/versions/v1/Api/OrganizationsApi.md @@ -357,7 +357,7 @@ Name | Type | Description | Notes ## `getOrganizationMailMessages()` ```php -getOrganizationMailMessages($id, $start, $limit): \Pipedrive\versions\v1\Model\ListMailMessagesResponse +getOrganizationMailMessages($id, $start, $limit, $include_body): \Pipedrive\versions\v1\Model\ListMailMessagesResponse ``` List mail messages associated with an organization @@ -389,9 +389,10 @@ $apiInstance = new Pipedrive\versions\v1\Api\OrganizationsApi( $id = 56; // int | The ID of the organization $start = 0; // int | Pagination start $limit = 56; // int | Items shown per page +$include_body = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBooleanDefault0(); // \Pipedrive\versions\v1\Model\NumberBooleanDefault0 | Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. try { - $result = $apiInstance->getOrganizationMailMessages($id, $start, $limit); + $result = $apiInstance->getOrganizationMailMessages($id, $start, $limit, $include_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling OrganizationsApi->getOrganizationMailMessages: ', $e->getMessage(), PHP_EOL; @@ -405,6 +406,7 @@ Name | Type | Description | Notes **id** | **int**| The ID of the organization | **start** | **int**| Pagination start | [optional] [default to 0] **limit** | **int**| Items shown per page | [optional] + **include_body** | [**\Pipedrive\versions\v1\Model\NumberBooleanDefault0**](../Model/.md)| Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. | [optional] ### Return type diff --git a/docs/versions/v1/Api/PersonsApi.md b/docs/versions/v1/Api/PersonsApi.md index 72f2a776..84b55dc5 100644 --- a/docs/versions/v1/Api/PersonsApi.md +++ b/docs/versions/v1/Api/PersonsApi.md @@ -500,7 +500,7 @@ Name | Type | Description | Notes ## `getPersonMailMessages()` ```php -getPersonMailMessages($id, $start, $limit): \Pipedrive\versions\v1\Model\ListMailMessagesResponse +getPersonMailMessages($id, $start, $limit, $include_body): \Pipedrive\versions\v1\Model\ListMailMessagesResponse ``` List mail messages associated with a person @@ -532,9 +532,10 @@ $apiInstance = new Pipedrive\versions\v1\Api\PersonsApi( $id = 56; // int | The ID of the person $start = 0; // int | Pagination start $limit = 56; // int | Items shown per page +$include_body = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBooleanDefault0(); // \Pipedrive\versions\v1\Model\NumberBooleanDefault0 | Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. try { - $result = $apiInstance->getPersonMailMessages($id, $start, $limit); + $result = $apiInstance->getPersonMailMessages($id, $start, $limit, $include_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling PersonsApi->getPersonMailMessages: ', $e->getMessage(), PHP_EOL; @@ -548,6 +549,7 @@ Name | Type | Description | Notes **id** | **int**| The ID of the person | **start** | **int**| Pagination start | [optional] [default to 0] **limit** | **int**| Items shown per page | [optional] + **include_body** | [**\Pipedrive\versions\v1\Model\NumberBooleanDefault0**](../Model/.md)| Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. | [optional] ### Return type diff --git a/docs/versions/v1/Model/MailMessageData.md b/docs/versions/v1/Model/MailMessageData.md index bb612f59..480bc248 100644 --- a/docs/versions/v1/Model/MailMessageData.md +++ b/docs/versions/v1/Model/MailMessageData.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **cc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message copies (object) | [optional] **bcc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message blind copies (object) | [optional] **body_url** | **string** | The mail message body URL | [optional] +**body** | **string** | The mail message body content. Only present when `include_body=1` is passed. | [optional] **account_id** | **string** | The connection account ID | [optional] **user_id** | **int** | ID of the user whom mail message will be assigned to | [optional] **mail_thread_id** | **int** | ID of the mail message thread | [optional] diff --git a/docs/versions/v1/Model/MailMessageItemForList.md b/docs/versions/v1/Model/MailMessageItemForList.md index 79e7ac64..d2ede8bb 100644 --- a/docs/versions/v1/Model/MailMessageItemForList.md +++ b/docs/versions/v1/Model/MailMessageItemForList.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **cc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message copies (object) | [optional] **bcc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message blind copies (object) | [optional] **body_url** | **string** | The mail message body URL | [optional] +**body** | **string** | The mail message body content. Only present when `include_body=1` is passed. | [optional] **account_id** | **string** | The connection account ID | [optional] **user_id** | **int** | ID of the user whom mail message will be assigned to | [optional] **mail_thread_id** | **int** | ID of the mail message thread | [optional] diff --git a/docs/versions/v2/Api/OrganizationsApi.md b/docs/versions/v2/Api/OrganizationsApi.md index a6ae7071..684aa430 100644 --- a/docs/versions/v2/Api/OrganizationsApi.md +++ b/docs/versions/v2/Api/OrganizationsApi.md @@ -19,7 +19,7 @@ Method | HTTP request | Description ## `addOrganization()` ```php -addOrganization($organization_request_body): \Pipedrive\versions\v2\Model\PostPatchGetOrganization +addOrganization($post_organization_request_body): \Pipedrive\versions\v2\Model\PostPatchGetOrganization ``` Add a new organization @@ -48,10 +48,10 @@ $apiInstance = new Pipedrive\versions\v2\Api\OrganizationsApi( new GuzzleHttp\Client(), $config ); -$organization_request_body = new \Pipedrive\versions\v2\Model\OrganizationRequestBody(); // \Pipedrive\versions\v2\Model\OrganizationRequestBody +$post_organization_request_body = new \Pipedrive\versions\v2\Model\PostOrganizationRequestBody(); // \Pipedrive\versions\v2\Model\PostOrganizationRequestBody try { - $result = $apiInstance->addOrganization($organization_request_body); + $result = $apiInstance->addOrganization($post_organization_request_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling OrganizationsApi->addOrganization: ', $e->getMessage(), PHP_EOL; @@ -62,7 +62,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **organization_request_body** | [**\Pipedrive\versions\v2\Model\OrganizationRequestBody**](../Model/OrganizationRequestBody.md)| | [optional] + **post_organization_request_body** | [**\Pipedrive\versions\v2\Model\PostOrganizationRequestBody**](../Model/PostOrganizationRequestBody.md)| | [optional] ### Return type @@ -656,7 +656,7 @@ Name | Type | Description | Notes ## `updateOrganization()` ```php -updateOrganization($id, $organization_request_body): \Pipedrive\versions\v2\Model\PostPatchGetOrganization +updateOrganization($id, $update_organization_request_body): \Pipedrive\versions\v2\Model\PostPatchGetOrganization ``` Update a organization @@ -686,10 +686,10 @@ $apiInstance = new Pipedrive\versions\v2\Api\OrganizationsApi( $config ); $id = 56; // int | The ID of the organization -$organization_request_body = new \Pipedrive\versions\v2\Model\OrganizationRequestBody(); // \Pipedrive\versions\v2\Model\OrganizationRequestBody +$update_organization_request_body = new \Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody(); // \Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody try { - $result = $apiInstance->updateOrganization($id, $organization_request_body); + $result = $apiInstance->updateOrganization($id, $update_organization_request_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling OrganizationsApi->updateOrganization: ', $e->getMessage(), PHP_EOL; @@ -701,7 +701,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| The ID of the organization | - **organization_request_body** | [**\Pipedrive\versions\v2\Model\OrganizationRequestBody**](../Model/OrganizationRequestBody.md)| | [optional] + **update_organization_request_body** | [**\Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody**](../Model/UpdateOrganizationRequestBody.md)| | [optional] ### Return type diff --git a/docs/versions/v2/Api/PersonsApi.md b/docs/versions/v2/Api/PersonsApi.md index 8ffe983f..914eb662 100644 --- a/docs/versions/v2/Api/PersonsApi.md +++ b/docs/versions/v2/Api/PersonsApi.md @@ -20,12 +20,12 @@ Method | HTTP request | Description ## `addPerson()` ```php -addPerson($person_request_body): \Pipedrive\versions\v2\Model\PostPatchGetPerson +addPerson($post_person_request_body): \Pipedrive\versions\v2\Model\PostPatchGetPerson ``` Add a new person -Adds a new person. If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field. +Adds a new person.
If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field.
The `im`, `postal_address`, `notes`, `birthday` and `job_title` fields don’t exist by default in Pipedrive and are only created when you set up your contact sync. ### Example @@ -49,10 +49,10 @@ $apiInstance = new Pipedrive\versions\v2\Api\PersonsApi( new GuzzleHttp\Client(), $config ); -$person_request_body = new \Pipedrive\versions\v2\Model\PersonRequestBody(); // \Pipedrive\versions\v2\Model\PersonRequestBody +$post_person_request_body = new \Pipedrive\versions\v2\Model\PostPersonRequestBody(); // \Pipedrive\versions\v2\Model\PostPersonRequestBody try { - $result = $apiInstance->addPerson($person_request_body); + $result = $apiInstance->addPerson($post_person_request_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling PersonsApi->addPerson: ', $e->getMessage(), PHP_EOL; @@ -63,7 +63,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **person_request_body** | [**\Pipedrive\versions\v2\Model\PersonRequestBody**](../Model/PersonRequestBody.md)| | [optional] + **post_person_request_body** | [**\Pipedrive\versions\v2\Model\PostPersonRequestBody**](../Model/PostPersonRequestBody.md)| | [optional] ### Return type @@ -730,12 +730,12 @@ Name | Type | Description | Notes ## `updatePerson()` ```php -updatePerson($id, $person_request_body): \Pipedrive\versions\v2\Model\PostPatchGetPerson +updatePerson($id, $update_person_request_body): \Pipedrive\versions\v2\Model\PostPatchGetPerson ``` Update a person -Updates the properties of a person.
If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field. +Updates the properties of a person.
If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field.
The `im`, `postal_address`, `notes`, `birthday` and `job_title` fields don’t exist by default in Pipedrive and are only created when you set up your contact sync. ### Example @@ -760,10 +760,10 @@ $apiInstance = new Pipedrive\versions\v2\Api\PersonsApi( $config ); $id = 56; // int | The ID of the person -$person_request_body = new \Pipedrive\versions\v2\Model\PersonRequestBody(); // \Pipedrive\versions\v2\Model\PersonRequestBody +$update_person_request_body = new \Pipedrive\versions\v2\Model\UpdatePersonRequestBody(); // \Pipedrive\versions\v2\Model\UpdatePersonRequestBody try { - $result = $apiInstance->updatePerson($id, $person_request_body); + $result = $apiInstance->updatePerson($id, $update_person_request_body); print_r($result); } catch (Exception $e) { echo 'Exception when calling PersonsApi->updatePerson: ', $e->getMessage(), PHP_EOL; @@ -775,7 +775,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **int**| The ID of the person | - **person_request_body** | [**\Pipedrive\versions\v2\Model\PersonRequestBody**](../Model/PersonRequestBody.md)| | [optional] + **update_person_request_body** | [**\Pipedrive\versions\v2\Model\UpdatePersonRequestBody**](../Model/UpdatePersonRequestBody.md)| | [optional] ### Return type diff --git a/docs/versions/v2/Model/ActivityFieldItemOptions.md b/docs/versions/v2/Model/ActivityFieldItemOptions.md index 289f2b55..f743b393 100644 --- a/docs/versions/v2/Model/ActivityFieldItemOptions.md +++ b/docs/versions/v2/Model/ActivityFieldItemOptions.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | The option ID | [optional] +**id** | [**OneOfIntegerString**](OneOfIntegerString.md) | The option ID (integer for custom fields, string for built-in fields) | [optional] **label** | **string** | The option display label | [optional] **color** | **string** | Optional color code for the option | [optional] **update_time** | **\DateTime** | When the option was last updated | [optional] diff --git a/docs/versions/v2/Model/DealFieldItem.md b/docs/versions/v2/Model/DealFieldItem.md index f8062055..6b8e7c15 100644 --- a/docs/versions/v2/Model/DealFieldItem.md +++ b/docs/versions/v2/Model/DealFieldItem.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field_name** | **string** | The display name/label of the field | **field_code** | **string** | The unique identifier for the field (40-character hash for custom fields) | -**description** | **string** | The description of the field | +**description** | **string** | The description of the field | [optional] **field_type** | **string** | The type of the field | **options** | [**\Pipedrive\versions\v2\Model\ActivityFieldItemOptions[]**](ActivityFieldItemOptions.md) | Array of available options for enum/set fields, null for other field types | [optional] **subfields** | [**\Pipedrive\versions\v2\Model\ActivityFieldItemSubfields[]**](ActivityFieldItemSubfields.md) | Array of subfields for complex field types (address, monetary), null for simple field types | [optional] diff --git a/docs/versions/v2/Model/DeleteDealFieldData.md b/docs/versions/v2/Model/DeleteDealFieldData.md index 765aa6c0..7e035ad9 100644 --- a/docs/versions/v2/Model/DeleteDealFieldData.md +++ b/docs/versions/v2/Model/DeleteDealFieldData.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field_name** | **string** | The display name/label of the field | **field_code** | **string** | The unique identifier for the field (40-character hash for custom fields) | -**description** | **string** | The description of the field | +**description** | **string** | The description of the field | [optional] **field_type** | **string** | The type of the field | **options** | **object[]** | Array of available options for enum/set fields, null for other field types | [optional] **subfields** | **object[]** | Array of subfields for complex field types (address, monetary), null for simple field types | [optional] diff --git a/docs/versions/v2/Model/Person.md b/docs/versions/v2/Model/Person.md index fc01b575..90556b72 100644 --- a/docs/versions/v2/Model/Person.md +++ b/docs/versions/v2/Model/Person.md @@ -12,15 +12,15 @@ Name | Type | Description | Notes **org_id** | **int** | The ID of the organization linked to the person | [optional] **add_time** | **string** | The creation date and time of the person | [optional] **update_time** | **string** | The last updated date and time of the person | [optional] -**emails** | [**\Pipedrive\versions\v2\Model\PersonEmails[]**](PersonEmails.md) | The emails of the person | [optional] -**phones** | [**\Pipedrive\versions\v2\Model\PersonPhones[]**](PersonPhones.md) | The phones of the person | [optional] +**emails** | [**\Pipedrive\versions\v2\Model\PersonItemEmail[]**](PersonItemEmail.md) | The emails of the person | [optional] +**phones** | [**\Pipedrive\versions\v2\Model\PersonItemPhone[]**](PersonItemPhone.md) | The phones of the person | [optional] **is_deleted** | **bool** | Whether the person is deleted or not | [optional] **visible_to** | **int** | The visibility of the person | [optional] **label_ids** | **int[]** | The IDs of labels assigned to the person | [optional] **picture_id** | **int** | The ID of the picture associated with the person | [optional] -**postal_address** | [**\Pipedrive\versions\v2\Model\PersonPostalAddress**](PersonPostalAddress.md) | | [optional] +**postal_address** | [**\Pipedrive\versions\v2\Model\PersonItemAddress**](PersonItemAddress.md) | | [optional] **notes** | **string** | Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company | [optional] -**im** | [**\Pipedrive\versions\v2\Model\PersonIm[]**](PersonIm.md) | The instant messaging accounts of the person, included if contact sync is enabled for the company | [optional] +**im** | [**\Pipedrive\versions\v2\Model\PersonItemIm[]**](PersonItemIm.md) | The instant messaging accounts of the person, included if contact sync is enabled for the company | [optional] **birthday** | **string** | The birthday of the person, included if contact sync is enabled for the company | [optional] **job_title** | **string** | The job title of the person, included if contact sync is enabled for the company | [optional] **custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. | [optional] diff --git a/docs/versions/v2/Model/PersonItem.md b/docs/versions/v2/Model/PersonItem.md index d3c3c56b..d597aa76 100644 --- a/docs/versions/v2/Model/PersonItem.md +++ b/docs/versions/v2/Model/PersonItem.md @@ -12,15 +12,15 @@ Name | Type | Description | Notes **org_id** | **int** | The ID of the organization linked to the person | [optional] **add_time** | **string** | The creation date and time of the person | [optional] **update_time** | **string** | The last updated date and time of the person | [optional] -**emails** | [**\Pipedrive\versions\v2\Model\PersonEmails[]**](PersonEmails.md) | The emails of the person | [optional] -**phones** | [**\Pipedrive\versions\v2\Model\PersonPhones[]**](PersonPhones.md) | The phones of the person | [optional] +**emails** | [**\Pipedrive\versions\v2\Model\PersonItemEmail[]**](PersonItemEmail.md) | The emails of the person | [optional] +**phones** | [**\Pipedrive\versions\v2\Model\PersonItemPhone[]**](PersonItemPhone.md) | The phones of the person | [optional] **is_deleted** | **bool** | Whether the person is deleted or not | [optional] **visible_to** | **int** | The visibility of the person | [optional] **label_ids** | **int[]** | The IDs of labels assigned to the person | [optional] **picture_id** | **int** | The ID of the picture associated with the person | [optional] -**postal_address** | [**\Pipedrive\versions\v2\Model\PersonPostalAddress**](PersonPostalAddress.md) | | [optional] +**postal_address** | [**\Pipedrive\versions\v2\Model\PersonItemAddress**](PersonItemAddress.md) | | [optional] **notes** | **string** | Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company | [optional] -**im** | [**\Pipedrive\versions\v2\Model\PersonIm[]**](PersonIm.md) | The instant messaging accounts of the person, included if contact sync is enabled for the company | [optional] +**im** | [**\Pipedrive\versions\v2\Model\PersonItemIm[]**](PersonItemIm.md) | The instant messaging accounts of the person, included if contact sync is enabled for the company | [optional] **birthday** | **string** | The birthday of the person, included if contact sync is enabled for the company | [optional] **job_title** | **string** | The job title of the person, included if contact sync is enabled for the company | [optional] **custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. | [optional] diff --git a/docs/versions/v2/Model/PersonItemAddress.md b/docs/versions/v2/Model/PersonItemAddress.md new file mode 100644 index 00000000..c568a600 --- /dev/null +++ b/docs/versions/v2/Model/PersonItemAddress.md @@ -0,0 +1,18 @@ +# # PersonItemAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The full address of the person | [optional] +**country** | **string** | Country of the person | [optional] +**admin_area_level_1** | **string** | Admin area level 1 (e.g. state) of the person | [optional] +**admin_area_level_2** | **string** | Admin area level 2 (e.g. county) of the person | [optional] +**locality** | **string** | Locality (e.g. city) of the person | [optional] +**sublocality** | **string** | Sublocality (e.g. neighborhood) of the person | [optional] +**route** | **string** | Route (e.g. street) of the person | [optional] +**street_number** | **string** | Street number of the person | [optional] +**subpremise** | **string** | Subpremise (e.g. apartment/suite number) of the person | [optional] +**postal_code** | **string** | Postal code of the person | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/PersonItemEmail.md b/docs/versions/v2/Model/PersonItemEmail.md new file mode 100644 index 00000000..72725e74 --- /dev/null +++ b/docs/versions/v2/Model/PersonItemEmail.md @@ -0,0 +1,11 @@ +# # PersonItemEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The email address of the person | [optional] +**primary** | **bool** | Whether the email is primary or not | [optional] +**label** | **string** | The email address classification label | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/PersonItemPhone.md b/docs/versions/v2/Model/PersonItemPhone.md new file mode 100644 index 00000000..1e21c3ed --- /dev/null +++ b/docs/versions/v2/Model/PersonItemPhone.md @@ -0,0 +1,11 @@ +# # PersonItemPhone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The phone number of the person | [optional] +**primary** | **bool** | Whether the phone number is primary or not | [optional] +**label** | **string** | The phone number classification label | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/PostOrganizationRequestBody.md b/docs/versions/v2/Model/PostOrganizationRequestBody.md new file mode 100644 index 00000000..dfa301d4 --- /dev/null +++ b/docs/versions/v2/Model/PostOrganizationRequestBody.md @@ -0,0 +1,20 @@ +# # PostOrganizationRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization | [optional] +**owner_id** | **int** | The ID of the user who owns the organization | [optional] +**add_time** | **string** | The creation date and time of the organization | [optional] +**visible_to** | **int** | The visibility of the organization | [optional] +**label_ids** | **int[]** | The IDs of labels assigned to the organization | [optional] +**address** | [**\Pipedrive\versions\v2\Model\OrganizationItemAddress**](OrganizationItemAddress.md) | | [optional] +**website** | **string** | The website of the organization | [optional] +**linkedin** | **string** | The LinkedIn profile URL of the organization | [optional] +**industry** | **int** | The industry the organization belongs to | [optional] +**annual_revenue** | **int** | The annual revenue of the organization | [optional] +**employee_count** | **int** | The number of employees in the organization | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/PostPersonRequestBody.md b/docs/versions/v2/Model/PostPersonRequestBody.md new file mode 100644 index 00000000..b47dbdfc --- /dev/null +++ b/docs/versions/v2/Model/PostPersonRequestBody.md @@ -0,0 +1,23 @@ +# # PostPersonRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | [optional] +**owner_id** | **int** | The ID of the user who owns the person | [optional] +**org_id** | **int** | The ID of the organization linked to the person | [optional] +**add_time** | **string** | The creation date and time of the person | [optional] +**emails** | [**\Pipedrive\versions\v2\Model\PersonItemEmail[]**](PersonItemEmail.md) | The emails of the person | [optional] +**phones** | [**\Pipedrive\versions\v2\Model\PersonItemPhone[]**](PersonItemPhone.md) | The phones of the person | [optional] +**visible_to** | **int** | The visibility of the person | [optional] +**label_ids** | **int[]** | The IDs of labels assigned to the person | [optional] +**postal_address** | [**\Pipedrive\versions\v2\Model\PersonItemAddress**](PersonItemAddress.md) | | [optional] +**notes** | **string** | Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company | [optional] +**im** | [**\Pipedrive\versions\v2\Model\PersonItemIm[]**](PersonItemIm.md) | The instant messaging accounts of the person, included if contact sync is enabled for the company | [optional] +**birthday** | **string** | The birthday of the person, included if contact sync is enabled for the company | [optional] +**job_title** | **string** | The job title of the person, included if contact sync is enabled for the company | [optional] +**marketing_status** | **string** | If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/UpdateOrganizationRequestBody.md b/docs/versions/v2/Model/UpdateOrganizationRequestBody.md new file mode 100644 index 00000000..9bb64923 --- /dev/null +++ b/docs/versions/v2/Model/UpdateOrganizationRequestBody.md @@ -0,0 +1,19 @@ +# # UpdateOrganizationRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization | [optional] +**owner_id** | **int** | The ID of the user who owns the organization | [optional] +**visible_to** | **int** | The visibility of the organization | [optional] +**label_ids** | **int[]** | The IDs of labels assigned to the organization | [optional] +**address** | [**\Pipedrive\versions\v2\Model\OrganizationItemAddress**](OrganizationItemAddress.md) | | [optional] +**website** | **string** | The website of the organization | [optional] +**linkedin** | **string** | The LinkedIn profile URL of the organization | [optional] +**industry** | **int** | The industry the organization belongs to | [optional] +**annual_revenue** | **int** | The annual revenue of the organization | [optional] +**employee_count** | **int** | The number of employees in the organization | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/Model/UpdatePersonRequestBody.md b/docs/versions/v2/Model/UpdatePersonRequestBody.md new file mode 100644 index 00000000..078f986b --- /dev/null +++ b/docs/versions/v2/Model/UpdatePersonRequestBody.md @@ -0,0 +1,22 @@ +# # UpdatePersonRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | [optional] +**owner_id** | **int** | The ID of the user who owns the person | [optional] +**org_id** | **int** | The ID of the organization linked to the person | [optional] +**emails** | [**\Pipedrive\versions\v2\Model\PersonItemEmail[]**](PersonItemEmail.md) | The emails of the person | [optional] +**phones** | [**\Pipedrive\versions\v2\Model\PersonItemPhone[]**](PersonItemPhone.md) | The phones of the person | [optional] +**visible_to** | **int** | The visibility of the person | [optional] +**label_ids** | **int[]** | The IDs of labels assigned to the person | [optional] +**postal_address** | [**\Pipedrive\versions\v2\Model\PersonItemAddress**](PersonItemAddress.md) | | [optional] +**notes** | **string** | Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company | [optional] +**im** | [**\Pipedrive\versions\v2\Model\PersonItemIm[]**](PersonItemIm.md) | The instant messaging accounts of the person, included if contact sync is enabled for the company | [optional] +**birthday** | **string** | The birthday of the person, included if contact sync is enabled for the company | [optional] +**job_title** | **string** | The job title of the person, included if contact sync is enabled for the company | [optional] +**marketing_status** | **string** | If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> | [optional] +**custom_fields** | **array** | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v2/README.md b/docs/versions/v2/README.md index 74f62a85..0a69a061 100644 --- a/docs/versions/v2/README.md +++ b/docs/versions/v2/README.md @@ -637,24 +637,22 @@ Class | Method | HTTP request | Description - [OrganizationFieldItemUiVisibilityShowInAddPersonDialog](Model/OrganizationFieldItemUiVisibilityShowInAddPersonDialog.md) - [OrganizationItem](Model/OrganizationItem.md) - [OrganizationItemAddress](Model/OrganizationItemAddress.md) - - [OrganizationRequestBody](Model/OrganizationRequestBody.md) - [OrganizationSearchItem](Model/OrganizationSearchItem.md) - [OrganizationSearchItemItem](Model/OrganizationSearchItemItem.md) - [Person](Model/Person.md) - - [PersonEmails](Model/PersonEmails.md) - [PersonFieldItem](Model/PersonFieldItem.md) - [PersonFieldItemImportantFields](Model/PersonFieldItemImportantFields.md) - [PersonFieldItemRequiredFields](Model/PersonFieldItemRequiredFields.md) - [PersonFieldItemUiVisibility](Model/PersonFieldItemUiVisibility.md) - [PersonFieldItemUiVisibilityShowInAddDealDialog](Model/PersonFieldItemUiVisibilityShowInAddDealDialog.md) - - [PersonIm](Model/PersonIm.md) - [PersonItem](Model/PersonItem.md) - - [PersonPhones](Model/PersonPhones.md) + - [PersonItemAddress](Model/PersonItemAddress.md) + - [PersonItemEmail](Model/PersonItemEmail.md) + - [PersonItemIm](Model/PersonItemIm.md) + - [PersonItemPhone](Model/PersonItemPhone.md) - [PersonPictureItem](Model/PersonPictureItem.md) - [PersonPictureItemPictures](Model/PersonPictureItemPictures.md) - [PersonPictureResponse](Model/PersonPictureResponse.md) - - [PersonPostalAddress](Model/PersonPostalAddress.md) - - [PersonRequestBody](Model/PersonRequestBody.md) - [PersonSearchItem](Model/PersonSearchItem.md) - [PersonSearchItemItem](Model/PersonSearchItemItem.md) - [PersonSearchItemItemOrganization](Model/PersonSearchItemItemOrganization.md) @@ -668,6 +666,7 @@ Class | Method | HTTP request | Description - [PipelineRequestBody](Model/PipelineRequestBody.md) - [PostFollower](Model/PostFollower.md) - [PostFollowerAllOf](Model/PostFollowerAllOf.md) + - [PostOrganizationRequestBody](Model/PostOrganizationRequestBody.md) - [PostPatchGetActivity](Model/PostPatchGetActivity.md) - [PostPatchGetBoard](Model/PostPatchGetBoard.md) - [PostPatchGetDeal](Model/PostPatchGetDeal.md) @@ -678,6 +677,7 @@ Class | Method | HTTP request | Description - [PostPatchGetProject](Model/PostPatchGetProject.md) - [PostPatchGetProjectAllOf](Model/PostPatchGetProjectAllOf.md) - [PostPatchGetStage](Model/PostPatchGetStage.md) + - [PostPersonRequestBody](Model/PostPersonRequestBody.md) - [ProductFieldItem](Model/ProductFieldItem.md) - [ProductImageResponse](Model/ProductImageResponse.md) - [ProductImageResponseData](Model/ProductImageResponseData.md) @@ -722,7 +722,9 @@ Class | Method | HTTP request | Description - [UpdateDealProductRequestBody](Model/UpdateDealProductRequestBody.md) - [UpdateInstallmentResponse](Model/UpdateInstallmentResponse.md) - [UpdateOrganizationFieldRequest](Model/UpdateOrganizationFieldRequest.md) + - [UpdateOrganizationRequestBody](Model/UpdateOrganizationRequestBody.md) - [UpdatePersonFieldRequest](Model/UpdatePersonFieldRequest.md) + - [UpdatePersonRequestBody](Model/UpdatePersonRequestBody.md) - [UpdateProductFieldRequest](Model/UpdateProductFieldRequest.md) - [UpdateProductImageResponse](Model/UpdateProductImageResponse.md) - [UpdateProductRequestBody](Model/UpdateProductRequestBody.md) diff --git a/lib/versions/v1/Api/DealsApi.php b/lib/versions/v1/Api/DealsApi.php index a6760dbf..c7e1111b 100644 --- a/lib/versions/v1/Api/DealsApi.php +++ b/lib/versions/v1/Api/DealsApi.php @@ -3838,14 +3838,15 @@ public function getDealFollowersRequest($id): Request * @param int $id The ID of the deal (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListMailMessagesResponse */ - public function getDealMailMessages($id, $start = 0, $limit = null) + public function getDealMailMessages($id, $start = 0, $limit = null, $include_body = null) { - list($response) = $this->getDealMailMessagesWithHttpInfo($id, $start, $limit); + list($response) = $this->getDealMailMessagesWithHttpInfo($id, $start, $limit, $include_body); return $response; } @@ -3857,14 +3858,15 @@ public function getDealMailMessages($id, $start = 0, $limit = null) * @param int $id The ID of the deal (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListMailMessagesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null) + public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null, $include_body = null) { - $request = $this->getDealMailMessagesRequest($id, $start, $limit); + $request = $this->getDealMailMessagesRequest($id, $start, $limit, $include_body); try { $options = $this->createHttpClientOption(); @@ -3873,7 +3875,7 @@ public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getDealMailMessagesRequest($id, $start, $limit); + $request = $this->getDealMailMessagesRequest($id, $start, $limit, $include_body); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -3960,13 +3962,14 @@ public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null) * @param int $id The ID of the deal (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getDealMailMessagesAsync($id, $start = 0, $limit = null): PromiseInterface + public function getDealMailMessagesAsync($id, $start = 0, $limit = null, $include_body = null): PromiseInterface { - return $this->getDealMailMessagesAsyncWithHttpInfo($id, $start, $limit) + return $this->getDealMailMessagesAsyncWithHttpInfo($id, $start, $limit, $include_body) ->then( function ($response) { return $response[0]; @@ -3982,14 +3985,15 @@ function ($response) { * @param int $id The ID of the deal (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getDealMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + public function getDealMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null, $include_body = null): PromiseInterface { $returnType = '\Pipedrive\versions\v1\Model\ListMailMessagesResponse'; - $request = $this->getDealMailMessagesRequest($id, $start, $limit); + $request = $this->getDealMailMessagesRequest($id, $start, $limit, $include_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4031,11 +4035,12 @@ function ($exception) { * @param int $id The ID of the deal (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getDealMailMessagesRequest($id, $start = 0, $limit = null): Request + public function getDealMailMessagesRequest($id, $start = 0, $limit = null, $include_body = null): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ @@ -4068,6 +4073,14 @@ public function getDealMailMessagesRequest($id, $start = 0, $limit = null): Requ if ($limit !== null) { $queryParams['limit'] = $limit; } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_body)) { + $include_body = ObjectSerializer::serializeCollection($include_body, '', true); + } + if ($include_body !== null) { + $queryParams['include_body'] = $include_body; + } // path params diff --git a/lib/versions/v1/Api/OrganizationsApi.php b/lib/versions/v1/Api/OrganizationsApi.php index e0332e6b..ee0ea5b1 100644 --- a/lib/versions/v1/Api/OrganizationsApi.php +++ b/lib/versions/v1/Api/OrganizationsApi.php @@ -1710,14 +1710,15 @@ public function getOrganizationFollowersRequest($id): Request * @param int $id The ID of the organization (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListMailMessagesResponse */ - public function getOrganizationMailMessages($id, $start = 0, $limit = null) + public function getOrganizationMailMessages($id, $start = 0, $limit = null, $include_body = null) { - list($response) = $this->getOrganizationMailMessagesWithHttpInfo($id, $start, $limit); + list($response) = $this->getOrganizationMailMessagesWithHttpInfo($id, $start, $limit, $include_body); return $response; } @@ -1729,14 +1730,15 @@ public function getOrganizationMailMessages($id, $start = 0, $limit = null) * @param int $id The ID of the organization (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListMailMessagesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrganizationMailMessagesWithHttpInfo($id, $start = 0, $limit = null) + public function getOrganizationMailMessagesWithHttpInfo($id, $start = 0, $limit = null, $include_body = null) { - $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit); + $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit, $include_body); try { $options = $this->createHttpClientOption(); @@ -1745,7 +1747,7 @@ public function getOrganizationMailMessagesWithHttpInfo($id, $start = 0, $limit } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit); + $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit, $include_body); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -1832,13 +1834,14 @@ public function getOrganizationMailMessagesWithHttpInfo($id, $start = 0, $limit * @param int $id The ID of the organization (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getOrganizationMailMessagesAsync($id, $start = 0, $limit = null): PromiseInterface + public function getOrganizationMailMessagesAsync($id, $start = 0, $limit = null, $include_body = null): PromiseInterface { - return $this->getOrganizationMailMessagesAsyncWithHttpInfo($id, $start, $limit) + return $this->getOrganizationMailMessagesAsyncWithHttpInfo($id, $start, $limit, $include_body) ->then( function ($response) { return $response[0]; @@ -1854,14 +1857,15 @@ function ($response) { * @param int $id The ID of the organization (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getOrganizationMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + public function getOrganizationMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null, $include_body = null): PromiseInterface { $returnType = '\Pipedrive\versions\v1\Model\ListMailMessagesResponse'; - $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit); + $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit, $include_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1903,11 +1907,12 @@ function ($exception) { * @param int $id The ID of the organization (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getOrganizationMailMessagesRequest($id, $start = 0, $limit = null): Request + public function getOrganizationMailMessagesRequest($id, $start = 0, $limit = null, $include_body = null): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ @@ -1940,6 +1945,14 @@ public function getOrganizationMailMessagesRequest($id, $start = 0, $limit = nul if ($limit !== null) { $queryParams['limit'] = $limit; } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_body)) { + $include_body = ObjectSerializer::serializeCollection($include_body, '', true); + } + if ($include_body !== null) { + $queryParams['include_body'] = $include_body; + } // path params diff --git a/lib/versions/v1/Api/PersonsApi.php b/lib/versions/v1/Api/PersonsApi.php index bc7d7632..cf652211 100644 --- a/lib/versions/v1/Api/PersonsApi.php +++ b/lib/versions/v1/Api/PersonsApi.php @@ -2363,14 +2363,15 @@ public function getPersonFollowersRequest($id): Request * @param int $id The ID of the person (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v1\Model\ListMailMessagesResponse */ - public function getPersonMailMessages($id, $start = 0, $limit = null) + public function getPersonMailMessages($id, $start = 0, $limit = null, $include_body = null) { - list($response) = $this->getPersonMailMessagesWithHttpInfo($id, $start, $limit); + list($response) = $this->getPersonMailMessagesWithHttpInfo($id, $start, $limit, $include_body); return $response; } @@ -2382,14 +2383,15 @@ public function getPersonMailMessages($id, $start = 0, $limit = null) * @param int $id The ID of the person (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v1\Model\ListMailMessagesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPersonMailMessagesWithHttpInfo($id, $start = 0, $limit = null) + public function getPersonMailMessagesWithHttpInfo($id, $start = 0, $limit = null, $include_body = null) { - $request = $this->getPersonMailMessagesRequest($id, $start, $limit); + $request = $this->getPersonMailMessagesRequest($id, $start, $limit, $include_body); try { $options = $this->createHttpClientOption(); @@ -2398,7 +2400,7 @@ public function getPersonMailMessagesWithHttpInfo($id, $start = 0, $limit = null } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->getPersonMailMessagesRequest($id, $start, $limit); + $request = $this->getPersonMailMessagesRequest($id, $start, $limit, $include_body); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -2485,13 +2487,14 @@ public function getPersonMailMessagesWithHttpInfo($id, $start = 0, $limit = null * @param int $id The ID of the person (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getPersonMailMessagesAsync($id, $start = 0, $limit = null): PromiseInterface + public function getPersonMailMessagesAsync($id, $start = 0, $limit = null, $include_body = null): PromiseInterface { - return $this->getPersonMailMessagesAsyncWithHttpInfo($id, $start, $limit) + return $this->getPersonMailMessagesAsyncWithHttpInfo($id, $start, $limit, $include_body) ->then( function ($response) { return $response[0]; @@ -2507,14 +2510,15 @@ function ($response) { * @param int $id The ID of the person (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function getPersonMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + public function getPersonMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null, $include_body = null): PromiseInterface { $returnType = '\Pipedrive\versions\v1\Model\ListMailMessagesResponse'; - $request = $this->getPersonMailMessagesRequest($id, $start, $limit); + $request = $this->getPersonMailMessagesRequest($id, $start, $limit, $include_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2556,11 +2560,12 @@ function ($exception) { * @param int $id The ID of the person (required) * @param int|0 $start Pagination start (optional, default to 0) * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function getPersonMailMessagesRequest($id, $start = 0, $limit = null): Request + public function getPersonMailMessagesRequest($id, $start = 0, $limit = null, $include_body = null): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ @@ -2593,6 +2598,14 @@ public function getPersonMailMessagesRequest($id, $start = 0, $limit = null): Re if ($limit !== null) { $queryParams['limit'] = $limit; } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_body)) { + $include_body = ObjectSerializer::serializeCollection($include_body, '', true); + } + if ($include_body !== null) { + $queryParams['include_body'] = $include_body; + } // path params diff --git a/lib/versions/v1/Model/MailMessageData.php b/lib/versions/v1/Model/MailMessageData.php index 93e78400..a7abc990 100644 --- a/lib/versions/v1/Model/MailMessageData.php +++ b/lib/versions/v1/Model/MailMessageData.php @@ -72,6 +72,7 @@ class MailMessageData implements ModelInterface, ArrayAccess, JsonSerializable 'cc' => '\Pipedrive\versions\v1\Model\MailParticipant[]', 'bcc' => '\Pipedrive\versions\v1\Model\MailParticipant[]', 'body_url' => 'string', + 'body' => 'string', 'account_id' => 'string', 'user_id' => 'int', 'mail_thread_id' => 'int', @@ -110,6 +111,7 @@ class MailMessageData implements ModelInterface, ArrayAccess, JsonSerializable 'cc' => null, 'bcc' => null, 'body_url' => null, + 'body' => null, 'account_id' => null, 'user_id' => null, 'mail_thread_id' => null, @@ -171,6 +173,7 @@ public static function openAPIFormats(): array 'cc' => 'cc', 'bcc' => 'bcc', 'body_url' => 'body_url', + 'body' => 'body', 'account_id' => 'account_id', 'user_id' => 'user_id', 'mail_thread_id' => 'mail_thread_id', @@ -207,6 +210,7 @@ public static function openAPIFormats(): array 'cc' => 'setCc', 'bcc' => 'setBcc', 'body_url' => 'setBodyUrl', + 'body' => 'setBody', 'account_id' => 'setAccountId', 'user_id' => 'setUserId', 'mail_thread_id' => 'setMailThreadId', @@ -243,6 +247,7 @@ public static function openAPIFormats(): array 'cc' => 'getCc', 'bcc' => 'getBcc', 'body_url' => 'getBodyUrl', + 'body' => 'getBody', 'account_id' => 'getAccountId', 'user_id' => 'getUserId', 'mail_thread_id' => 'getMailThreadId', @@ -357,6 +362,7 @@ public function __construct(?array $data = null) $this->container['cc'] = $data['cc'] ?? null; $this->container['bcc'] = $data['bcc'] ?? null; $this->container['body_url'] = $data['body_url'] ?? null; + $this->container['body'] = $data['body'] ?? null; $this->container['account_id'] = $data['account_id'] ?? null; $this->container['user_id'] = $data['user_id'] ?? null; $this->container['mail_thread_id'] = $data['mail_thread_id'] ?? null; @@ -560,6 +566,30 @@ public function setBodyUrl($body_url): self return $this; } + /** + * Gets body + * + * @return string|null + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string|null $body The mail message body content. Only present when `include_body=1` is passed. + * + * @return self + */ + public function setBody($body): self + { + $this->container['body'] = $body; + + return $this; + } + /** * Gets account_id * diff --git a/lib/versions/v1/Model/MailMessageItemForList.php b/lib/versions/v1/Model/MailMessageItemForList.php index 54f3efd3..caafb0ea 100644 --- a/lib/versions/v1/Model/MailMessageItemForList.php +++ b/lib/versions/v1/Model/MailMessageItemForList.php @@ -72,6 +72,7 @@ class MailMessageItemForList implements ModelInterface, ArrayAccess, JsonSeriali 'cc' => '\Pipedrive\versions\v1\Model\MailParticipant[]', 'bcc' => '\Pipedrive\versions\v1\Model\MailParticipant[]', 'body_url' => 'string', + 'body' => 'string', 'account_id' => 'string', 'user_id' => 'int', 'mail_thread_id' => 'int', @@ -119,6 +120,7 @@ class MailMessageItemForList implements ModelInterface, ArrayAccess, JsonSeriali 'cc' => null, 'bcc' => null, 'body_url' => null, + 'body' => null, 'account_id' => null, 'user_id' => null, 'mail_thread_id' => null, @@ -189,6 +191,7 @@ public static function openAPIFormats(): array 'cc' => 'cc', 'bcc' => 'bcc', 'body_url' => 'body_url', + 'body' => 'body', 'account_id' => 'account_id', 'user_id' => 'user_id', 'mail_thread_id' => 'mail_thread_id', @@ -234,6 +237,7 @@ public static function openAPIFormats(): array 'cc' => 'setCc', 'bcc' => 'setBcc', 'body_url' => 'setBodyUrl', + 'body' => 'setBody', 'account_id' => 'setAccountId', 'user_id' => 'setUserId', 'mail_thread_id' => 'setMailThreadId', @@ -279,6 +283,7 @@ public static function openAPIFormats(): array 'cc' => 'getCc', 'bcc' => 'getBcc', 'body_url' => 'getBodyUrl', + 'body' => 'getBody', 'account_id' => 'getAccountId', 'user_id' => 'getUserId', 'mail_thread_id' => 'getMailThreadId', @@ -402,6 +407,7 @@ public function __construct(?array $data = null) $this->container['cc'] = $data['cc'] ?? null; $this->container['bcc'] = $data['bcc'] ?? null; $this->container['body_url'] = $data['body_url'] ?? null; + $this->container['body'] = $data['body'] ?? null; $this->container['account_id'] = $data['account_id'] ?? null; $this->container['user_id'] = $data['user_id'] ?? null; $this->container['mail_thread_id'] = $data['mail_thread_id'] ?? null; @@ -614,6 +620,30 @@ public function setBodyUrl($body_url): self return $this; } + /** + * Gets body + * + * @return string|null + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string|null $body The mail message body content. Only present when `include_body=1` is passed. + * + * @return self + */ + public function setBody($body): self + { + $this->container['body'] = $body; + + return $this; + } + /** * Gets account_id * diff --git a/lib/versions/v2/Api/OrganizationsApi.php b/lib/versions/v2/Api/OrganizationsApi.php index 119c3389..4f55d619 100644 --- a/lib/versions/v2/Api/OrganizationsApi.php +++ b/lib/versions/v2/Api/OrganizationsApi.php @@ -127,15 +127,15 @@ public function getConfig(): Configuration * * Add a new organization * - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostOrganizationRequestBody|null $post_organization_request_body post_organization_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v2\Model\PostPatchGetOrganization */ - public function addOrganization($organization_request_body = null) + public function addOrganization($post_organization_request_body = null) { - list($response) = $this->addOrganizationWithHttpInfo($organization_request_body); + list($response) = $this->addOrganizationWithHttpInfo($post_organization_request_body); return $response; } @@ -144,15 +144,15 @@ public function addOrganization($organization_request_body = null) * * Add a new organization * - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostOrganizationRequestBody|null $post_organization_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v2\Model\PostPatchGetOrganization, HTTP status code, HTTP response headers (array of strings) */ - public function addOrganizationWithHttpInfo($organization_request_body = null) + public function addOrganizationWithHttpInfo($post_organization_request_body = null) { - $request = $this->addOrganizationRequest($organization_request_body); + $request = $this->addOrganizationRequest($post_organization_request_body); try { $options = $this->createHttpClientOption(); @@ -161,7 +161,7 @@ public function addOrganizationWithHttpInfo($organization_request_body = null) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->addOrganizationRequest($organization_request_body); + $request = $this->addOrganizationRequest($post_organization_request_body); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -245,14 +245,14 @@ public function addOrganizationWithHttpInfo($organization_request_body = null) * * Add a new organization * - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostOrganizationRequestBody|null $post_organization_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function addOrganizationAsync($organization_request_body = null): PromiseInterface + public function addOrganizationAsync($post_organization_request_body = null): PromiseInterface { - return $this->addOrganizationAsyncWithHttpInfo($organization_request_body) + return $this->addOrganizationAsyncWithHttpInfo($post_organization_request_body) ->then( function ($response) { return $response[0]; @@ -265,15 +265,15 @@ function ($response) { * * Add a new organization * - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostOrganizationRequestBody|null $post_organization_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function addOrganizationAsyncWithHttpInfo($organization_request_body = null): PromiseInterface + public function addOrganizationAsyncWithHttpInfo($post_organization_request_body = null): PromiseInterface { $returnType = '\Pipedrive\versions\v2\Model\PostPatchGetOrganization'; - $request = $this->addOrganizationRequest($organization_request_body); + $request = $this->addOrganizationRequest($post_organization_request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -312,12 +312,12 @@ function ($exception) { /** * Create request for operation 'addOrganization' * - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostOrganizationRequestBody|null $post_organization_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function addOrganizationRequest($organization_request_body = null): Request + public function addOrganizationRequest($post_organization_request_body = null): Request { $resourcePath = '/organizations'; @@ -344,11 +344,11 @@ public function addOrganizationRequest($organization_request_body = null): Reque } // for model (json/xml) - if (isset($organization_request_body)) { + if (isset($post_organization_request_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($organization_request_body)); + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($post_organization_request_body)); } else { - $httpBody = $organization_request_body; + $httpBody = $post_organization_request_body; } } elseif (count($formParams) > 0) { /* @phpstan-ignore-next-line */ @@ -3119,15 +3119,15 @@ public function searchOrganizationRequest($term, $fields = null, $exact_match = * Update a organization * * @param int $id The ID of the organization (required) - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody|null $update_organization_request_body update_organization_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v2\Model\PostPatchGetOrganization */ - public function updateOrganization($id, $organization_request_body = null) + public function updateOrganization($id, $update_organization_request_body = null) { - list($response) = $this->updateOrganizationWithHttpInfo($id, $organization_request_body); + list($response) = $this->updateOrganizationWithHttpInfo($id, $update_organization_request_body); return $response; } @@ -3137,15 +3137,15 @@ public function updateOrganization($id, $organization_request_body = null) * Update a organization * * @param int $id The ID of the organization (required) - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody|null $update_organization_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v2\Model\PostPatchGetOrganization, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrganizationWithHttpInfo($id, $organization_request_body = null) + public function updateOrganizationWithHttpInfo($id, $update_organization_request_body = null) { - $request = $this->updateOrganizationRequest($id, $organization_request_body); + $request = $this->updateOrganizationRequest($id, $update_organization_request_body); try { $options = $this->createHttpClientOption(); @@ -3154,7 +3154,7 @@ public function updateOrganizationWithHttpInfo($id, $organization_request_body = } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->updateOrganizationRequest($id, $organization_request_body); + $request = $this->updateOrganizationRequest($id, $update_organization_request_body); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -3239,14 +3239,14 @@ public function updateOrganizationWithHttpInfo($id, $organization_request_body = * Update a organization * * @param int $id The ID of the organization (required) - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody|null $update_organization_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function updateOrganizationAsync($id, $organization_request_body = null): PromiseInterface + public function updateOrganizationAsync($id, $update_organization_request_body = null): PromiseInterface { - return $this->updateOrganizationAsyncWithHttpInfo($id, $organization_request_body) + return $this->updateOrganizationAsyncWithHttpInfo($id, $update_organization_request_body) ->then( function ($response) { return $response[0]; @@ -3260,15 +3260,15 @@ function ($response) { * Update a organization * * @param int $id The ID of the organization (required) - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody|null $update_organization_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function updateOrganizationAsyncWithHttpInfo($id, $organization_request_body = null): PromiseInterface + public function updateOrganizationAsyncWithHttpInfo($id, $update_organization_request_body = null): PromiseInterface { $returnType = '\Pipedrive\versions\v2\Model\PostPatchGetOrganization'; - $request = $this->updateOrganizationRequest($id, $organization_request_body); + $request = $this->updateOrganizationRequest($id, $update_organization_request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3308,12 +3308,12 @@ function ($exception) { * Create request for operation 'updateOrganization' * * @param int $id The ID of the organization (required) - * @param \Pipedrive\versions\v2\Model\OrganizationRequestBody|null $organization_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdateOrganizationRequestBody|null $update_organization_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function updateOrganizationRequest($id, $organization_request_body = null): Request + public function updateOrganizationRequest($id, $update_organization_request_body = null): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ @@ -3355,11 +3355,11 @@ public function updateOrganizationRequest($id, $organization_request_body = null } // for model (json/xml) - if (isset($organization_request_body)) { + if (isset($update_organization_request_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($organization_request_body)); + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_organization_request_body)); } else { - $httpBody = $organization_request_body; + $httpBody = $update_organization_request_body; } } elseif (count($formParams) > 0) { /* @phpstan-ignore-next-line */ diff --git a/lib/versions/v2/Api/PersonsApi.php b/lib/versions/v2/Api/PersonsApi.php index 7820e261..a4c2475e 100644 --- a/lib/versions/v2/Api/PersonsApi.php +++ b/lib/versions/v2/Api/PersonsApi.php @@ -127,15 +127,15 @@ public function getConfig(): Configuration * * Add a new person * - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostPersonRequestBody|null $post_person_request_body post_person_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v2\Model\PostPatchGetPerson */ - public function addPerson($person_request_body = null) + public function addPerson($post_person_request_body = null) { - list($response) = $this->addPersonWithHttpInfo($person_request_body); + list($response) = $this->addPersonWithHttpInfo($post_person_request_body); return $response; } @@ -144,15 +144,15 @@ public function addPerson($person_request_body = null) * * Add a new person * - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostPersonRequestBody|null $post_person_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v2\Model\PostPatchGetPerson, HTTP status code, HTTP response headers (array of strings) */ - public function addPersonWithHttpInfo($person_request_body = null) + public function addPersonWithHttpInfo($post_person_request_body = null) { - $request = $this->addPersonRequest($person_request_body); + $request = $this->addPersonRequest($post_person_request_body); try { $options = $this->createHttpClientOption(); @@ -161,7 +161,7 @@ public function addPersonWithHttpInfo($person_request_body = null) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->addPersonRequest($person_request_body); + $request = $this->addPersonRequest($post_person_request_body); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -245,14 +245,14 @@ public function addPersonWithHttpInfo($person_request_body = null) * * Add a new person * - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostPersonRequestBody|null $post_person_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function addPersonAsync($person_request_body = null): PromiseInterface + public function addPersonAsync($post_person_request_body = null): PromiseInterface { - return $this->addPersonAsyncWithHttpInfo($person_request_body) + return $this->addPersonAsyncWithHttpInfo($post_person_request_body) ->then( function ($response) { return $response[0]; @@ -265,15 +265,15 @@ function ($response) { * * Add a new person * - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostPersonRequestBody|null $post_person_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function addPersonAsyncWithHttpInfo($person_request_body = null): PromiseInterface + public function addPersonAsyncWithHttpInfo($post_person_request_body = null): PromiseInterface { $returnType = '\Pipedrive\versions\v2\Model\PostPatchGetPerson'; - $request = $this->addPersonRequest($person_request_body); + $request = $this->addPersonRequest($post_person_request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -312,12 +312,12 @@ function ($exception) { /** * Create request for operation 'addPerson' * - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\PostPersonRequestBody|null $post_person_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function addPersonRequest($person_request_body = null): Request + public function addPersonRequest($post_person_request_body = null): Request { $resourcePath = '/persons'; @@ -344,11 +344,11 @@ public function addPersonRequest($person_request_body = null): Request } // for model (json/xml) - if (isset($person_request_body)) { + if (isset($post_person_request_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($person_request_body)); + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($post_person_request_body)); } else { - $httpBody = $person_request_body; + $httpBody = $post_person_request_body; } } elseif (count($formParams) > 0) { /* @phpstan-ignore-next-line */ @@ -3467,15 +3467,15 @@ public function searchPersonsRequest($term, $fields = null, $exact_match = null, * Update a person * * @param int $id The ID of the person (required) - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdatePersonRequestBody|null $update_person_request_body update_person_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return \Pipedrive\versions\v2\Model\PostPatchGetPerson */ - public function updatePerson($id, $person_request_body = null) + public function updatePerson($id, $update_person_request_body = null) { - list($response) = $this->updatePersonWithHttpInfo($id, $person_request_body); + list($response) = $this->updatePersonWithHttpInfo($id, $update_person_request_body); return $response; } @@ -3485,15 +3485,15 @@ public function updatePerson($id, $person_request_body = null) * Update a person * * @param int $id The ID of the person (required) - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdatePersonRequestBody|null $update_person_request_body (optional) * * @throws ApiException on non-2xx response * @throws InvalidArgumentException|GuzzleException * @return array of \Pipedrive\versions\v2\Model\PostPatchGetPerson, HTTP status code, HTTP response headers (array of strings) */ - public function updatePersonWithHttpInfo($id, $person_request_body = null) + public function updatePersonWithHttpInfo($id, $update_person_request_body = null) { - $request = $this->updatePersonRequest($id, $person_request_body); + $request = $this->updatePersonRequest($id, $update_person_request_body); try { $options = $this->createHttpClientOption(); @@ -3502,7 +3502,7 @@ public function updatePersonWithHttpInfo($id, $person_request_body = null) } catch (RequestException $e) { if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { $this->config->refreshToken(); - $request = $this->updatePersonRequest($id, $person_request_body); + $request = $this->updatePersonRequest($id, $update_person_request_body); $response = $this->client->send($request, $options); } else { throw new ApiException( @@ -3587,14 +3587,14 @@ public function updatePersonWithHttpInfo($id, $person_request_body = null) * Update a person * * @param int $id The ID of the person (required) - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdatePersonRequestBody|null $update_person_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function updatePersonAsync($id, $person_request_body = null): PromiseInterface + public function updatePersonAsync($id, $update_person_request_body = null): PromiseInterface { - return $this->updatePersonAsyncWithHttpInfo($id, $person_request_body) + return $this->updatePersonAsyncWithHttpInfo($id, $update_person_request_body) ->then( function ($response) { return $response[0]; @@ -3608,15 +3608,15 @@ function ($response) { * Update a person * * @param int $id The ID of the person (required) - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdatePersonRequestBody|null $update_person_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return PromiseInterface */ - public function updatePersonAsyncWithHttpInfo($id, $person_request_body = null): PromiseInterface + public function updatePersonAsyncWithHttpInfo($id, $update_person_request_body = null): PromiseInterface { $returnType = '\Pipedrive\versions\v2\Model\PostPatchGetPerson'; - $request = $this->updatePersonRequest($id, $person_request_body); + $request = $this->updatePersonRequest($id, $update_person_request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3656,12 +3656,12 @@ function ($exception) { * Create request for operation 'updatePerson' * * @param int $id The ID of the person (required) - * @param \Pipedrive\versions\v2\Model\PersonRequestBody|null $person_request_body (optional) + * @param \Pipedrive\versions\v2\Model\UpdatePersonRequestBody|null $update_person_request_body (optional) * * @throws InvalidArgumentException|OAuthProviderException * @return Request */ - public function updatePersonRequest($id, $person_request_body = null): Request + public function updatePersonRequest($id, $update_person_request_body = null): Request { // verify the required parameter 'id' is set /* @phpstan-ignore-next-line */ @@ -3703,11 +3703,11 @@ public function updatePersonRequest($id, $person_request_body = null): Request } // for model (json/xml) - if (isset($person_request_body)) { + if (isset($update_person_request_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($person_request_body)); + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_person_request_body)); } else { - $httpBody = $person_request_body; + $httpBody = $update_person_request_body; } } elseif (count($formParams) > 0) { /* @phpstan-ignore-next-line */ diff --git a/lib/versions/v2/Model/ActivityFieldItemOptions.php b/lib/versions/v2/Model/ActivityFieldItemOptions.php index dbad29e9..02bd1a40 100644 --- a/lib/versions/v2/Model/ActivityFieldItemOptions.php +++ b/lib/versions/v2/Model/ActivityFieldItemOptions.php @@ -66,7 +66,7 @@ class ActivityFieldItemOptions implements ModelInterface, ArrayAccess, JsonSeria * @phpsalm-var array */ protected static array $openAPITypes = [ - 'id' => 'int', + 'id' => 'OneOfIntegerString', 'label' => 'string', 'color' => 'string', 'update_time' => '\DateTime', @@ -255,7 +255,7 @@ public function valid(): bool /** * Gets id * - * @return int|null + * @return OneOfIntegerString|null */ public function getId() { @@ -265,7 +265,7 @@ public function getId() /** * Sets id * - * @param int|null $id The option ID + * @param OneOfIntegerString|null $id The option ID (integer for custom fields, string for built-in fields) * * @return self */ diff --git a/lib/versions/v2/Model/DealFieldItem.php b/lib/versions/v2/Model/DealFieldItem.php index abcdde76..5fe6c01d 100644 --- a/lib/versions/v2/Model/DealFieldItem.php +++ b/lib/versions/v2/Model/DealFieldItem.php @@ -358,9 +358,6 @@ public function listInvalidProperties(): array if ($this->container['field_code'] === null) { $invalidProperties[] = "'field_code' can't be null"; } - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' can't be null"; - } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -445,7 +442,7 @@ public function setFieldCode($field_code): self /** * Gets description * - * @return string + * @return string|null */ public function getDescription() { @@ -455,7 +452,7 @@ public function getDescription() /** * Sets description * - * @param string $description The description of the field + * @param string|null $description The description of the field * * @return self */ diff --git a/lib/versions/v2/Model/DeleteDealFieldData.php b/lib/versions/v2/Model/DeleteDealFieldData.php index bdbbc4bc..a3466746 100644 --- a/lib/versions/v2/Model/DeleteDealFieldData.php +++ b/lib/versions/v2/Model/DeleteDealFieldData.php @@ -261,9 +261,6 @@ public function listInvalidProperties(): array if ($this->container['field_code'] === null) { $invalidProperties[] = "'field_code' can't be null"; } - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' can't be null"; - } if ($this->container['field_type'] === null) { $invalidProperties[] = "'field_type' can't be null"; } @@ -339,7 +336,7 @@ public function setFieldCode($field_code): self /** * Gets description * - * @return string + * @return string|null */ public function getDescription() { @@ -349,7 +346,7 @@ public function getDescription() /** * Sets description * - * @param string $description The description of the field + * @param string|null $description The description of the field * * @return self */ diff --git a/lib/versions/v2/Model/OrganizationItemAddress.php b/lib/versions/v2/Model/OrganizationItemAddress.php index c754078c..e223517d 100644 --- a/lib/versions/v2/Model/OrganizationItemAddress.php +++ b/lib/versions/v2/Model/OrganizationItemAddress.php @@ -38,6 +38,7 @@ * OrganizationItemAddress Class Doc Comment * * @category Class + * @description The address of the organization * @package Pipedrive\versions\v2 * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/lib/versions/v2/Model/Person.php b/lib/versions/v2/Model/Person.php index b9b7e7f6..e0df7cf8 100644 --- a/lib/versions/v2/Model/Person.php +++ b/lib/versions/v2/Model/Person.php @@ -74,15 +74,15 @@ class Person implements ModelInterface, ArrayAccess, JsonSerializable 'org_id' => 'int', 'add_time' => 'string', 'update_time' => 'string', - 'emails' => '\Pipedrive\versions\v2\Model\PersonEmails[]', - 'phones' => '\Pipedrive\versions\v2\Model\PersonPhones[]', + 'emails' => '\Pipedrive\versions\v2\Model\PersonItemEmail[]', + 'phones' => '\Pipedrive\versions\v2\Model\PersonItemPhone[]', 'is_deleted' => 'bool', 'visible_to' => 'int', 'label_ids' => 'int[]', 'picture_id' => 'int', - 'postal_address' => '\Pipedrive\versions\v2\Model\PersonPostalAddress', + 'postal_address' => '\Pipedrive\versions\v2\Model\PersonItemAddress', 'notes' => 'string', - 'im' => '\Pipedrive\versions\v2\Model\PersonIm[]', + 'im' => '\Pipedrive\versions\v2\Model\PersonItemIm[]', 'birthday' => 'string', 'job_title' => 'string', 'custom_fields' => 'array' @@ -537,7 +537,7 @@ public function setUpdateTime($update_time): self /** * Gets emails * - * @return \Pipedrive\versions\v2\Model\PersonEmails[]|null + * @return \Pipedrive\versions\v2\Model\PersonItemEmail[]|null */ public function getEmails() { @@ -547,7 +547,7 @@ public function getEmails() /** * Sets emails * - * @param \Pipedrive\versions\v2\Model\PersonEmails[]|null $emails The emails of the person + * @param \Pipedrive\versions\v2\Model\PersonItemEmail[]|null $emails The emails of the person * * @return self */ @@ -561,7 +561,7 @@ public function setEmails($emails): self /** * Gets phones * - * @return \Pipedrive\versions\v2\Model\PersonPhones[]|null + * @return \Pipedrive\versions\v2\Model\PersonItemPhone[]|null */ public function getPhones() { @@ -571,7 +571,7 @@ public function getPhones() /** * Sets phones * - * @param \Pipedrive\versions\v2\Model\PersonPhones[]|null $phones The phones of the person + * @param \Pipedrive\versions\v2\Model\PersonItemPhone[]|null $phones The phones of the person * * @return self */ @@ -681,7 +681,7 @@ public function setPictureId($picture_id): self /** * Gets postal_address * - * @return \Pipedrive\versions\v2\Model\PersonPostalAddress|null + * @return \Pipedrive\versions\v2\Model\PersonItemAddress|null */ public function getPostalAddress() { @@ -691,7 +691,7 @@ public function getPostalAddress() /** * Sets postal_address * - * @param \Pipedrive\versions\v2\Model\PersonPostalAddress|null $postal_address postal_address + * @param \Pipedrive\versions\v2\Model\PersonItemAddress|null $postal_address postal_address * * @return self */ @@ -729,7 +729,7 @@ public function setNotes($notes): self /** * Gets im * - * @return \Pipedrive\versions\v2\Model\PersonIm[]|null + * @return \Pipedrive\versions\v2\Model\PersonItemIm[]|null */ public function getIm() { @@ -739,7 +739,7 @@ public function getIm() /** * Sets im * - * @param \Pipedrive\versions\v2\Model\PersonIm[]|null $im The instant messaging accounts of the person, included if contact sync is enabled for the company + * @param \Pipedrive\versions\v2\Model\PersonItemIm[]|null $im The instant messaging accounts of the person, included if contact sync is enabled for the company * * @return self */ diff --git a/lib/versions/v2/Model/PersonItem.php b/lib/versions/v2/Model/PersonItem.php index e5dc3bbc..610c641f 100644 --- a/lib/versions/v2/Model/PersonItem.php +++ b/lib/versions/v2/Model/PersonItem.php @@ -74,15 +74,15 @@ class PersonItem implements ModelInterface, ArrayAccess, JsonSerializable 'org_id' => 'int', 'add_time' => 'string', 'update_time' => 'string', - 'emails' => '\Pipedrive\versions\v2\Model\PersonEmails[]', - 'phones' => '\Pipedrive\versions\v2\Model\PersonPhones[]', + 'emails' => '\Pipedrive\versions\v2\Model\PersonItemEmail[]', + 'phones' => '\Pipedrive\versions\v2\Model\PersonItemPhone[]', 'is_deleted' => 'bool', 'visible_to' => 'int', 'label_ids' => 'int[]', 'picture_id' => 'int', - 'postal_address' => '\Pipedrive\versions\v2\Model\PersonPostalAddress', + 'postal_address' => '\Pipedrive\versions\v2\Model\PersonItemAddress', 'notes' => 'string', - 'im' => '\Pipedrive\versions\v2\Model\PersonIm[]', + 'im' => '\Pipedrive\versions\v2\Model\PersonItemIm[]', 'birthday' => 'string', 'job_title' => 'string', 'custom_fields' => 'array' @@ -537,7 +537,7 @@ public function setUpdateTime($update_time): self /** * Gets emails * - * @return \Pipedrive\versions\v2\Model\PersonEmails[]|null + * @return \Pipedrive\versions\v2\Model\PersonItemEmail[]|null */ public function getEmails() { @@ -547,7 +547,7 @@ public function getEmails() /** * Sets emails * - * @param \Pipedrive\versions\v2\Model\PersonEmails[]|null $emails The emails of the person + * @param \Pipedrive\versions\v2\Model\PersonItemEmail[]|null $emails The emails of the person * * @return self */ @@ -561,7 +561,7 @@ public function setEmails($emails): self /** * Gets phones * - * @return \Pipedrive\versions\v2\Model\PersonPhones[]|null + * @return \Pipedrive\versions\v2\Model\PersonItemPhone[]|null */ public function getPhones() { @@ -571,7 +571,7 @@ public function getPhones() /** * Sets phones * - * @param \Pipedrive\versions\v2\Model\PersonPhones[]|null $phones The phones of the person + * @param \Pipedrive\versions\v2\Model\PersonItemPhone[]|null $phones The phones of the person * * @return self */ @@ -681,7 +681,7 @@ public function setPictureId($picture_id): self /** * Gets postal_address * - * @return \Pipedrive\versions\v2\Model\PersonPostalAddress|null + * @return \Pipedrive\versions\v2\Model\PersonItemAddress|null */ public function getPostalAddress() { @@ -691,7 +691,7 @@ public function getPostalAddress() /** * Sets postal_address * - * @param \Pipedrive\versions\v2\Model\PersonPostalAddress|null $postal_address postal_address + * @param \Pipedrive\versions\v2\Model\PersonItemAddress|null $postal_address postal_address * * @return self */ @@ -729,7 +729,7 @@ public function setNotes($notes): self /** * Gets im * - * @return \Pipedrive\versions\v2\Model\PersonIm[]|null + * @return \Pipedrive\versions\v2\Model\PersonItemIm[]|null */ public function getIm() { @@ -739,7 +739,7 @@ public function getIm() /** * Sets im * - * @param \Pipedrive\versions\v2\Model\PersonIm[]|null $im The instant messaging accounts of the person, included if contact sync is enabled for the company + * @param \Pipedrive\versions\v2\Model\PersonItemIm[]|null $im The instant messaging accounts of the person, included if contact sync is enabled for the company * * @return self */ diff --git a/lib/versions/v2/Model/PersonItemAddress.php b/lib/versions/v2/Model/PersonItemAddress.php new file mode 100644 index 00000000..7c3977c1 --- /dev/null +++ b/lib/versions/v2/Model/PersonItemAddress.php @@ -0,0 +1,616 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonItemAddress implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonItemAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'string', + 'country' => 'string', + 'admin_area_level_1' => 'string', + 'admin_area_level_2' => 'string', + 'locality' => 'string', + 'sublocality' => 'string', + 'route' => 'string', + 'street_number' => 'string', + 'subpremise' => 'string', + 'postal_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'country' => null, + 'admin_area_level_1' => null, + 'admin_area_level_2' => null, + 'locality' => null, + 'sublocality' => null, + 'route' => null, + 'street_number' => null, + 'subpremise' => null, + 'postal_code' => 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 = [ + 'value' => 'value', + 'country' => 'country', + 'admin_area_level_1' => 'admin_area_level_1', + 'admin_area_level_2' => 'admin_area_level_2', + 'locality' => 'locality', + 'sublocality' => 'sublocality', + 'route' => 'route', + 'street_number' => 'street_number', + 'subpremise' => 'subpremise', + 'postal_code' => 'postal_code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'country' => 'setCountry', + 'admin_area_level_1' => 'setAdminAreaLevel1', + 'admin_area_level_2' => 'setAdminAreaLevel2', + 'locality' => 'setLocality', + 'sublocality' => 'setSublocality', + 'route' => 'setRoute', + 'street_number' => 'setStreetNumber', + 'subpremise' => 'setSubpremise', + 'postal_code' => 'setPostalCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'country' => 'getCountry', + 'admin_area_level_1' => 'getAdminAreaLevel1', + 'admin_area_level_2' => 'getAdminAreaLevel2', + 'locality' => 'getLocality', + 'sublocality' => 'getSublocality', + 'route' => 'getRoute', + 'street_number' => 'getStreetNumber', + 'subpremise' => 'getSubpremise', + 'postal_code' => 'getPostalCode' + ]; + + /** + * 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['value'] = $data['value'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['admin_area_level_1'] = $data['admin_area_level_1'] ?? null; + $this->container['admin_area_level_2'] = $data['admin_area_level_2'] ?? null; + $this->container['locality'] = $data['locality'] ?? null; + $this->container['sublocality'] = $data['sublocality'] ?? null; + $this->container['route'] = $data['route'] ?? null; + $this->container['street_number'] = $data['street_number'] ?? null; + $this->container['subpremise'] = $data['subpremise'] ?? null; + $this->container['postal_code'] = $data['postal_code'] ?? 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 value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The full address of the person + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Country of the person + * + * @return self + */ + public function setCountry($country): self + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets admin_area_level_1 + * + * @return string|null + */ + public function getAdminAreaLevel1() + { + return $this->container['admin_area_level_1']; + } + + /** + * Sets admin_area_level_1 + * + * @param string|null $admin_area_level_1 Admin area level 1 (e.g. state) of the person + * + * @return self + */ + public function setAdminAreaLevel1($admin_area_level_1): self + { + $this->container['admin_area_level_1'] = $admin_area_level_1; + + return $this; + } + + /** + * Gets admin_area_level_2 + * + * @return string|null + */ + public function getAdminAreaLevel2() + { + return $this->container['admin_area_level_2']; + } + + /** + * Sets admin_area_level_2 + * + * @param string|null $admin_area_level_2 Admin area level 2 (e.g. county) of the person + * + * @return self + */ + public function setAdminAreaLevel2($admin_area_level_2): self + { + $this->container['admin_area_level_2'] = $admin_area_level_2; + + return $this; + } + + /** + * Gets locality + * + * @return string|null + */ + public function getLocality() + { + return $this->container['locality']; + } + + /** + * Sets locality + * + * @param string|null $locality Locality (e.g. city) of the person + * + * @return self + */ + public function setLocality($locality): self + { + $this->container['locality'] = $locality; + + return $this; + } + + /** + * Gets sublocality + * + * @return string|null + */ + public function getSublocality() + { + return $this->container['sublocality']; + } + + /** + * Sets sublocality + * + * @param string|null $sublocality Sublocality (e.g. neighborhood) of the person + * + * @return self + */ + public function setSublocality($sublocality): self + { + $this->container['sublocality'] = $sublocality; + + return $this; + } + + /** + * Gets route + * + * @return string|null + */ + public function getRoute() + { + return $this->container['route']; + } + + /** + * Sets route + * + * @param string|null $route Route (e.g. street) of the person + * + * @return self + */ + public function setRoute($route): self + { + $this->container['route'] = $route; + + return $this; + } + + /** + * Gets street_number + * + * @return string|null + */ + public function getStreetNumber() + { + return $this->container['street_number']; + } + + /** + * Sets street_number + * + * @param string|null $street_number Street number of the person + * + * @return self + */ + public function setStreetNumber($street_number): self + { + $this->container['street_number'] = $street_number; + + return $this; + } + + /** + * Gets subpremise + * + * @return string|null + */ + public function getSubpremise() + { + return $this->container['subpremise']; + } + + /** + * Sets subpremise + * + * @param string|null $subpremise Subpremise (e.g. apartment/suite number) of the person + * + * @return self + */ + public function setSubpremise($subpremise): self + { + $this->container['subpremise'] = $subpremise; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code Postal code of the person + * + * @return self + */ + public function setPostalCode($postal_code): self + { + $this->container['postal_code'] = $postal_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/PersonItemEmail.php b/lib/versions/v2/Model/PersonItemEmail.php new file mode 100644 index 00000000..6e0d504e --- /dev/null +++ b/lib/versions/v2/Model/PersonItemEmail.php @@ -0,0 +1,405 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonItemEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonItemEmail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'string', + 'primary' => 'bool', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'primary' => null, + 'label' => 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 = [ + 'value' => 'value', + 'primary' => 'primary', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'primary' => 'setPrimary', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'primary' => 'getPrimary', + 'label' => 'getLabel' + ]; + + /** + * 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['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + $this->container['label'] = $data['label'] ?? 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 value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The email address of the person + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Whether the email is primary or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The email address classification label + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/PersonItemIm.php b/lib/versions/v2/Model/PersonItemIm.php index 5af11f09..6dd87c1b 100644 --- a/lib/versions/v2/Model/PersonItemIm.php +++ b/lib/versions/v2/Model/PersonItemIm.php @@ -2,7 +2,7 @@ /** * PersonItemIm * - * PHP version 7.3 + * PHP version 8.0 * * @category Class * @package Pipedrive\versions\v2 @@ -56,7 +56,7 @@ class PersonItemIm implements ModelInterface, ArrayAccess, JsonSerializable * * @var string */ - protected static string $openAPIModelName = 'PersonItem_im'; + protected static string $openAPIModelName = 'PersonItemIm'; /** * Array of property to type mappings. Used for (de)serialization @@ -207,7 +207,7 @@ public function getModelName(): string * @param array|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->container['value'] = $data['value'] ?? null; $this->container['primary'] = $data['primary'] ?? null; diff --git a/lib/versions/v2/Model/PersonItemPhone.php b/lib/versions/v2/Model/PersonItemPhone.php new file mode 100644 index 00000000..61a64e04 --- /dev/null +++ b/lib/versions/v2/Model/PersonItemPhone.php @@ -0,0 +1,405 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonItemPhone implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonItemPhone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'string', + 'primary' => 'bool', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'primary' => null, + 'label' => 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 = [ + 'value' => 'value', + 'primary' => 'primary', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'primary' => 'setPrimary', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'primary' => 'getPrimary', + 'label' => 'getLabel' + ]; + + /** + * 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['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + $this->container['label'] = $data['label'] ?? 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 value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The phone number of the person + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Whether the phone number is primary or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The phone number classification label + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/PostOrganizationRequestBody.php b/lib/versions/v2/Model/PostOrganizationRequestBody.php new file mode 100644 index 00000000..db7f2796 --- /dev/null +++ b/lib/versions/v2/Model/PostOrganizationRequestBody.php @@ -0,0 +1,675 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostOrganizationRequestBody implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostOrganizationRequestBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'owner_id' => 'int', + 'add_time' => 'string', + 'visible_to' => 'int', + 'label_ids' => 'int[]', + 'address' => '\Pipedrive\versions\v2\Model\OrganizationItemAddress', + 'website' => 'string', + 'linkedin' => 'string', + 'industry' => 'int', + 'annual_revenue' => 'int', + 'employee_count' => 'int', + 'custom_fields' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'owner_id' => null, + 'add_time' => null, + 'visible_to' => null, + 'label_ids' => null, + 'address' => null, + 'website' => null, + 'linkedin' => null, + 'industry' => null, + 'annual_revenue' => null, + 'employee_count' => null, + 'custom_fields' => 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 = [ + 'name' => 'name', + 'owner_id' => 'owner_id', + 'add_time' => 'add_time', + 'visible_to' => 'visible_to', + 'label_ids' => 'label_ids', + 'address' => 'address', + 'website' => 'website', + 'linkedin' => 'linkedin', + 'industry' => 'industry', + 'annual_revenue' => 'annual_revenue', + 'employee_count' => 'employee_count', + 'custom_fields' => 'custom_fields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'owner_id' => 'setOwnerId', + 'add_time' => 'setAddTime', + 'visible_to' => 'setVisibleTo', + 'label_ids' => 'setLabelIds', + 'address' => 'setAddress', + 'website' => 'setWebsite', + 'linkedin' => 'setLinkedin', + 'industry' => 'setIndustry', + 'annual_revenue' => 'setAnnualRevenue', + 'employee_count' => 'setEmployeeCount', + 'custom_fields' => 'setCustomFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'owner_id' => 'getOwnerId', + 'add_time' => 'getAddTime', + 'visible_to' => 'getVisibleTo', + 'label_ids' => 'getLabelIds', + 'address' => 'getAddress', + 'website' => 'getWebsite', + 'linkedin' => 'getLinkedin', + 'industry' => 'getIndustry', + 'annual_revenue' => 'getAnnualRevenue', + 'employee_count' => 'getEmployeeCount', + 'custom_fields' => 'getCustomFields' + ]; + + /** + * 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['name'] = $data['name'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label_ids'] = $data['label_ids'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['website'] = $data['website'] ?? null; + $this->container['linkedin'] = $data['linkedin'] ?? null; + $this->container['industry'] = $data['industry'] ?? null; + $this->container['annual_revenue'] = $data['annual_revenue'] ?? null; + $this->container['employee_count'] = $data['employee_count'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who owns the organization + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the organization + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the organization + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label_ids + * + * @return int[]|null + */ + public function getLabelIds() + { + return $this->container['label_ids']; + } + + /** + * Sets label_ids + * + * @param int[]|null $label_ids The IDs of labels assigned to the organization + * + * @return self + */ + public function setLabelIds($label_ids): self + { + $this->container['label_ids'] = $label_ids; + + return $this; + } + + /** + * Gets address + * + * @return \Pipedrive\versions\v2\Model\OrganizationItemAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Pipedrive\versions\v2\Model\OrganizationItemAddress|null $address address + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets website + * + * @return string|null + */ + public function getWebsite() + { + return $this->container['website']; + } + + /** + * Sets website + * + * @param string|null $website The website of the organization + * + * @return self + */ + public function setWebsite($website): self + { + $this->container['website'] = $website; + + return $this; + } + + /** + * Gets linkedin + * + * @return string|null + */ + public function getLinkedin() + { + return $this->container['linkedin']; + } + + /** + * Sets linkedin + * + * @param string|null $linkedin The LinkedIn profile URL of the organization + * + * @return self + */ + public function setLinkedin($linkedin): self + { + $this->container['linkedin'] = $linkedin; + + return $this; + } + + /** + * Gets industry + * + * @return int|null + */ + public function getIndustry() + { + return $this->container['industry']; + } + + /** + * Sets industry + * + * @param int|null $industry The industry the organization belongs to + * + * @return self + */ + public function setIndustry($industry): self + { + $this->container['industry'] = $industry; + + return $this; + } + + /** + * Gets annual_revenue + * + * @return int|null + */ + public function getAnnualRevenue() + { + return $this->container['annual_revenue']; + } + + /** + * Sets annual_revenue + * + * @param int|null $annual_revenue The annual revenue of the organization + * + * @return self + */ + public function setAnnualRevenue($annual_revenue): self + { + $this->container['annual_revenue'] = $annual_revenue; + + return $this; + } + + /** + * Gets employee_count + * + * @return int|null + */ + public function getEmployeeCount() + { + return $this->container['employee_count']; + } + + /** + * Sets employee_count + * + * @param int|null $employee_count The number of employees in the organization + * + * @return self + */ + public function setEmployeeCount($employee_count): self + { + $this->container['employee_count'] = $employee_count; + + return $this; + } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/PostPersonRequestBody.php b/lib/versions/v2/Model/PostPersonRequestBody.php new file mode 100644 index 00000000..94228fbf --- /dev/null +++ b/lib/versions/v2/Model/PostPersonRequestBody.php @@ -0,0 +1,805 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostPersonRequestBody implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostPersonRequestBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'owner_id' => 'int', + 'org_id' => 'int', + 'add_time' => 'string', + 'emails' => '\Pipedrive\versions\v2\Model\PersonItemEmail[]', + 'phones' => '\Pipedrive\versions\v2\Model\PersonItemPhone[]', + 'visible_to' => 'int', + 'label_ids' => 'int[]', + 'postal_address' => '\Pipedrive\versions\v2\Model\PersonItemAddress', + 'notes' => 'string', + 'im' => '\Pipedrive\versions\v2\Model\PersonItemIm[]', + 'birthday' => 'string', + 'job_title' => 'string', + 'marketing_status' => 'string', + 'custom_fields' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'owner_id' => null, + 'org_id' => null, + 'add_time' => null, + 'emails' => null, + 'phones' => null, + 'visible_to' => null, + 'label_ids' => null, + 'postal_address' => null, + 'notes' => null, + 'im' => null, + 'birthday' => null, + 'job_title' => null, + 'marketing_status' => null, + 'custom_fields' => 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 = [ + 'name' => 'name', + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'add_time' => 'add_time', + 'emails' => 'emails', + 'phones' => 'phones', + 'visible_to' => 'visible_to', + 'label_ids' => 'label_ids', + 'postal_address' => 'postal_address', + 'notes' => 'notes', + 'im' => 'im', + 'birthday' => 'birthday', + 'job_title' => 'job_title', + 'marketing_status' => 'marketing_status', + 'custom_fields' => 'custom_fields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'add_time' => 'setAddTime', + 'emails' => 'setEmails', + 'phones' => 'setPhones', + 'visible_to' => 'setVisibleTo', + 'label_ids' => 'setLabelIds', + 'postal_address' => 'setPostalAddress', + 'notes' => 'setNotes', + 'im' => 'setIm', + 'birthday' => 'setBirthday', + 'job_title' => 'setJobTitle', + 'marketing_status' => 'setMarketingStatus', + 'custom_fields' => 'setCustomFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'add_time' => 'getAddTime', + 'emails' => 'getEmails', + 'phones' => 'getPhones', + 'visible_to' => 'getVisibleTo', + 'label_ids' => 'getLabelIds', + 'postal_address' => 'getPostalAddress', + 'notes' => 'getNotes', + 'im' => 'getIm', + 'birthday' => 'getBirthday', + 'job_title' => 'getJobTitle', + 'marketing_status' => 'getMarketingStatus', + 'custom_fields' => 'getCustomFields' + ]; + + /** + * 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; + } + + const MARKETING_STATUS_NO_CONSENT = 'no_consent'; + const MARKETING_STATUS_UNSUBSCRIBED = 'unsubscribed'; + const MARKETING_STATUS_SUBSCRIBED = 'subscribed'; + const MARKETING_STATUS_ARCHIVED = 'archived'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getMarketingStatusAllowableValues(): array + { + return [ + self::MARKETING_STATUS_NO_CONSENT, + self::MARKETING_STATUS_UNSUBSCRIBED, + self::MARKETING_STATUS_SUBSCRIBED, + self::MARKETING_STATUS_ARCHIVED, + ]; + } + + /** + * 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['name'] = $data['name'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['emails'] = $data['emails'] ?? null; + $this->container['phones'] = $data['phones'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label_ids'] = $data['label_ids'] ?? null; + $this->container['postal_address'] = $data['postal_address'] ?? null; + $this->container['notes'] = $data['notes'] ?? null; + $this->container['im'] = $data['im'] ?? null; + $this->container['birthday'] = $data['birthday'] ?? null; + $this->container['job_title'] = $data['job_title'] ?? null; + $this->container['marketing_status'] = $data['marketing_status'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? 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 = []; + + $allowedValues = $this->getMarketingStatusAllowableValues(); + if (!is_null($this->container['marketing_status']) && !in_array($this->container['marketing_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'marketing_status', must be one of '%s'", + $this->container['marketing_status'], + implode("', '", $allowedValues) + ); + } + + 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who owns the person + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization linked to the person + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the person + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets emails + * + * @return \Pipedrive\versions\v2\Model\PersonItemEmail[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param \Pipedrive\versions\v2\Model\PersonItemEmail[]|null $emails The emails of the person + * + * @return self + */ + public function setEmails($emails): self + { + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets phones + * + * @return \Pipedrive\versions\v2\Model\PersonItemPhone[]|null + */ + public function getPhones() + { + return $this->container['phones']; + } + + /** + * Sets phones + * + * @param \Pipedrive\versions\v2\Model\PersonItemPhone[]|null $phones The phones of the person + * + * @return self + */ + public function setPhones($phones): self + { + $this->container['phones'] = $phones; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the person + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label_ids + * + * @return int[]|null + */ + public function getLabelIds() + { + return $this->container['label_ids']; + } + + /** + * Sets label_ids + * + * @param int[]|null $label_ids The IDs of labels assigned to the person + * + * @return self + */ + public function setLabelIds($label_ids): self + { + $this->container['label_ids'] = $label_ids; + + return $this; + } + + /** + * Gets postal_address + * + * @return \Pipedrive\versions\v2\Model\PersonItemAddress|null + */ + public function getPostalAddress() + { + return $this->container['postal_address']; + } + + /** + * Sets postal_address + * + * @param \Pipedrive\versions\v2\Model\PersonItemAddress|null $postal_address postal_address + * + * @return self + */ + public function setPostalAddress($postal_address): self + { + $this->container['postal_address'] = $postal_address; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company + * + * @return self + */ + public function setNotes($notes): self + { + $this->container['notes'] = $notes; + + return $this; + } + + /** + * Gets im + * + * @return \Pipedrive\versions\v2\Model\PersonItemIm[]|null + */ + public function getIm() + { + return $this->container['im']; + } + + /** + * Sets im + * + * @param \Pipedrive\versions\v2\Model\PersonItemIm[]|null $im The instant messaging accounts of the person, included if contact sync is enabled for the company + * + * @return self + */ + public function setIm($im): self + { + $this->container['im'] = $im; + + return $this; + } + + /** + * Gets birthday + * + * @return string|null + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string|null $birthday The birthday of the person, included if contact sync is enabled for the company + * + * @return self + */ + public function setBirthday($birthday): self + { + $this->container['birthday'] = $birthday; + + return $this; + } + + /** + * Gets job_title + * + * @return string|null + */ + public function getJobTitle() + { + return $this->container['job_title']; + } + + /** + * Sets job_title + * + * @param string|null $job_title The job title of the person, included if contact sync is enabled for the company + * + * @return self + */ + public function setJobTitle($job_title): self + { + $this->container['job_title'] = $job_title; + + return $this; + } + + /** + * Gets marketing_status + * + * @return string|null + */ + public function getMarketingStatus() + { + return $this->container['marketing_status']; + } + + /** + * Sets marketing_status + * + * @param string|null $marketing_status If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.
ValueDescription
`no_consent`The customer has not given consent to receive any marketing communications
`unsubscribed`The customers have unsubscribed from ALL marketing communications
`subscribed`The customers are subscribed and are counted towards marketing caps
`archived`The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for
+ * + * @return self + */ + public function setMarketingStatus($marketing_status): self + { + $allowedValues = $this->getMarketingStatusAllowableValues(); + if (!is_null($marketing_status) && !in_array($marketing_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'marketing_status', must be one of '%s'", + $marketing_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['marketing_status'] = $marketing_status; + + return $this; + } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/UpdateOrganizationRequestBody.php b/lib/versions/v2/Model/UpdateOrganizationRequestBody.php new file mode 100644 index 00000000..7cb93b01 --- /dev/null +++ b/lib/versions/v2/Model/UpdateOrganizationRequestBody.php @@ -0,0 +1,645 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateOrganizationRequestBody implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateOrganizationRequestBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'owner_id' => 'int', + 'visible_to' => 'int', + 'label_ids' => 'int[]', + 'address' => '\Pipedrive\versions\v2\Model\OrganizationItemAddress', + 'website' => 'string', + 'linkedin' => 'string', + 'industry' => 'int', + 'annual_revenue' => 'int', + 'employee_count' => 'int', + 'custom_fields' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'owner_id' => null, + 'visible_to' => null, + 'label_ids' => null, + 'address' => null, + 'website' => null, + 'linkedin' => null, + 'industry' => null, + 'annual_revenue' => null, + 'employee_count' => null, + 'custom_fields' => 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 = [ + 'name' => 'name', + 'owner_id' => 'owner_id', + 'visible_to' => 'visible_to', + 'label_ids' => 'label_ids', + 'address' => 'address', + 'website' => 'website', + 'linkedin' => 'linkedin', + 'industry' => 'industry', + 'annual_revenue' => 'annual_revenue', + 'employee_count' => 'employee_count', + 'custom_fields' => 'custom_fields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'owner_id' => 'setOwnerId', + 'visible_to' => 'setVisibleTo', + 'label_ids' => 'setLabelIds', + 'address' => 'setAddress', + 'website' => 'setWebsite', + 'linkedin' => 'setLinkedin', + 'industry' => 'setIndustry', + 'annual_revenue' => 'setAnnualRevenue', + 'employee_count' => 'setEmployeeCount', + 'custom_fields' => 'setCustomFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'owner_id' => 'getOwnerId', + 'visible_to' => 'getVisibleTo', + 'label_ids' => 'getLabelIds', + 'address' => 'getAddress', + 'website' => 'getWebsite', + 'linkedin' => 'getLinkedin', + 'industry' => 'getIndustry', + 'annual_revenue' => 'getAnnualRevenue', + 'employee_count' => 'getEmployeeCount', + 'custom_fields' => 'getCustomFields' + ]; + + /** + * 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['name'] = $data['name'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label_ids'] = $data['label_ids'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['website'] = $data['website'] ?? null; + $this->container['linkedin'] = $data['linkedin'] ?? null; + $this->container['industry'] = $data['industry'] ?? null; + $this->container['annual_revenue'] = $data['annual_revenue'] ?? null; + $this->container['employee_count'] = $data['employee_count'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who owns the organization + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the organization + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label_ids + * + * @return int[]|null + */ + public function getLabelIds() + { + return $this->container['label_ids']; + } + + /** + * Sets label_ids + * + * @param int[]|null $label_ids The IDs of labels assigned to the organization + * + * @return self + */ + public function setLabelIds($label_ids): self + { + $this->container['label_ids'] = $label_ids; + + return $this; + } + + /** + * Gets address + * + * @return \Pipedrive\versions\v2\Model\OrganizationItemAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Pipedrive\versions\v2\Model\OrganizationItemAddress|null $address address + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets website + * + * @return string|null + */ + public function getWebsite() + { + return $this->container['website']; + } + + /** + * Sets website + * + * @param string|null $website The website of the organization + * + * @return self + */ + public function setWebsite($website): self + { + $this->container['website'] = $website; + + return $this; + } + + /** + * Gets linkedin + * + * @return string|null + */ + public function getLinkedin() + { + return $this->container['linkedin']; + } + + /** + * Sets linkedin + * + * @param string|null $linkedin The LinkedIn profile URL of the organization + * + * @return self + */ + public function setLinkedin($linkedin): self + { + $this->container['linkedin'] = $linkedin; + + return $this; + } + + /** + * Gets industry + * + * @return int|null + */ + public function getIndustry() + { + return $this->container['industry']; + } + + /** + * Sets industry + * + * @param int|null $industry The industry the organization belongs to + * + * @return self + */ + public function setIndustry($industry): self + { + $this->container['industry'] = $industry; + + return $this; + } + + /** + * Gets annual_revenue + * + * @return int|null + */ + public function getAnnualRevenue() + { + return $this->container['annual_revenue']; + } + + /** + * Sets annual_revenue + * + * @param int|null $annual_revenue The annual revenue of the organization + * + * @return self + */ + public function setAnnualRevenue($annual_revenue): self + { + $this->container['annual_revenue'] = $annual_revenue; + + return $this; + } + + /** + * Gets employee_count + * + * @return int|null + */ + public function getEmployeeCount() + { + return $this->container['employee_count']; + } + + /** + * Sets employee_count + * + * @param int|null $employee_count The number of employees in the organization + * + * @return self + */ + public function setEmployeeCount($employee_count): self + { + $this->container['employee_count'] = $employee_count; + + return $this; + } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v2/Model/UpdatePersonRequestBody.php b/lib/versions/v2/Model/UpdatePersonRequestBody.php new file mode 100644 index 00000000..31b96db8 --- /dev/null +++ b/lib/versions/v2/Model/UpdatePersonRequestBody.php @@ -0,0 +1,775 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdatePersonRequestBody implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdatePersonRequestBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'owner_id' => 'int', + 'org_id' => 'int', + 'emails' => '\Pipedrive\versions\v2\Model\PersonItemEmail[]', + 'phones' => '\Pipedrive\versions\v2\Model\PersonItemPhone[]', + 'visible_to' => 'int', + 'label_ids' => 'int[]', + 'postal_address' => '\Pipedrive\versions\v2\Model\PersonItemAddress', + 'notes' => 'string', + 'im' => '\Pipedrive\versions\v2\Model\PersonItemIm[]', + 'birthday' => 'string', + 'job_title' => 'string', + 'marketing_status' => 'string', + 'custom_fields' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'owner_id' => null, + 'org_id' => null, + 'emails' => null, + 'phones' => null, + 'visible_to' => null, + 'label_ids' => null, + 'postal_address' => null, + 'notes' => null, + 'im' => null, + 'birthday' => null, + 'job_title' => null, + 'marketing_status' => null, + 'custom_fields' => 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 = [ + 'name' => 'name', + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'emails' => 'emails', + 'phones' => 'phones', + 'visible_to' => 'visible_to', + 'label_ids' => 'label_ids', + 'postal_address' => 'postal_address', + 'notes' => 'notes', + 'im' => 'im', + 'birthday' => 'birthday', + 'job_title' => 'job_title', + 'marketing_status' => 'marketing_status', + 'custom_fields' => 'custom_fields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'emails' => 'setEmails', + 'phones' => 'setPhones', + 'visible_to' => 'setVisibleTo', + 'label_ids' => 'setLabelIds', + 'postal_address' => 'setPostalAddress', + 'notes' => 'setNotes', + 'im' => 'setIm', + 'birthday' => 'setBirthday', + 'job_title' => 'setJobTitle', + 'marketing_status' => 'setMarketingStatus', + 'custom_fields' => 'setCustomFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'emails' => 'getEmails', + 'phones' => 'getPhones', + 'visible_to' => 'getVisibleTo', + 'label_ids' => 'getLabelIds', + 'postal_address' => 'getPostalAddress', + 'notes' => 'getNotes', + 'im' => 'getIm', + 'birthday' => 'getBirthday', + 'job_title' => 'getJobTitle', + 'marketing_status' => 'getMarketingStatus', + 'custom_fields' => 'getCustomFields' + ]; + + /** + * 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; + } + + const MARKETING_STATUS_NO_CONSENT = 'no_consent'; + const MARKETING_STATUS_UNSUBSCRIBED = 'unsubscribed'; + const MARKETING_STATUS_SUBSCRIBED = 'subscribed'; + const MARKETING_STATUS_ARCHIVED = 'archived'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getMarketingStatusAllowableValues(): array + { + return [ + self::MARKETING_STATUS_NO_CONSENT, + self::MARKETING_STATUS_UNSUBSCRIBED, + self::MARKETING_STATUS_SUBSCRIBED, + self::MARKETING_STATUS_ARCHIVED, + ]; + } + + /** + * 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['name'] = $data['name'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['emails'] = $data['emails'] ?? null; + $this->container['phones'] = $data['phones'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label_ids'] = $data['label_ids'] ?? null; + $this->container['postal_address'] = $data['postal_address'] ?? null; + $this->container['notes'] = $data['notes'] ?? null; + $this->container['im'] = $data['im'] ?? null; + $this->container['birthday'] = $data['birthday'] ?? null; + $this->container['job_title'] = $data['job_title'] ?? null; + $this->container['marketing_status'] = $data['marketing_status'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? 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 = []; + + $allowedValues = $this->getMarketingStatusAllowableValues(); + if (!is_null($this->container['marketing_status']) && !in_array($this->container['marketing_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'marketing_status', must be one of '%s'", + $this->container['marketing_status'], + implode("', '", $allowedValues) + ); + } + + 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who owns the person + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization linked to the person + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets emails + * + * @return \Pipedrive\versions\v2\Model\PersonItemEmail[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param \Pipedrive\versions\v2\Model\PersonItemEmail[]|null $emails The emails of the person + * + * @return self + */ + public function setEmails($emails): self + { + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets phones + * + * @return \Pipedrive\versions\v2\Model\PersonItemPhone[]|null + */ + public function getPhones() + { + return $this->container['phones']; + } + + /** + * Sets phones + * + * @param \Pipedrive\versions\v2\Model\PersonItemPhone[]|null $phones The phones of the person + * + * @return self + */ + public function setPhones($phones): self + { + $this->container['phones'] = $phones; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the person + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label_ids + * + * @return int[]|null + */ + public function getLabelIds() + { + return $this->container['label_ids']; + } + + /** + * Sets label_ids + * + * @param int[]|null $label_ids The IDs of labels assigned to the person + * + * @return self + */ + public function setLabelIds($label_ids): self + { + $this->container['label_ids'] = $label_ids; + + return $this; + } + + /** + * Gets postal_address + * + * @return \Pipedrive\versions\v2\Model\PersonItemAddress|null + */ + public function getPostalAddress() + { + return $this->container['postal_address']; + } + + /** + * Sets postal_address + * + * @param \Pipedrive\versions\v2\Model\PersonItemAddress|null $postal_address postal_address + * + * @return self + */ + public function setPostalAddress($postal_address): self + { + $this->container['postal_address'] = $postal_address; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company + * + * @return self + */ + public function setNotes($notes): self + { + $this->container['notes'] = $notes; + + return $this; + } + + /** + * Gets im + * + * @return \Pipedrive\versions\v2\Model\PersonItemIm[]|null + */ + public function getIm() + { + return $this->container['im']; + } + + /** + * Sets im + * + * @param \Pipedrive\versions\v2\Model\PersonItemIm[]|null $im The instant messaging accounts of the person, included if contact sync is enabled for the company + * + * @return self + */ + public function setIm($im): self + { + $this->container['im'] = $im; + + return $this; + } + + /** + * Gets birthday + * + * @return string|null + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string|null $birthday The birthday of the person, included if contact sync is enabled for the company + * + * @return self + */ + public function setBirthday($birthday): self + { + $this->container['birthday'] = $birthday; + + return $this; + } + + /** + * Gets job_title + * + * @return string|null + */ + public function getJobTitle() + { + return $this->container['job_title']; + } + + /** + * Sets job_title + * + * @param string|null $job_title The job title of the person, included if contact sync is enabled for the company + * + * @return self + */ + public function setJobTitle($job_title): self + { + $this->container['job_title'] = $job_title; + + return $this; + } + + /** + * Gets marketing_status + * + * @return string|null + */ + public function getMarketingStatus() + { + return $this->container['marketing_status']; + } + + /** + * Sets marketing_status + * + * @param string|null $marketing_status If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.
ValueDescription
`no_consent`The customer has not given consent to receive any marketing communications
`unsubscribed`The customers have unsubscribed from ALL marketing communications
`subscribed`The customers are subscribed and are counted towards marketing caps
`archived`The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for
+ * + * @return self + */ + public function setMarketingStatus($marketing_status): self + { + $allowedValues = $this->getMarketingStatusAllowableValues(); + if (!is_null($marketing_status) && !in_array($marketing_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'marketing_status', must be one of '%s'", + $marketing_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['marketing_status'] = $marketing_status; + + return $this; + } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + 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); + } +} + +