From faf76abaf785dfd7b5c9794dacc34188548bb6f6 Mon Sep 17 00:00:00 2001 From: klaviyo-sdk Date: Tue, 9 Apr 2024 16:18:34 +0000 Subject: [PATCH] version 7.1.2 --- CHANGELOG.md | 6 + README.md | 2 +- composer.json | 2 +- lib/Configuration.php | 4 +- lib/Model/AudiencesSubObject.php | 22 +- ...aignCloneQueryResourceObjectAttributes.php | 11 +- ...ignCreateQueryResourceObjectAttributes.php | 22 +- ...eryResourceObjectAttributesSendOptions.php | 11 +- ...esourceObjectAttributesTrackingOptions.php | 44 +- ...ageCreateQueryResourceObjectAttributes.php | 22 +- ...teQueryResourceObjectAttributesContent.php | 88 +- ...ialUpdateQueryResourceObjectAttributes.php | 22 +- ...ialUpdateQueryResourceObjectAttributes.php | 33 +- ...luesRequestDTOResourceObjectAttributes.php | 13 +- ...oryCreateQueryResourceObjectAttributes.php | 22 +- ...oryUpdateQueryResourceObjectAttributes.php | 11 +- ...temCreateQueryResourceObjectAttributes.php | 88 +- ...temUpdateQueryResourceObjectAttributes.php | 99 +- ...antCreateQueryResourceObjectAttributes.php | 88 +- ...antUpdateQueryResourceObjectAttributes.php | 132 ++- ...odeCreateQueryResourceObjectAttributes.php | 11 +- ...odeUpdateQueryResourceObjectAttributes.php | 22 +- ...ponCreateQueryResourceObjectAttributes.php | 11 +- ...ponUpdateQueryResourceObjectAttributes.php | 11 +- .../DataPrivacyProfileQueryResourceObject.php | 11 +- ...cyProfileQueryResourceObjectAttributes.php | 22 +- lib/Model/DeviceMetadata.php | 132 ++- lib/Model/EmailContentSubObject.php | 77 +- lib/Model/EmailSendOptionsSubObject.php | 11 +- lib/Model/EmailTrackingOptionsSubObject.php | 44 +- ...tCreateQueryV2ResourceObjectAttributes.php | 44 +- ...QueryV2ResourceObjectAttributesProfile.php | 6 +- ...EventProfileCreateQueryResourceObject.php} | 71 +- ...leCreateQueryResourceObjectAttributes.php} | 243 +++-- ...riesRequestDTOResourceObjectAttributes.php | 13 +- ...luesRequestDTOResourceObjectAttributes.php | 13 +- ...ageCreateQueryResourceObjectAttributes.php | 22 +- ...ialUpdateQueryResourceObjectAttributes.php | 22 +- lib/Model/MarketingSubscriptionParameters.php | 11 +- ...AggregateQueryResourceObjectAttributes.php | 55 +- ...ricCreateQueryResourceObjectAttributes.php | 11 +- ...ileCreateQueryResourceObjectAttributes.php | 99 +- .../ProfileIdentifierDTOResourceObject.php | 11 +- ...eIdentifierDTOResourceObjectAttributes.php | 44 +- lib/Model/ProfileLocation.php | 110 ++- lib/Model/ProfileMetaPatchProperties.php | 33 +- ...ialUpdateQueryResourceObjectAttributes.php | 110 ++- ...eSubscriptionCreateQueryResourceObject.php | 11 +- ...ionCreateQueryResourceObjectAttributes.php | 22 +- ...ionDeleteQueryResourceObjectAttributes.php | 22 +- ...ionCreateQueryResourceObjectAttributes.php | 11 +- ...ionDeleteQueryResourceObjectAttributes.php | 11 +- .../ProfileUpsertQueryResourceObject.php | 11 +- ...ileUpsertQueryResourceObjectAttributes.php | 121 ++- .../PushProfileUpsertQueryResourceObject.php | 487 ++++++++++ ...ileUpsertQueryResourceObjectAttributes.php | 911 ++++++++++++++++++ ...kenCreateQueryResourceObjectAttributes.php | 22 +- ...teQueryResourceObjectAttributesProfile.php | 6 +- lib/Model/RenderOptionsSubObject.php | 44 +- lib/Model/SMSContentSubObjectCreate.php | 11 +- lib/Model/SMSSendOptionsSubObject.php | 11 +- lib/Model/SMSTrackingOptionsSubObject.php | 22 +- ...ialUpdateQueryResourceObjectAttributes.php | 22 +- ...ionCreateQueryResourceObjectAttributes.php | 11 +- lib/Model/StaticScheduleOptions.php | 22 +- ...JobCreateQueryResourceObjectAttributes.php | 11 +- ...sionCreateJobCreateQueryResourceObject.php | 48 +- ...JobCreateQueryResourceObjectAttributes.php | 18 +- ...CreateQueryResourceObjectRelationships.php | 438 +++++++++ ...teQueryResourceObjectRelationshipsList.php | 405 ++++++++ ...eryResourceObjectRelationshipsListData.php | 444 +++++++++ ...ueryResourceObjectRelationshipsSegment.php | 405 ++++++++ ...ResourceObjectRelationshipsSegmentData.php | 444 +++++++++ ...sionDeleteJobCreateQueryResourceObject.php | 48 +- ...JobCreateQueryResourceObjectAttributes.php | 18 +- ...CreateQueryResourceObjectRelationships.php | 438 +++++++++ ...teQueryResourceObjectRelationshipsList.php | 405 ++++++++ ...eryResourceObjectRelationshipsListData.php | 444 +++++++++ ...ueryResourceObjectRelationshipsSegment.php | 405 ++++++++ ...ResourceObjectRelationshipsSegmentData.php | 444 +++++++++ ...oupCreateQueryResourceObjectAttributes.php | 11 +- ...oupUpdateQueryResourceObjectAttributes.php | 11 +- ...lateCloneQueryResourceObjectAttributes.php | 11 +- ...ateCreateQueryResourceObjectAttributes.php | 22 +- ...ateUpdateQueryResourceObjectAttributes.php | 33 +- lib/Subclient.php | 21 +- 86 files changed, 7758 insertions(+), 556 deletions(-) rename lib/Model/{OnsiteProfileCreateQueryResourceObject.php => EventProfileCreateQueryResourceObject.php} (86%) rename lib/Model/{OnsiteProfileCreateQueryResourceObjectAttributes.php => EventProfileCreateQueryResourceObjectAttributes.php} (73%) create mode 100644 lib/Model/PushProfileUpsertQueryResourceObject.php create mode 100644 lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php create mode 100644 lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php create mode 100644 lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php create mode 100644 lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php create mode 100644 lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php create mode 100644 lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php create mode 100644 lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php create mode 100644 lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php create mode 100644 lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php create mode 100644 lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php create mode 100644 lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php diff --git a/CHANGELOG.md b/CHANGELOG.md index e37b101..21b75c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ NOTE: For more granular API-specific changes, please see our [API Changelog](htt +## [7.1.2] - revision 2024-02-15 + +### Fixed: + +- Patched a bug due to incorrect handling of page_cursor + ## [7.1.1] - revision 2024-02-15 ### Fixed: diff --git a/README.md b/README.md index 523c74a..315074b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Klaviyo PHP SDK -- SDK version: 7.1.1 +- SDK version: 7.1.2 - API Revision: 2024-02-15 ## Helpful Resources diff --git a/composer.json b/composer.json index a3edfb2..f368391 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "klaviyo/api", - "version": "7.1.1", + "version": "7.1.2", "description": "PHP SDK for Klaviyo's API.", "keywords": [ "openapitools", diff --git a/lib/Configuration.php b/lib/Configuration.php index a46bd68..3f3495d 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -101,7 +101,7 @@ class Configuration * * @var string */ - protected $userAgent = 'klaviyo-api-php/7.1.1'; + protected $userAgent = 'klaviyo-api-php/7.1.2'; /** * Debug switch (default set to false) @@ -434,7 +434,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 2024-02-15' . PHP_EOL; - $report .= ' SDK Package Version: 7.1.1' . PHP_EOL; + $report .= ' SDK Package Version: 7.1.2' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AudiencesSubObject.php b/lib/Model/AudiencesSubObject.php index 2a16bfd..0101154 100644 --- a/lib/Model/AudiencesSubObject.php +++ b/lib/Model/AudiencesSubObject.php @@ -80,8 +80,8 @@ class AudiencesSubObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'included' => false, - 'excluded' => false + 'included' => true, + 'excluded' => true ]; /** @@ -308,7 +308,14 @@ public function setIncluded($included) { if (is_null($included)) { - throw new \InvalidArgumentException('non-nullable included cannot be null'); + array_push($this->openAPINullablesSetToNull, 'included'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('included', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['included'] = $included; @@ -337,7 +344,14 @@ public function setExcluded($excluded) { if (is_null($excluded)) { - throw new \InvalidArgumentException('non-nullable excluded cannot be null'); + array_push($this->openAPINullablesSetToNull, 'excluded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('excluded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['excluded'] = $excluded; diff --git a/lib/Model/CampaignCloneQueryResourceObjectAttributes.php b/lib/Model/CampaignCloneQueryResourceObjectAttributes.php index 22c50b2..3d4936e 100644 --- a/lib/Model/CampaignCloneQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignCloneQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class CampaignCloneQueryResourceObjectAttributes implements ModelInterface, Arra * @var boolean[] */ protected static array $openAPINullables = [ - 'new_name' => false + 'new_name' => true ]; /** @@ -301,7 +301,14 @@ public function setNewName($new_name) { if (is_null($new_name)) { - throw new \InvalidArgumentException('non-nullable new_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'new_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('new_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['new_name'] = $new_name; diff --git a/lib/Model/CampaignCreateQueryResourceObjectAttributes.php b/lib/Model/CampaignCreateQueryResourceObjectAttributes.php index aa994c0..8d0021c 100644 --- a/lib/Model/CampaignCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignCreateQueryResourceObjectAttributes.php @@ -91,8 +91,8 @@ class CampaignCreateQueryResourceObjectAttributes implements ModelInterface, Arr 'name' => false, 'audiences' => false, 'send_strategy' => false, - 'send_options' => false, - 'tracking_options' => false, + 'send_options' => true, + 'tracking_options' => true, 'campaign_messages' => false ]; @@ -432,7 +432,14 @@ public function setSendOptions($send_options) { if (is_null($send_options)) { - throw new \InvalidArgumentException('non-nullable send_options cannot be null'); + array_push($this->openAPINullablesSetToNull, 'send_options'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('send_options', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['send_options'] = $send_options; @@ -461,7 +468,14 @@ public function setTrackingOptions($tracking_options) { if (is_null($tracking_options)) { - throw new \InvalidArgumentException('non-nullable tracking_options cannot be null'); + array_push($this->openAPINullablesSetToNull, 'tracking_options'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tracking_options', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['tracking_options'] = $tracking_options; diff --git a/lib/Model/CampaignCreateQueryResourceObjectAttributesSendOptions.php b/lib/Model/CampaignCreateQueryResourceObjectAttributesSendOptions.php index 33b6691..317a72f 100644 --- a/lib/Model/CampaignCreateQueryResourceObjectAttributesSendOptions.php +++ b/lib/Model/CampaignCreateQueryResourceObjectAttributesSendOptions.php @@ -79,7 +79,7 @@ class CampaignCreateQueryResourceObjectAttributesSendOptions implements ModelInt * @var boolean[] */ protected static array $openAPINullables = [ - 'use_smart_sending' => false + 'use_smart_sending' => true ]; /** @@ -302,7 +302,14 @@ public function setUseSmartSending($use_smart_sending) { if (is_null($use_smart_sending)) { - throw new \InvalidArgumentException('non-nullable use_smart_sending cannot be null'); + array_push($this->openAPINullablesSetToNull, 'use_smart_sending'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('use_smart_sending', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['use_smart_sending'] = $use_smart_sending; diff --git a/lib/Model/CampaignCreateQueryResourceObjectAttributesTrackingOptions.php b/lib/Model/CampaignCreateQueryResourceObjectAttributesTrackingOptions.php index 3c94ca2..c75c9f7 100644 --- a/lib/Model/CampaignCreateQueryResourceObjectAttributesTrackingOptions.php +++ b/lib/Model/CampaignCreateQueryResourceObjectAttributesTrackingOptions.php @@ -85,10 +85,10 @@ class CampaignCreateQueryResourceObjectAttributesTrackingOptions implements Mode * @var boolean[] */ protected static array $openAPINullables = [ - 'is_add_utm' => false, - 'utm_params' => false, - 'is_tracking_clicks' => false, - 'is_tracking_opens' => false + 'is_add_utm' => true, + 'utm_params' => true, + 'is_tracking_clicks' => true, + 'is_tracking_opens' => true ]; /** @@ -323,7 +323,14 @@ public function setIsAddUtm($is_add_utm) { if (is_null($is_add_utm)) { - throw new \InvalidArgumentException('non-nullable is_add_utm cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_add_utm'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_add_utm', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_add_utm'] = $is_add_utm; @@ -352,7 +359,14 @@ public function setUtmParams($utm_params) { if (is_null($utm_params)) { - throw new \InvalidArgumentException('non-nullable utm_params cannot be null'); + array_push($this->openAPINullablesSetToNull, 'utm_params'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utm_params', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['utm_params'] = $utm_params; @@ -381,7 +395,14 @@ public function setIsTrackingClicks($is_tracking_clicks) { if (is_null($is_tracking_clicks)) { - throw new \InvalidArgumentException('non-nullable is_tracking_clicks cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_tracking_clicks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_tracking_clicks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_tracking_clicks'] = $is_tracking_clicks; @@ -410,7 +431,14 @@ public function setIsTrackingOpens($is_tracking_opens) { if (is_null($is_tracking_opens)) { - throw new \InvalidArgumentException('non-nullable is_tracking_opens cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_tracking_opens'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_tracking_opens', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_tracking_opens'] = $is_tracking_opens; diff --git a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php index ea1ebc2..d13107d 100644 --- a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php @@ -85,8 +85,8 @@ class CampaignMessageCreateQueryResourceObjectAttributes implements ModelInterfa */ protected static array $openAPINullables = [ 'channel' => false, - 'label' => false, - 'content' => false, + 'label' => true, + 'content' => true, 'render_options' => false ]; @@ -354,7 +354,14 @@ public function setLabel($label) { if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + array_push($this->openAPINullablesSetToNull, 'label'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('label', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['label'] = $label; @@ -383,7 +390,14 @@ public function setContent($content) { if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['content'] = $content; diff --git a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php index 53cf139..ac21e8b 100644 --- a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php +++ b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php @@ -93,14 +93,14 @@ class CampaignMessageCreateQueryResourceObjectAttributesContent implements Model * @var boolean[] */ protected static array $openAPINullables = [ - 'subject' => false, - 'preview_text' => false, - 'from_email' => false, - 'from_label' => false, - 'reply_to_email' => false, - 'cc_email' => false, - 'bcc_email' => false, - 'body' => false + 'subject' => true, + 'preview_text' => true, + 'from_email' => true, + 'from_label' => true, + 'reply_to_email' => true, + 'cc_email' => true, + 'bcc_email' => true, + 'body' => true ]; /** @@ -351,7 +351,14 @@ public function setSubject($subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + array_push($this->openAPINullablesSetToNull, 'subject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subject', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['subject'] = $subject; @@ -380,7 +387,14 @@ public function setPreviewText($preview_text) { if (is_null($preview_text)) { - throw new \InvalidArgumentException('non-nullable preview_text cannot be null'); + array_push($this->openAPINullablesSetToNull, 'preview_text'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('preview_text', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['preview_text'] = $preview_text; @@ -409,7 +423,14 @@ public function setFromEmail($from_email) { if (is_null($from_email)) { - throw new \InvalidArgumentException('non-nullable from_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'from_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('from_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['from_email'] = $from_email; @@ -438,7 +459,14 @@ public function setFromLabel($from_label) { if (is_null($from_label)) { - throw new \InvalidArgumentException('non-nullable from_label cannot be null'); + array_push($this->openAPINullablesSetToNull, 'from_label'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('from_label', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['from_label'] = $from_label; @@ -467,7 +495,14 @@ public function setReplyToEmail($reply_to_email) { if (is_null($reply_to_email)) { - throw new \InvalidArgumentException('non-nullable reply_to_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'reply_to_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reply_to_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['reply_to_email'] = $reply_to_email; @@ -496,7 +531,14 @@ public function setCcEmail($cc_email) { if (is_null($cc_email)) { - throw new \InvalidArgumentException('non-nullable cc_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'cc_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cc_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['cc_email'] = $cc_email; @@ -525,7 +567,14 @@ public function setBccEmail($bcc_email) { if (is_null($bcc_email)) { - throw new \InvalidArgumentException('non-nullable bcc_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'bcc_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bcc_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['bcc_email'] = $bcc_email; @@ -554,7 +603,14 @@ public function setBody($body) { if (is_null($body)) { - throw new \InvalidArgumentException('non-nullable body cannot be null'); + array_push($this->openAPINullablesSetToNull, 'body'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('body', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['body'] = $body; diff --git a/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php b/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php index a3b453b..1e2ab00 100644 --- a/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php @@ -82,8 +82,8 @@ class CampaignMessagePartialUpdateQueryResourceObjectAttributes implements Model * @var boolean[] */ protected static array $openAPINullables = [ - 'label' => false, - 'content' => false, + 'label' => true, + 'content' => true, 'render_options' => false ]; @@ -315,7 +315,14 @@ public function setLabel($label) { if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + array_push($this->openAPINullablesSetToNull, 'label'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('label', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['label'] = $label; @@ -344,7 +351,14 @@ public function setContent($content) { if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['content'] = $content; diff --git a/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php index c1946d3..7852246 100644 --- a/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php @@ -86,10 +86,10 @@ class CampaignPartialUpdateQueryResourceObjectAttributes implements ModelInterfa * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, + 'name' => true, 'audiences' => false, - 'send_options' => false, - 'tracking_options' => false, + 'send_options' => true, + 'tracking_options' => true, 'send_strategy' => false ]; @@ -329,7 +329,14 @@ public function setName($name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['name'] = $name; @@ -387,7 +394,14 @@ public function setSendOptions($send_options) { if (is_null($send_options)) { - throw new \InvalidArgumentException('non-nullable send_options cannot be null'); + array_push($this->openAPINullablesSetToNull, 'send_options'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('send_options', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['send_options'] = $send_options; @@ -416,7 +430,14 @@ public function setTrackingOptions($tracking_options) { if (is_null($tracking_options)) { - throw new \InvalidArgumentException('non-nullable tracking_options cannot be null'); + array_push($this->openAPINullablesSetToNull, 'tracking_options'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tracking_options', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['tracking_options'] = $tracking_options; diff --git a/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php b/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php index 2a5c9b9..5cd36b3 100644 --- a/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php +++ b/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php @@ -87,7 +87,7 @@ class CampaignValuesRequestDTOResourceObjectAttributes implements ModelInterface 'statistics' => false, 'timeframe' => false, 'conversion_metric_id' => false, - 'filter' => false + 'filter' => true ]; /** @@ -484,7 +484,7 @@ public function getFilter() /** * Sets filter * - * @param string|null $filter API filter string used to filter the query. Allowed filters are send_channel, campaign_id. Allowed operators are equals, contains-any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. + * @param string|null $filter API filter string used to filter the query. Allowed filters are send_channel, campaign_id. Allowed operators are equals, contains-any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. When filtering on send_channel, allowed values are email, push-notification, sms. * * @return self */ @@ -492,7 +492,14 @@ public function setFilter($filter) { if (is_null($filter)) { - throw new \InvalidArgumentException('non-nullable filter cannot be null'); + array_push($this->openAPINullablesSetToNull, 'filter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('filter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['filter'] = $filter; diff --git a/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php index d4db503..bdc84a3 100644 --- a/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php @@ -86,8 +86,8 @@ class CatalogCategoryCreateQueryResourceObjectAttributes implements ModelInterfa protected static array $openAPINullables = [ 'external_id' => false, 'name' => false, - 'integration_type' => false, - 'catalog_type' => false + 'integration_type' => true, + 'catalog_type' => true ]; /** @@ -418,7 +418,14 @@ public function setIntegrationType($integration_type) } if (is_null($integration_type)) { - throw new \InvalidArgumentException('non-nullable integration_type cannot be null'); + array_push($this->openAPINullablesSetToNull, 'integration_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('integration_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['integration_type'] = $integration_type; @@ -447,7 +454,14 @@ public function setCatalogType($catalog_type) { if (is_null($catalog_type)) { - throw new \InvalidArgumentException('non-nullable catalog_type cannot be null'); + array_push($this->openAPINullablesSetToNull, 'catalog_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('catalog_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['catalog_type'] = $catalog_type; diff --git a/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php b/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php index a939f11..063d5cf 100644 --- a/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class CatalogCategoryUpdateQueryResourceObjectAttributes implements ModelInterfa * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false + 'name' => true ]; /** @@ -301,7 +301,14 @@ public function setName($name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['name'] = $name; diff --git a/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php index 255926b..f5c8ca7 100644 --- a/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php @@ -101,17 +101,17 @@ class CatalogItemCreateQueryResourceObjectAttributes implements ModelInterface, */ protected static array $openAPINullables = [ 'external_id' => false, - 'integration_type' => false, + 'integration_type' => true, 'title' => false, - 'price' => false, - 'catalog_type' => false, + 'price' => true, + 'catalog_type' => true, 'description' => false, 'url' => false, - 'image_full_url' => false, - 'image_thumbnail_url' => false, - 'images' => false, - 'custom_metadata' => false, - 'published' => false + 'image_full_url' => true, + 'image_thumbnail_url' => true, + 'images' => true, + 'custom_metadata' => true, + 'published' => true ]; /** @@ -451,7 +451,14 @@ public function setIntegrationType($integration_type) } if (is_null($integration_type)) { - throw new \InvalidArgumentException('non-nullable integration_type cannot be null'); + array_push($this->openAPINullablesSetToNull, 'integration_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('integration_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['integration_type'] = $integration_type; @@ -509,7 +516,14 @@ public function setPrice($price) { if (is_null($price)) { - throw new \InvalidArgumentException('non-nullable price cannot be null'); + array_push($this->openAPINullablesSetToNull, 'price'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('price', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['price'] = $price; @@ -538,7 +552,14 @@ public function setCatalogType($catalog_type) { if (is_null($catalog_type)) { - throw new \InvalidArgumentException('non-nullable catalog_type cannot be null'); + array_push($this->openAPINullablesSetToNull, 'catalog_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('catalog_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['catalog_type'] = $catalog_type; @@ -625,7 +646,14 @@ public function setImageFullUrl($image_full_url) { if (is_null($image_full_url)) { - throw new \InvalidArgumentException('non-nullable image_full_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_full_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_full_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_full_url'] = $image_full_url; @@ -654,7 +682,14 @@ public function setImageThumbnailUrl($image_thumbnail_url) { if (is_null($image_thumbnail_url)) { - throw new \InvalidArgumentException('non-nullable image_thumbnail_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_thumbnail_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_thumbnail_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_thumbnail_url'] = $image_thumbnail_url; @@ -683,7 +718,14 @@ public function setImages($images) { if (is_null($images)) { - throw new \InvalidArgumentException('non-nullable images cannot be null'); + array_push($this->openAPINullablesSetToNull, 'images'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('images', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['images'] = $images; @@ -712,7 +754,14 @@ public function setCustomMetadata($custom_metadata) { if (is_null($custom_metadata)) { - throw new \InvalidArgumentException('non-nullable custom_metadata cannot be null'); + array_push($this->openAPINullablesSetToNull, 'custom_metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['custom_metadata'] = $custom_metadata; @@ -741,7 +790,14 @@ public function setPublished($published) { if (is_null($published)) { - throw new \InvalidArgumentException('non-nullable published cannot be null'); + array_push($this->openAPINullablesSetToNull, 'published'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('published', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['published'] = $published; diff --git a/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php b/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php index c58865f..d5e0eaf 100644 --- a/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php @@ -94,15 +94,15 @@ class CatalogItemUpdateQueryResourceObjectAttributes implements ModelInterface, * @var boolean[] */ protected static array $openAPINullables = [ - 'title' => false, - 'price' => false, - 'description' => false, - 'url' => false, - 'image_full_url' => false, - 'image_thumbnail_url' => false, - 'images' => false, - 'custom_metadata' => false, - 'published' => false + 'title' => true, + 'price' => true, + 'description' => true, + 'url' => true, + 'image_full_url' => true, + 'image_thumbnail_url' => true, + 'images' => true, + 'custom_metadata' => true, + 'published' => true ]; /** @@ -357,7 +357,14 @@ public function setTitle($title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['title'] = $title; @@ -386,7 +393,14 @@ public function setPrice($price) { if (is_null($price)) { - throw new \InvalidArgumentException('non-nullable price cannot be null'); + array_push($this->openAPINullablesSetToNull, 'price'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('price', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['price'] = $price; @@ -415,7 +429,14 @@ public function setDescription($description) { if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['description'] = $description; @@ -444,7 +465,14 @@ public function setUrl($url) { if (is_null($url)) { - throw new \InvalidArgumentException('non-nullable url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['url'] = $url; @@ -473,7 +501,14 @@ public function setImageFullUrl($image_full_url) { if (is_null($image_full_url)) { - throw new \InvalidArgumentException('non-nullable image_full_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_full_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_full_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_full_url'] = $image_full_url; @@ -502,7 +537,14 @@ public function setImageThumbnailUrl($image_thumbnail_url) { if (is_null($image_thumbnail_url)) { - throw new \InvalidArgumentException('non-nullable image_thumbnail_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_thumbnail_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_thumbnail_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_thumbnail_url'] = $image_thumbnail_url; @@ -531,7 +573,14 @@ public function setImages($images) { if (is_null($images)) { - throw new \InvalidArgumentException('non-nullable images cannot be null'); + array_push($this->openAPINullablesSetToNull, 'images'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('images', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['images'] = $images; @@ -560,7 +609,14 @@ public function setCustomMetadata($custom_metadata) { if (is_null($custom_metadata)) { - throw new \InvalidArgumentException('non-nullable custom_metadata cannot be null'); + array_push($this->openAPINullablesSetToNull, 'custom_metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['custom_metadata'] = $custom_metadata; @@ -589,7 +645,14 @@ public function setPublished($published) { if (is_null($published)) { - throw new \InvalidArgumentException('non-nullable published cannot be null'); + array_push($this->openAPINullablesSetToNull, 'published'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('published', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['published'] = $published; diff --git a/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php index 6aa4218..20cf2af 100644 --- a/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php @@ -107,20 +107,20 @@ class CatalogVariantCreateQueryResourceObjectAttributes implements ModelInterfac */ protected static array $openAPINullables = [ 'external_id' => false, - 'catalog_type' => false, - 'integration_type' => false, + 'catalog_type' => true, + 'integration_type' => true, 'title' => false, 'description' => false, 'sku' => false, - 'inventory_policy' => false, + 'inventory_policy' => true, 'inventory_quantity' => false, 'price' => false, 'url' => false, - 'image_full_url' => false, - 'image_thumbnail_url' => false, - 'images' => false, - 'custom_metadata' => false, - 'published' => false + 'image_full_url' => true, + 'image_thumbnail_url' => true, + 'images' => true, + 'custom_metadata' => true, + 'published' => true ]; /** @@ -497,7 +497,14 @@ public function setCatalogType($catalog_type) { if (is_null($catalog_type)) { - throw new \InvalidArgumentException('non-nullable catalog_type cannot be null'); + array_push($this->openAPINullablesSetToNull, 'catalog_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('catalog_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['catalog_type'] = $catalog_type; @@ -536,7 +543,14 @@ public function setIntegrationType($integration_type) } if (is_null($integration_type)) { - throw new \InvalidArgumentException('non-nullable integration_type cannot be null'); + array_push($this->openAPINullablesSetToNull, 'integration_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('integration_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['integration_type'] = $integration_type; @@ -662,7 +676,14 @@ public function setInventoryPolicy($inventory_policy) } if (is_null($inventory_policy)) { - throw new \InvalidArgumentException('non-nullable inventory_policy cannot be null'); + array_push($this->openAPINullablesSetToNull, 'inventory_policy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inventory_policy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['inventory_policy'] = $inventory_policy; @@ -778,7 +799,14 @@ public function setImageFullUrl($image_full_url) { if (is_null($image_full_url)) { - throw new \InvalidArgumentException('non-nullable image_full_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_full_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_full_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_full_url'] = $image_full_url; @@ -807,7 +835,14 @@ public function setImageThumbnailUrl($image_thumbnail_url) { if (is_null($image_thumbnail_url)) { - throw new \InvalidArgumentException('non-nullable image_thumbnail_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_thumbnail_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_thumbnail_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_thumbnail_url'] = $image_thumbnail_url; @@ -836,7 +871,14 @@ public function setImages($images) { if (is_null($images)) { - throw new \InvalidArgumentException('non-nullable images cannot be null'); + array_push($this->openAPINullablesSetToNull, 'images'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('images', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['images'] = $images; @@ -865,7 +907,14 @@ public function setCustomMetadata($custom_metadata) { if (is_null($custom_metadata)) { - throw new \InvalidArgumentException('non-nullable custom_metadata cannot be null'); + array_push($this->openAPINullablesSetToNull, 'custom_metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['custom_metadata'] = $custom_metadata; @@ -894,7 +943,14 @@ public function setPublished($published) { if (is_null($published)) { - throw new \InvalidArgumentException('non-nullable published cannot be null'); + array_push($this->openAPINullablesSetToNull, 'published'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('published', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['published'] = $published; diff --git a/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php b/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php index c0a3211..20ac85d 100644 --- a/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php @@ -100,18 +100,18 @@ class CatalogVariantUpdateQueryResourceObjectAttributes implements ModelInterfac * @var boolean[] */ protected static array $openAPINullables = [ - 'title' => false, - 'description' => false, - 'sku' => false, - 'inventory_policy' => false, - 'inventory_quantity' => false, - 'price' => false, - 'url' => false, - 'image_full_url' => false, - 'image_thumbnail_url' => false, - 'images' => false, - 'custom_metadata' => false, - 'published' => false + 'title' => true, + 'description' => true, + 'sku' => true, + 'inventory_policy' => true, + 'inventory_quantity' => true, + 'price' => true, + 'url' => true, + 'image_full_url' => true, + 'image_thumbnail_url' => true, + 'images' => true, + 'custom_metadata' => true, + 'published' => true ]; /** @@ -404,7 +404,14 @@ public function setTitle($title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['title'] = $title; @@ -433,7 +440,14 @@ public function setDescription($description) { if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['description'] = $description; @@ -462,7 +476,14 @@ public function setSku($sku) { if (is_null($sku)) { - throw new \InvalidArgumentException('non-nullable sku cannot be null'); + array_push($this->openAPINullablesSetToNull, 'sku'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sku', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['sku'] = $sku; @@ -501,7 +522,14 @@ public function setInventoryPolicy($inventory_policy) } if (is_null($inventory_policy)) { - throw new \InvalidArgumentException('non-nullable inventory_policy cannot be null'); + array_push($this->openAPINullablesSetToNull, 'inventory_policy'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inventory_policy', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['inventory_policy'] = $inventory_policy; @@ -530,7 +558,14 @@ public function setInventoryQuantity($inventory_quantity) { if (is_null($inventory_quantity)) { - throw new \InvalidArgumentException('non-nullable inventory_quantity cannot be null'); + array_push($this->openAPINullablesSetToNull, 'inventory_quantity'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inventory_quantity', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['inventory_quantity'] = $inventory_quantity; @@ -559,7 +594,14 @@ public function setPrice($price) { if (is_null($price)) { - throw new \InvalidArgumentException('non-nullable price cannot be null'); + array_push($this->openAPINullablesSetToNull, 'price'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('price', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['price'] = $price; @@ -588,7 +630,14 @@ public function setUrl($url) { if (is_null($url)) { - throw new \InvalidArgumentException('non-nullable url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['url'] = $url; @@ -617,7 +666,14 @@ public function setImageFullUrl($image_full_url) { if (is_null($image_full_url)) { - throw new \InvalidArgumentException('non-nullable image_full_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_full_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_full_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_full_url'] = $image_full_url; @@ -646,7 +702,14 @@ public function setImageThumbnailUrl($image_thumbnail_url) { if (is_null($image_thumbnail_url)) { - throw new \InvalidArgumentException('non-nullable image_thumbnail_url cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image_thumbnail_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image_thumbnail_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image_thumbnail_url'] = $image_thumbnail_url; @@ -675,7 +738,14 @@ public function setImages($images) { if (is_null($images)) { - throw new \InvalidArgumentException('non-nullable images cannot be null'); + array_push($this->openAPINullablesSetToNull, 'images'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('images', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['images'] = $images; @@ -704,7 +774,14 @@ public function setCustomMetadata($custom_metadata) { if (is_null($custom_metadata)) { - throw new \InvalidArgumentException('non-nullable custom_metadata cannot be null'); + array_push($this->openAPINullablesSetToNull, 'custom_metadata'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_metadata', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['custom_metadata'] = $custom_metadata; @@ -733,7 +810,14 @@ public function setPublished($published) { if (is_null($published)) { - throw new \InvalidArgumentException('non-nullable published cannot be null'); + array_push($this->openAPINullablesSetToNull, 'published'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('published', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['published'] = $published; diff --git a/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php b/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php index 6ada3a6..630db8c 100644 --- a/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php @@ -81,7 +81,7 @@ class CouponCodeCreateQueryResourceObjectAttributes implements ModelInterface, A */ protected static array $openAPINullables = [ 'unique_code' => false, - 'expires_at' => false + 'expires_at' => true ]; /** @@ -340,7 +340,14 @@ public function setExpiresAt($expires_at) { if (is_null($expires_at)) { - throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['expires_at'] = $expires_at; diff --git a/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php b/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php index d4e7c9d..46ac5c1 100644 --- a/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php @@ -80,8 +80,8 @@ class CouponCodeUpdateQueryResourceObjectAttributes implements ModelInterface, A * @var boolean[] */ protected static array $openAPINullables = [ - 'status' => false, - 'expires_at' => false + 'status' => true, + 'expires_at' => true ]; /** @@ -348,7 +348,14 @@ public function setStatus($status) } if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['status'] = $status; @@ -377,7 +384,14 @@ public function setExpiresAt($expires_at) { if (is_null($expires_at)) { - throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['expires_at'] = $expires_at; diff --git a/lib/Model/CouponCreateQueryResourceObjectAttributes.php b/lib/Model/CouponCreateQueryResourceObjectAttributes.php index d855b6b..3492130 100644 --- a/lib/Model/CouponCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponCreateQueryResourceObjectAttributes.php @@ -81,7 +81,7 @@ class CouponCreateQueryResourceObjectAttributes implements ModelInterface, Array */ protected static array $openAPINullables = [ 'external_id' => false, - 'description' => false + 'description' => true ]; /** @@ -340,7 +340,14 @@ public function setDescription($description) { if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['description'] = $description; diff --git a/lib/Model/CouponUpdateQueryResourceObjectAttributes.php b/lib/Model/CouponUpdateQueryResourceObjectAttributes.php index 0539396..c860f16 100644 --- a/lib/Model/CouponUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponUpdateQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class CouponUpdateQueryResourceObjectAttributes implements ModelInterface, Array * @var boolean[] */ protected static array $openAPINullables = [ - 'description' => false + 'description' => true ]; /** @@ -301,7 +301,14 @@ public function setDescription($description) { if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['description'] = $description; diff --git a/lib/Model/DataPrivacyProfileQueryResourceObject.php b/lib/Model/DataPrivacyProfileQueryResourceObject.php index daabfba..a2893cd 100644 --- a/lib/Model/DataPrivacyProfileQueryResourceObject.php +++ b/lib/Model/DataPrivacyProfileQueryResourceObject.php @@ -83,7 +83,7 @@ class DataPrivacyProfileQueryResourceObject implements ModelInterface, ArrayAcce */ protected static array $openAPINullables = [ 'type' => false, - 'id' => false, + 'id' => true, 'attributes' => false ]; @@ -350,7 +350,14 @@ public function setId($id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['id'] = $id; diff --git a/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php b/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php index d09f09f..eaf82ee 100644 --- a/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php +++ b/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php @@ -80,8 +80,8 @@ class DataPrivacyProfileQueryResourceObjectAttributes implements ModelInterface, * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false + 'email' => true, + 'phone_number' => true ]; /** @@ -308,7 +308,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; @@ -337,7 +344,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; diff --git a/lib/Model/DeviceMetadata.php b/lib/Model/DeviceMetadata.php index 733f532..c64752b 100644 --- a/lib/Model/DeviceMetadata.php +++ b/lib/Model/DeviceMetadata.php @@ -100,18 +100,18 @@ class DeviceMetadata implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'device_id' => false, - 'klaviyo_sdk' => false, - 'sdk_version' => false, - 'device_model' => false, - 'os_name' => false, - 'os_version' => false, - 'manufacturer' => false, - 'app_name' => false, - 'app_version' => false, - 'app_build' => false, - 'app_id' => false, - 'environment' => false + 'device_id' => true, + 'klaviyo_sdk' => true, + 'sdk_version' => true, + 'device_model' => true, + 'os_name' => true, + 'os_version' => true, + 'manufacturer' => true, + 'app_name' => true, + 'app_version' => true, + 'app_build' => true, + 'app_id' => true, + 'environment' => true ]; /** @@ -456,7 +456,14 @@ public function setDeviceId($device_id) { if (is_null($device_id)) { - throw new \InvalidArgumentException('non-nullable device_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'device_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('device_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['device_id'] = $device_id; @@ -495,7 +502,14 @@ public function setKlaviyoSdk($klaviyo_sdk) } if (is_null($klaviyo_sdk)) { - throw new \InvalidArgumentException('non-nullable klaviyo_sdk cannot be null'); + array_push($this->openAPINullablesSetToNull, 'klaviyo_sdk'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('klaviyo_sdk', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['klaviyo_sdk'] = $klaviyo_sdk; @@ -524,7 +538,14 @@ public function setSdkVersion($sdk_version) { if (is_null($sdk_version)) { - throw new \InvalidArgumentException('non-nullable sdk_version cannot be null'); + array_push($this->openAPINullablesSetToNull, 'sdk_version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sdk_version', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['sdk_version'] = $sdk_version; @@ -553,7 +574,14 @@ public function setDeviceModel($device_model) { if (is_null($device_model)) { - throw new \InvalidArgumentException('non-nullable device_model cannot be null'); + array_push($this->openAPINullablesSetToNull, 'device_model'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('device_model', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['device_model'] = $device_model; @@ -592,7 +620,14 @@ public function setOsName($os_name) } if (is_null($os_name)) { - throw new \InvalidArgumentException('non-nullable os_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'os_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('os_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['os_name'] = $os_name; @@ -621,7 +656,14 @@ public function setOsVersion($os_version) { if (is_null($os_version)) { - throw new \InvalidArgumentException('non-nullable os_version cannot be null'); + array_push($this->openAPINullablesSetToNull, 'os_version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('os_version', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['os_version'] = $os_version; @@ -650,7 +692,14 @@ public function setManufacturer($manufacturer) { if (is_null($manufacturer)) { - throw new \InvalidArgumentException('non-nullable manufacturer cannot be null'); + array_push($this->openAPINullablesSetToNull, 'manufacturer'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('manufacturer', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['manufacturer'] = $manufacturer; @@ -679,7 +728,14 @@ public function setAppName($app_name) { if (is_null($app_name)) { - throw new \InvalidArgumentException('non-nullable app_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'app_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('app_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['app_name'] = $app_name; @@ -708,7 +764,14 @@ public function setAppVersion($app_version) { if (is_null($app_version)) { - throw new \InvalidArgumentException('non-nullable app_version cannot be null'); + array_push($this->openAPINullablesSetToNull, 'app_version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('app_version', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['app_version'] = $app_version; @@ -737,7 +800,14 @@ public function setAppBuild($app_build) { if (is_null($app_build)) { - throw new \InvalidArgumentException('non-nullable app_build cannot be null'); + array_push($this->openAPINullablesSetToNull, 'app_build'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('app_build', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['app_build'] = $app_build; @@ -766,7 +836,14 @@ public function setAppId($app_id) { if (is_null($app_id)) { - throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'app_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('app_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['app_id'] = $app_id; @@ -805,7 +882,14 @@ public function setEnvironment($environment) } if (is_null($environment)) { - throw new \InvalidArgumentException('non-nullable environment cannot be null'); + array_push($this->openAPINullablesSetToNull, 'environment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('environment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['environment'] = $environment; diff --git a/lib/Model/EmailContentSubObject.php b/lib/Model/EmailContentSubObject.php index f005a55..9bb76b6 100644 --- a/lib/Model/EmailContentSubObject.php +++ b/lib/Model/EmailContentSubObject.php @@ -90,13 +90,13 @@ class EmailContentSubObject implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static array $openAPINullables = [ - 'subject' => false, - 'preview_text' => false, - 'from_email' => false, - 'from_label' => false, - 'reply_to_email' => false, - 'cc_email' => false, - 'bcc_email' => false + 'subject' => true, + 'preview_text' => true, + 'from_email' => true, + 'from_label' => true, + 'reply_to_email' => true, + 'cc_email' => true, + 'bcc_email' => true ]; /** @@ -343,7 +343,14 @@ public function setSubject($subject) { if (is_null($subject)) { - throw new \InvalidArgumentException('non-nullable subject cannot be null'); + array_push($this->openAPINullablesSetToNull, 'subject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subject', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['subject'] = $subject; @@ -372,7 +379,14 @@ public function setPreviewText($preview_text) { if (is_null($preview_text)) { - throw new \InvalidArgumentException('non-nullable preview_text cannot be null'); + array_push($this->openAPINullablesSetToNull, 'preview_text'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('preview_text', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['preview_text'] = $preview_text; @@ -401,7 +415,14 @@ public function setFromEmail($from_email) { if (is_null($from_email)) { - throw new \InvalidArgumentException('non-nullable from_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'from_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('from_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['from_email'] = $from_email; @@ -430,7 +451,14 @@ public function setFromLabel($from_label) { if (is_null($from_label)) { - throw new \InvalidArgumentException('non-nullable from_label cannot be null'); + array_push($this->openAPINullablesSetToNull, 'from_label'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('from_label', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['from_label'] = $from_label; @@ -459,7 +487,14 @@ public function setReplyToEmail($reply_to_email) { if (is_null($reply_to_email)) { - throw new \InvalidArgumentException('non-nullable reply_to_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'reply_to_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reply_to_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['reply_to_email'] = $reply_to_email; @@ -488,7 +523,14 @@ public function setCcEmail($cc_email) { if (is_null($cc_email)) { - throw new \InvalidArgumentException('non-nullable cc_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'cc_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cc_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['cc_email'] = $cc_email; @@ -517,7 +559,14 @@ public function setBccEmail($bcc_email) { if (is_null($bcc_email)) { - throw new \InvalidArgumentException('non-nullable bcc_email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'bcc_email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bcc_email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['bcc_email'] = $bcc_email; diff --git a/lib/Model/EmailSendOptionsSubObject.php b/lib/Model/EmailSendOptionsSubObject.php index 572a10f..5d01ad2 100644 --- a/lib/Model/EmailSendOptionsSubObject.php +++ b/lib/Model/EmailSendOptionsSubObject.php @@ -78,7 +78,7 @@ class EmailSendOptionsSubObject implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'use_smart_sending' => false + 'use_smart_sending' => true ]; /** @@ -301,7 +301,14 @@ public function setUseSmartSending($use_smart_sending) { if (is_null($use_smart_sending)) { - throw new \InvalidArgumentException('non-nullable use_smart_sending cannot be null'); + array_push($this->openAPINullablesSetToNull, 'use_smart_sending'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('use_smart_sending', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['use_smart_sending'] = $use_smart_sending; diff --git a/lib/Model/EmailTrackingOptionsSubObject.php b/lib/Model/EmailTrackingOptionsSubObject.php index c2ae4d9..08e8835 100644 --- a/lib/Model/EmailTrackingOptionsSubObject.php +++ b/lib/Model/EmailTrackingOptionsSubObject.php @@ -84,10 +84,10 @@ class EmailTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'is_add_utm' => false, - 'utm_params' => false, - 'is_tracking_clicks' => false, - 'is_tracking_opens' => false + 'is_add_utm' => true, + 'utm_params' => true, + 'is_tracking_clicks' => true, + 'is_tracking_opens' => true ]; /** @@ -322,7 +322,14 @@ public function setIsAddUtm($is_add_utm) { if (is_null($is_add_utm)) { - throw new \InvalidArgumentException('non-nullable is_add_utm cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_add_utm'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_add_utm', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_add_utm'] = $is_add_utm; @@ -351,7 +358,14 @@ public function setUtmParams($utm_params) { if (is_null($utm_params)) { - throw new \InvalidArgumentException('non-nullable utm_params cannot be null'); + array_push($this->openAPINullablesSetToNull, 'utm_params'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utm_params', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['utm_params'] = $utm_params; @@ -380,7 +394,14 @@ public function setIsTrackingClicks($is_tracking_clicks) { if (is_null($is_tracking_clicks)) { - throw new \InvalidArgumentException('non-nullable is_tracking_clicks cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_tracking_clicks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_tracking_clicks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_tracking_clicks'] = $is_tracking_clicks; @@ -409,7 +430,14 @@ public function setIsTrackingOpens($is_tracking_opens) { if (is_null($is_tracking_opens)) { - throw new \InvalidArgumentException('non-nullable is_tracking_opens cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_tracking_opens'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_tracking_opens', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_tracking_opens'] = $is_tracking_opens; diff --git a/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php b/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php index be36fed..09b5bba 100644 --- a/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php +++ b/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php @@ -91,10 +91,10 @@ class EventCreateQueryV2ResourceObjectAttributes implements ModelInterface, Arra */ protected static array $openAPINullables = [ 'properties' => false, - 'time' => false, - 'value' => false, - 'value_currency' => false, - 'unique_id' => false, + 'time' => true, + 'value' => true, + 'value_currency' => true, + 'unique_id' => true, 'metric' => false, 'profile' => false ]; @@ -381,7 +381,14 @@ public function setTime($time) { if (is_null($time)) { - throw new \InvalidArgumentException('non-nullable time cannot be null'); + array_push($this->openAPINullablesSetToNull, 'time'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('time', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['time'] = $time; @@ -410,7 +417,14 @@ public function setValue($value) { if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['value'] = $value; @@ -439,7 +453,14 @@ public function setValueCurrency($value_currency) { if (is_null($value_currency)) { - throw new \InvalidArgumentException('non-nullable value_currency cannot be null'); + array_push($this->openAPINullablesSetToNull, 'value_currency'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value_currency', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['value_currency'] = $value_currency; @@ -468,7 +489,14 @@ public function setUniqueId($unique_id) { if (is_null($unique_id)) { - throw new \InvalidArgumentException('non-nullable unique_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'unique_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unique_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['unique_id'] = $unique_id; diff --git a/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php b/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php index ab43074..8e7324e 100644 --- a/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php +++ b/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php @@ -58,7 +58,7 @@ class EventCreateQueryV2ResourceObjectAttributesProfile implements ModelInterfac * @var string[] */ protected static $openAPITypes = [ - 'data' => '\KlaviyoAPI\Model\OnsiteProfileCreateQueryResourceObject' + 'data' => '\KlaviyoAPI\Model\EventProfileCreateQueryResourceObject' ]; /** @@ -286,7 +286,7 @@ public function valid() /** * Gets data * - * @return \KlaviyoAPI\Model\OnsiteProfileCreateQueryResourceObject + * @return \KlaviyoAPI\Model\EventProfileCreateQueryResourceObject */ public function getData() { @@ -296,7 +296,7 @@ public function getData() /** * Sets data * - * @param \KlaviyoAPI\Model\OnsiteProfileCreateQueryResourceObject $data data + * @param \KlaviyoAPI\Model\EventProfileCreateQueryResourceObject $data data * * @return self */ diff --git a/lib/Model/OnsiteProfileCreateQueryResourceObject.php b/lib/Model/EventProfileCreateQueryResourceObject.php similarity index 86% rename from lib/Model/OnsiteProfileCreateQueryResourceObject.php rename to lib/Model/EventProfileCreateQueryResourceObject.php index 4c9875d..0c79a64 100644 --- a/lib/Model/OnsiteProfileCreateQueryResourceObject.php +++ b/lib/Model/EventProfileCreateQueryResourceObject.php @@ -1,6 +1,6 @@ */ -class OnsiteProfileCreateQueryResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +class EventProfileCreateQueryResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class OnsiteProfileCreateQueryResourceObject implements ModelInterface, ArrayAcc * * @var string */ - protected static $openAPIModelName = 'OnsiteProfileCreateQueryResourceObject'; + protected static $openAPIModelName = 'EventProfileCreateQueryResourceObject'; /** * Array of property to type mappings. Used for (de)serialization @@ -60,8 +60,7 @@ class OnsiteProfileCreateQueryResourceObject implements ModelInterface, ArrayAcc protected static $openAPITypes = [ 'type' => '\KlaviyoAPI\Model\ProfileEnum', 'id' => 'string', - 'attributes' => '\KlaviyoAPI\Model\OnsiteProfileCreateQueryResourceObjectAttributes', - 'meta' => '\KlaviyoAPI\Model\OnsiteProfileMeta' + 'attributes' => '\KlaviyoAPI\Model\EventProfileCreateQueryResourceObjectAttributes' ]; /** @@ -74,8 +73,7 @@ class OnsiteProfileCreateQueryResourceObject implements ModelInterface, ArrayAcc protected static $openAPIFormats = [ 'type' => null, 'id' => null, - 'attributes' => null, - 'meta' => null + 'attributes' => null ]; /** @@ -85,9 +83,8 @@ class OnsiteProfileCreateQueryResourceObject implements ModelInterface, ArrayAcc */ protected static array $openAPINullables = [ 'type' => false, - 'id' => false, - 'attributes' => false, - 'meta' => false + 'id' => true, + 'attributes' => false ]; /** @@ -168,8 +165,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'id' => 'id', - 'attributes' => 'attributes', - 'meta' => 'meta' + 'attributes' => 'attributes' ]; /** @@ -180,8 +176,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'id' => 'setId', - 'attributes' => 'setAttributes', - 'meta' => 'setMeta' + 'attributes' => 'setAttributes' ]; /** @@ -192,8 +187,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'id' => 'getId', - 'attributes' => 'getAttributes', - 'meta' => 'getMeta' + 'attributes' => 'getAttributes' ]; /** @@ -256,7 +250,6 @@ public function __construct(array $data = null) $this->setIfExists('type', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('attributes', $data ?? [], null); - $this->setIfExists('meta', $data ?? [], null); } /** @@ -357,7 +350,14 @@ public function setId($id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['id'] = $id; @@ -368,7 +368,7 @@ public function setId($id) /** * Gets attributes * - * @return \KlaviyoAPI\Model\OnsiteProfileCreateQueryResourceObjectAttributes + * @return \KlaviyoAPI\Model\EventProfileCreateQueryResourceObjectAttributes */ public function getAttributes() { @@ -378,7 +378,7 @@ public function getAttributes() /** * Sets attributes * - * @param \KlaviyoAPI\Model\OnsiteProfileCreateQueryResourceObjectAttributes $attributes attributes + * @param \KlaviyoAPI\Model\EventProfileCreateQueryResourceObjectAttributes $attributes attributes * * @return self */ @@ -393,35 +393,6 @@ public function setAttributes($attributes) return $this; } - - /** - * Gets meta - * - * @return \KlaviyoAPI\Model\OnsiteProfileMeta|null - */ - public function getMeta() - { - return $this->container['meta']; - } - - /** - * Sets meta - * - * @param \KlaviyoAPI\Model\OnsiteProfileMeta|null $meta meta - * - * @return self - */ - public function setMeta($meta) - { - - if (is_null($meta)) { - throw new \InvalidArgumentException('non-nullable meta cannot be null'); - } - - $this->container['meta'] = $meta; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/OnsiteProfileCreateQueryResourceObjectAttributes.php b/lib/Model/EventProfileCreateQueryResourceObjectAttributes.php similarity index 73% rename from lib/Model/OnsiteProfileCreateQueryResourceObjectAttributes.php rename to lib/Model/EventProfileCreateQueryResourceObjectAttributes.php index 57699d8..3d06241 100644 --- a/lib/Model/OnsiteProfileCreateQueryResourceObjectAttributes.php +++ b/lib/Model/EventProfileCreateQueryResourceObjectAttributes.php @@ -1,6 +1,6 @@ */ -class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +class EventProfileCreateQueryResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface * * @var string */ - protected static $openAPIModelName = 'OnsiteProfileCreateQueryResourceObject_attributes'; + protected static $openAPIModelName = 'EventProfileCreateQueryResourceObject_attributes'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,7 +58,6 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface * @var string[] */ protected static $openAPITypes = [ - 'email' => 'string', 'phone_number' => 'string', 'external_id' => 'string', 'anonymous_id' => 'string', @@ -69,7 +68,9 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface 'title' => 'string', 'image' => 'string', 'location' => '\KlaviyoAPI\Model\ProfileLocation', - 'properties' => 'object' + 'properties' => 'object', + 'meta' => '\KlaviyoAPI\Model\OnsiteProfileMeta', + 'email' => 'string' ]; /** @@ -80,7 +81,6 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface * @psalm-var array */ protected static $openAPIFormats = [ - 'email' => null, 'phone_number' => null, 'external_id' => null, 'anonymous_id' => null, @@ -91,7 +91,9 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface 'title' => null, 'image' => null, 'location' => null, - 'properties' => null + 'properties' => null, + 'meta' => null, + 'email' => null ]; /** @@ -100,18 +102,19 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false, - 'external_id' => false, - 'anonymous_id' => false, - '_kx' => false, - 'first_name' => false, - 'last_name' => false, - 'organization' => false, - 'title' => false, - 'image' => false, + 'phone_number' => true, + 'external_id' => true, + 'anonymous_id' => true, + '_kx' => true, + 'first_name' => true, + 'last_name' => true, + 'organization' => true, + 'title' => true, + 'image' => true, 'location' => false, - 'properties' => false + 'properties' => true, + 'meta' => false, + 'email' => true ]; /** @@ -190,7 +193,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'email' => 'email', 'phone_number' => 'phone_number', 'external_id' => 'external_id', 'anonymous_id' => 'anonymous_id', @@ -201,7 +203,9 @@ public function isNullableSetToNull(string $property): bool 'title' => 'title', 'image' => 'image', 'location' => 'location', - 'properties' => 'properties' + 'properties' => 'properties', + 'meta' => 'meta', + 'email' => 'email' ]; /** @@ -210,7 +214,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'email' => 'setEmail', 'phone_number' => 'setPhoneNumber', 'external_id' => 'setExternalId', 'anonymous_id' => 'setAnonymousId', @@ -221,7 +224,9 @@ public function isNullableSetToNull(string $property): bool 'title' => 'setTitle', 'image' => 'setImage', 'location' => 'setLocation', - 'properties' => 'setProperties' + 'properties' => 'setProperties', + 'meta' => 'setMeta', + 'email' => 'setEmail' ]; /** @@ -230,7 +235,6 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'email' => 'getEmail', 'phone_number' => 'getPhoneNumber', 'external_id' => 'getExternalId', 'anonymous_id' => 'getAnonymousId', @@ -241,7 +245,9 @@ public function isNullableSetToNull(string $property): bool 'title' => 'getTitle', 'image' => 'getImage', 'location' => 'getLocation', - 'properties' => 'getProperties' + 'properties' => 'getProperties', + 'meta' => 'getMeta', + 'email' => 'getEmail' ]; /** @@ -301,7 +307,6 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('email', $data ?? [], null); $this->setIfExists('phone_number', $data ?? [], null); $this->setIfExists('external_id', $data ?? [], null); $this->setIfExists('anonymous_id', $data ?? [], null); @@ -313,6 +318,8 @@ public function __construct(array $data = null) $this->setIfExists('image', $data ?? [], null); $this->setIfExists('location', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('meta', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); } /** @@ -357,35 +364,6 @@ public function valid() } - /** - * Gets email - * - * @return string|null - */ - public function getEmail() - { - return $this->container['email']; - } - - /** - * Sets email - * - * @param string|null $email Individual's email address - * - * @return self - */ - public function setEmail($email) - { - - if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); - } - - $this->container['email'] = $email; - - return $this; - } - /** * Gets phone_number * @@ -407,7 +385,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; @@ -436,7 +421,14 @@ public function setExternalId($external_id) { if (is_null($external_id)) { - throw new \InvalidArgumentException('non-nullable external_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'external_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['external_id'] = $external_id; @@ -465,7 +457,14 @@ public function setAnonymousId($anonymous_id) { if (is_null($anonymous_id)) { - throw new \InvalidArgumentException('non-nullable anonymous_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'anonymous_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('anonymous_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['anonymous_id'] = $anonymous_id; @@ -494,7 +493,14 @@ public function setKx($_kx) { if (is_null($_kx)) { - throw new \InvalidArgumentException('non-nullable _kx cannot be null'); + array_push($this->openAPINullablesSetToNull, '_kx'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('_kx', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['_kx'] = $_kx; @@ -523,7 +529,14 @@ public function setFirstName($first_name) { if (is_null($first_name)) { - throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['first_name'] = $first_name; @@ -552,7 +565,14 @@ public function setLastName($last_name) { if (is_null($last_name)) { - throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['last_name'] = $last_name; @@ -581,7 +601,14 @@ public function setOrganization($organization) { if (is_null($organization)) { - throw new \InvalidArgumentException('non-nullable organization cannot be null'); + array_push($this->openAPINullablesSetToNull, 'organization'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('organization', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['organization'] = $organization; @@ -610,7 +637,14 @@ public function setTitle($title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['title'] = $title; @@ -639,7 +673,14 @@ public function setImage($image) { if (is_null($image)) { - throw new \InvalidArgumentException('non-nullable image cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image'] = $image; @@ -697,13 +738,85 @@ public function setProperties($properties) { if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + array_push($this->openAPINullablesSetToNull, 'properties'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('properties', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['properties'] = $properties; return $this; } + + /** + * Gets meta + * + * @return \KlaviyoAPI\Model\OnsiteProfileMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \KlaviyoAPI\Model\OnsiteProfileMeta|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + + $this->container['meta'] = $meta; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email Individual's email address + * + * @return self + */ + public function setEmail($email) + { + + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['email'] = $email; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php b/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php index 4e6a269..a918d29 100644 --- a/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php +++ b/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php @@ -90,7 +90,7 @@ class FlowSeriesRequestDTOResourceObjectAttributes implements ModelInterface, Ar 'timeframe' => false, 'interval' => false, 'conversion_metric_id' => false, - 'filter' => false + 'filter' => true ]; /** @@ -561,7 +561,7 @@ public function getFilter() /** * Sets filter * - * @param string|null $filter API filter string used to filter the query. Allowed filters are flow_id, send_channel, flow_message_id. Allowed operators are equals, contains-any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. + * @param string|null $filter API filter string used to filter the query. Allowed filters are flow_id, send_channel, flow_message_id. Allowed operators are equals, contains-any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. When filtering on send_channel, allowed values are email, push-notification, sms. * * @return self */ @@ -569,7 +569,14 @@ public function setFilter($filter) { if (is_null($filter)) { - throw new \InvalidArgumentException('non-nullable filter cannot be null'); + array_push($this->openAPINullablesSetToNull, 'filter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('filter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['filter'] = $filter; diff --git a/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php b/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php index 47c3a96..8c84dc5 100644 --- a/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php +++ b/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php @@ -87,7 +87,7 @@ class FlowValuesRequestDTOResourceObjectAttributes implements ModelInterface, Ar 'statistics' => false, 'timeframe' => false, 'conversion_metric_id' => false, - 'filter' => false + 'filter' => true ]; /** @@ -484,7 +484,7 @@ public function getFilter() /** * Sets filter * - * @param string|null $filter API filter string used to filter the query. Allowed filters are flow_id, send_channel, flow_message_id. Allowed operators are equals, contains-any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. + * @param string|null $filter API filter string used to filter the query. Allowed filters are flow_id, send_channel, flow_message_id. Allowed operators are equals, contains-any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. When filtering on send_channel, allowed values are email, push-notification, sms. * * @return self */ @@ -492,7 +492,14 @@ public function setFilter($filter) { if (is_null($filter)) { - throw new \InvalidArgumentException('non-nullable filter cannot be null'); + array_push($this->openAPINullablesSetToNull, 'filter'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('filter', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['filter'] = $filter; diff --git a/lib/Model/ImageCreateQueryResourceObjectAttributes.php b/lib/Model/ImageCreateQueryResourceObjectAttributes.php index ff57214..4b07417 100644 --- a/lib/Model/ImageCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ImageCreateQueryResourceObjectAttributes.php @@ -82,9 +82,9 @@ class ImageCreateQueryResourceObjectAttributes implements ModelInterface, ArrayA * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, + 'name' => true, 'import_from_url' => false, - 'hidden' => false + 'hidden' => true ]; /** @@ -318,7 +318,14 @@ public function setName($name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['name'] = $name; @@ -376,7 +383,14 @@ public function setHidden($hidden) { if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + array_push($this->openAPINullablesSetToNull, 'hidden'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hidden', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['hidden'] = $hidden; diff --git a/lib/Model/ImagePartialUpdateQueryResourceObjectAttributes.php b/lib/Model/ImagePartialUpdateQueryResourceObjectAttributes.php index abe7157..f4f40dc 100644 --- a/lib/Model/ImagePartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/ImagePartialUpdateQueryResourceObjectAttributes.php @@ -80,8 +80,8 @@ class ImagePartialUpdateQueryResourceObjectAttributes implements ModelInterface, * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, - 'hidden' => false + 'name' => true, + 'hidden' => true ]; /** @@ -308,7 +308,14 @@ public function setName($name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['name'] = $name; @@ -337,7 +344,14 @@ public function setHidden($hidden) { if (is_null($hidden)) { - throw new \InvalidArgumentException('non-nullable hidden cannot be null'); + array_push($this->openAPINullablesSetToNull, 'hidden'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hidden', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['hidden'] = $hidden; diff --git a/lib/Model/MarketingSubscriptionParameters.php b/lib/Model/MarketingSubscriptionParameters.php index 6240dbe..6859740 100644 --- a/lib/Model/MarketingSubscriptionParameters.php +++ b/lib/Model/MarketingSubscriptionParameters.php @@ -81,7 +81,7 @@ class MarketingSubscriptionParameters implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'consent' => false, - 'consented_at' => false + 'consented_at' => true ]; /** @@ -372,7 +372,14 @@ public function setConsentedAt($consented_at) { if (is_null($consented_at)) { - throw new \InvalidArgumentException('non-nullable consented_at cannot be null'); + array_push($this->openAPINullablesSetToNull, 'consented_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('consented_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['consented_at'] = $consented_at; diff --git a/lib/Model/MetricAggregateQueryResourceObjectAttributes.php b/lib/Model/MetricAggregateQueryResourceObjectAttributes.php index 1b611ce..fc5af65 100644 --- a/lib/Model/MetricAggregateQueryResourceObjectAttributes.php +++ b/lib/Model/MetricAggregateQueryResourceObjectAttributes.php @@ -99,12 +99,12 @@ class MetricAggregateQueryResourceObjectAttributes implements ModelInterface, Ar 'metric_id' => false, 'page_cursor' => false, 'measurements' => false, - 'interval' => false, - 'page_size' => false, - 'by' => false, - 'return_fields' => false, + 'interval' => true, + 'page_size' => true, + 'by' => true, + 'return_fields' => true, 'filter' => false, - 'timezone' => false, + 'timezone' => true, 'sort' => false ]; @@ -747,7 +747,14 @@ public function setInterval($interval) } if (is_null($interval)) { - throw new \InvalidArgumentException('non-nullable interval cannot be null'); + array_push($this->openAPINullablesSetToNull, 'interval'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('interval', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['interval'] = $interval; @@ -776,7 +783,14 @@ public function setPageSize($page_size) { if (is_null($page_size)) { - throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + array_push($this->openAPINullablesSetToNull, 'page_size'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('page_size', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['page_size'] = $page_size; @@ -814,7 +828,14 @@ public function setBy($by) } if (is_null($by)) { - throw new \InvalidArgumentException('non-nullable by cannot be null'); + array_push($this->openAPINullablesSetToNull, 'by'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('by', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['by'] = $by; @@ -843,7 +864,14 @@ public function setReturnFields($return_fields) { if (is_null($return_fields)) { - throw new \InvalidArgumentException('non-nullable return_fields cannot be null'); + array_push($this->openAPINullablesSetToNull, 'return_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('return_fields', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['return_fields'] = $return_fields; @@ -901,7 +929,14 @@ public function setTimezone($timezone) { if (is_null($timezone)) { - throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + array_push($this->openAPINullablesSetToNull, 'timezone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('timezone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['timezone'] = $timezone; diff --git a/lib/Model/MetricCreateQueryResourceObjectAttributes.php b/lib/Model/MetricCreateQueryResourceObjectAttributes.php index 1919312..d21d8b0 100644 --- a/lib/Model/MetricCreateQueryResourceObjectAttributes.php +++ b/lib/Model/MetricCreateQueryResourceObjectAttributes.php @@ -81,7 +81,7 @@ class MetricCreateQueryResourceObjectAttributes implements ModelInterface, Array */ protected static array $openAPINullables = [ 'name' => false, - 'service' => false + 'service' => true ]; /** @@ -340,7 +340,14 @@ public function setService($service) { if (is_null($service)) { - throw new \InvalidArgumentException('non-nullable service cannot be null'); + array_push($this->openAPINullablesSetToNull, 'service'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('service', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['service'] = $service; diff --git a/lib/Model/ProfileCreateQueryResourceObjectAttributes.php b/lib/Model/ProfileCreateQueryResourceObjectAttributes.php index 5da55ef..96b128d 100644 --- a/lib/Model/ProfileCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileCreateQueryResourceObjectAttributes.php @@ -96,16 +96,16 @@ class ProfileCreateQueryResourceObjectAttributes implements ModelInterface, Arra * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false, - 'external_id' => false, - 'first_name' => false, - 'last_name' => false, - 'organization' => false, - 'title' => false, - 'image' => false, + 'email' => true, + 'phone_number' => true, + 'external_id' => true, + 'first_name' => true, + 'last_name' => true, + 'organization' => true, + 'title' => true, + 'image' => true, 'location' => false, - 'properties' => false + 'properties' => true ]; /** @@ -364,7 +364,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; @@ -393,7 +400,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; @@ -422,7 +436,14 @@ public function setExternalId($external_id) { if (is_null($external_id)) { - throw new \InvalidArgumentException('non-nullable external_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'external_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['external_id'] = $external_id; @@ -451,7 +472,14 @@ public function setFirstName($first_name) { if (is_null($first_name)) { - throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['first_name'] = $first_name; @@ -480,7 +508,14 @@ public function setLastName($last_name) { if (is_null($last_name)) { - throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['last_name'] = $last_name; @@ -509,7 +544,14 @@ public function setOrganization($organization) { if (is_null($organization)) { - throw new \InvalidArgumentException('non-nullable organization cannot be null'); + array_push($this->openAPINullablesSetToNull, 'organization'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('organization', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['organization'] = $organization; @@ -538,7 +580,14 @@ public function setTitle($title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['title'] = $title; @@ -567,7 +616,14 @@ public function setImage($image) { if (is_null($image)) { - throw new \InvalidArgumentException('non-nullable image cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image'] = $image; @@ -625,7 +681,14 @@ public function setProperties($properties) { if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + array_push($this->openAPINullablesSetToNull, 'properties'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('properties', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['properties'] = $properties; diff --git a/lib/Model/ProfileIdentifierDTOResourceObject.php b/lib/Model/ProfileIdentifierDTOResourceObject.php index 808b3da..d973163 100644 --- a/lib/Model/ProfileIdentifierDTOResourceObject.php +++ b/lib/Model/ProfileIdentifierDTOResourceObject.php @@ -83,7 +83,7 @@ class ProfileIdentifierDTOResourceObject implements ModelInterface, ArrayAccess, */ protected static array $openAPINullables = [ 'type' => false, - 'id' => false, + 'id' => true, 'attributes' => false ]; @@ -350,7 +350,14 @@ public function setId($id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['id'] = $id; diff --git a/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php b/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php index 99fd8f0..19115d4 100644 --- a/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php +++ b/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php @@ -84,10 +84,10 @@ class ProfileIdentifierDTOResourceObjectAttributes implements ModelInterface, Ar * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false, - 'external_id' => false, - 'anonymous_id' => false + 'email' => true, + 'phone_number' => true, + 'external_id' => true, + 'anonymous_id' => true ]; /** @@ -322,7 +322,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; @@ -351,7 +358,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; @@ -380,7 +394,14 @@ public function setExternalId($external_id) { if (is_null($external_id)) { - throw new \InvalidArgumentException('non-nullable external_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'external_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['external_id'] = $external_id; @@ -409,7 +430,14 @@ public function setAnonymousId($anonymous_id) { if (is_null($anonymous_id)) { - throw new \InvalidArgumentException('non-nullable anonymous_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'anonymous_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('anonymous_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['anonymous_id'] = $anonymous_id; diff --git a/lib/Model/ProfileLocation.php b/lib/Model/ProfileLocation.php index bd1c893..4c8a95f 100644 --- a/lib/Model/ProfileLocation.php +++ b/lib/Model/ProfileLocation.php @@ -96,16 +96,16 @@ class ProfileLocation implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'address1' => false, - 'address2' => false, - 'city' => false, - 'country' => false, - 'latitude' => false, - 'longitude' => false, - 'region' => false, - 'zip' => false, - 'timezone' => false, - 'ip' => false + 'address1' => true, + 'address2' => true, + 'city' => true, + 'country' => true, + 'latitude' => true, + 'longitude' => true, + 'region' => true, + 'zip' => true, + 'timezone' => true, + 'ip' => true ]; /** @@ -364,7 +364,14 @@ public function setAddress1($address1) { if (is_null($address1)) { - throw new \InvalidArgumentException('non-nullable address1 cannot be null'); + array_push($this->openAPINullablesSetToNull, 'address1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['address1'] = $address1; @@ -393,7 +400,14 @@ public function setAddress2($address2) { if (is_null($address2)) { - throw new \InvalidArgumentException('non-nullable address2 cannot be null'); + array_push($this->openAPINullablesSetToNull, 'address2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['address2'] = $address2; @@ -422,7 +436,14 @@ public function setCity($city) { if (is_null($city)) { - throw new \InvalidArgumentException('non-nullable city cannot be null'); + array_push($this->openAPINullablesSetToNull, 'city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['city'] = $city; @@ -451,7 +472,14 @@ public function setCountry($country) { if (is_null($country)) { - throw new \InvalidArgumentException('non-nullable country cannot be null'); + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['country'] = $country; @@ -480,7 +508,14 @@ public function setLatitude($latitude) { if (is_null($latitude)) { - throw new \InvalidArgumentException('non-nullable latitude cannot be null'); + array_push($this->openAPINullablesSetToNull, 'latitude'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('latitude', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['latitude'] = $latitude; @@ -509,7 +544,14 @@ public function setLongitude($longitude) { if (is_null($longitude)) { - throw new \InvalidArgumentException('non-nullable longitude cannot be null'); + array_push($this->openAPINullablesSetToNull, 'longitude'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('longitude', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['longitude'] = $longitude; @@ -538,7 +580,14 @@ public function setRegion($region) { if (is_null($region)) { - throw new \InvalidArgumentException('non-nullable region cannot be null'); + array_push($this->openAPINullablesSetToNull, 'region'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('region', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['region'] = $region; @@ -567,7 +616,14 @@ public function setZip($zip) { if (is_null($zip)) { - throw new \InvalidArgumentException('non-nullable zip cannot be null'); + array_push($this->openAPINullablesSetToNull, 'zip'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('zip', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['zip'] = $zip; @@ -596,7 +652,14 @@ public function setTimezone($timezone) { if (is_null($timezone)) { - throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + array_push($this->openAPINullablesSetToNull, 'timezone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('timezone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['timezone'] = $timezone; @@ -625,7 +688,14 @@ public function setIp($ip) { if (is_null($ip)) { - throw new \InvalidArgumentException('non-nullable ip cannot be null'); + array_push($this->openAPINullablesSetToNull, 'ip'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ip', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['ip'] = $ip; diff --git a/lib/Model/ProfileMetaPatchProperties.php b/lib/Model/ProfileMetaPatchProperties.php index 08b3b35..a9ba8fd 100644 --- a/lib/Model/ProfileMetaPatchProperties.php +++ b/lib/Model/ProfileMetaPatchProperties.php @@ -82,9 +82,9 @@ class ProfileMetaPatchProperties implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static array $openAPINullables = [ - 'append' => false, - 'unappend' => false, - 'unset' => false + 'append' => true, + 'unappend' => true, + 'unset' => true ]; /** @@ -315,7 +315,14 @@ public function setAppend($append) { if (is_null($append)) { - throw new \InvalidArgumentException('non-nullable append cannot be null'); + array_push($this->openAPINullablesSetToNull, 'append'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('append', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['append'] = $append; @@ -344,7 +351,14 @@ public function setUnappend($unappend) { if (is_null($unappend)) { - throw new \InvalidArgumentException('non-nullable unappend cannot be null'); + array_push($this->openAPINullablesSetToNull, 'unappend'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unappend', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['unappend'] = $unappend; @@ -373,7 +387,14 @@ public function setUnset($unset) { if (is_null($unset)) { - throw new \InvalidArgumentException('non-nullable unset cannot be null'); + array_push($this->openAPINullablesSetToNull, 'unset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['unset'] = $unset; diff --git a/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php b/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php index 67984e9..c34127f 100644 --- a/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php @@ -98,17 +98,17 @@ class ProfilePartialUpdateQueryResourceObjectAttributes implements ModelInterfac * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false, - 'external_id' => false, - 'anonymous_id' => false, - 'first_name' => false, - 'last_name' => false, - 'organization' => false, - 'title' => false, - 'image' => false, + 'email' => true, + 'phone_number' => true, + 'external_id' => true, + 'anonymous_id' => true, + 'first_name' => true, + 'last_name' => true, + 'organization' => true, + 'title' => true, + 'image' => true, 'location' => false, - 'properties' => false + 'properties' => true ]; /** @@ -371,7 +371,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; @@ -400,7 +407,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; @@ -429,7 +443,14 @@ public function setExternalId($external_id) { if (is_null($external_id)) { - throw new \InvalidArgumentException('non-nullable external_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'external_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['external_id'] = $external_id; @@ -458,7 +479,14 @@ public function setAnonymousId($anonymous_id) { if (is_null($anonymous_id)) { - throw new \InvalidArgumentException('non-nullable anonymous_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'anonymous_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('anonymous_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['anonymous_id'] = $anonymous_id; @@ -487,7 +515,14 @@ public function setFirstName($first_name) { if (is_null($first_name)) { - throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['first_name'] = $first_name; @@ -516,7 +551,14 @@ public function setLastName($last_name) { if (is_null($last_name)) { - throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['last_name'] = $last_name; @@ -545,7 +587,14 @@ public function setOrganization($organization) { if (is_null($organization)) { - throw new \InvalidArgumentException('non-nullable organization cannot be null'); + array_push($this->openAPINullablesSetToNull, 'organization'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('organization', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['organization'] = $organization; @@ -574,7 +623,14 @@ public function setTitle($title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['title'] = $title; @@ -603,7 +659,14 @@ public function setImage($image) { if (is_null($image)) { - throw new \InvalidArgumentException('non-nullable image cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image'] = $image; @@ -661,7 +724,14 @@ public function setProperties($properties) { if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + array_push($this->openAPINullablesSetToNull, 'properties'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('properties', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['properties'] = $properties; diff --git a/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php b/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php index 4817483..3a608fb 100644 --- a/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php +++ b/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php @@ -83,7 +83,7 @@ class ProfileSubscriptionCreateQueryResourceObject implements ModelInterface, Ar */ protected static array $openAPINullables = [ 'type' => false, - 'id' => false, + 'id' => true, 'attributes' => false ]; @@ -350,7 +350,14 @@ public function setId($id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['id'] = $id; diff --git a/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php b/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php index e51451f..f8d8096 100644 --- a/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php @@ -82,8 +82,8 @@ class ProfileSubscriptionCreateQueryResourceObjectAttributes implements ModelInt * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false, + 'email' => true, + 'phone_number' => true, 'subscriptions' => false ]; @@ -315,7 +315,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; @@ -344,7 +351,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; diff --git a/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php b/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php index 2faca71..bce7a0d 100644 --- a/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php @@ -80,8 +80,8 @@ class ProfileSubscriptionDeleteQueryResourceObjectAttributes implements ModelInt * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false + 'email' => true, + 'phone_number' => true ]; /** @@ -308,7 +308,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; @@ -337,7 +344,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; diff --git a/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php b/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php index b536689..0526f90 100644 --- a/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class ProfileSuppressionCreateQueryResourceObjectAttributes implements ModelInte * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false + 'email' => true ]; /** @@ -301,7 +301,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; diff --git a/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php b/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php index a84c778..0022aed 100644 --- a/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class ProfileSuppressionDeleteQueryResourceObjectAttributes implements ModelInte * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false + 'email' => true ]; /** @@ -301,7 +301,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; diff --git a/lib/Model/ProfileUpsertQueryResourceObject.php b/lib/Model/ProfileUpsertQueryResourceObject.php index 279eaec..d7f134a 100644 --- a/lib/Model/ProfileUpsertQueryResourceObject.php +++ b/lib/Model/ProfileUpsertQueryResourceObject.php @@ -85,7 +85,7 @@ class ProfileUpsertQueryResourceObject implements ModelInterface, ArrayAccess, \ */ protected static array $openAPINullables = [ 'type' => false, - 'id' => false, + 'id' => true, 'attributes' => false, 'meta' => false ]; @@ -357,7 +357,14 @@ public function setId($id) { if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['id'] = $id; diff --git a/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php b/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php index 66a150d..ae05bf4 100644 --- a/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php @@ -100,18 +100,18 @@ class ProfileUpsertQueryResourceObjectAttributes implements ModelInterface, Arra * @var boolean[] */ protected static array $openAPINullables = [ - 'email' => false, - 'phone_number' => false, - 'external_id' => false, - 'anonymous_id' => false, - '_kx' => false, - 'first_name' => false, - 'last_name' => false, - 'organization' => false, - 'title' => false, - 'image' => false, + 'email' => true, + 'phone_number' => true, + 'external_id' => true, + 'anonymous_id' => true, + '_kx' => true, + 'first_name' => true, + 'last_name' => true, + 'organization' => true, + 'title' => true, + 'image' => true, 'location' => false, - 'properties' => false + 'properties' => true ]; /** @@ -378,7 +378,14 @@ public function setEmail($email) { if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['email'] = $email; @@ -407,7 +414,14 @@ public function setPhoneNumber($phone_number) { if (is_null($phone_number)) { - throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['phone_number'] = $phone_number; @@ -436,7 +450,14 @@ public function setExternalId($external_id) { if (is_null($external_id)) { - throw new \InvalidArgumentException('non-nullable external_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'external_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['external_id'] = $external_id; @@ -465,7 +486,14 @@ public function setAnonymousId($anonymous_id) { if (is_null($anonymous_id)) { - throw new \InvalidArgumentException('non-nullable anonymous_id cannot be null'); + array_push($this->openAPINullablesSetToNull, 'anonymous_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('anonymous_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['anonymous_id'] = $anonymous_id; @@ -494,7 +522,14 @@ public function setKx($_kx) { if (is_null($_kx)) { - throw new \InvalidArgumentException('non-nullable _kx cannot be null'); + array_push($this->openAPINullablesSetToNull, '_kx'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('_kx', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['_kx'] = $_kx; @@ -523,7 +558,14 @@ public function setFirstName($first_name) { if (is_null($first_name)) { - throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['first_name'] = $first_name; @@ -552,7 +594,14 @@ public function setLastName($last_name) { if (is_null($last_name)) { - throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['last_name'] = $last_name; @@ -581,7 +630,14 @@ public function setOrganization($organization) { if (is_null($organization)) { - throw new \InvalidArgumentException('non-nullable organization cannot be null'); + array_push($this->openAPINullablesSetToNull, 'organization'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('organization', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['organization'] = $organization; @@ -610,7 +666,14 @@ public function setTitle($title) { if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['title'] = $title; @@ -639,7 +702,14 @@ public function setImage($image) { if (is_null($image)) { - throw new \InvalidArgumentException('non-nullable image cannot be null'); + array_push($this->openAPINullablesSetToNull, 'image'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['image'] = $image; @@ -697,7 +767,14 @@ public function setProperties($properties) { if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + array_push($this->openAPINullablesSetToNull, 'properties'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('properties', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['properties'] = $properties; diff --git a/lib/Model/PushProfileUpsertQueryResourceObject.php b/lib/Model/PushProfileUpsertQueryResourceObject.php new file mode 100644 index 0000000..b318d07 --- /dev/null +++ b/lib/Model/PushProfileUpsertQueryResourceObject.php @@ -0,0 +1,487 @@ + + */ +class PushProfileUpsertQueryResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PushProfileUpsertQueryResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\ProfileEnum', + 'id' => 'string', + 'attributes' => '\KlaviyoAPI\Model\PushProfileUpsertQueryResourceObjectAttributes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => null, + 'attributes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'id' => true, + 'attributes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId', + 'attributes' => 'getAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('attributes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['attributes'] === null) { + $invalidProperties[] = "'attributes' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\ProfileEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\ProfileEnum $type type + * + * @return self + */ + public function setType($type) + { + + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Primary key that uniquely identifies this profile. Generated by Klaviyo. + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets attributes + * + * @return \KlaviyoAPI\Model\PushProfileUpsertQueryResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\PushProfileUpsertQueryResourceObjectAttributes $attributes attributes + * + * @return self + */ + public function setAttributes($attributes) + { + + if (is_null($attributes)) { + throw new \InvalidArgumentException('non-nullable attributes cannot be null'); + } + + $this->container['attributes'] = $attributes; + + 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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php b/lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php new file mode 100644 index 0000000..8b92953 --- /dev/null +++ b/lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php @@ -0,0 +1,911 @@ + + */ +class PushProfileUpsertQueryResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PushProfileUpsertQueryResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'phone_number' => 'string', + 'external_id' => 'string', + 'anonymous_id' => 'string', + '_kx' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'organization' => 'string', + 'title' => 'string', + 'image' => 'string', + 'location' => '\KlaviyoAPI\Model\ProfileLocation', + 'properties' => 'object', + 'meta' => '\KlaviyoAPI\Model\ProfileMeta', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'phone_number' => null, + 'external_id' => null, + 'anonymous_id' => null, + '_kx' => null, + 'first_name' => null, + 'last_name' => null, + 'organization' => null, + 'title' => null, + 'image' => null, + 'location' => null, + 'properties' => null, + 'meta' => null, + 'email' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number' => true, + 'external_id' => true, + 'anonymous_id' => true, + '_kx' => true, + 'first_name' => true, + 'last_name' => true, + 'organization' => true, + 'title' => true, + 'image' => true, + 'location' => false, + 'properties' => true, + 'meta' => false, + 'email' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'phone_number' => 'phone_number', + 'external_id' => 'external_id', + 'anonymous_id' => 'anonymous_id', + '_kx' => '_kx', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'organization' => 'organization', + 'title' => 'title', + 'image' => 'image', + 'location' => 'location', + 'properties' => 'properties', + 'meta' => 'meta', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'phone_number' => 'setPhoneNumber', + 'external_id' => 'setExternalId', + 'anonymous_id' => 'setAnonymousId', + '_kx' => 'setKx', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'organization' => 'setOrganization', + 'title' => 'setTitle', + 'image' => 'setImage', + 'location' => 'setLocation', + 'properties' => 'setProperties', + 'meta' => 'setMeta', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'phone_number' => 'getPhoneNumber', + 'external_id' => 'getExternalId', + 'anonymous_id' => 'getAnonymousId', + '_kx' => 'getKx', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'organization' => 'getOrganization', + 'title' => 'getTitle', + 'image' => 'getImage', + 'location' => 'getLocation', + 'properties' => 'getProperties', + 'meta' => 'getMeta', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('external_id', $data ?? [], null); + $this->setIfExists('anonymous_id', $data ?? [], null); + $this->setIfExists('_kx', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('image', $data ?? [], null); + $this->setIfExists('location', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('meta', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $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() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number Individual's phone number in E.164 format + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets external_id + * + * @return string|null + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string|null $external_id A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system. + * + * @return self + */ + public function setExternalId($external_id) + { + + if (is_null($external_id)) { + array_push($this->openAPINullablesSetToNull, 'external_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['external_id'] = $external_id; + + return $this; + } + + /** + * Gets anonymous_id + * + * @return string|null + */ + public function getAnonymousId() + { + return $this->container['anonymous_id']; + } + + /** + * Sets anonymous_id + * + * @param string|null $anonymous_id Id that can be used to identify a profile when other identifiers are not available + * + * @return self + */ + public function setAnonymousId($anonymous_id) + { + + if (is_null($anonymous_id)) { + array_push($this->openAPINullablesSetToNull, 'anonymous_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('anonymous_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['anonymous_id'] = $anonymous_id; + + return $this; + } + + /** + * Gets _kx + * + * @return string|null + */ + public function getKx() + { + return $this->container['_kx']; + } + + /** + * Sets _kx + * + * @param string|null $_kx Also known as the `exchange_id`, this is an encrypted identifier used for identifying a profile by Klaviyo's web tracking. You can use this field as a filter when retrieving profiles via the Get Profiles endpoint. + * + * @return self + */ + public function setKx($_kx) + { + + if (is_null($_kx)) { + array_push($this->openAPINullablesSetToNull, '_kx'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('_kx', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['_kx'] = $_kx; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name Individual's first name + * + * @return self + */ + public function setFirstName($first_name) + { + + if (is_null($first_name)) { + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name Individual's last name + * + * @return self + */ + public function setLastName($last_name) + { + + if (is_null($last_name)) { + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets organization + * + * @return string|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param string|null $organization Name of the company or organization within the company for whom the individual works + * + * @return self + */ + public function setOrganization($organization) + { + + if (is_null($organization)) { + array_push($this->openAPINullablesSetToNull, 'organization'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('organization', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Individual's job title + * + * @return self + */ + public function setTitle($title) + { + + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets image + * + * @return string|null + */ + public function getImage() + { + return $this->container['image']; + } + + /** + * Sets image + * + * @param string|null $image URL pointing to the location of a profile image + * + * @return self + */ + public function setImage($image) + { + + if (is_null($image)) { + array_push($this->openAPINullablesSetToNull, 'image'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('image', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['image'] = $image; + + return $this; + } + + /** + * Gets location + * + * @return \KlaviyoAPI\Model\ProfileLocation|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \KlaviyoAPI\Model\ProfileLocation|null $location location + * + * @return self + */ + public function setLocation($location) + { + + if (is_null($location)) { + throw new \InvalidArgumentException('non-nullable location cannot be null'); + } + + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets properties + * + * @return object|null + */ + public function getProperties() + { + return $this->container['properties']; + } + + /** + * Sets properties + * + * @param object|null $properties An object containing key/value pairs for any custom properties assigned to this profile + * + * @return self + */ + public function setProperties($properties) + { + + if (is_null($properties)) { + array_push($this->openAPINullablesSetToNull, 'properties'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('properties', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['properties'] = $properties; + + return $this; + } + + /** + * Gets meta + * + * @return \KlaviyoAPI\Model\ProfileMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \KlaviyoAPI\Model\ProfileMeta|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + + $this->container['meta'] = $meta; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email Individual's email address + * + * @return self + */ + public function setEmail($email) + { + + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['email'] = $email; + + 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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php b/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php index f2f380c..1c9fb16 100644 --- a/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php +++ b/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php @@ -92,9 +92,9 @@ class PushTokenCreateQueryResourceObjectAttributes implements ModelInterface, Ar protected static array $openAPINullables = [ 'token' => false, 'platform' => false, - 'enablement_status' => false, + 'enablement_status' => true, 'vendor' => false, - 'background' => false, + 'background' => true, 'device_metadata' => false, 'profile' => false ]; @@ -537,7 +537,14 @@ public function setEnablementStatus($enablement_status) } if (is_null($enablement_status)) { - throw new \InvalidArgumentException('non-nullable enablement_status cannot be null'); + array_push($this->openAPINullablesSetToNull, 'enablement_status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enablement_status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['enablement_status'] = $enablement_status; @@ -615,7 +622,14 @@ public function setBackground($background) } if (is_null($background)) { - throw new \InvalidArgumentException('non-nullable background cannot be null'); + array_push($this->openAPINullablesSetToNull, 'background'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('background', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['background'] = $background; diff --git a/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php b/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php index c76ab4c..1b95224 100644 --- a/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php +++ b/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php @@ -59,7 +59,7 @@ class PushTokenCreateQueryResourceObjectAttributesProfile implements ModelInterf * @var string[] */ protected static $openAPITypes = [ - 'data' => '\KlaviyoAPI\Model\ProfileUpsertQueryResourceObject' + 'data' => '\KlaviyoAPI\Model\PushProfileUpsertQueryResourceObject' ]; /** @@ -287,7 +287,7 @@ public function valid() /** * Gets data * - * @return \KlaviyoAPI\Model\ProfileUpsertQueryResourceObject + * @return \KlaviyoAPI\Model\PushProfileUpsertQueryResourceObject */ public function getData() { @@ -297,7 +297,7 @@ public function getData() /** * Sets data * - * @param \KlaviyoAPI\Model\ProfileUpsertQueryResourceObject $data data + * @param \KlaviyoAPI\Model\PushProfileUpsertQueryResourceObject $data data * * @return self */ diff --git a/lib/Model/RenderOptionsSubObject.php b/lib/Model/RenderOptionsSubObject.php index 135973b..3e88944 100644 --- a/lib/Model/RenderOptionsSubObject.php +++ b/lib/Model/RenderOptionsSubObject.php @@ -84,10 +84,10 @@ class RenderOptionsSubObject implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'shorten_links' => false, - 'add_org_prefix' => false, - 'add_info_link' => false, - 'add_opt_out_language' => false + 'shorten_links' => true, + 'add_org_prefix' => true, + 'add_info_link' => true, + 'add_opt_out_language' => true ]; /** @@ -322,7 +322,14 @@ public function setShortenLinks($shorten_links) { if (is_null($shorten_links)) { - throw new \InvalidArgumentException('non-nullable shorten_links cannot be null'); + array_push($this->openAPINullablesSetToNull, 'shorten_links'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shorten_links', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['shorten_links'] = $shorten_links; @@ -351,7 +358,14 @@ public function setAddOrgPrefix($add_org_prefix) { if (is_null($add_org_prefix)) { - throw new \InvalidArgumentException('non-nullable add_org_prefix cannot be null'); + array_push($this->openAPINullablesSetToNull, 'add_org_prefix'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('add_org_prefix', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['add_org_prefix'] = $add_org_prefix; @@ -380,7 +394,14 @@ public function setAddInfoLink($add_info_link) { if (is_null($add_info_link)) { - throw new \InvalidArgumentException('non-nullable add_info_link cannot be null'); + array_push($this->openAPINullablesSetToNull, 'add_info_link'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('add_info_link', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['add_info_link'] = $add_info_link; @@ -409,7 +430,14 @@ public function setAddOptOutLanguage($add_opt_out_language) { if (is_null($add_opt_out_language)) { - throw new \InvalidArgumentException('non-nullable add_opt_out_language cannot be null'); + array_push($this->openAPINullablesSetToNull, 'add_opt_out_language'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('add_opt_out_language', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['add_opt_out_language'] = $add_opt_out_language; diff --git a/lib/Model/SMSContentSubObjectCreate.php b/lib/Model/SMSContentSubObjectCreate.php index c913976..f137c26 100644 --- a/lib/Model/SMSContentSubObjectCreate.php +++ b/lib/Model/SMSContentSubObjectCreate.php @@ -78,7 +78,7 @@ class SMSContentSubObjectCreate implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'body' => false + 'body' => true ]; /** @@ -301,7 +301,14 @@ public function setBody($body) { if (is_null($body)) { - throw new \InvalidArgumentException('non-nullable body cannot be null'); + array_push($this->openAPINullablesSetToNull, 'body'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('body', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['body'] = $body; diff --git a/lib/Model/SMSSendOptionsSubObject.php b/lib/Model/SMSSendOptionsSubObject.php index b4dfd19..ed08c8f 100644 --- a/lib/Model/SMSSendOptionsSubObject.php +++ b/lib/Model/SMSSendOptionsSubObject.php @@ -78,7 +78,7 @@ class SMSSendOptionsSubObject implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ - 'use_smart_sending' => false + 'use_smart_sending' => true ]; /** @@ -301,7 +301,14 @@ public function setUseSmartSending($use_smart_sending) { if (is_null($use_smart_sending)) { - throw new \InvalidArgumentException('non-nullable use_smart_sending cannot be null'); + array_push($this->openAPINullablesSetToNull, 'use_smart_sending'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('use_smart_sending', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['use_smart_sending'] = $use_smart_sending; diff --git a/lib/Model/SMSTrackingOptionsSubObject.php b/lib/Model/SMSTrackingOptionsSubObject.php index c636932..3f14f15 100644 --- a/lib/Model/SMSTrackingOptionsSubObject.php +++ b/lib/Model/SMSTrackingOptionsSubObject.php @@ -80,8 +80,8 @@ class SMSTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'is_add_utm' => false, - 'utm_params' => false + 'is_add_utm' => true, + 'utm_params' => true ]; /** @@ -308,7 +308,14 @@ public function setIsAddUtm($is_add_utm) { if (is_null($is_add_utm)) { - throw new \InvalidArgumentException('non-nullable is_add_utm cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_add_utm'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_add_utm', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_add_utm'] = $is_add_utm; @@ -337,7 +344,14 @@ public function setUtmParams($utm_params) { if (is_null($utm_params)) { - throw new \InvalidArgumentException('non-nullable utm_params cannot be null'); + array_push($this->openAPINullablesSetToNull, 'utm_params'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('utm_params', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['utm_params'] = $utm_params; diff --git a/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php index 75061c4..2c7c1bf 100644 --- a/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php @@ -80,8 +80,8 @@ class SegmentPartialUpdateQueryResourceObjectAttributes implements ModelInterfac * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, - 'is_starred' => false + 'name' => true, + 'is_starred' => true ]; /** @@ -308,7 +308,14 @@ public function setName($name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['name'] = $name; @@ -337,7 +344,14 @@ public function setIsStarred($is_starred) { if (is_null($is_starred)) { - throw new \InvalidArgumentException('non-nullable is_starred cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_starred'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_starred', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_starred'] = $is_starred; diff --git a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php index 7902a8c..1510df7 100644 --- a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php @@ -81,7 +81,7 @@ class ServerBISSubscriptionCreateQueryResourceObjectAttributes implements ModelI */ protected static array $openAPINullables = [ 'channels' => false, - 'profile' => false + 'profile' => true ]; /** @@ -366,7 +366,14 @@ public function setProfile($profile) { if (is_null($profile)) { - throw new \InvalidArgumentException('non-nullable profile cannot be null'); + array_push($this->openAPINullablesSetToNull, 'profile'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('profile', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['profile'] = $profile; diff --git a/lib/Model/StaticScheduleOptions.php b/lib/Model/StaticScheduleOptions.php index 7d08b88..b4aca0d 100644 --- a/lib/Model/StaticScheduleOptions.php +++ b/lib/Model/StaticScheduleOptions.php @@ -83,8 +83,8 @@ class StaticScheduleOptions implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static array $openAPINullables = [ 'datetime' => false, - 'is_local' => false, - 'send_past_recipients_immediately' => false + 'is_local' => true, + 'send_past_recipients_immediately' => true ]; /** @@ -347,7 +347,14 @@ public function setIsLocal($is_local) { if (is_null($is_local)) { - throw new \InvalidArgumentException('non-nullable is_local cannot be null'); + array_push($this->openAPINullablesSetToNull, 'is_local'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_local', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['is_local'] = $is_local; @@ -376,7 +383,14 @@ public function setSendPastRecipientsImmediately($send_past_recipients_immediate { if (is_null($send_past_recipients_immediately)) { - throw new \InvalidArgumentException('non-nullable send_past_recipients_immediately cannot be null'); + array_push($this->openAPINullablesSetToNull, 'send_past_recipients_immediately'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('send_past_recipients_immediately', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['send_past_recipients_immediately'] = $send_past_recipients_immediately; diff --git a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php index 80b736f..2f12a15 100644 --- a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php @@ -80,7 +80,7 @@ class SubscriptionCreateJobCreateQueryResourceObjectAttributes implements ModelI * @var boolean[] */ protected static array $openAPINullables = [ - 'custom_source' => false, + 'custom_source' => true, 'profiles' => false ]; @@ -311,7 +311,14 @@ public function setCustomSource($custom_source) { if (is_null($custom_source)) { - throw new \InvalidArgumentException('non-nullable custom_source cannot be null'); + array_push($this->openAPINullablesSetToNull, 'custom_source'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_source', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['custom_source'] = $custom_source; diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php index 0177ab0..10783fe 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php @@ -59,7 +59,8 @@ class SuppressionCreateJobCreateQueryResourceObject implements ModelInterface, A */ protected static $openAPITypes = [ 'type' => '\KlaviyoAPI\Model\ProfileSuppressionBulkCreateJobEnum', - 'attributes' => '\KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectAttributes' + 'attributes' => '\KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectAttributes', + 'relationships' => '\KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationships' ]; /** @@ -71,7 +72,8 @@ class SuppressionCreateJobCreateQueryResourceObject implements ModelInterface, A */ protected static $openAPIFormats = [ 'type' => null, - 'attributes' => null + 'attributes' => null, + 'relationships' => null ]; /** @@ -81,7 +83,8 @@ class SuppressionCreateJobCreateQueryResourceObject implements ModelInterface, A */ protected static array $openAPINullables = [ 'type' => false, - 'attributes' => false + 'attributes' => false, + 'relationships' => false ]; /** @@ -161,7 +164,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'attributes' => 'attributes' + 'attributes' => 'attributes', + 'relationships' => 'relationships' ]; /** @@ -171,7 +175,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'attributes' => 'setAttributes' + 'attributes' => 'setAttributes', + 'relationships' => 'setRelationships' ]; /** @@ -181,7 +186,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'attributes' => 'getAttributes' + 'attributes' => 'getAttributes', + 'relationships' => 'getRelationships' ]; /** @@ -243,6 +249,7 @@ public function __construct(array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('attributes', $data ?? [], null); + $this->setIfExists('relationships', $data ?? [], null); } /** @@ -350,6 +357,35 @@ public function setAttributes($attributes) return $this; } + + /** + * Gets relationships + * + * @return \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationships|null + */ + public function getRelationships() + { + return $this->container['relationships']; + } + + /** + * Sets relationships + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationships|null $relationships relationships + * + * @return self + */ + public function setRelationships($relationships) + { + + if (is_null($relationships)) { + throw new \InvalidArgumentException('non-nullable relationships cannot be null'); + } + + $this->container['relationships'] = $relationships; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php index 70665b4..5cba281 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class SuppressionCreateJobCreateQueryResourceObjectAttributes implements ModelIn * @var boolean[] */ protected static array $openAPINullables = [ - 'profiles' => false + 'profiles' => true ]; /** @@ -265,9 +265,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['profiles'] === null) { - $invalidProperties[] = "'profiles' can't be null"; - } return $invalidProperties; } @@ -286,7 +283,7 @@ public function valid() /** * Gets profiles * - * @return \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles + * @return \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles|null */ public function getProfiles() { @@ -296,7 +293,7 @@ public function getProfiles() /** * Sets profiles * - * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles $profiles profiles + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles|null $profiles profiles * * @return self */ @@ -304,7 +301,14 @@ public function setProfiles($profiles) { if (is_null($profiles)) { - throw new \InvalidArgumentException('non-nullable profiles cannot be null'); + array_push($this->openAPINullablesSetToNull, 'profiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('profiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['profiles'] = $profiles; diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php new file mode 100644 index 0000000..a5fdbdd --- /dev/null +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php @@ -0,0 +1,438 @@ + + */ +class SuppressionCreateJobCreateQueryResourceObjectRelationships implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionCreateJobCreateQueryResourceObject_relationships'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'list' => '\KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsList', + 'segment' => '\KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'list' => null, + 'segment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'list' => false, + 'segment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'list' => 'list', + 'segment' => 'segment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'list' => 'setList', + 'segment' => 'setSegment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'list' => 'getList', + 'segment' => 'getSegment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('list', $data ?? [], null); + $this->setIfExists('segment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $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() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets list + * + * @return \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsList|null + */ + public function getList() + { + return $this->container['list']; + } + + /** + * Sets list + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsList|null $list list + * + * @return self + */ + public function setList($list) + { + + if (is_null($list)) { + throw new \InvalidArgumentException('non-nullable list cannot be null'); + } + + $this->container['list'] = $list; + + return $this; + } + + /** + * Gets segment + * + * @return \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment|null + */ + public function getSegment() + { + return $this->container['segment']; + } + + /** + * Sets segment + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment|null $segment segment + * + * @return self + */ + public function setSegment($segment) + { + + if (is_null($segment)) { + throw new \InvalidArgumentException('non-nullable segment cannot be null'); + } + + $this->container['segment'] = $segment; + + 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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php new file mode 100644 index 0000000..888f76e --- /dev/null +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php @@ -0,0 +1,405 @@ + + */ +class SuppressionCreateJobCreateQueryResourceObjectRelationshipsList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionCreateJobCreateQueryResourceObject_relationships_list'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData $data data + * + * @return self + */ + public function setData($data) + { + + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php new file mode 100644 index 0000000..85a637a --- /dev/null +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php @@ -0,0 +1,444 @@ + + */ +class SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionCreateJobCreateQueryResourceObject_relationships_list_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\ListEnum', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\ListEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\ListEnum $type type + * + * @return self + */ + public function setType($type) + { + + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Suppress all profiles in this list + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php new file mode 100644 index 0000000..47adf02 --- /dev/null +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php @@ -0,0 +1,405 @@ + + */ +class SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionCreateJobCreateQueryResourceObject_relationships_segment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData $data data + * + * @return self + */ + public function setData($data) + { + + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php new file mode 100644 index 0000000..75e711d --- /dev/null +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php @@ -0,0 +1,444 @@ + + */ +class SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionCreateJobCreateQueryResourceObject_relationships_segment_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\SegmentEnum', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\SegmentEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\SegmentEnum $type type + * + * @return self + */ + public function setType($type) + { + + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Suppress all profiles in this segment + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php index 4724528..62a4abe 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php @@ -59,7 +59,8 @@ class SuppressionDeleteJobCreateQueryResourceObject implements ModelInterface, A */ protected static $openAPITypes = [ 'type' => '\KlaviyoAPI\Model\ProfileSuppressionBulkDeleteJobEnum', - 'attributes' => '\KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectAttributes' + 'attributes' => '\KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectAttributes', + 'relationships' => '\KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationships' ]; /** @@ -71,7 +72,8 @@ class SuppressionDeleteJobCreateQueryResourceObject implements ModelInterface, A */ protected static $openAPIFormats = [ 'type' => null, - 'attributes' => null + 'attributes' => null, + 'relationships' => null ]; /** @@ -81,7 +83,8 @@ class SuppressionDeleteJobCreateQueryResourceObject implements ModelInterface, A */ protected static array $openAPINullables = [ 'type' => false, - 'attributes' => false + 'attributes' => false, + 'relationships' => false ]; /** @@ -161,7 +164,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'attributes' => 'attributes' + 'attributes' => 'attributes', + 'relationships' => 'relationships' ]; /** @@ -171,7 +175,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'attributes' => 'setAttributes' + 'attributes' => 'setAttributes', + 'relationships' => 'setRelationships' ]; /** @@ -181,7 +186,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'attributes' => 'getAttributes' + 'attributes' => 'getAttributes', + 'relationships' => 'getRelationships' ]; /** @@ -243,6 +249,7 @@ public function __construct(array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('attributes', $data ?? [], null); + $this->setIfExists('relationships', $data ?? [], null); } /** @@ -350,6 +357,35 @@ public function setAttributes($attributes) return $this; } + + /** + * Gets relationships + * + * @return \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationships|null + */ + public function getRelationships() + { + return $this->container['relationships']; + } + + /** + * Sets relationships + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationships|null $relationships relationships + * + * @return self + */ + public function setRelationships($relationships) + { + + if (is_null($relationships)) { + throw new \InvalidArgumentException('non-nullable relationships cannot be null'); + } + + $this->container['relationships'] = $relationships; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php index 9d53f95..abc6d29 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class SuppressionDeleteJobCreateQueryResourceObjectAttributes implements ModelIn * @var boolean[] */ protected static array $openAPINullables = [ - 'profiles' => false + 'profiles' => true ]; /** @@ -265,9 +265,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['profiles'] === null) { - $invalidProperties[] = "'profiles' can't be null"; - } return $invalidProperties; } @@ -286,7 +283,7 @@ public function valid() /** * Gets profiles * - * @return \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles + * @return \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles|null */ public function getProfiles() { @@ -296,7 +293,7 @@ public function getProfiles() /** * Sets profiles * - * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles $profiles profiles + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles|null $profiles profiles * * @return self */ @@ -304,7 +301,14 @@ public function setProfiles($profiles) { if (is_null($profiles)) { - throw new \InvalidArgumentException('non-nullable profiles cannot be null'); + array_push($this->openAPINullablesSetToNull, 'profiles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('profiles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['profiles'] = $profiles; diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php new file mode 100644 index 0000000..8aad6d2 --- /dev/null +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php @@ -0,0 +1,438 @@ + + */ +class SuppressionDeleteJobCreateQueryResourceObjectRelationships implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionDeleteJobCreateQueryResourceObject_relationships'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'list' => '\KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList', + 'segment' => '\KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'list' => null, + 'segment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'list' => false, + 'segment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'list' => 'list', + 'segment' => 'segment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'list' => 'setList', + 'segment' => 'setSegment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'list' => 'getList', + 'segment' => 'getSegment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('list', $data ?? [], null); + $this->setIfExists('segment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $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() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets list + * + * @return \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList|null + */ + public function getList() + { + return $this->container['list']; + } + + /** + * Sets list + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList|null $list list + * + * @return self + */ + public function setList($list) + { + + if (is_null($list)) { + throw new \InvalidArgumentException('non-nullable list cannot be null'); + } + + $this->container['list'] = $list; + + return $this; + } + + /** + * Gets segment + * + * @return \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment|null + */ + public function getSegment() + { + return $this->container['segment']; + } + + /** + * Sets segment + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment|null $segment segment + * + * @return self + */ + public function setSegment($segment) + { + + if (is_null($segment)) { + throw new \InvalidArgumentException('non-nullable segment cannot be null'); + } + + $this->container['segment'] = $segment; + + 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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php new file mode 100644 index 0000000..3b8c60d --- /dev/null +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php @@ -0,0 +1,405 @@ + + */ +class SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionDeleteJobCreateQueryResourceObject_relationships_list'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData $data data + * + * @return self + */ + public function setData($data) + { + + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php new file mode 100644 index 0000000..51298d8 --- /dev/null +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php @@ -0,0 +1,444 @@ + + */ +class SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionDeleteJobCreateQueryResourceObject_relationships_list_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\ListEnum', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\ListEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\ListEnum $type type + * + * @return self + */ + public function setType($type) + { + + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The list to pull the profiles to remove suppressions from + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php new file mode 100644 index 0000000..1864e3b --- /dev/null +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php @@ -0,0 +1,405 @@ + + */ +class SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionDeleteJobCreateQueryResourceObject_relationships_segment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData $data data + * + * @return self + */ + public function setData($data) + { + + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php new file mode 100644 index 0000000..143b5ec --- /dev/null +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php @@ -0,0 +1,444 @@ + + */ +class SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuppressionDeleteJobCreateQueryResourceObject_relationships_segment_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\SegmentEnum', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\SegmentEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\SegmentEnum $type type + * + * @return self + */ + public function setType($type) + { + + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The segment to pull the profiles to remove suppressions from + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $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|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php b/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php index ee63642..fbab898 100644 --- a/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php +++ b/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php @@ -81,7 +81,7 @@ class TagGroupCreateQueryResourceObjectAttributes implements ModelInterface, Arr */ protected static array $openAPINullables = [ 'name' => false, - 'exclusive' => false + 'exclusive' => true ]; /** @@ -340,7 +340,14 @@ public function setExclusive($exclusive) { if (is_null($exclusive)) { - throw new \InvalidArgumentException('non-nullable exclusive cannot be null'); + array_push($this->openAPINullablesSetToNull, 'exclusive'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('exclusive', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['exclusive'] = $exclusive; diff --git a/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php b/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php index 9952cc6..de584a0 100644 --- a/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php @@ -81,7 +81,7 @@ class TagGroupUpdateQueryResourceObjectAttributes implements ModelInterface, Arr */ protected static array $openAPINullables = [ 'name' => false, - 'return_fields' => false + 'return_fields' => true ]; /** @@ -340,7 +340,14 @@ public function setReturnFields($return_fields) { if (is_null($return_fields)) { - throw new \InvalidArgumentException('non-nullable return_fields cannot be null'); + array_push($this->openAPINullablesSetToNull, 'return_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('return_fields', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['return_fields'] = $return_fields; diff --git a/lib/Model/TemplateCloneQueryResourceObjectAttributes.php b/lib/Model/TemplateCloneQueryResourceObjectAttributes.php index 921c5c4..93f07ae 100644 --- a/lib/Model/TemplateCloneQueryResourceObjectAttributes.php +++ b/lib/Model/TemplateCloneQueryResourceObjectAttributes.php @@ -78,7 +78,7 @@ class TemplateCloneQueryResourceObjectAttributes implements ModelInterface, Arra * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false + 'name' => true ]; /** @@ -301,7 +301,14 @@ public function setName($name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['name'] = $name; diff --git a/lib/Model/TemplateCreateQueryResourceObjectAttributes.php b/lib/Model/TemplateCreateQueryResourceObjectAttributes.php index 86663fb..5482bc4 100644 --- a/lib/Model/TemplateCreateQueryResourceObjectAttributes.php +++ b/lib/Model/TemplateCreateQueryResourceObjectAttributes.php @@ -86,8 +86,8 @@ class TemplateCreateQueryResourceObjectAttributes implements ModelInterface, Arr protected static array $openAPINullables = [ 'name' => false, 'editor_type' => false, - 'html' => false, - 'text' => false + 'html' => true, + 'text' => true ]; /** @@ -386,7 +386,14 @@ public function setHtml($html) { if (is_null($html)) { - throw new \InvalidArgumentException('non-nullable html cannot be null'); + array_push($this->openAPINullablesSetToNull, 'html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['html'] = $html; @@ -415,7 +422,14 @@ public function setText($text) { if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); + array_push($this->openAPINullablesSetToNull, 'text'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('text', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['text'] = $text; diff --git a/lib/Model/TemplateUpdateQueryResourceObjectAttributes.php b/lib/Model/TemplateUpdateQueryResourceObjectAttributes.php index afb80cc..a2e929c 100644 --- a/lib/Model/TemplateUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/TemplateUpdateQueryResourceObjectAttributes.php @@ -82,9 +82,9 @@ class TemplateUpdateQueryResourceObjectAttributes implements ModelInterface, Arr * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, - 'html' => false, - 'text' => false + 'name' => true, + 'html' => true, + 'text' => true ]; /** @@ -315,7 +315,14 @@ public function setName($name) { if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['name'] = $name; @@ -344,7 +351,14 @@ public function setHtml($html) { if (is_null($html)) { - throw new \InvalidArgumentException('non-nullable html cannot be null'); + array_push($this->openAPINullablesSetToNull, 'html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['html'] = $html; @@ -373,7 +387,14 @@ public function setText($text) { if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); + array_push($this->openAPINullablesSetToNull, 'text'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('text', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['text'] = $text; diff --git a/lib/Subclient.php b/lib/Subclient.php index 366f3b9..00b20db 100644 --- a/lib/Subclient.php +++ b/lib/Subclient.php @@ -38,21 +38,18 @@ public function __call($name, $args) { if (in_array('page_cursor', $param_names)) { - $param = new \ReflectionParameter(array($this->api_instance, $name),'page_cursor'); - - $param_position = $param->getPosition(); + if (isset($args['page_cursor'])) { + $param_position = 'page_cursor'; + } else { + $param = new \ReflectionParameter(array($this->api_instance, $name), 'page_cursor'); - if (count($args) > $param_position) { - - $page_cursor = $args[$param_position]; - if ($page_cursor != NULL) { - $page_cursor = $this->new_page_cursor($page_cursor); - - $args[$param_position] = $page_cursor; - - } + $param_position = $param->getPosition(); + } + if (isset($args[$param_position])) { + $page_cursor = $this->new_page_cursor($args[$param_position]); + $args[$param_position] = $page_cursor; } }