diff --git a/CHANGELOG.md b/CHANGELOG.md index b220270..cd0df2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Fixed `GET /v1/deals/{id}/participants` and `POST /v1/deals/{id}/participants` response schemas to accurately represent the API response structure. Added `DealParticipantItem` schema with proper nesting of `email` and `phone` fields within `person_id` object, replacing incorrect `PersonItem` reference. ## [15.3.0](https://github.com/pipedrive/client-php/compare/15.2.0...15.3.0) (2026-02-06) diff --git a/docs/versions/v1/Model/DealParticipantItem.md b/docs/versions/v1/Model/DealParticipantItem.md new file mode 100644 index 0000000..630c7b3 --- /dev/null +++ b/docs/versions/v1/Model/DealParticipantItem.md @@ -0,0 +1,17 @@ +# # DealParticipantItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the participant | [optional] +**person_id** | [**\Pipedrive\versions\v1\Model\DealParticipantItemPersonId**](DealParticipantItemPersonId.md) | | [optional] +**add_time** | **string** | The date and time when the participant was added. Format: YYYY-MM-DD HH:MM:SS | [optional] +**active_flag** | **bool** | Whether the participant is active or not | [optional] +**related_item_data** | [**\Pipedrive\versions\v1\Model\DealParticipantItemRelatedItemData**](DealParticipantItemRelatedItemData.md) | | [optional] +**person** | [**\Pipedrive\versions\v1\Model\PersonItem**](PersonItem.md) | | [optional] +**added_by_user_id** | [**\Pipedrive\versions\v1\Model\User**](User.md) | | [optional] +**related_item_type** | **string** | The type of the related item | [optional] +**related_item_id** | **int** | The ID of the related item | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v1/Model/DealParticipantItemPersonId.md b/docs/versions/v1/Model/DealParticipantItemPersonId.md new file mode 100644 index 0000000..d3ddc16 --- /dev/null +++ b/docs/versions/v1/Model/DealParticipantItemPersonId.md @@ -0,0 +1,15 @@ +# # DealParticipantItemPersonId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the person is active or not | [optional] +**name** | **string** | The name of the person | [optional] +**email** | [**\Pipedrive\versions\v1\Model\DealParticipantItemPersonIdEmail[]**](DealParticipantItemPersonIdEmail.md) | An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. | [optional] +**phone** | [**\Pipedrive\versions\v1\Model\BasePersonItemPhone[]**](BasePersonItemPhone.md) | A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. | [optional] +**owner_id** | **int** | The ID of the owner of the person | [optional] +**company_id** | **int** | The ID of the company related to the person | [optional] +**value** | **int** | The ID 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/v1/Model/DealParticipantItemPersonIdEmail.md b/docs/versions/v1/Model/DealParticipantItemPersonIdEmail.md new file mode 100644 index 0000000..607dcc8 --- /dev/null +++ b/docs/versions/v1/Model/DealParticipantItemPersonIdEmail.md @@ -0,0 +1,11 @@ +# # DealParticipantItemPersonIdEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The email address | [optional] +**primary** | **bool** | Boolean that indicates if email is primary for the person or not | [optional] +**label** | **string** | The label that indicates the type of the email. (Possible values - work, home or other) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v1/Model/DealParticipantItemRelatedItemData.md b/docs/versions/v1/Model/DealParticipantItemRelatedItemData.md new file mode 100644 index 0000000..f891dfd --- /dev/null +++ b/docs/versions/v1/Model/DealParticipantItemRelatedItemData.md @@ -0,0 +1,10 @@ +# # DealParticipantItemRelatedItemData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal_id** | **int** | The ID of the deal | [optional] +**title** | **string** | The title of the deal | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v1/Model/DealParticipants.md b/docs/versions/v1/Model/DealParticipants.md index 908a1e6..7aa8d83 100644 --- a/docs/versions/v1/Model/DealParticipants.md +++ b/docs/versions/v1/Model/DealParticipants.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **success** | **bool** | If the request was successful or not | [optional] -**data** | [**\Pipedrive\versions\v1\Model\PersonItem[]**](PersonItem.md) | The array of participants | [optional] +**data** | [**\Pipedrive\versions\v1\Model\DealParticipantItem[]**](DealParticipantItem.md) | The array of participants | [optional] **additional_data** | [**\Pipedrive\versions\v1\Model\AdditionalData**](AdditionalData.md) | | [optional] **related_objects** | [**\Pipedrive\versions\v1\Model\GetDealsRelatedObjects**](GetDealsRelatedObjects.md) | | [optional] diff --git a/docs/versions/v1/Model/PostDealParticipants.md b/docs/versions/v1/Model/PostDealParticipants.md index 38fb465..1608921 100644 --- a/docs/versions/v1/Model/PostDealParticipants.md +++ b/docs/versions/v1/Model/PostDealParticipants.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **success** | **bool** | If the request was successful or not | [optional] -**data** | [**PersonItem**](PersonItem.md) | The object of participant | [optional] +**data** | [**\Pipedrive\versions\v1\Model\DealParticipantItem**](DealParticipantItem.md) | | [optional] **related_objects** | [**\Pipedrive\versions\v1\Model\PostDealParticipantsRelatedObjects**](PostDealParticipantsRelatedObjects.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/versions/v1/README.md b/docs/versions/v1/README.md index 3737ad7..5b29253 100644 --- a/docs/versions/v1/README.md +++ b/docs/versions/v1/README.md @@ -711,6 +711,10 @@ Class | Method | HTTP request | Description - [DealOrganizationDataWithId](Model/DealOrganizationDataWithId.md) - [DealOrganizationDataWithIdAllOf](Model/DealOrganizationDataWithIdAllOf.md) - [DealParticipantCountInfo](Model/DealParticipantCountInfo.md) + - [DealParticipantItem](Model/DealParticipantItem.md) + - [DealParticipantItemPersonId](Model/DealParticipantItemPersonId.md) + - [DealParticipantItemPersonIdEmail](Model/DealParticipantItemPersonIdEmail.md) + - [DealParticipantItemRelatedItemData](Model/DealParticipantItemRelatedItemData.md) - [DealParticipants](Model/DealParticipants.md) - [DealParticipantsChangelog](Model/DealParticipantsChangelog.md) - [DealPersonData](Model/DealPersonData.md) @@ -1370,7 +1374,4 @@ Class | Method | HTTP request | Description - **goals:full**: Create, read, update and delete goals - **video-calls**: Allows application to register as a video call integration provider and create conference links - **messengers-integration**: Allows application to register as a messengers integration provider and allows them to deliver incoming messages and their statuses -- **deal-fields:full**: Create, read, update and delete deal fields -- **product-fields:full**: Create, read, update and delete product fields -- **contact-fields:full**: Create, read, update and delete person and organization fields diff --git a/lib/versions/v1/Model/DealParticipantItem.php b/lib/versions/v1/Model/DealParticipantItem.php new file mode 100644 index 0000000..581dd30 --- /dev/null +++ b/lib/versions/v1/Model/DealParticipantItem.php @@ -0,0 +1,585 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealParticipantItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealParticipantItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'person_id' => '\Pipedrive\versions\v1\Model\DealParticipantItemPersonId', + 'add_time' => 'string', + 'active_flag' => 'bool', + 'related_item_data' => '\Pipedrive\versions\v1\Model\DealParticipantItemRelatedItemData', + 'person' => '\Pipedrive\versions\v1\Model\PersonItem', + 'added_by_user_id' => '\Pipedrive\versions\v1\Model\User', + 'related_item_type' => 'string', + 'related_item_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'person_id' => null, + 'add_time' => null, + 'active_flag' => null, + 'related_item_data' => null, + 'person' => null, + 'added_by_user_id' => null, + 'related_item_type' => null, + 'related_item_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'person_id' => 'person_id', + 'add_time' => 'add_time', + 'active_flag' => 'active_flag', + 'related_item_data' => 'related_item_data', + 'person' => 'person', + 'added_by_user_id' => 'added_by_user_id', + 'related_item_type' => 'related_item_type', + 'related_item_id' => 'related_item_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'person_id' => 'setPersonId', + 'add_time' => 'setAddTime', + 'active_flag' => 'setActiveFlag', + 'related_item_data' => 'setRelatedItemData', + 'person' => 'setPerson', + 'added_by_user_id' => 'setAddedByUserId', + 'related_item_type' => 'setRelatedItemType', + 'related_item_id' => 'setRelatedItemId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'person_id' => 'getPersonId', + 'add_time' => 'getAddTime', + 'active_flag' => 'getActiveFlag', + 'related_item_data' => 'getRelatedItemData', + 'person' => 'getPerson', + 'added_by_user_id' => 'getAddedByUserId', + 'related_item_type' => 'getRelatedItemType', + 'related_item_id' => 'getRelatedItemId' + ]; + + /** + * 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['id'] = $data['id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['related_item_data'] = $data['related_item_data'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['added_by_user_id'] = $data['added_by_user_id'] ?? null; + $this->container['related_item_type'] = $data['related_item_type'] ?? null; + $this->container['related_item_id'] = $data['related_item_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the participant + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets person_id + * + * @return \Pipedrive\versions\v1\Model\DealParticipantItemPersonId|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param \Pipedrive\versions\v1\Model\DealParticipantItemPersonId|null $person_id person_id + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_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 date and time when the participant was added. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the participant is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets related_item_data + * + * @return \Pipedrive\versions\v1\Model\DealParticipantItemRelatedItemData|null + */ + public function getRelatedItemData() + { + return $this->container['related_item_data']; + } + + /** + * Sets related_item_data + * + * @param \Pipedrive\versions\v1\Model\DealParticipantItemRelatedItemData|null $related_item_data related_item_data + * + * @return self + */ + public function setRelatedItemData($related_item_data): self + { + $this->container['related_item_data'] = $related_item_data; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\versions\v1\Model\PersonItem|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\versions\v1\Model\PersonItem|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets added_by_user_id + * + * @return \Pipedrive\versions\v1\Model\User|null + */ + public function getAddedByUserId() + { + return $this->container['added_by_user_id']; + } + + /** + * Sets added_by_user_id + * + * @param \Pipedrive\versions\v1\Model\User|null $added_by_user_id added_by_user_id + * + * @return self + */ + public function setAddedByUserId($added_by_user_id): self + { + $this->container['added_by_user_id'] = $added_by_user_id; + + return $this; + } + + /** + * Gets related_item_type + * + * @return string|null + */ + public function getRelatedItemType() + { + return $this->container['related_item_type']; + } + + /** + * Sets related_item_type + * + * @param string|null $related_item_type The type of the related item + * + * @return self + */ + public function setRelatedItemType($related_item_type): self + { + $this->container['related_item_type'] = $related_item_type; + + return $this; + } + + /** + * Gets related_item_id + * + * @return int|null + */ + public function getRelatedItemId() + { + return $this->container['related_item_id']; + } + + /** + * Sets related_item_id + * + * @param int|null $related_item_id The ID of the related item + * + * @return self + */ + public function setRelatedItemId($related_item_id): self + { + $this->container['related_item_id'] = $related_item_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v1/Model/DealParticipantItemPersonId.php b/lib/versions/v1/Model/DealParticipantItemPersonId.php new file mode 100644 index 0000000..593a378 --- /dev/null +++ b/lib/versions/v1/Model/DealParticipantItemPersonId.php @@ -0,0 +1,526 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealParticipantItemPersonId implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealParticipantItem_person_id'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool', + 'name' => 'string', + 'email' => '\Pipedrive\versions\v1\Model\DealParticipantItemPersonIdEmail[]', + 'phone' => '\Pipedrive\versions\v1\Model\BasePersonItemPhone[]', + 'owner_id' => 'int', + 'company_id' => 'int', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null, + 'name' => null, + 'email' => null, + 'phone' => null, + 'owner_id' => null, + 'company_id' => null, + 'value' => 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 = [ + 'active_flag' => 'active_flag', + 'name' => 'name', + 'email' => 'email', + 'phone' => 'phone', + 'owner_id' => 'owner_id', + 'company_id' => 'company_id', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag', + 'name' => 'setName', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'owner_id' => 'setOwnerId', + 'company_id' => 'setCompanyId', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag', + 'name' => 'getName', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'owner_id' => 'getOwnerId', + 'company_id' => 'getCompanyId', + 'value' => 'getValue' + ]; + + /** + * 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['active_flag'] = $data['active_flag'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['value'] = $data['value'] ?? 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 active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * 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 email + * + * @return \Pipedrive\versions\v1\Model\DealParticipantItemPersonIdEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\versions\v1\Model\DealParticipantItemPersonIdEmail[]|null $email An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\versions\v1\Model\BasePersonItemPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\versions\v1\Model\BasePersonItemPhone[]|null $phone A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + 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 owner of the person + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the person + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the person + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v1/Model/DealParticipantItemPersonIdEmail.php b/lib/versions/v1/Model/DealParticipantItemPersonIdEmail.php new file mode 100644 index 0000000..5fcb163 --- /dev/null +++ b/lib/versions/v1/Model/DealParticipantItemPersonIdEmail.php @@ -0,0 +1,405 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealParticipantItemPersonIdEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealParticipantItem_person_id_email'; + + /** + * 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 + * + * @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 Boolean that indicates if email is primary for the person 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 label that indicates the type of the email. (Possible values - work, home or other) + * + * @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/v1/Model/DealParticipantItemRelatedItemData.php b/lib/versions/v1/Model/DealParticipantItemRelatedItemData.php new file mode 100644 index 0000000..d6db4fe --- /dev/null +++ b/lib/versions/v1/Model/DealParticipantItemRelatedItemData.php @@ -0,0 +1,376 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealParticipantItemRelatedItemData implements ModelInterface, ArrayAccess, JsonSerializable +{ + use RawData; + + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealParticipantItem_related_item_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal_id' => 'int', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal_id' => null, + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal_id' => 'deal_id', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal_id' => 'setDealId', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal_id' => 'getDealId', + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/versions/v1/Model/DealParticipants.php b/lib/versions/v1/Model/DealParticipants.php index 3b76d82..1ea9132 100644 --- a/lib/versions/v1/Model/DealParticipants.php +++ b/lib/versions/v1/Model/DealParticipants.php @@ -67,7 +67,7 @@ class DealParticipants implements ModelInterface, ArrayAccess, JsonSerializable */ protected static array $openAPITypes = [ 'success' => 'bool', - 'data' => '\Pipedrive\versions\v1\Model\PersonItem[]', + 'data' => '\Pipedrive\versions\v1\Model\DealParticipantItem[]', 'additional_data' => '\Pipedrive\versions\v1\Model\AdditionalData', 'related_objects' => '\Pipedrive\versions\v1\Model\GetDealsRelatedObjects' ]; @@ -273,7 +273,7 @@ public function setSuccess($success): self /** * Gets data * - * @return \Pipedrive\versions\v1\Model\PersonItem[]|null + * @return \Pipedrive\versions\v1\Model\DealParticipantItem[]|null */ public function getData() { @@ -283,7 +283,7 @@ public function getData() /** * Sets data * - * @param \Pipedrive\versions\v1\Model\PersonItem[]|null $data The array of participants + * @param \Pipedrive\versions\v1\Model\DealParticipantItem[]|null $data The array of participants * * @return self */ diff --git a/lib/versions/v1/Model/PostDealParticipants.php b/lib/versions/v1/Model/PostDealParticipants.php index 3fe1f93..7994ea0 100644 --- a/lib/versions/v1/Model/PostDealParticipants.php +++ b/lib/versions/v1/Model/PostDealParticipants.php @@ -67,7 +67,7 @@ class PostDealParticipants implements ModelInterface, ArrayAccess, JsonSerializa */ protected static array $openAPITypes = [ 'success' => 'bool', - 'data' => 'PersonItem', + 'data' => '\Pipedrive\versions\v1\Model\DealParticipantItem', 'related_objects' => '\Pipedrive\versions\v1\Model\PostDealParticipantsRelatedObjects' ]; @@ -267,7 +267,7 @@ public function setSuccess($success): self /** * Gets data * - * @return PersonItem|null + * @return \Pipedrive\versions\v1\Model\DealParticipantItem|null */ public function getData() { @@ -277,7 +277,7 @@ public function getData() /** * Sets data * - * @param PersonItem|null $data The object of participant + * @param \Pipedrive\versions\v1\Model\DealParticipantItem|null $data data * * @return self */