From 9a7dd50a2883b7a4920675426eca30088be8cfc6 Mon Sep 17 00:00:00 2001 From: klaviyo-sdk Date: Thu, 17 Oct 2024 14:30:17 +0000 Subject: [PATCH] version 11.0.0 --- CHANGELOG.md | 4 + README.md | 2678 ++-- composer.json | 2 +- lib/API/AccountsApi.php | 42 +- lib/API/CampaignsApi.php | 3480 +++--- lib/API/CatalogsApi.php | 10226 +++++++++------- lib/API/CouponsApi.php | 2143 ++-- lib/API/DataPrivacyApi.php | 16 +- lib/API/EventsApi.php | 614 +- lib/API/FlowsApi.php | 2141 ++-- lib/API/FormsApi.php | 242 +- lib/API/ImagesApi.php | 110 +- lib/API/ListsApi.php | 1494 ++- lib/API/MetricsApi.php | 3073 ++++- lib/API/ProfilesApi.php | 5174 ++++++-- lib/API/ReportingApi.php | 1706 ++- lib/API/ReviewsApi.php | 995 ++ lib/API/SegmentsApi.php | 1580 ++- lib/API/TagsApi.php | 5646 +++++---- lib/API/TemplatesApi.php | 2800 ++++- lib/API/TrackingSettingsApi.php | 1293 ++ lib/API/WebhooksApi.php | 120 +- lib/ApiException.php | 2 +- lib/Configuration.php | 8 +- lib/HeaderSelector.php | 2 +- lib/KlaviyoAPI.php | 16 + lib/Model/APIMethodFilter.php | 2 +- lib/Model/AlltimeDateFilter.php | 2 +- lib/Model/AnniversaryDateFilter.php | 2 +- lib/Model/AnyEnum.php | 2 +- lib/Model/ApiEnum.php | 2 +- lib/Model/AudiencesSubObject.php | 2 +- lib/Model/BackInStockEnum.php | 2 +- lib/Model/BackInStockMethodFilter.php | 2 +- lib/Model/BackInStockSubscriptionEnum.php | 2 +- .../BaseEventCreateQueryResourceObject.php | 2 +- ...entCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/BlockDisplayOptions.php | 524 + lib/Model/BlockEnum.php | 60 + lib/Model/BooleanEnum.php | 2 +- lib/Model/BooleanFilter.php | 2 +- lib/Model/BounceDateEnum.php | 2 +- lib/Model/BounceDateFilter.php | 2 +- lib/Model/BounceDateFilterFilter.php | 2 +- lib/Model/BulkRemoveEnum.php | 2 +- lib/Model/BulkRemoveMethodFilter.php | 2 +- lib/Model/CalendarDateFilter.php | 2 +- lib/Model/CampaignCloneQuery.php | 2 +- .../CampaignCloneQueryResourceObject.php | 2 +- ...aignCloneQueryResourceObjectAttributes.php | 2 +- lib/Model/CampaignCreateQuery.php | 2 +- .../CampaignCreateQueryResourceObject.php | 2 +- ...ignCreateQueryResourceObjectAttributes.php | 2 +- ...sourceObjectAttributesCampaignMessages.php | 2 +- ...eryResourceObjectAttributesSendOptions.php | 2 +- ...esourceObjectAttributesTrackingOptions.php | 72 +- lib/Model/CampaignEnum.php | 2 +- .../CampaignMessageAssignTemplateQuery.php | 2 +- ...ssageAssignTemplateQueryResourceObject.php | 2 +- ...mplateQueryResourceObjectRelationships.php | 2 +- ...eryResourceObjectRelationshipsTemplate.php | 2 +- ...esourceObjectRelationshipsTemplateData.php | 2 +- ...mpaignMessageCreateQueryResourceObject.php | 2 +- ...ageCreateQueryResourceObjectAttributes.php | 2 +- ...teQueryResourceObjectAttributesContent.php | 2 +- lib/Model/CampaignMessageEnum.php | 2 +- .../CampaignMessagePartialUpdateQuery.php | 2 +- ...essagePartialUpdateQueryResourceObject.php | 2 +- ...ialUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/CampaignPartialUpdateQuery.php | 2 +- ...mpaignPartialUpdateQueryResourceObject.php | 2 +- ...ialUpdateQueryResourceObjectAttributes.php | 2 +- ...paignRecipientEstimationJobCreateQuery.php | 2 +- ...EstimationJobCreateQueryResourceObject.php | 2 +- .../CampaignRecipientEstimationJobEnum.php | 2 +- lib/Model/CampaignSendJobCreateQuery.php | 2 +- ...mpaignSendJobCreateQueryResourceObject.php | 2 +- lib/Model/CampaignSendJobEnum.php | 2 +- .../CampaignSendJobPartialUpdateQuery.php | 2 +- ...endJobPartialUpdateQueryResourceObject.php | 2 +- ...ialUpdateQueryResourceObjectAttributes.php | 2 +- .../CampaignTrackingSettingDynamicParam.php | 498 + .../CampaignTrackingSettingStaticParam.php | 444 + lib/Model/CampaignValuesReportEnum.php | 2 +- lib/Model/CampaignValuesRequestDTO.php | 2 +- ...CampaignValuesRequestDTOResourceObject.php | 2 +- ...luesRequestDTOResourceObjectAttributes.php | 2 +- ...stDTOResourceObjectAttributesTimeframe.php | 2 +- lib/Model/CarrierDeactivationEnum.php | 2 +- lib/Model/CarrierDeactivationMethodFilter.php | 2 +- .../CatalogCategoryBulkCreateJobEnum.php | 2 +- .../CatalogCategoryBulkDeleteJobEnum.php | 2 +- .../CatalogCategoryBulkUpdateJobEnum.php | 2 +- .../CatalogCategoryCreateJobCreateQuery.php | 2 +- ...goryCreateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...ueryResourceObjectAttributesCategories.php | 2 +- lib/Model/CatalogCategoryCreateQuery.php | 2 +- ...talogCategoryCreateQueryResourceObject.php | 2 +- ...oryCreateQueryResourceObjectAttributes.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...eQueryResourceObjectRelationshipsItems.php | 2 +- ...ourceObjectRelationshipsItemsDataInner.php | 2 +- .../CatalogCategoryDeleteJobCreateQuery.php | 2 +- ...goryDeleteJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...ueryResourceObjectAttributesCategories.php | 2 +- ...talogCategoryDeleteQueryResourceObject.php | 2 +- lib/Model/CatalogCategoryEnum.php | 2 +- lib/Model/CatalogCategoryItemOp.php | 2 +- .../CatalogCategoryUpdateJobCreateQuery.php | 2 +- ...goryUpdateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...ueryResourceObjectAttributesCategories.php | 2 +- lib/Model/CatalogCategoryUpdateQuery.php | 2 +- ...talogCategoryUpdateQueryResourceObject.php | 2 +- ...oryUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/CatalogItemBulkCreateJobEnum.php | 2 +- lib/Model/CatalogItemBulkDeleteJobEnum.php | 2 +- lib/Model/CatalogItemBulkUpdateJobEnum.php | 2 +- lib/Model/CatalogItemCategoryOp.php | 2 +- lib/Model/CatalogItemCreateJobCreateQuery.php | 2 +- ...ItemCreateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eateQueryResourceObjectAttributesItems.php | 2 +- lib/Model/CatalogItemCreateQuery.php | 2 +- .../CatalogItemCreateQueryResourceObject.php | 2 +- ...temCreateQueryResourceObjectAttributes.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...yResourceObjectRelationshipsCategories.php | 2 +- ...ObjectRelationshipsCategoriesDataInner.php | 2 +- lib/Model/CatalogItemDeleteJobCreateQuery.php | 2 +- ...ItemDeleteJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eateQueryResourceObjectAttributesItems.php | 2 +- .../CatalogItemDeleteQueryResourceObject.php | 2 +- lib/Model/CatalogItemEnum.php | 2 +- lib/Model/CatalogItemUpdateJobCreateQuery.php | 2 +- ...ItemUpdateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eateQueryResourceObjectAttributesItems.php | 2 +- lib/Model/CatalogItemUpdateQuery.php | 2 +- .../CatalogItemUpdateQueryResourceObject.php | 2 +- ...temUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/CatalogVariantBulkCreateJobEnum.php | 2 +- lib/Model/CatalogVariantBulkDeleteJobEnum.php | 2 +- lib/Model/CatalogVariantBulkUpdateJobEnum.php | 2 +- .../CatalogVariantCreateJobCreateQuery.php | 2 +- ...iantCreateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesVariants.php | 2 +- lib/Model/CatalogVariantCreateQuery.php | 2 +- ...atalogVariantCreateQueryResourceObject.php | 2 +- ...antCreateQueryResourceObjectAttributes.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...teQueryResourceObjectRelationshipsItem.php | 2 +- ...eryResourceObjectRelationshipsItemData.php | 2 +- .../CatalogVariantDeleteJobCreateQuery.php | 2 +- ...iantDeleteJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesVariants.php | 2 +- ...atalogVariantDeleteQueryResourceObject.php | 2 +- lib/Model/CatalogVariantEnum.php | 2 +- .../CatalogVariantUpdateJobCreateQuery.php | 2 +- ...iantUpdateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesVariants.php | 2 +- lib/Model/CatalogVariantUpdateQuery.php | 2 +- ...atalogVariantUpdateQueryResourceObject.php | 2 +- ...antUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/CheckoutEnum.php | 2 +- lib/Model/CheckoutMethodFilter.php | 2 +- lib/Model/ConditionGroup.php | 2 +- lib/Model/ConditionGroupConditionsInner.php | 2 +- lib/Model/ConstantContactEnum.php | 2 +- .../ConstantContactIntegrationFilter.php | 2 +- ...ConstantContactIntegrationMethodFilter.php | 2 +- lib/Model/ContentRepeat.php | 444 + lib/Model/CouponCodeBulkCreateJobEnum.php | 2 +- lib/Model/CouponCodeCreateJobCreateQuery.php | 2 +- ...CodeCreateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eryResourceObjectAttributesCouponCodes.php | 2 +- lib/Model/CouponCodeCreateQuery.php | 2 +- .../CouponCodeCreateQueryResourceObject.php | 2 +- ...odeCreateQueryResourceObjectAttributes.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...QueryResourceObjectRelationshipsCoupon.php | 2 +- ...yResourceObjectRelationshipsCouponData.php | 2 +- lib/Model/CouponCodeEnum.php | 2 +- lib/Model/CouponCodeUpdateQuery.php | 2 +- .../CouponCodeUpdateQueryResourceObject.php | 2 +- ...odeUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/CouponCreateQuery.php | 2 +- lib/Model/CouponCreateQueryResourceObject.php | 2 +- ...ponCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/CouponEnum.php | 2 +- lib/Model/CouponUpdateQuery.php | 2 +- lib/Model/CouponUpdateQueryResourceObject.php | 2 +- ...ponUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/CustomSourceEnum.php | 2 +- lib/Model/CustomSourceFilter.php | 2 +- lib/Model/CustomTimeframe.php | 2 +- lib/Model/CustomTrackingParamDTO.php | 491 + .../DataPrivacyCreateDeletionJobQuery.php | 2 +- ...cyCreateDeletionJobQueryResourceObject.php | 2 +- ...letionJobQueryResourceObjectAttributes.php | 2 +- ...obQueryResourceObjectAttributesProfile.php | 2 +- lib/Model/DataPrivacyDeletionJobEnum.php | 2 +- .../DataPrivacyProfileQueryResourceObject.php | 2 +- ...cyProfileQueryResourceObjectAttributes.php | 2 +- lib/Model/DateEnum.php | 2 +- lib/Model/DeviceMetadata.php | 4 +- lib/Model/DoubleOptinFilter.php | 2 +- lib/Model/DynamicEnum.php | 60 + lib/Model/DynamicTrackingParam.php | 537 + lib/Model/EmailContentSubObject.php | 2 +- lib/Model/EmailEnum.php | 2 +- lib/Model/EmailSendOptionsSubObject.php | 2 +- lib/Model/EmailSubscriptionParameters.php | 8 +- lib/Model/EmailTrackingOptionsSubObject.php | 72 +- ...ionsSubObjectCustomTrackingParamsInner.php | 483 + lib/Model/EqualsEnum.php | 2 +- lib/Model/EqualsStringFilter.php | 2 +- lib/Model/EventBulkCreateEnum.php | 2 +- lib/Model/EventBulkCreateJobEnum.php | 2 +- lib/Model/EventCreateQueryV2.php | 2 +- .../EventCreateQueryV2ResourceObject.php | 2 +- ...tCreateQueryV2ResourceObjectAttributes.php | 2 +- ...eQueryV2ResourceObjectAttributesMetric.php | 2 +- ...QueryV2ResourceObjectAttributesProfile.php | 2 +- lib/Model/EventEnum.php | 2 +- .../EventProfileCreateQueryResourceObject.php | 2 +- ...ileCreateQueryResourceObjectAttributes.php | 45 +- lib/Model/EventsBulkCreateJob.php | 2 +- .../EventsBulkCreateJobResourceObject.php | 2 +- ...sBulkCreateJobResourceObjectAttributes.php | 2 +- ...sourceObjectAttributesEventsBulkCreate.php | 2 +- .../EventsBulkCreateQueryResourceObject.php | 2 +- ...ulkCreateQueryResourceObjectAttributes.php | 2 +- ...ateQueryResourceObjectAttributesEvents.php | 2 +- ...teQueryResourceObjectAttributesProfile.php | 2 +- lib/Model/ExistenceEnum.php | 2 +- lib/Model/ExistenceOperatorFilter.php | 2 +- lib/Model/FailedAgeGateEnum.php | 2 +- lib/Model/FailedAgeGateMethodFilter.php | 2 +- lib/Model/FlowEnum.php | 2 +- lib/Model/FlowSeriesReportEnum.php | 2 +- lib/Model/FlowSeriesRequestDTO.php | 2 +- .../FlowSeriesRequestDTOResourceObject.php | 2 +- ...riesRequestDTOResourceObjectAttributes.php | 2 +- lib/Model/FlowTrackingSettingDynamicParam.php | 492 + ...php => FlowTrackingSettingStaticParam.php} | 50 +- lib/Model/FlowUpdateQuery.php | 2 +- lib/Model/FlowUpdateQueryResourceObject.php | 2 +- ...lowUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/FlowValuesReportEnum.php | 2 +- lib/Model/FlowValuesRequestDTO.php | 2 +- .../FlowValuesRequestDTOResourceObject.php | 2 +- ...luesRequestDTOResourceObjectAttributes.php | 2 +- lib/Model/FormEnum.php | 2 +- lib/Model/FormMethodFilter.php | 2 +- lib/Model/FormSeriesReportEnum.php | 60 + lib/Model/FormSeriesRequestDTO.php | 405 + .../FormSeriesRequestDTOResourceObject.php | 444 + ...riesRequestDTOResourceObjectAttributes.php | 675 + lib/Model/FormValuesReportEnum.php | 60 + lib/Model/FormValuesRequestDTO.php | 405 + .../FormValuesRequestDTOResourceObject.php | 444 + ...luesRequestDTOResourceObjectAttributes.php | 598 + lib/Model/GetAccounts400Response.php | 2 +- .../GetAccounts400ResponseErrorsInner.php | 2 +- ...etAccounts400ResponseErrorsInnerSource.php | 2 +- lib/Model/GreaterThanEnum.php | 2 +- lib/Model/HTMLBlock.php | 483 + lib/Model/HTMLBlockData.php | 487 + lib/Model/HasEmailMarketing.php | 2 +- lib/Model/HasEmailMarketingConsent.php | 2 +- .../HasEmailMarketingConsentConsentStatus.php | 2 +- .../HasEmailMarketingNeverSubscribed.php | 2 +- lib/Model/HasEmailMarketingSubscribed.php | 2 +- ...asEmailMarketingSubscribedFiltersInner.php | 2 +- lib/Model/HasPushMarketing.php | 2 +- lib/Model/HasPushMarketingConsent.php | 2 +- lib/Model/HasSMSMarketingConsent.php | 2 +- lib/Model/HasSMSMarketingSubscribed.php | 2 +- .../HasSMSMarketingSubscribedFiltersInner.php | 2 +- lib/Model/HtmlEnum.php | 60 + lib/Model/ImageCreateQuery.php | 2 +- lib/Model/ImageCreateQueryResourceObject.php | 2 +- ...ageCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/ImageEnum.php | 2 +- lib/Model/ImagePartialUpdateQuery.php | 2 +- .../ImagePartialUpdateQueryResourceObject.php | 2 +- ...ialUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/InEnum.php | 2 +- lib/Model/InStringArrayFilter.php | 2 +- lib/Model/InboundMessageEnum.php | 2 +- lib/Model/InboundMessageMethodFilter.php | 2 +- lib/Model/IntegrationEnum.php | 2 +- lib/Model/InvalidEmailDateEnum.php | 2 +- lib/Model/InvalidEmailDateFilter.php | 2 +- lib/Model/IsDoubleOptInEnum.php | 2 +- lib/Model/IsSetEnum.php | 2 +- lib/Model/IsSetExistenceFilter.php | 2 +- lib/Model/LessThanEnum.php | 2 +- lib/Model/ListContainsOperatorFilter.php | 2 +- lib/Model/ListContainsOperatorFilterValue.php | 2 +- lib/Model/ListCreateQuery.php | 2 +- lib/Model/ListCreateQueryResourceObject.php | 2 +- ...istCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/ListEnum.php | 2 +- lib/Model/ListLengthFilter.php | 2 +- lib/Model/ListMembersAddQuery.php | 2 +- lib/Model/ListMembersAddQueryDataInner.php | 2 +- lib/Model/ListMembersDeleteQuery.php | 2 +- lib/Model/ListPartialUpdateQuery.php | 2 +- .../ListPartialUpdateQueryResourceObject.php | 2 +- lib/Model/ListSetFilter.php | 8 +- lib/Model/ListSubstringFilter.php | 524 + lib/Model/MailboxProviderEnum.php | 2 +- lib/Model/MailboxProviderMethodFilter.php | 2 +- lib/Model/ManualAddEnum.php | 2 +- lib/Model/ManualAddMethodFilter.php | 2 +- lib/Model/ManualImportEnum.php | 2 +- lib/Model/ManualImportMethodFilter.php | 2 +- lib/Model/ManualRemoveEnum.php | 2 +- lib/Model/ManualRemoveMethodFilter.php | 2 +- lib/Model/ManualSuppressionDateEnum.php | 2 +- lib/Model/ManualSuppressionDateFilter.php | 2 +- lib/Model/MessageBlockedEnum.php | 2 +- lib/Model/MessageBlockedMethodFilter.php | 2 +- lib/Model/MethodEnum.php | 2 +- lib/Model/MetricAggregateEnum.php | 2 +- lib/Model/MetricAggregateQuery.php | 2 +- .../MetricAggregateQueryResourceObject.php | 2 +- ...AggregateQueryResourceObjectAttributes.php | 2 +- lib/Model/MetricCreateQueryResourceObject.php | 2 +- ...ricCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/MetricEnum.php | 2 +- lib/Model/ModelInterface.php | 2 +- lib/Model/NeverSubscribedEnum.php | 2 +- lib/Model/NoEmailMarketing.php | 2 +- lib/Model/NoEmailMarketingConsent.php | 2 +- .../NoEmailMarketingConsentConsentStatus.php | 2 +- lib/Model/NoEmailMarketingFiltersInner.php | 2 +- lib/Model/NoEmailMarketingNeverSubscribed.php | 2 +- lib/Model/NoEmailMarketingSubscribed.php | 2 +- lib/Model/NoEmailMarketingUnsubscribed.php | 2 +- .../NoEmailMarketingUnsubscribedFilters.php | 2 +- ...MarketingUnsubscribedFiltersOneOfInner.php | 2 +- lib/Model/NoPushMarketing.php | 2 +- lib/Model/NoPushMarketingConsent.php | 2 +- lib/Model/NoSMSMarketing.php | 2 +- lib/Model/NoSMSMarketingConsent.php | 2 +- .../NoSMSMarketingConsentConsentStatus.php | 2 +- lib/Model/NoSMSMarketingNeverSubscribed.php | 2 +- lib/Model/NoSMSMarketingUnsubscribed.php | 2 +- ...NoSMSMarketingUnsubscribedFiltersInner.php | 2 +- lib/Model/NotEqualsEnum.php | 2 +- lib/Model/NumericEnum.php | 2 +- lib/Model/NumericOperatorFilter.php | 2 +- lib/Model/NumericOperatorFilterValue.php | 2 +- ...OnsiteProfileCreateQueryResourceObject.php | 2 +- ...ileCreateQueryResourceObjectAttributes.php | 45 +- lib/Model/OnsiteProfileMeta.php | 2 +- lib/Model/PreferencePageEnum.php | 2 +- lib/Model/PreferencePageFilter.php | 2 +- lib/Model/PreferencePageMethodFilter.php | 2 +- lib/Model/ProfileBulkImportJobEnum.php | 2 +- lib/Model/ProfileCreateQuery.php | 2 +- .../ProfileCreateQueryResourceObject.php | 2 +- ...ileCreateQueryResourceObjectAttributes.php | 45 +- lib/Model/ProfileEnum.php | 2 +- lib/Model/ProfileGroupMembershipEnum.php | 2 +- .../ProfileHasGroupMembershipCondition.php | 2 +- ...roupMembershipConditionTimeframeFilter.php | 2 +- .../ProfileIdentifierDTOResourceObject.php | 2 +- ...eIdentifierDTOResourceObjectAttributes.php | 2 +- lib/Model/ProfileImportJobCreateQuery.php | 2 +- ...fileImportJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesProfiles.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...eQueryResourceObjectRelationshipsLists.php | 2 +- ...ourceObjectRelationshipsListsDataInner.php | 2 +- lib/Model/ProfileLocation.php | 2 +- lib/Model/ProfileLocationLatitude.php | 2 +- lib/Model/ProfileLocationLongitude.php | 2 +- .../ProfileMarketingConsentCondition.php | 2 +- ...rofileMarketingConsentConditionConsent.php | 2 +- lib/Model/ProfileMarketingConsentEnum.php | 2 +- lib/Model/ProfileMergeEnum.php | 2 +- lib/Model/ProfileMergeQuery.php | 2 +- lib/Model/ProfileMergeQueryResourceObject.php | 2 +- ...eMergeQueryResourceObjectRelationships.php | 2 +- ...eryResourceObjectRelationshipsProfiles.php | 2 +- ...ceObjectRelationshipsProfilesDataInner.php | 2 +- lib/Model/ProfileMeta.php | 2 +- lib/Model/ProfileMetaPatchProperties.php | 2 +- lib/Model/ProfileMetaPatchPropertiesUnset.php | 2 +- lib/Model/ProfileMetricCondition.php | 2 +- .../ProfileMetricConditionTimeframeFilter.php | 2 +- lib/Model/ProfileMetricEnum.php | 2 +- lib/Model/ProfileMetricPropertyFilter.php | 2 +- .../ProfileMetricPropertyFilterFilter.php | 30 +- .../ProfileNoGroupMembershipCondition.php | 2 +- lib/Model/ProfilePartialUpdateQuery.php | 2 +- ...rofilePartialUpdateQueryResourceObject.php | 2 +- ...ialUpdateQueryResourceObjectAttributes.php | 45 +- .../ProfilePostalCodeDistanceCondition.php | 2 +- lib/Model/ProfilePostalCodeDistanceEnum.php | 2 +- lib/Model/ProfilePredictiveAnalyticsEnum.php | 2 +- ...ilePredictiveAnalyticsNumericCondition.php | 2 +- ...filePredictiveAnalyticsStringCondition.php | 2 +- ...ProfilePredictiveAnalyticsStringFilter.php | 2 +- ...redictiveAnalyticsStringFilterOperator.php | 2 +- lib/Model/ProfilePropertyCondition.php | 2 +- lib/Model/ProfilePropertyConditionFilter.php | 2 +- lib/Model/ProfilePropertyEnum.php | 2 +- lib/Model/ProfileRegionCondition.php | 2 +- lib/Model/ProfileRegionEnum.php | 2 +- .../ProfileSubscriptionBulkCreateJobEnum.php | 2 +- .../ProfileSubscriptionBulkDeleteJobEnum.php | 2 +- ...eSubscriptionCreateQueryResourceObject.php | 2 +- ...ionCreateQueryResourceObjectAttributes.php | 2 +- ...eSubscriptionDeleteQueryResourceObject.php | 2 +- ...ionDeleteQueryResourceObjectAttributes.php | 2 +- .../ProfileSuppressionBulkCreateJobEnum.php | 2 +- .../ProfileSuppressionBulkDeleteJobEnum.php | 2 +- ...leSuppressionCreateQueryResourceObject.php | 2 +- ...ionCreateQueryResourceObjectAttributes.php | 2 +- ...leSuppressionDeleteQueryResourceObject.php | 2 +- ...ionDeleteQueryResourceObjectAttributes.php | 2 +- lib/Model/ProfileUpsertQuery.php | 2 +- .../ProfileUpsertQueryResourceObject.php | 2 +- ...ileUpsertQueryResourceObjectAttributes.php | 45 +- lib/Model/ProvidedLandlineEnum.php | 2 +- lib/Model/ProvidedLandlineMethodFilter.php | 2 +- lib/Model/ProvidedNoAgeEnum.php | 2 +- lib/Model/ProvidedNoAgeMethodFilter.php | 2 +- lib/Model/PushEnum.php | 2 +- .../PushProfileUpsertQueryResourceObject.php | 2 +- ...ileUpsertQueryResourceObjectAttributes.php | 45 +- lib/Model/PushTokenCreateQuery.php | 2 +- .../PushTokenCreateQueryResourceObject.php | 2 +- ...kenCreateQueryResourceObjectAttributes.php | 2 +- ...teQueryResourceObjectAttributesProfile.php | 2 +- lib/Model/PushTokenEnum.php | 2 +- lib/Model/RelativeAnniversaryDateFilter.php | 2 +- lib/Model/RelativeDateOperatorBaseFilter.php | 2 +- lib/Model/RelativeDateRangeFilter.php | 2 +- lib/Model/RenderOptionsSubObject.php | 2 +- lib/Model/SMSContentSubObjectCreate.php | 2 +- lib/Model/SMSSendOptionsSubObject.php | 2 +- lib/Model/SMSSubscriptionParameters.php | 11 +- lib/Model/SMSTrackingOptionsSubObject.php | 72 +- lib/Model/STOScheduleOptions.php | 2 +- lib/Model/SegmentCreateQuery.php | 2 +- .../SegmentCreateQueryResourceObject.php | 2 +- ...entCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/SegmentDefinition.php | 2 +- lib/Model/SegmentEnum.php | 2 +- lib/Model/SegmentPartialUpdateQuery.php | 2 +- ...egmentPartialUpdateQueryResourceObject.php | 2 +- ...ialUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/SegmentSeriesReportEnum.php | 60 + lib/Model/SegmentSeriesRequestDTO.php | 405 + .../SegmentSeriesRequestDTOResourceObject.php | 444 + ...riesRequestDTOResourceObjectAttributes.php | 592 + lib/Model/SegmentValuesReportEnum.php | 60 + lib/Model/SegmentValuesRequestDTO.php | 405 + .../SegmentValuesRequestDTOResourceObject.php | 444 + ...luesRequestDTOResourceObjectAttributes.php | 515 + ...stDTOResourceObjectAttributesTimeframe.php | 542 + lib/Model/SendStrategySubObject.php | 2 +- .../ServerBISSubscriptionCreateQuery.php | 2 +- ...SSubscriptionCreateQueryResourceObject.php | 2 +- ...ionCreateQueryResourceObjectAttributes.php | 2 +- ...teQueryResourceObjectAttributesProfile.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...ueryResourceObjectRelationshipsVariant.php | 2 +- ...ResourceObjectRelationshipsVariantData.php | 2 +- lib/Model/SftpEnum.php | 2 +- lib/Model/SftpMethodFilter.php | 2 +- lib/Model/ShopifyEnum.php | 2 +- lib/Model/ShopifyIntegrationFilter.php | 2 +- lib/Model/ShopifyIntegrationMethodFilter.php | 2 +- lib/Model/SmsEnum.php | 2 +- lib/Model/SpamComplaintEnum.php | 2 +- lib/Model/SpamComplaintMethodFilter.php | 2 +- lib/Model/StaticDateFilter.php | 2 +- lib/Model/StaticDateRangeFilter.php | 2 +- lib/Model/StaticEnum.php | 60 + lib/Model/StaticScheduleOptions.php | 2 +- lib/Model/StaticTrackingParam.php | 483 + lib/Model/StatusDateEnum.php | 2 +- lib/Model/StatusDateFilter.php | 2 +- lib/Model/StatusDateFilterFilter.php | 2 +- lib/Model/StringArrayOperatorFilter.php | 2 +- lib/Model/StringEnum.php | 2 +- lib/Model/StringOperatorFilter.php | 2 +- lib/Model/StringPhoneOperatorArrayFilter.php | 2 +- lib/Model/SubscribedEnum.php | 2 +- lib/Model/SubscriptionChannels.php | 2 +- .../SubscriptionCreateJobCreateQuery.php | 2 +- ...tionCreateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesProfiles.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...teQueryResourceObjectRelationshipsList.php | 2 +- ...eryResourceObjectRelationshipsListData.php | 2 +- .../SubscriptionDeleteJobCreateQuery.php | 2 +- ...tionDeleteJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesProfiles.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...teQueryResourceObjectRelationshipsList.php | 2 +- ...eryResourceObjectRelationshipsListData.php | 2 +- ...ameters.php => SubscriptionParameters.php} | 12 +- lib/Model/SuppressionCreateJobCreateQuery.php | 2 +- ...sionCreateJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesProfiles.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...teQueryResourceObjectRelationshipsList.php | 2 +- ...eryResourceObjectRelationshipsListData.php | 2 +- ...ueryResourceObjectRelationshipsSegment.php | 2 +- ...ResourceObjectRelationshipsSegmentData.php | 2 +- lib/Model/SuppressionDeleteJobCreateQuery.php | 2 +- ...sionDeleteJobCreateQueryResourceObject.php | 2 +- ...JobCreateQueryResourceObjectAttributes.php | 2 +- ...eQueryResourceObjectAttributesProfiles.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...teQueryResourceObjectRelationshipsList.php | 2 +- ...eryResourceObjectRelationshipsListData.php | 2 +- ...ueryResourceObjectRelationshipsSegment.php | 2 +- ...ResourceObjectRelationshipsSegmentData.php | 2 +- lib/Model/TagCampaignOp.php | 2 +- lib/Model/TagCampaignOpDataInner.php | 2 +- lib/Model/TagCreateQuery.php | 2 +- lib/Model/TagCreateQueryResourceObject.php | 2 +- ...TagCreateQueryResourceObjectAttributes.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...eryResourceObjectRelationshipsTagGroup.php | 2 +- ...esourceObjectRelationshipsTagGroupData.php | 2 +- lib/Model/TagEnum.php | 2 +- lib/Model/TagFlowOp.php | 2 +- lib/Model/TagFlowOpDataInner.php | 2 +- lib/Model/TagGroupCreateQuery.php | 2 +- .../TagGroupCreateQueryResourceObject.php | 2 +- ...oupCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/TagGroupEnum.php | 2 +- lib/Model/TagGroupUpdateQuery.php | 2 +- .../TagGroupUpdateQueryResourceObject.php | 2 +- ...oupUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/TagListOp.php | 2 +- lib/Model/TagListOpDataInner.php | 2 +- lib/Model/TagSegmentOp.php | 2 +- lib/Model/TagSegmentOpDataInner.php | 2 +- lib/Model/TagUpdateQuery.php | 2 +- lib/Model/TagUpdateQueryResourceObject.php | 2 +- lib/Model/TemplateCloneQuery.php | 2 +- .../TemplateCloneQueryResourceObject.php | 2 +- ...lateCloneQueryResourceObjectAttributes.php | 2 +- lib/Model/TemplateCreateQuery.php | 2 +- .../TemplateCreateQueryResourceObject.php | 2 +- ...ateCreateQueryResourceObjectAttributes.php | 2 +- lib/Model/TemplateEnum.php | 2 +- lib/Model/TemplateRenderQuery.php | 2 +- .../TemplateRenderQueryResourceObject.php | 2 +- ...ateRenderQueryResourceObjectAttributes.php | 2 +- lib/Model/TemplateUniversalContentEnum.php | 60 + lib/Model/TemplateUpdateQuery.php | 2 +- .../TemplateUpdateQueryResourceObject.php | 2 +- ...ateUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/TextBlock.php | 483 + lib/Model/TextBlockData.php | 483 + lib/Model/TextBlockStyles.php | 1595 +++ lib/Model/TextEnum.php | 60 + lib/Model/ThrottledScheduleOptions.php | 2 +- lib/Model/Timeframe.php | 2 +- lib/Model/TrackingParamDTO.php | 452 + lib/Model/TrackingParamDTOCampaign.php | 445 + lib/Model/TrackingParamDTOFlow.php | 445 + lib/Model/TrackingSettingEnum.php | 60 + .../TrackingSettingPartialUpdateQuery.php | 405 + ...ettingPartialUpdateQueryResourceObject.php | 483 + ...ialUpdateQueryResourceObjectAttributes.php | 632 + lib/Model/UnionPositiveNumericFilter.php | 2 +- .../UnionPositiveNumericFilterOperator.php | 2 +- lib/Model/UniversalContentCreateQuery.php | 405 + ...versalContentCreateQueryResourceObject.php | 444 + ...entCreateQueryResourceObjectAttributes.php | 444 + ...ueryResourceObjectAttributesDefinition.php | 483 + .../UniversalContentPartialUpdateQuery.php | 405 + ...ontentPartialUpdateQueryResourceObject.php | 483 + ...ialUpdateQueryResourceObjectAttributes.php | 452 + ...ueryResourceObjectAttributesDefinition.php | 483 + lib/Model/UnsubscribedEnum.php | 2 +- lib/Model/WebhookCreateQuery.php | 2 +- .../WebhookCreateQueryResourceObject.php | 2 +- ...ookCreateQueryResourceObjectAttributes.php | 2 +- ...CreateQueryResourceObjectRelationships.php | 2 +- ...sourceObjectRelationshipsWebhookTopics.php | 2 +- ...ectRelationshipsWebhookTopicsDataInner.php | 2 +- lib/Model/WebhookEnum.php | 2 +- lib/Model/WebhookPartialUpdateQuery.php | 2 +- ...ebhookPartialUpdateQueryResourceObject.php | 2 +- ...ialUpdateQueryResourceObjectAttributes.php | 2 +- lib/Model/WebhookTopicEnum.php | 2 +- lib/ObjectSerializer.php | 2 +- 612 files changed, 54391 insertions(+), 14749 deletions(-) create mode 100644 lib/API/ReviewsApi.php create mode 100644 lib/API/TrackingSettingsApi.php create mode 100644 lib/Model/BlockDisplayOptions.php create mode 100644 lib/Model/BlockEnum.php create mode 100644 lib/Model/CampaignTrackingSettingDynamicParam.php create mode 100644 lib/Model/CampaignTrackingSettingStaticParam.php create mode 100644 lib/Model/ContentRepeat.php create mode 100644 lib/Model/CustomTrackingParamDTO.php create mode 100644 lib/Model/DynamicEnum.php create mode 100644 lib/Model/DynamicTrackingParam.php create mode 100644 lib/Model/EmailTrackingOptionsSubObjectCustomTrackingParamsInner.php create mode 100644 lib/Model/FlowTrackingSettingDynamicParam.php rename lib/Model/{UTMParamsSubObject.php => FlowTrackingSettingStaticParam.php} (89%) create mode 100644 lib/Model/FormSeriesReportEnum.php create mode 100644 lib/Model/FormSeriesRequestDTO.php create mode 100644 lib/Model/FormSeriesRequestDTOResourceObject.php create mode 100644 lib/Model/FormSeriesRequestDTOResourceObjectAttributes.php create mode 100644 lib/Model/FormValuesReportEnum.php create mode 100644 lib/Model/FormValuesRequestDTO.php create mode 100644 lib/Model/FormValuesRequestDTOResourceObject.php create mode 100644 lib/Model/FormValuesRequestDTOResourceObjectAttributes.php create mode 100644 lib/Model/HTMLBlock.php create mode 100644 lib/Model/HTMLBlockData.php create mode 100644 lib/Model/HtmlEnum.php create mode 100644 lib/Model/ListSubstringFilter.php create mode 100644 lib/Model/SegmentSeriesReportEnum.php create mode 100644 lib/Model/SegmentSeriesRequestDTO.php create mode 100644 lib/Model/SegmentSeriesRequestDTOResourceObject.php create mode 100644 lib/Model/SegmentSeriesRequestDTOResourceObjectAttributes.php create mode 100644 lib/Model/SegmentValuesReportEnum.php create mode 100644 lib/Model/SegmentValuesRequestDTO.php create mode 100644 lib/Model/SegmentValuesRequestDTOResourceObject.php create mode 100644 lib/Model/SegmentValuesRequestDTOResourceObjectAttributes.php create mode 100644 lib/Model/SegmentValuesRequestDTOResourceObjectAttributesTimeframe.php create mode 100644 lib/Model/StaticEnum.php create mode 100644 lib/Model/StaticTrackingParam.php rename lib/Model/{MarketingSubscriptionParameters.php => SubscriptionParameters.php} (96%) create mode 100644 lib/Model/TemplateUniversalContentEnum.php create mode 100644 lib/Model/TextBlock.php create mode 100644 lib/Model/TextBlockData.php create mode 100644 lib/Model/TextBlockStyles.php create mode 100644 lib/Model/TextEnum.php create mode 100644 lib/Model/TrackingParamDTO.php create mode 100644 lib/Model/TrackingParamDTOCampaign.php create mode 100644 lib/Model/TrackingParamDTOFlow.php create mode 100644 lib/Model/TrackingSettingEnum.php create mode 100644 lib/Model/TrackingSettingPartialUpdateQuery.php create mode 100644 lib/Model/TrackingSettingPartialUpdateQueryResourceObject.php create mode 100644 lib/Model/TrackingSettingPartialUpdateQueryResourceObjectAttributes.php create mode 100644 lib/Model/UniversalContentCreateQuery.php create mode 100644 lib/Model/UniversalContentCreateQueryResourceObject.php create mode 100644 lib/Model/UniversalContentCreateQueryResourceObjectAttributes.php create mode 100644 lib/Model/UniversalContentCreateQueryResourceObjectAttributesDefinition.php create mode 100644 lib/Model/UniversalContentPartialUpdateQuery.php create mode 100644 lib/Model/UniversalContentPartialUpdateQueryResourceObject.php create mode 100644 lib/Model/UniversalContentPartialUpdateQueryResourceObjectAttributes.php create mode 100644 lib/Model/UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition.php diff --git a/CHANGELOG.md b/CHANGELOG.md index bf79e0d..142f42c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 NOTE: For more granular API-specific changes, please see our [API Changelog](https://developers.klaviyo.com/en/docs/changelog_) +## [11.0.0] - 2024-10-15 +### Added +- Sample Change + ## [10.0.0] - revision 2024-07-15 ### Added - Added several method aliases based on previous operation IDs diff --git a/README.md b/README.md index 45ca4a3..e898e0a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Klaviyo PHP SDK -- SDK version: 10.0.0 -- API Revision: 2024-07-15 +- SDK version: 11.0.0 +- API Revision: 2024-10-15 ## Helpful Resources -- [API Reference](https://developers.klaviyo.com/en/v2024-07-15/reference) -- [API Guides](https://developers.klaviyo.com/en/v2024-07-15/docs) +- [API Reference](https://developers.klaviyo.com/en/v2024-10-15/reference) +- [API Guides](https://developers.klaviyo.com/en/v2024-10-15/docs) - [Postman Workspace](https://www.postman.com/klaviyo/workspace/klaviyo-developers) ## Design & Approach @@ -73,6 +73,10 @@ This SDK is organized into the following resources: +- Reviews + + + - Segments @@ -85,6 +89,10 @@ This SDK is organized into the following resources: +- TrackingSettings + + + - Webhooks @@ -250,7 +258,7 @@ try { ## Important Notes - The main difference between this SDK and the language-agnostic API Docs that the below endpoints link to is that this SDK automatically adds the `revision` header corresponding to the SDK version. -- Organization: Resource groups and functions are listed in alphabetical order, first by Resource name, then by **OpenAPI Summary**. Operation summaries are those listed in the right side bar of the [API Reference](https://developers.klaviyo.com/en/v2024-07-15/reference/get_events). These summaries link directly to the corresponding section of the API reference. +- Organization: Resource groups and functions are listed in alphabetical order, first by Resource name, then by **OpenAPI Summary**. Operation summaries are those listed in the right side bar of the [API Reference](https://developers.klaviyo.com/en/v2024-10-15/reference/get_events). These summaries link directly to the corresponding section of the API reference. - For example values / data types, as well as whether parameters are required/optional, please reference the corresponding API Reference link. - Some keyword args are required for the API call to succeed, the API docs above are the source of truth regarding which keyword args are required. - JSON payloads should be passed in as associative arrays @@ -268,7 +276,7 @@ try { ## Accounts -#### [Get Account](https://developers.klaviyo.com/en/v2024-07-15/reference/get_account) +#### [Get Account](https://developers.klaviyo.com/en/v2024-10-15/reference/get_account) ```php ## Positional Arguments @@ -285,7 +293,7 @@ $klaviyo->Accounts->getAccount($id, $fields_account=$fields_account); -#### [Get Accounts](https://developers.klaviyo.com/en/v2024-07-15/reference/get_accounts) +#### [Get Accounts](https://developers.klaviyo.com/en/v2024-10-15/reference/get_accounts) ```php @@ -303,72 +311,72 @@ $klaviyo->Accounts->getAccounts($fields_account=$fields_account); ## Campaigns -#### [Create Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign) +#### [Assign Template to Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/assign_template_to_campaign_message) ```php ## Positional Arguments # $body | associative array -$klaviyo->Campaigns->createCampaign($body); +$klaviyo->Campaigns->assignTemplateToCampaignMessage($body); ``` - - - - -#### [Create Campaign Clone](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_clone) - +##### Method alias: ```php -## Positional Arguments - -# $body | associative array - -$klaviyo->Campaigns->createCampaignClone($body); +$klaviyo->Campaigns->createCampaignMessageAssignTemplate($body); ``` -#### [Assign Campaign Message Template](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_message_assign_template) +#### [Cancel Campaign Send](https://developers.klaviyo.com/en/v2024-10-15/reference/cancel_campaign_send) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Campaigns->createCampaignMessageAssignTemplate($body); +$klaviyo->Campaigns->cancelCampaignSend($id, $body); +``` +##### Method alias: +```php +$klaviyo->Campaigns->updateCampaignSendJob($id, $body); ``` -#### [Create Campaign Recipient Estimation Job](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_recipient_estimation_job) +#### [Create Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/create_campaign) ```php ## Positional Arguments # $body | associative array -$klaviyo->Campaigns->createCampaignRecipientEstimationJob($body); +$klaviyo->Campaigns->createCampaign($body); ``` -#### [Create Campaign Send Job](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_send_job) +#### [Create Campaign Clone](https://developers.klaviyo.com/en/v2024-10-15/reference/create_campaign_clone) ```php ## Positional Arguments # $body | associative array -$klaviyo->Campaigns->createCampaignSendJob($body); +$klaviyo->Campaigns->createCampaignClone($body); +``` +##### Method alias: +```php +$klaviyo->Campaigns->cloneCampaign($body); ``` -#### [Delete Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_campaign) +#### [Delete Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_campaign) ```php ## Positional Arguments @@ -381,7 +389,7 @@ $klaviyo->Campaigns->deleteCampaign($id); -#### [Get Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign) +#### [Get Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign) ```php ## Positional Arguments @@ -401,7 +409,7 @@ $klaviyo->Campaigns->getCampaign($id, $fields_campaign_message=$fields_campaign_ -#### [Get Campaign Campaign Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_campaign_messages) +#### [Get Campaign for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_for_campaign_message) ```php ## Positional Arguments @@ -410,38 +418,36 @@ $klaviyo->Campaigns->getCampaign($id, $fields_campaign_message=$fields_campaign_ ## Keyword Arguments -# $fields_campaign_message | string[] # $fields_campaign | string[] -# $fields_template | string[] -# $include | string[] -$klaviyo->Campaigns->getCampaignCampaignMessages($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include); +$klaviyo->Campaigns->getCampaignForCampaignMessage($id, $fields_campaign=$fields_campaign); +``` +##### Method alias: +```php +$klaviyo->Campaigns->getCampaignMessageCampaign($id, $fields_campaign=$fields_campaign); ``` -#### [Get Campaign Message](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message) +#### [Get Campaign ID for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_id_for_campaign_message) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $fields_campaign_message | string[] -# $fields_campaign | string[] -# $fields_template | string[] -# $include | string[] - -$klaviyo->Campaigns->getCampaignMessage($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include); +$klaviyo->Campaigns->getCampaignIdForCampaignMessage($id); +``` +##### Method alias: +```php +$klaviyo->Campaigns->getCampaignMessageRelationshipsCampaign($id); ``` -#### [Get Campaign Message Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_campaign) +#### [Get Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_message) ```php ## Positional Arguments @@ -450,41 +456,52 @@ $klaviyo->Campaigns->getCampaignMessage($id, $fields_campaign_message=$fields_ca ## Keyword Arguments +# $fields_campaign_message | string[] # $fields_campaign | string[] +# $fields_template | string[] +# $include | string[] -$klaviyo->Campaigns->getCampaignMessageCampaign($id, $fields_campaign=$fields_campaign); +$klaviyo->Campaigns->getCampaignMessage($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include); ``` -#### [Get Campaign Message Relationships Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_relationships_campaign) +#### [Get Campaign Recipient Estimation](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_recipient_estimation) ```php ## Positional Arguments # $id | string -$klaviyo->Campaigns->getCampaignMessageRelationshipsCampaign($id); +## Keyword Arguments + +# $fields_campaign_recipient_estimation | string[] + +$klaviyo->Campaigns->getCampaignRecipientEstimation($id, $fields_campaign_recipient_estimation=$fields_campaign_recipient_estimation); ``` -#### [Get Campaign Message Relationships Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_relationships_template) +#### [Get Campaign Recipient Estimation Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_recipient_estimation_job) ```php ## Positional Arguments # $id | string -$klaviyo->Campaigns->getCampaignMessageRelationshipsTemplate($id); +## Keyword Arguments + +# $fields_campaign_recipient_estimation_job | string[] + +$klaviyo->Campaigns->getCampaignRecipientEstimationJob($id, $fields_campaign_recipient_estimation_job=$fields_campaign_recipient_estimation_job); ``` -#### [Get Campaign Message Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_template) +#### [Get Campaign Send Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_send_job) ```php ## Positional Arguments @@ -493,15 +510,15 @@ $klaviyo->Campaigns->getCampaignMessageRelationshipsTemplate($id); ## Keyword Arguments -# $fields_template | string[] +# $fields_campaign_send_job | string[] -$klaviyo->Campaigns->getCampaignMessageTemplate($id, $fields_template=$fields_template); +$klaviyo->Campaigns->getCampaignSendJob($id, $fields_campaign_send_job=$fields_campaign_send_job); ``` -#### [Get Campaign Recipient Estimation](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_recipient_estimation) +#### [Get Campaign Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_tags) ```php ## Positional Arguments @@ -510,75 +527,95 @@ $klaviyo->Campaigns->getCampaignMessageTemplate($id, $fields_template=$fields_te ## Keyword Arguments -# $fields_campaign_recipient_estimation | string[] +# $fields_tag | string[] -$klaviyo->Campaigns->getCampaignRecipientEstimation($id, $fields_campaign_recipient_estimation=$fields_campaign_recipient_estimation); +$klaviyo->Campaigns->getCampaignTags($id, $fields_tag=$fields_tag); ``` -#### [Get Campaign Recipient Estimation Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_recipient_estimation_job) +#### [Get Campaigns](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaigns) ```php ## Positional Arguments -# $id | string +# $filter | string ## Keyword Arguments -# $fields_campaign_recipient_estimation_job | string[] +# $fields_campaign_message | string[] +# $fields_campaign | string[] +# $fields_tag | string[] +# $include | string[] +# $page_cursor | string +# $sort | string -$klaviyo->Campaigns->getCampaignRecipientEstimationJob($id, $fields_campaign_recipient_estimation_job=$fields_campaign_recipient_estimation_job); +$klaviyo->Campaigns->getCampaigns($filter, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_tag=$fields_tag, $include=$include, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Get Campaign Relationships Campaign Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_relationships_campaign_messages) +#### [Get Message IDs for Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_message_ids_for_campaign) ```php ## Positional Arguments # $id | string +$klaviyo->Campaigns->getMessageIdsForCampaign($id); +``` +##### Method alias: +```php $klaviyo->Campaigns->getCampaignRelationshipsCampaignMessages($id); ``` -#### [Get Campaign Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_relationships_tags) +#### [Get Messages for Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_messages_for_campaign) ```php ## Positional Arguments # $id | string -$klaviyo->Campaigns->getCampaignRelationshipsTags($id); +## Keyword Arguments + +# $fields_campaign_message | string[] +# $fields_campaign | string[] +# $fields_template | string[] +# $include | string[] + +$klaviyo->Campaigns->getMessagesForCampaign($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include); +``` +##### Method alias: +```php +$klaviyo->Campaigns->getCampaignCampaignMessages($id, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_template=$fields_template, $include=$include); ``` -#### [Get Campaign Send Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_send_job) +#### [Get Tag IDs for Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_campaign) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $fields_campaign_send_job | string[] - -$klaviyo->Campaigns->getCampaignSendJob($id, $fields_campaign_send_job=$fields_campaign_send_job); +$klaviyo->Campaigns->getTagIdsForCampaign($id); +``` +##### Method alias: +```php +$klaviyo->Campaigns->getCampaignRelationshipsTags($id); ``` -#### [Get Campaign Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_tags) +#### [Get Template for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_for_campaign_message) ```php ## Positional Arguments @@ -587,65 +624,70 @@ $klaviyo->Campaigns->getCampaignSendJob($id, $fields_campaign_send_job=$fields_c ## Keyword Arguments -# $fields_tag | string[] +# $fields_template | string[] -$klaviyo->Campaigns->getCampaignTags($id, $fields_tag=$fields_tag); +$klaviyo->Campaigns->getTemplateForCampaignMessage($id, $fields_template=$fields_template); +``` +##### Method alias: +```php +$klaviyo->Campaigns->getCampaignMessageTemplate($id, $fields_template=$fields_template); ``` -#### [Get Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaigns) +#### [Get Template ID for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_id_for_campaign_message) ```php ## Positional Arguments -# $filter | string - -## Keyword Arguments - -# $fields_campaign_message | string[] -# $fields_campaign | string[] -# $fields_tag | string[] -# $include | string[] -# $page_cursor | string -# $sort | string +# $id | string -$klaviyo->Campaigns->getCampaigns($filter, $fields_campaign_message=$fields_campaign_message, $fields_campaign=$fields_campaign, $fields_tag=$fields_tag, $include=$include, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Campaigns->getTemplateIdForCampaignMessage($id); +``` +##### Method alias: +```php +$klaviyo->Campaigns->getCampaignMessageRelationshipsTemplate($id); ``` -#### [Update Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/update_campaign) +#### [Refresh Campaign Recipient Estimation](https://developers.klaviyo.com/en/v2024-10-15/reference/refresh_campaign_recipient_estimation) ```php ## Positional Arguments -# $id | string # $body | associative array -$klaviyo->Campaigns->updateCampaign($id, $body); +$klaviyo->Campaigns->refreshCampaignRecipientEstimation($body); +``` +##### Method alias: +```php +$klaviyo->Campaigns->createCampaignRecipientEstimationJob($body); ``` -#### [Update Campaign Message](https://developers.klaviyo.com/en/v2024-07-15/reference/update_campaign_message) +#### [Send Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/send_campaign) ```php ## Positional Arguments -# $id | string # $body | associative array -$klaviyo->Campaigns->updateCampaignMessage($id, $body); +$klaviyo->Campaigns->sendCampaign($body); +``` +##### Method alias: +```php +$klaviyo->Campaigns->createCampaignSendJob($body); ``` -#### [Update Campaign Send Job](https://developers.klaviyo.com/en/v2024-07-15/reference/update_campaign_send_job) +#### [Update Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/update_campaign) ```php ## Positional Arguments @@ -653,43 +695,53 @@ $klaviyo->Campaigns->updateCampaignMessage($id, $body); # $id | string # $body | associative array -$klaviyo->Campaigns->updateCampaignSendJob($id, $body); +$klaviyo->Campaigns->updateCampaign($id, $body); ``` - - -## Catalogs - -#### [Create Back In Stock Subscription](https://developers.klaviyo.com/en/v2024-07-15/reference/create_back_in_stock_subscription) +#### [Update Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/update_campaign_message) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->createBackInStockSubscription($body); +$klaviyo->Campaigns->updateCampaignMessage($id, $body); ``` -#### [Create Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_category) + + +## Catalogs + +#### [Add Category to Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/add_category_to_catalog_item) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->createCatalogCategory($body); +$klaviyo->Catalogs->addCategoryToCatalogItem($id, $body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogItemRelationshipsCategories($id, $body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogItemRelationshipsCategory($id, $body); ``` -#### [Create Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_category_relationships_items) +#### [Add Items to Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/add_items_to_catalog_category) ```php ## Positional Arguments @@ -697,6 +749,10 @@ $klaviyo->Catalogs->createCatalogCategory($body); # $id | string # $body | associative array +$klaviyo->Catalogs->addItemsToCatalogCategory($id, $body); +``` +##### Method alias: +```php $klaviyo->Catalogs->createCatalogCategoryRelationshipsItems($id, $body); ``` ##### Method alias: @@ -707,215 +763,440 @@ $klaviyo->Catalogs->createCatalogCategoryRelationshipsItem($id, $body); -#### [Create Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_item) +#### [Bulk Create Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_catalog_categories) ```php ## Positional Arguments # $body | associative array -$klaviyo->Catalogs->createCatalogItem($body); +$klaviyo->Catalogs->bulkCreateCatalogCategories($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnCreateCategoriesJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogCategoryBulkCreateJob($body); ``` -#### [Create Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_item_relationships_categories) +#### [Bulk Create Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_catalog_items) ```php ## Positional Arguments -# $id | string # $body | associative array -$klaviyo->Catalogs->createCatalogItemRelationshipsCategories($id, $body); +$klaviyo->Catalogs->bulkCreateCatalogItems($body); ``` ##### Method alias: ```php -$klaviyo->Catalogs->createCatalogItemRelationshipsCategory($id, $body); +$klaviyo->Catalogs->spawnCreateItemsJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogItemBulkCreateJob($body); ``` -#### [Create Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_variant) +#### [Bulk Create Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_catalog_variants) ```php ## Positional Arguments # $body | associative array -$klaviyo->Catalogs->createCatalogVariant($body); +$klaviyo->Catalogs->bulkCreateCatalogVariants($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnCreateVariantsJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogVariantBulkCreateJob($body); ``` -#### [Delete Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_category) +#### [Bulk Delete Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_delete_catalog_categories) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Catalogs->deleteCatalogCategory($id); +$klaviyo->Catalogs->bulkDeleteCatalogCategories($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnDeleteCategoriesJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogCategoryBulkDeleteJob($body); ``` -#### [Delete Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_category_relationships_items) +#### [Bulk Delete Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_delete_catalog_items) ```php ## Positional Arguments -# $id | string # $body | associative array -$klaviyo->Catalogs->deleteCatalogCategoryRelationshipsItems($id, $body); +$klaviyo->Catalogs->bulkDeleteCatalogItems($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnDeleteItemsJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogItemBulkDeleteJob($body); ``` -#### [Delete Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_item) +#### [Bulk Delete Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_delete_catalog_variants) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Catalogs->deleteCatalogItem($id); +$klaviyo->Catalogs->bulkDeleteCatalogVariants($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnDeleteVariantsJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogVariantBulkDeleteJob($body); ``` -#### [Delete Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_item_relationships_categories) +#### [Bulk Update Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_update_catalog_categories) ```php ## Positional Arguments -# $id | string # $body | associative array -$klaviyo->Catalogs->deleteCatalogItemRelationshipsCategories($id, $body); +$klaviyo->Catalogs->bulkUpdateCatalogCategories($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnUpdateCategoriesJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogCategoryBulkUpdateJob($body); ``` -#### [Delete Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_variant) +#### [Bulk Update Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_update_catalog_items) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Catalogs->deleteCatalogVariant($id); +$klaviyo->Catalogs->bulkUpdateCatalogItems($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnUpdateItemsJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogItemBulkUpdateJob($body); ``` -#### [Get Catalog Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_categories) +#### [Bulk Update Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_update_catalog_variants) ```php +## Positional Arguments -## Keyword Arguments +# $body | associative array -# $fields_catalog_category | string[] -# $filter | string -# $page_cursor | string -# $sort | string +$klaviyo->Catalogs->bulkUpdateCatalogVariants($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->spawnUpdateVariantsJob($body); +``` +##### Method alias: +```php +$klaviyo->Catalogs->createCatalogVariantBulkUpdateJob($body); +``` -$klaviyo->Catalogs->getCatalogCategories($fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); + + + +#### [Create Back In Stock Subscription](https://developers.klaviyo.com/en/v2024-10-15/reference/create_back_in_stock_subscription) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Catalogs->createBackInStockSubscription($body); +``` + + + + +#### [Create Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/create_catalog_category) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Catalogs->createCatalogCategory($body); +``` + + + + +#### [Create Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/create_catalog_item) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Catalogs->createCatalogItem($body); +``` + + + + +#### [Create Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/create_catalog_variant) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Catalogs->createCatalogVariant($body); ``` -#### [Get Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_category) +#### [Delete Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_catalog_category) ```php ## Positional Arguments # $id | string -## Keyword Arguments +$klaviyo->Catalogs->deleteCatalogCategory($id); +``` -# $fields_catalog_category | string[] -$klaviyo->Catalogs->getCatalogCategory($id, $fields_catalog_category=$fields_catalog_category); + + +#### [Delete Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_catalog_item) + +```php +## Positional Arguments + +# $id | string + +$klaviyo->Catalogs->deleteCatalogItem($id); ``` -#### [Get Catalog Category Items](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_category_items) +#### [Delete Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_catalog_variant) ```php ## Positional Arguments # $id | string +$klaviyo->Catalogs->deleteCatalogVariant($id); +``` + + + + +#### [Get Bulk Create Catalog Items Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_catalog_items_job) + +```php +## Positional Arguments + +# $job_id | string + ## Keyword Arguments +# $fields_catalog_item_bulk_create_job | string[] # $fields_catalog_item | string[] -# $fields_catalog_variant | string[] -# $filter | string # $include | string[] + +$klaviyo->Catalogs->getBulkCreateCatalogItemsJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCreateItemsJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCatalogItemBulkCreateJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include); +``` + + + + +#### [Get Bulk Create Catalog Items Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_catalog_items_jobs) + +```php + +## Keyword Arguments + +# $fields_catalog_item_bulk_create_job | string[] +# $filter | string # $page_cursor | string -# $sort | string -$klaviyo->Catalogs->getCatalogCategoryItems($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Catalogs->getBulkCreateCatalogItemsJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCreateItemsJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCatalogItemBulkCreateJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); ``` -#### [Get Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_category_relationships_items) +#### [Get Bulk Delete Catalog Items Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_delete_catalog_items_job) ```php ## Positional Arguments -# $id | string +# $job_id | string + +## Keyword Arguments + +# $fields_catalog_item_bulk_delete_job | string[] + +$klaviyo->Catalogs->getBulkDeleteCatalogItemsJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getDeleteItemsJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCatalogItemBulkDeleteJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job); +``` + + + + +#### [Get Bulk Delete Catalog Items Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_delete_catalog_items_jobs) + +```php ## Keyword Arguments +# $fields_catalog_item_bulk_delete_job | string[] +# $filter | string # $page_cursor | string -$klaviyo->Catalogs->getCatalogCategoryRelationshipsItems($id, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getBulkDeleteCatalogItemsJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getDeleteItemsJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCatalogItemBulkDeleteJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); ``` -#### [Get Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item) +#### [Get Bulk Update Catalog Items Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_update_catalog_items_job) ```php ## Positional Arguments -# $id | string +# $job_id | string ## Keyword Arguments +# $fields_catalog_item_bulk_update_job | string[] # $fields_catalog_item | string[] -# $fields_catalog_variant | string[] # $include | string[] -$klaviyo->Catalogs->getCatalogItem($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $include=$include); +$klaviyo->Catalogs->getBulkUpdateCatalogItemsJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getUpdateItemsJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCatalogItemBulkUpdateJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include); ``` -#### [Get Catalog Item Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item_categories) +#### [Get Bulk Update Catalog Items Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_update_catalog_items_jobs) ```php -## Positional Arguments -# $id | string +## Keyword Arguments + +# $fields_catalog_item_bulk_update_job | string[] +# $filter | string +# $page_cursor | string + +$klaviyo->Catalogs->getBulkUpdateCatalogItemsJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getUpdateItemsJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Catalogs->getCatalogItemBulkUpdateJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor); +``` + + + + +#### [Get Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_categories) + +```php ## Keyword Arguments @@ -924,13 +1205,13 @@ $klaviyo->Catalogs->getCatalogItem($id, $fields_catalog_item=$fields_catalog_ite # $page_cursor | string # $sort | string -$klaviyo->Catalogs->getCatalogItemCategories($id, $fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Catalogs->getCatalogCategories($fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Get Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item_relationships_categories) +#### [Get Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_category) ```php ## Positional Arguments @@ -939,15 +1220,15 @@ $klaviyo->Catalogs->getCatalogItemCategories($id, $fields_catalog_category=$fiel ## Keyword Arguments -# $page_cursor | string +# $fields_catalog_category | string[] -$klaviyo->Catalogs->getCatalogItemRelationshipsCategories($id, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getCatalogCategory($id, $fields_catalog_category=$fields_catalog_category); ``` -#### [Get Catalog Item Variants](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item_variants) +#### [Get Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_item) ```php ## Positional Arguments @@ -956,18 +1237,17 @@ $klaviyo->Catalogs->getCatalogItemRelationshipsCategories($id, $page_cursor=$pag ## Keyword Arguments +# $fields_catalog_item | string[] # $fields_catalog_variant | string[] -# $filter | string -# $page_cursor | string -# $sort | string +# $include | string[] -$klaviyo->Catalogs->getCatalogItemVariants($id, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Catalogs->getCatalogItem($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $include=$include); ``` -#### [Get Catalog Items](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_items) +#### [Get Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_items) ```php @@ -986,7 +1266,7 @@ $klaviyo->Catalogs->getCatalogItems($fields_catalog_item=$fields_catalog_item, $ -#### [Get Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_variant) +#### [Get Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_variant) ```php ## Positional Arguments @@ -1003,7 +1283,7 @@ $klaviyo->Catalogs->getCatalogVariant($id, $fields_catalog_variant=$fields_catal -#### [Get Catalog Variants](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_variants) +#### [Get Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_variants) ```php @@ -1020,50 +1300,52 @@ $klaviyo->Catalogs->getCatalogVariants($fields_catalog_variant=$fields_catalog_v -#### [Get Create Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_categories_job) +#### [Get Categories for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_categories_for_catalog_item) ```php ## Positional Arguments -# $job_id | string +# $id | string ## Keyword Arguments -# $fields_catalog_category_bulk_create_job | string[] # $fields_catalog_category | string[] -# $include | string[] +# $filter | string +# $page_cursor | string +# $sort | string -$klaviyo->Catalogs->getCreateCategoriesJob($job_id, $fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $fields_catalog_category=$fields_catalog_category, $include=$include); +$klaviyo->Catalogs->getCategoriesForCatalogItem($id, $fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogCategoryBulkCreateJob($job_id, $fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $fields_catalog_category=$fields_catalog_category, $include=$include); +$klaviyo->Catalogs->getCatalogItemCategories($id, $fields_catalog_category=$fields_catalog_category, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Get Create Categories Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_categories_jobs) +#### [Get Category IDs for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_category_ids_for_catalog_item) ```php +## Positional Arguments + +# $id | string ## Keyword Arguments -# $fields_catalog_category_bulk_create_job | string[] -# $filter | string # $page_cursor | string -$klaviyo->Catalogs->getCreateCategoriesJobs($fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getCategoryIdsForCatalogItem($id, $page_cursor=$page_cursor); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogCategoryBulkCreateJobs($fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getCatalogItemRelationshipsCategories($id, $page_cursor=$page_cursor); ``` -#### [Get Create Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_items_job) +#### [Get Create Categories Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_categories_job) ```php ## Positional Arguments @@ -1072,41 +1354,41 @@ $klaviyo->Catalogs->getCatalogCategoryBulkCreateJobs($fields_catalog_category_bu ## Keyword Arguments -# $fields_catalog_item_bulk_create_job | string[] -# $fields_catalog_item | string[] +# $fields_catalog_category_bulk_create_job | string[] +# $fields_catalog_category | string[] # $include | string[] -$klaviyo->Catalogs->getCreateItemsJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include); +$klaviyo->Catalogs->getCreateCategoriesJob($job_id, $fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $fields_catalog_category=$fields_catalog_category, $include=$include); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogItemBulkCreateJob($job_id, $fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $fields_catalog_item=$fields_catalog_item, $include=$include); +$klaviyo->Catalogs->getCatalogCategoryBulkCreateJob($job_id, $fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $fields_catalog_category=$fields_catalog_category, $include=$include); ``` -#### [Get Create Items Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_items_jobs) +#### [Get Create Categories Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_categories_jobs) ```php ## Keyword Arguments -# $fields_catalog_item_bulk_create_job | string[] +# $fields_catalog_category_bulk_create_job | string[] # $filter | string # $page_cursor | string -$klaviyo->Catalogs->getCreateItemsJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getCreateCategoriesJobs($fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogItemBulkCreateJobs($fields_catalog_item_bulk_create_job=$fields_catalog_item_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getCatalogCategoryBulkCreateJobs($fields_catalog_category_bulk_create_job=$fields_catalog_category_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); ``` -#### [Get Create Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_variants_job) +#### [Get Create Variants Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_variants_job) ```php ## Positional Arguments @@ -1129,7 +1411,7 @@ $klaviyo->Catalogs->getCatalogVariantBulkCreateJob($job_id, $fields_catalog_vari -#### [Get Create Variants Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_variants_jobs) +#### [Get Create Variants Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_variants_jobs) ```php @@ -1149,7 +1431,7 @@ $klaviyo->Catalogs->getCatalogVariantBulkCreateJobs($fields_catalog_variant_bulk -#### [Get Delete Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_categories_job) +#### [Get Delete Categories Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_categories_job) ```php ## Positional Arguments @@ -1170,7 +1452,7 @@ $klaviyo->Catalogs->getCatalogCategoryBulkDeleteJob($job_id, $fields_catalog_cat -#### [Get Delete Categories Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_categories_jobs) +#### [Get Delete Categories Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_categories_jobs) ```php @@ -1190,7 +1472,7 @@ $klaviyo->Catalogs->getCatalogCategoryBulkDeleteJobs($fields_catalog_category_bu -#### [Get Delete Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_items_job) +#### [Get Delete Variants Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_variants_job) ```php ## Positional Arguments @@ -1199,80 +1481,86 @@ $klaviyo->Catalogs->getCatalogCategoryBulkDeleteJobs($fields_catalog_category_bu ## Keyword Arguments -# $fields_catalog_item_bulk_delete_job | string[] +# $fields_catalog_variant_bulk_delete_job | string[] -$klaviyo->Catalogs->getDeleteItemsJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job); +$klaviyo->Catalogs->getDeleteVariantsJob($job_id, $fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogItemBulkDeleteJob($job_id, $fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job); +$klaviyo->Catalogs->getCatalogVariantBulkDeleteJob($job_id, $fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job); ``` -#### [Get Delete Items Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_items_jobs) +#### [Get Delete Variants Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_variants_jobs) ```php ## Keyword Arguments -# $fields_catalog_item_bulk_delete_job | string[] +# $fields_catalog_variant_bulk_delete_job | string[] # $filter | string # $page_cursor | string -$klaviyo->Catalogs->getDeleteItemsJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getDeleteVariantsJobs($fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogItemBulkDeleteJobs($fields_catalog_item_bulk_delete_job=$fields_catalog_item_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getCatalogVariantBulkDeleteJobs($fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); ``` -#### [Get Delete Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_variants_job) +#### [Get Item IDs for Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/get_item_ids_for_catalog_category) ```php ## Positional Arguments -# $job_id | string +# $id | string ## Keyword Arguments -# $fields_catalog_variant_bulk_delete_job | string[] +# $page_cursor | string -$klaviyo->Catalogs->getDeleteVariantsJob($job_id, $fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job); +$klaviyo->Catalogs->getItemIdsForCatalogCategory($id, $page_cursor=$page_cursor); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogVariantBulkDeleteJob($job_id, $fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job); +$klaviyo->Catalogs->getCatalogCategoryRelationshipsItems($id, $page_cursor=$page_cursor); ``` -#### [Get Delete Variants Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_variants_jobs) +#### [Get Items for Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/get_items_for_catalog_category) ```php +## Positional Arguments + +# $id | string ## Keyword Arguments -# $fields_catalog_variant_bulk_delete_job | string[] +# $fields_catalog_item | string[] +# $fields_catalog_variant | string[] # $filter | string +# $include | string[] # $page_cursor | string +# $sort | string -$klaviyo->Catalogs->getDeleteVariantsJobs($fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getItemsForCatalogCategory($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); ``` ##### Method alias: ```php -$klaviyo->Catalogs->getCatalogVariantBulkDeleteJobs($fields_catalog_variant_bulk_delete_job=$fields_catalog_variant_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Catalogs->getCatalogCategoryItems($id, $fields_catalog_item=$fields_catalog_item, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Get Update Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_categories_job) +#### [Get Update Categories Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_categories_job) ```php ## Positional Arguments @@ -1295,7 +1583,7 @@ $klaviyo->Catalogs->getCatalogCategoryBulkUpdateJob($job_id, $fields_catalog_cat -#### [Get Update Categories Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_categories_jobs) +#### [Get Update Categories Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_categories_jobs) ```php @@ -1315,50 +1603,7 @@ $klaviyo->Catalogs->getCatalogCategoryBulkUpdateJobs($fields_catalog_category_bu -#### [Get Update Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_items_job) - -```php -## Positional Arguments - -# $job_id | string - -## Keyword Arguments - -# $fields_catalog_item_bulk_update_job | string[] -# $fields_catalog_item | string[] -# $include | string[] - -$klaviyo->Catalogs->getUpdateItemsJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include); -``` -##### Method alias: -```php -$klaviyo->Catalogs->getCatalogItemBulkUpdateJob($job_id, $fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $fields_catalog_item=$fields_catalog_item, $include=$include); -``` - - - - -#### [Get Update Items Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_items_jobs) - -```php - -## Keyword Arguments - -# $fields_catalog_item_bulk_update_job | string[] -# $filter | string -# $page_cursor | string - -$klaviyo->Catalogs->getUpdateItemsJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor); -``` -##### Method alias: -```php -$klaviyo->Catalogs->getCatalogItemBulkUpdateJobs($fields_catalog_item_bulk_update_job=$fields_catalog_item_bulk_update_job, $filter=$filter, $page_cursor=$page_cursor); -``` - - - - -#### [Get Update Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_variants_job) +#### [Get Update Variants Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_variants_job) ```php ## Positional Arguments @@ -1381,7 +1626,7 @@ $klaviyo->Catalogs->getCatalogVariantBulkUpdateJob($job_id, $fields_catalog_vari -#### [Get Update Variants Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_variants_jobs) +#### [Get Update Variants Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_variants_jobs) ```php @@ -1401,234 +1646,170 @@ $klaviyo->Catalogs->getCatalogVariantBulkUpdateJobs($fields_catalog_variant_bulk -#### [Spawn Create Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_create_categories_job) +#### [Get Variants for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_variants_for_catalog_item) ```php ## Positional Arguments -# $body | associative array - -$klaviyo->Catalogs->spawnCreateCategoriesJob($body); -``` -##### Method alias: -```php -$klaviyo->Catalogs->createCatalogCategoryBulkCreateJob($body); -``` - - - - -#### [Spawn Create Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_create_items_job) +# $id | string -```php -## Positional Arguments +## Keyword Arguments -# $body | associative array +# $fields_catalog_variant | string[] +# $filter | string +# $page_cursor | string +# $sort | string -$klaviyo->Catalogs->spawnCreateItemsJob($body); +$klaviyo->Catalogs->getVariantsForCatalogItem($id, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); ``` ##### Method alias: ```php -$klaviyo->Catalogs->createCatalogItemBulkCreateJob($body); +$klaviyo->Catalogs->getCatalogItemVariants($id, $fields_catalog_variant=$fields_catalog_variant, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Spawn Create Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_create_variants_job) +#### [Remove Categories from Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_categories_from_catalog_item) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->spawnCreateVariantsJob($body); +$klaviyo->Catalogs->removeCategoriesFromCatalogItem($id, $body); ``` ##### Method alias: ```php -$klaviyo->Catalogs->createCatalogVariantBulkCreateJob($body); +$klaviyo->Catalogs->deleteCatalogItemRelationshipsCategories($id, $body); ``` -#### [Spawn Delete Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_delete_categories_job) +#### [Remove Items from Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_items_from_catalog_category) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->spawnDeleteCategoriesJob($body); +$klaviyo->Catalogs->removeItemsFromCatalogCategory($id, $body); ``` ##### Method alias: ```php -$klaviyo->Catalogs->createCatalogCategoryBulkDeleteJob($body); +$klaviyo->Catalogs->deleteCatalogCategoryRelationshipsItems($id, $body); ``` -#### [Spawn Delete Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_delete_items_job) +#### [Update Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/update_catalog_category) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->spawnDeleteItemsJob($body); -``` -##### Method alias: -```php -$klaviyo->Catalogs->createCatalogItemBulkDeleteJob($body); +$klaviyo->Catalogs->updateCatalogCategory($id, $body); ``` -#### [Spawn Delete Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_delete_variants_job) +#### [Update Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/update_catalog_item) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->spawnDeleteVariantsJob($body); -``` -##### Method alias: -```php -$klaviyo->Catalogs->createCatalogVariantBulkDeleteJob($body); +$klaviyo->Catalogs->updateCatalogItem($id, $body); ``` -#### [Spawn Update Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_update_categories_job) +#### [Update Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/update_catalog_variant) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->spawnUpdateCategoriesJob($body); -``` -##### Method alias: -```php -$klaviyo->Catalogs->createCatalogCategoryBulkUpdateJob($body); +$klaviyo->Catalogs->updateCatalogVariant($id, $body); ``` -#### [Spawn Update Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_update_items_job) +#### [Update Categories for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/update_categories_for_catalog_item) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->spawnUpdateItemsJob($body); +$klaviyo->Catalogs->updateCategoriesForCatalogItem($id, $body); ``` ##### Method alias: ```php -$klaviyo->Catalogs->createCatalogItemBulkUpdateJob($body); +$klaviyo->Catalogs->updateCatalogItemRelationshipsCategories($id, $body); ``` -#### [Spawn Update Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_update_variants_job) +#### [Update Items for Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/update_items_for_catalog_category) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Catalogs->spawnUpdateVariantsJob($body); +$klaviyo->Catalogs->updateItemsForCatalogCategory($id, $body); ``` ##### Method alias: ```php -$klaviyo->Catalogs->createCatalogVariantBulkUpdateJob($body); -``` - - - - -#### [Update Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_category) - -```php -## Positional Arguments - -# $id | string -# $body | associative array - -$klaviyo->Catalogs->updateCatalogCategory($id, $body); +$klaviyo->Catalogs->updateCatalogCategoryRelationshipsItems($id, $body); ``` -#### [Update Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_category_relationships_items) - -```php -## Positional Arguments - -# $id | string -# $body | associative array - -$klaviyo->Catalogs->updateCatalogCategoryRelationshipsItems($id, $body); -``` - +## Coupons -#### [Update Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_item) +#### [Bulk Create Coupon Codes](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_coupon_codes) ```php ## Positional Arguments -# $id | string # $body | associative array -$klaviyo->Catalogs->updateCatalogItem($id, $body); +$klaviyo->Coupons->bulkCreateCouponCodes($body); ``` - - - - -#### [Update Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_item_relationships_categories) - +##### Method alias: ```php -## Positional Arguments - -# $id | string -# $body | associative array - -$klaviyo->Catalogs->updateCatalogItemRelationshipsCategories($id, $body); +$klaviyo->Coupons->spawnCouponCodeBulkCreateJob($body); ``` - - - - -#### [Update Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_variant) - +##### Method alias: ```php -## Positional Arguments - -# $id | string -# $body | associative array - -$klaviyo->Catalogs->updateCatalogVariant($id, $body); +$klaviyo->Coupons->createCouponCodeBulkCreateJob($body); ``` - - -## Coupons - -#### [Create Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/create_coupon) +#### [Create Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/create_coupon) ```php ## Positional Arguments @@ -1641,7 +1822,7 @@ $klaviyo->Coupons->createCoupon($body); -#### [Create Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/create_coupon_code) +#### [Create Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/create_coupon_code) ```php ## Positional Arguments @@ -1654,7 +1835,7 @@ $klaviyo->Coupons->createCouponCode($body); -#### [Delete Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_coupon) +#### [Delete Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_coupon) ```php ## Positional Arguments @@ -1667,7 +1848,7 @@ $klaviyo->Coupons->deleteCoupon($id); -#### [Delete Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_coupon_code) +#### [Delete Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_coupon_code) ```php ## Positional Arguments @@ -1680,78 +1861,88 @@ $klaviyo->Coupons->deleteCouponCode($id); -#### [Get Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon) +#### [Get Bulk Create Coupon Code Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_coupon_code_jobs) ```php -## Positional Arguments - -# $id | string ## Keyword Arguments -# $fields_coupon | string[] +# $fields_coupon_code_bulk_create_job | string[] +# $filter | string +# $page_cursor | string -$klaviyo->Coupons->getCoupon($id, $fields_coupon=$fields_coupon); +$klaviyo->Coupons->getBulkCreateCouponCodeJobs($fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Coupons->getCouponCodeBulkCreateJobs($fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); ``` -#### [Get Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code) +#### [Get Bulk Create Coupon Codes Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_coupon_codes_job) ```php ## Positional Arguments -# $id | string +# $job_id | string ## Keyword Arguments +# $fields_coupon_code_bulk_create_job | string[] # $fields_coupon_code | string[] -# $fields_coupon | string[] # $include | string[] -$klaviyo->Coupons->getCouponCode($id, $fields_coupon_code=$fields_coupon_code, $fields_coupon=$fields_coupon, $include=$include); +$klaviyo->Coupons->getBulkCreateCouponCodesJob($job_id, $fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $fields_coupon_code=$fields_coupon_code, $include=$include); +``` +##### Method alias: +```php +$klaviyo->Coupons->getCouponCodeBulkCreateJob($job_id, $fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $fields_coupon_code=$fields_coupon_code, $include=$include); ``` -#### [Get Coupon Code Bulk Create Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code_bulk_create_job) +#### [Get Code IDs for Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/get_code_ids_for_coupon) ```php ## Positional Arguments -# $job_id | string +# $id | string ## Keyword Arguments -# $fields_coupon_code_bulk_create_job | string[] -# $fields_coupon_code | string[] -# $include | string[] +# $page_cursor | string -$klaviyo->Coupons->getCouponCodeBulkCreateJob($job_id, $fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $fields_coupon_code=$fields_coupon_code, $include=$include); +$klaviyo->Coupons->getCodeIdsForCoupon($id, $page_cursor=$page_cursor); +``` +##### Method alias: +```php +$klaviyo->Coupons->getCouponCodeRelationshipsCoupon($id, $page_cursor=$page_cursor); ``` -#### [Get Coupon Code Bulk Create Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code_bulk_create_jobs) +#### [Get Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon) ```php +## Positional Arguments + +# $id | string ## Keyword Arguments -# $fields_coupon_code_bulk_create_job | string[] -# $filter | string -# $page_cursor | string +# $fields_coupon | string[] -$klaviyo->Coupons->getCouponCodeBulkCreateJobs($fields_coupon_code_bulk_create_job=$fields_coupon_code_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Coupons->getCoupon($id, $fields_coupon=$fields_coupon); ``` -#### [Get Coupon Code Relationships Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code_relationships_coupon) +#### [Get Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_code) ```php ## Positional Arguments @@ -1760,15 +1951,17 @@ $klaviyo->Coupons->getCouponCodeBulkCreateJobs($fields_coupon_code_bulk_create_j ## Keyword Arguments -# $page_cursor | string +# $fields_coupon_code | string[] +# $fields_coupon | string[] +# $include | string[] -$klaviyo->Coupons->getCouponCodeRelationshipsCoupon($id, $page_cursor=$page_cursor); +$klaviyo->Coupons->getCouponCode($id, $fields_coupon_code=$fields_coupon_code, $fields_coupon=$fields_coupon, $include=$include); ``` -#### [Get Coupon Codes](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_codes) +#### [Get Coupon Codes](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_codes) ```php @@ -1786,7 +1979,7 @@ $klaviyo->Coupons->getCouponCodes($fields_coupon_code=$fields_coupon_code, $fiel -#### [Get Coupon Codes For Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_codes_for_coupon) +#### [Get Coupon Codes For Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_codes_for_coupon) ```php ## Positional Arguments @@ -1809,7 +2002,7 @@ $klaviyo->Coupons->getCouponCouponCodes($id, $fields_coupon_code=$fields_coupon_ -#### [Get Coupon For Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_for_coupon_code) +#### [Get Coupon For Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_for_coupon_code) ```php ## Positional Arguments @@ -1830,20 +2023,24 @@ $klaviyo->Coupons->getCouponCodeCoupon($id, $fields_coupon=$fields_coupon); -#### [Get Coupon Relationships Coupon Codes](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_relationships_coupon_codes) +#### [Get Coupon ID for Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_id_for_coupon_code) ```php ## Positional Arguments # $id | string +$klaviyo->Coupons->getCouponIdForCouponCode($id); +``` +##### Method alias: +```php $klaviyo->Coupons->getCouponRelationshipsCouponCodes($id); ``` -#### [Get Coupons](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupons) +#### [Get Coupons](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupons) ```php @@ -1858,24 +2055,7 @@ $klaviyo->Coupons->getCoupons($fields_coupon=$fields_coupon, $page_cursor=$page_ -#### [Spawn Coupon Code Bulk Create Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_coupon_code_bulk_create_job) - -```php -## Positional Arguments - -# $body | associative array - -$klaviyo->Coupons->spawnCouponCodeBulkCreateJob($body); -``` -##### Method alias: -```php -$klaviyo->Coupons->createCouponCodeBulkCreateJob($body); -``` - - - - -#### [Update Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/update_coupon) +#### [Update Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/update_coupon) ```php ## Positional Arguments @@ -1889,7 +2069,7 @@ $klaviyo->Coupons->updateCoupon($id, $body); -#### [Update Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/update_coupon_code) +#### [Update Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/update_coupon_code) ```php ## Positional Arguments @@ -1907,7 +2087,7 @@ $klaviyo->Coupons->updateCouponCode($id, $body); ## DataPrivacy -#### [Request Profile Deletion](https://developers.klaviyo.com/en/v2024-07-15/reference/request_profile_deletion) +#### [Request Profile Deletion](https://developers.klaviyo.com/en/v2024-10-15/reference/request_profile_deletion) ```php ## Positional Arguments @@ -1928,7 +2108,7 @@ $klaviyo->DataPrivacy->createDataPrivacyDeletionJob($body); ## Events -#### [Bulk Create Events](https://developers.klaviyo.com/en/v2024-07-15/reference/bulk_create_events) +#### [Bulk Create Events](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_events) ```php ## Positional Arguments @@ -1945,7 +2125,7 @@ $klaviyo->Events->createEventBulkCreateJob($body); -#### [Create Event](https://developers.klaviyo.com/en/v2024-07-15/reference/create_event) +#### [Create Event](https://developers.klaviyo.com/en/v2024-10-15/reference/create_event) ```php ## Positional Arguments @@ -1958,7 +2138,7 @@ $klaviyo->Events->createEvent($body); -#### [Get Event](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event) +#### [Get Event](https://developers.klaviyo.com/en/v2024-10-15/reference/get_event) ```php ## Positional Arguments @@ -1978,7 +2158,7 @@ $klaviyo->Events->getEvent($id, $fields_event=$fields_event, $fields_metric=$fie -#### [Get Event Metric](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_metric) +#### [Get Event Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_event_metric) ```php ## Positional Arguments @@ -1995,7 +2175,7 @@ $klaviyo->Events->getEventMetric($id, $fields_metric=$fields_metric); -#### [Get Event Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_profile) +#### [Get Event Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_event_profile) ```php ## Positional Arguments @@ -2013,57 +2193,65 @@ $klaviyo->Events->getEventProfile($id, $additional_fields_profile=$additional_fi -#### [Get Event Relationships Metric](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_relationships_metric) +#### [Get Events](https://developers.klaviyo.com/en/v2024-10-15/reference/get_events) + +```php + +## Keyword Arguments + +# $fields_event | string[] +# $fields_metric | string[] +# $fields_profile | string[] +# $filter | string +# $include | string[] +# $page_cursor | string +# $sort | string + +$klaviyo->Events->getEvents($fields_event=$fields_event, $fields_metric=$fields_metric, $fields_profile=$fields_profile, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); +``` + + + + +#### [Get Metric ID for Event](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_id_for_event) ```php ## Positional Arguments # $id | string +$klaviyo->Events->getMetricIdForEvent($id); +``` +##### Method alias: +```php $klaviyo->Events->getEventRelationshipsMetric($id); ``` -#### [Get Event Relationships Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_relationships_profile) +#### [Get Profile ID for Event](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_id_for_event) ```php ## Positional Arguments # $id | string +$klaviyo->Events->getProfileIdForEvent($id); +``` +##### Method alias: +```php $klaviyo->Events->getEventRelationshipsProfile($id); ``` -#### [Get Events](https://developers.klaviyo.com/en/v2024-07-15/reference/get_events) - -```php - -## Keyword Arguments - -# $fields_event | string[] -# $fields_metric | string[] -# $fields_profile | string[] -# $filter | string -# $include | string[] -# $page_cursor | string -# $sort | string - -$klaviyo->Events->getEvents($fields_event=$fields_event, $fields_metric=$fields_metric, $fields_profile=$fields_profile, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); -``` - - - - ## Flows -#### [Delete Flow](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_flow) +#### [Delete Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_flow) ```php ## Positional Arguments @@ -2076,27 +2264,24 @@ $klaviyo->Flows->deleteFlow($id); -#### [Get Flow](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow) +#### [Get Action ID for Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_action_id_for_flow_message) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $fields_flow_action | string[] -# $fields_flow | string[] -# $fields_tag | string[] -# $include | string[] - -$klaviyo->Flows->getFlow($id, $fields_flow_action=$fields_flow_action, $fields_flow=$fields_flow, $fields_tag=$fields_tag, $include=$include); +$klaviyo->Flows->getActionIdForFlowMessage($id); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowMessageRelationshipsAction($id); ``` -#### [Get Flow Action](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action) +#### [Get Action IDs for Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_action_ids_for_flow) ```php ## Positional Arguments @@ -2105,18 +2290,21 @@ $klaviyo->Flows->getFlow($id, $fields_flow_action=$fields_flow_action, $fields_f ## Keyword Arguments -# $fields_flow_action | string[] -# $fields_flow_message | string[] -# $fields_flow | string[] -# $include | string[] +# $filter | string +# $page_size | int +# $sort | string -$klaviyo->Flows->getFlowAction($id, $fields_flow_action=$fields_flow_action, $fields_flow_message=$fields_flow_message, $fields_flow=$fields_flow, $include=$include); +$klaviyo->Flows->getActionIdsForFlow($id, $filter=$filter, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowRelationshipsFlowActions($id, $filter=$filter, $page_size=$page_size, $sort=$sort); ``` -#### [Get Flow For Flow Action](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_flow) +#### [Get Actions for Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_actions_for_flow) ```php ## Positional Arguments @@ -2125,15 +2313,23 @@ $klaviyo->Flows->getFlowAction($id, $fields_flow_action=$fields_flow_action, $fi ## Keyword Arguments -# $fields_flow | string[] +# $fields_flow_action | string[] +# $filter | string +# $page_cursor | string +# $page_size | int +# $sort | string -$klaviyo->Flows->getFlowActionFlow($id, $fields_flow=$fields_flow); +$klaviyo->Flows->getActionsForFlow($id, $fields_flow_action=$fields_flow_action, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowFlowActions($id, $fields_flow_action=$fields_flow_action, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Get Flow Action Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_messages) +#### [Get Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow) ```php ## Positional Arguments @@ -2142,31 +2338,38 @@ $klaviyo->Flows->getFlowActionFlow($id, $fields_flow=$fields_flow); ## Keyword Arguments -# $fields_flow_message | string[] -# $filter | string -# $page_size | int -# $sort | string +# $fields_flow_action | string[] +# $fields_flow | string[] +# $fields_tag | string[] +# $include | string[] -$klaviyo->Flows->getFlowActionMessages($id, $fields_flow_message=$fields_flow_message, $filter=$filter, $page_size=$page_size, $sort=$sort); +$klaviyo->Flows->getFlow($id, $fields_flow_action=$fields_flow_action, $fields_flow=$fields_flow, $fields_tag=$fields_tag, $include=$include); ``` -#### [Get Flow Action Relationships Flow](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_relationships_flow) +#### [Get Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_action) ```php ## Positional Arguments # $id | string -$klaviyo->Flows->getFlowActionRelationshipsFlow($id); +## Keyword Arguments + +# $fields_flow_action | string[] +# $fields_flow_message | string[] +# $fields_flow | string[] +# $include | string[] + +$klaviyo->Flows->getFlowAction($id, $fields_flow_action=$fields_flow_action, $fields_flow_message=$fields_flow_message, $fields_flow=$fields_flow, $include=$include); ``` -#### [Get Flow Action Relationships Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_relationships_messages) +#### [Get Flow For Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_action_flow) ```php ## Positional Arguments @@ -2175,39 +2378,32 @@ $klaviyo->Flows->getFlowActionRelationshipsFlow($id); ## Keyword Arguments -# $filter | string -# $page_cursor | string -# $page_size | int -# $sort | string +# $fields_flow | string[] -$klaviyo->Flows->getFlowActionRelationshipsMessages($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Flows->getFlowActionFlow($id, $fields_flow=$fields_flow); ``` -#### [Get Flow Flow Actions](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_flow_actions) +#### [Get Flow ID for Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_id_for_flow_action) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $fields_flow_action | string[] -# $filter | string -# $page_cursor | string -# $page_size | int -# $sort | string - -$klaviyo->Flows->getFlowFlowActions($id, $fields_flow_action=$fields_flow_action, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Flows->getFlowIdForFlowAction($id); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowActionRelationshipsFlow($id); ``` -#### [Get Flow Message](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message) +#### [Get Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_message) ```php ## Positional Arguments @@ -2227,7 +2423,7 @@ $klaviyo->Flows->getFlowMessage($id, $fields_flow_action=$fields_flow_action, $f -#### [Get Flow Action For Message](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_action) +#### [Get Flow Action For Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_message_action) ```php ## Positional Arguments @@ -2244,33 +2440,45 @@ $klaviyo->Flows->getFlowMessageAction($id, $fields_flow_action=$fields_flow_acti -#### [Get Flow Message Relationships Action](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_relationships_action) +#### [Get Flow Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_tags) ```php ## Positional Arguments # $id | string -$klaviyo->Flows->getFlowMessageRelationshipsAction($id); +## Keyword Arguments + +# $fields_tag | string[] + +$klaviyo->Flows->getFlowTags($id, $fields_tag=$fields_tag); ``` -#### [Get Flow Message Relationships Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_relationships_template) +#### [Get Flows](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flows) ```php -## Positional Arguments -# $id | string +## Keyword Arguments -$klaviyo->Flows->getFlowMessageRelationshipsTemplate($id); +# $fields_flow_action | string[] +# $fields_flow | string[] +# $fields_tag | string[] +# $filter | string +# $include | string[] +# $page_cursor | string +# $page_size | int +# $sort | string + +$klaviyo->Flows->getFlows($fields_flow_action=$fields_flow_action, $fields_flow=$fields_flow, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Get Flow Message Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_template) +#### [Get Message IDs for Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_message_ids_for_flow_action) ```php ## Positional Arguments @@ -2279,15 +2487,22 @@ $klaviyo->Flows->getFlowMessageRelationshipsTemplate($id); ## Keyword Arguments -# $fields_template | string[] +# $filter | string +# $page_cursor | string +# $page_size | int +# $sort | string -$klaviyo->Flows->getFlowMessageTemplate($id, $fields_template=$fields_template); +$klaviyo->Flows->getMessageIdsForFlowAction($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowActionRelationshipsMessages($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Get Flow Relationships Flow Actions](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_relationships_flow_actions) +#### [Get Messages for Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_messages_for_flow_action) ```php ## Positional Arguments @@ -2296,30 +2511,39 @@ $klaviyo->Flows->getFlowMessageTemplate($id, $fields_template=$fields_template); ## Keyword Arguments +# $fields_flow_message | string[] # $filter | string # $page_size | int # $sort | string -$klaviyo->Flows->getFlowRelationshipsFlowActions($id, $filter=$filter, $page_size=$page_size, $sort=$sort); +$klaviyo->Flows->getMessagesForFlowAction($id, $fields_flow_message=$fields_flow_message, $filter=$filter, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowActionMessages($id, $fields_flow_message=$fields_flow_message, $filter=$filter, $page_size=$page_size, $sort=$sort); ``` -#### [Get Flow Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_relationships_tags) +#### [Get Tag IDs for Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_flow) ```php ## Positional Arguments # $id | string +$klaviyo->Flows->getTagIdsForFlow($id); +``` +##### Method alias: +```php $klaviyo->Flows->getFlowRelationshipsTags($id); ``` -#### [Get Flow Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_tags) +#### [Get Template for Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_for_flow_message) ```php ## Positional Arguments @@ -2328,36 +2552,36 @@ $klaviyo->Flows->getFlowRelationshipsTags($id); ## Keyword Arguments -# $fields_tag | string[] +# $fields_template | string[] -$klaviyo->Flows->getFlowTags($id, $fields_tag=$fields_tag); +$klaviyo->Flows->getTemplateForFlowMessage($id, $fields_template=$fields_template); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowMessageTemplate($id, $fields_template=$fields_template); ``` -#### [Get Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flows) +#### [Get Template ID for Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_id_for_flow_message) ```php +## Positional Arguments -## Keyword Arguments - -# $fields_flow_action | string[] -# $fields_flow | string[] -# $fields_tag | string[] -# $filter | string -# $include | string[] -# $page_cursor | string -# $page_size | int -# $sort | string +# $id | string -$klaviyo->Flows->getFlows($fields_flow_action=$fields_flow_action, $fields_flow=$fields_flow, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Flows->getTemplateIdForFlowMessage($id); +``` +##### Method alias: +```php +$klaviyo->Flows->getFlowMessageRelationshipsTemplate($id); ``` -#### [Update Flow Status](https://developers.klaviyo.com/en/v2024-07-15/reference/update_flow) +#### [Update Flow Status](https://developers.klaviyo.com/en/v2024-10-15/reference/update_flow) ```php ## Positional Arguments @@ -2375,7 +2599,7 @@ $klaviyo->Flows->updateFlow($id, $body); ## Forms -#### [Get Form](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form) +#### [Get Form](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form) ```php ## Positional Arguments @@ -2394,7 +2618,7 @@ $klaviyo->Forms->getForm($id, $fields_form_version=$fields_form_version, $fields -#### [Get Form for Form Version](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form_for_form_version) +#### [Get Form for Form Version](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form_for_form_version) ```php ## Positional Arguments @@ -2415,7 +2639,7 @@ $klaviyo->Forms->getFormVersionForm($id, $fields_form=$fields_form); -#### [Get Form ID for Form Version](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form_id_for_form_version) +#### [Get Form ID for Form Version](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form_id_for_form_version) ```php ## Positional Arguments @@ -2432,7 +2656,7 @@ $klaviyo->Forms->getFormVersionRelationshipsForm($id); -#### [Get Form Version](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form_version) +#### [Get Form Version](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form_version) ```php ## Positional Arguments @@ -2449,7 +2673,7 @@ $klaviyo->Forms->getFormVersion($id, $fields_form_version=$fields_form_version); -#### [Get Forms](https://developers.klaviyo.com/en/v2024-07-15/reference/get_forms) +#### [Get Forms](https://developers.klaviyo.com/en/v2024-10-15/reference/get_forms) ```php @@ -2467,7 +2691,7 @@ $klaviyo->Forms->getForms($fields_form=$fields_form, $filter=$filter, $page_curs -#### [Get Version IDs for Form](https://developers.klaviyo.com/en/v2024-07-15/reference/get_version_ids_for_form) +#### [Get Version IDs for Form](https://developers.klaviyo.com/en/v2024-10-15/reference/get_version_ids_for_form) ```php ## Positional Arguments @@ -2484,7 +2708,7 @@ $klaviyo->Forms->getFormRelationshipsFormVersions($id); -#### [Get Versions for Form](https://developers.klaviyo.com/en/v2024-07-15/reference/get_versions_for_form) +#### [Get Versions for Form](https://developers.klaviyo.com/en/v2024-10-15/reference/get_versions_for_form) ```php ## Positional Arguments @@ -2513,7 +2737,7 @@ $klaviyo->Forms->getFormFormVersions($id, $fields_form_version=$fields_form_vers ## Images -#### [Get Image](https://developers.klaviyo.com/en/v2024-07-15/reference/get_image) +#### [Get Image](https://developers.klaviyo.com/en/v2024-10-15/reference/get_image) ```php ## Positional Arguments @@ -2530,7 +2754,7 @@ $klaviyo->Images->getImage($id, $fields_image=$fields_image); -#### [Get Images](https://developers.klaviyo.com/en/v2024-07-15/reference/get_images) +#### [Get Images](https://developers.klaviyo.com/en/v2024-10-15/reference/get_images) ```php @@ -2548,7 +2772,7 @@ $klaviyo->Images->getImages($fields_image=$fields_image, $filter=$filter, $page_ -#### [Update Image](https://developers.klaviyo.com/en/v2024-07-15/reference/update_image) +#### [Update Image](https://developers.klaviyo.com/en/v2024-10-15/reference/update_image) ```php ## Positional Arguments @@ -2562,7 +2786,7 @@ $klaviyo->Images->updateImage($id, $body); -#### [Upload Image From File](https://developers.klaviyo.com/en/v2024-07-15/reference/upload_image_from_file) +#### [Upload Image From File](https://developers.klaviyo.com/en/v2024-10-15/reference/upload_image_from_file) ```php ## Positional Arguments @@ -2584,7 +2808,7 @@ $klaviyo->Images->createImageUpload($file, $name=$name, $hidden=$hidden); -#### [Upload Image From URL](https://developers.klaviyo.com/en/v2024-07-15/reference/upload_image_from_url) +#### [Upload Image From URL](https://developers.klaviyo.com/en/v2024-10-15/reference/upload_image_from_url) ```php ## Positional Arguments @@ -2605,7 +2829,7 @@ $klaviyo->Images->createImage($body); ## Lists -#### [Create List](https://developers.klaviyo.com/en/v2024-07-15/reference/create_list) +#### [Create List](https://developers.klaviyo.com/en/v2024-10-15/reference/create_list) ```php ## Positional Arguments @@ -2618,7 +2842,7 @@ $klaviyo->Lists->createList($body); -#### [Add Profile To List](https://developers.klaviyo.com/en/v2024-07-15/reference/create_list_relationships) +#### [Add Profile To List](https://developers.klaviyo.com/en/v2024-10-15/reference/create_list_relationships) ```php ## Positional Arguments @@ -2636,7 +2860,7 @@ $klaviyo->Lists->createListRelationshipsProfile($id, $body); -#### [Delete List](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_list) +#### [Delete List](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_list) ```php ## Positional Arguments @@ -2649,7 +2873,7 @@ $klaviyo->Lists->deleteList($id); -#### [Remove Profile From List](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_list_relationships) +#### [Remove Profile From List](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_list_relationships) ```php ## Positional Arguments @@ -2667,7 +2891,7 @@ $klaviyo->Lists->deleteListRelationshipsProfiles($id, $body); -#### [Get List](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list) +#### [Get List](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list) ```php ## Positional Arguments @@ -2677,17 +2901,18 @@ $klaviyo->Lists->deleteListRelationshipsProfiles($id, $body); ## Keyword Arguments # $additional_fields_list | string[] +# $fields_flow | string[] # $fields_list | string[] # $fields_tag | string[] # $include | string[] -$klaviyo->Lists->getList($id, $additional_fields_list=$additional_fields_list, $fields_list=$fields_list, $fields_tag=$fields_tag, $include=$include); +$klaviyo->Lists->getList($id, $additional_fields_list=$additional_fields_list, $fields_flow=$fields_flow, $fields_list=$fields_list, $fields_tag=$fields_tag, $include=$include); ``` -#### [Get List Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_profiles) +#### [Get List Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_flow_triggers) ```php ## Positional Arguments @@ -2696,20 +2921,15 @@ $klaviyo->Lists->getList($id, $additional_fields_list=$additional_fields_list, $ ## Keyword Arguments -# $additional_fields_profile | string[] -# $fields_profile | string[] -# $filter | string -# $page_cursor | string -# $page_size | int -# $sort | string +# $fields_flow | string[] -$klaviyo->Lists->getListProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Lists->getListFlowTriggers($id, $fields_flow=$fields_flow); ``` -#### [Get List Relationships Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_relationships_profiles) +#### [Get List Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_profiles) ```php ## Positional Arguments @@ -2718,31 +2938,33 @@ $klaviyo->Lists->getListProfiles($id, $additional_fields_profile=$additional_fie ## Keyword Arguments +# $additional_fields_profile | string[] +# $fields_profile | string[] # $filter | string # $page_cursor | string # $page_size | int # $sort | string -$klaviyo->Lists->getListRelationshipsProfiles($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Lists->getListProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Get List Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_relationships_tags) +#### [Get List Relationships Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_relationships_flow_triggers) ```php ## Positional Arguments # $id | string -$klaviyo->Lists->getListRelationshipsTags($id); +$klaviyo->Lists->getListRelationshipsFlowTriggers($id); ``` -#### [Get List Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_tags) +#### [Get List Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_tags) ```php ## Positional Arguments @@ -2759,12 +2981,13 @@ $klaviyo->Lists->getListTags($id, $fields_tag=$fields_tag); -#### [Get Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_lists) +#### [Get Lists](https://developers.klaviyo.com/en/v2024-10-15/reference/get_lists) ```php ## Keyword Arguments +# $fields_flow | string[] # $fields_list | string[] # $fields_tag | string[] # $filter | string @@ -2772,13 +2995,54 @@ $klaviyo->Lists->getListTags($id, $fields_tag=$fields_tag); # $page_cursor | string # $sort | string -$klaviyo->Lists->getLists($fields_list=$fields_list, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Lists->getLists($fields_flow=$fields_flow, $fields_list=$fields_list, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); +``` + + + + +#### [Get Profile IDs for List](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_ids_for_list) + +```php +## Positional Arguments + +# $id | string + +## Keyword Arguments + +# $filter | string +# $page_cursor | string +# $page_size | int +# $sort | string + +$klaviyo->Lists->getProfileIdsForList($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Lists->getListRelationshipsProfiles($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` + + + + +#### [Get Tag IDs for List](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_list) + +```php +## Positional Arguments + +# $id | string + +$klaviyo->Lists->getTagIdsForList($id); +``` +##### Method alias: +```php +$klaviyo->Lists->getListRelationshipsTags($id); ``` -#### [Update List](https://developers.klaviyo.com/en/v2024-07-15/reference/update_list) +#### [Update List](https://developers.klaviyo.com/en/v2024-10-15/reference/update_list) ```php ## Positional Arguments @@ -2796,7 +3060,7 @@ $klaviyo->Lists->updateList($id, $body); ## Metrics -#### [Get Metric](https://developers.klaviyo.com/en/v2024-07-15/reference/get_metric) +#### [Get Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric) ```php ## Positional Arguments @@ -2805,118 +3069,447 @@ $klaviyo->Lists->updateList($id, $body); ## Keyword Arguments +# $fields_flow | string[] # $fields_metric | string[] +# $include | string[] -$klaviyo->Metrics->getMetric($id, $fields_metric=$fields_metric); +$klaviyo->Metrics->getMetric($id, $fields_flow=$fields_flow, $fields_metric=$fields_metric, $include=$include); ``` -#### [Get Metrics](https://developers.klaviyo.com/en/v2024-07-15/reference/get_metrics) +#### [Get Metric Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_flow_triggers) ```php +## Positional Arguments + +# $id | string ## Keyword Arguments -# $fields_metric | string[] -# $filter | string -# $page_cursor | string +# $fields_flow | string[] -$klaviyo->Metrics->getMetrics($fields_metric=$fields_metric, $filter=$filter, $page_cursor=$page_cursor); +$klaviyo->Metrics->getMetricFlowTriggers($id, $fields_flow=$fields_flow); ``` -#### [Query Metric Aggregates](https://developers.klaviyo.com/en/v2024-07-15/reference/query_metric_aggregates) +#### [Get Metric for Metric Property](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_for_metric_property) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Metrics->queryMetricAggregates($body); +## Keyword Arguments + +# $fields_metric | string[] + +$klaviyo->Metrics->getMetricForMetricProperty($id, $fields_metric=$fields_metric); ``` ##### Method alias: ```php -$klaviyo->Metrics->createMetricAggregate($body); +$klaviyo->Metrics->getMetricPropertyMetric($id, $fields_metric=$fields_metric); ``` - - -## Profiles - -#### [Create or Update Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/create_or_update_profile) +#### [Get Metric ID for Metric Property](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_id_for_metric_property) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->createOrUpdateProfile($body); +$klaviyo->Metrics->getMetricIdForMetricProperty($id); ``` ##### Method alias: ```php -$klaviyo->Profiles->createProfileImport($body); +$klaviyo->Metrics->getMetricPropertyRelationshipsMetric($id); ``` -#### [Create Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/create_profile) +#### [Get Metric Property](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_property) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->createProfile($body); +## Keyword Arguments + +# $additional_fields_metric_property | string[] +# $fields_metric_property | string[] +# $fields_metric | string[] +# $include | string[] + +$klaviyo->Metrics->getMetricProperty($id, $additional_fields_metric_property=$additional_fields_metric_property, $fields_metric_property=$fields_metric_property, $fields_metric=$fields_metric, $include=$include); ``` -#### [Create or Update Push Token](https://developers.klaviyo.com/en/v2024-07-15/reference/create_push_token) +#### [Get Metric Relationships Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_relationships_flow_triggers) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->createPushToken($body); +$klaviyo->Metrics->getMetricRelationshipsFlowTriggers($id); ``` -#### [Get Bulk Profile Import Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job) +#### [Get Metrics](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metrics) ```php -## Positional Arguments - -# $job_id | string ## Keyword Arguments -# $fields_list | string[] -# $fields_profile_bulk_import_job | string[] +# $fields_flow | string[] +# $fields_metric | string[] +# $filter | string # $include | string[] +# $page_cursor | string -$klaviyo->Profiles->getBulkProfileImportJob($job_id, $fields_list=$fields_list, $fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $include=$include); +$klaviyo->Metrics->getMetrics($fields_flow=$fields_flow, $fields_metric=$fields_metric, $filter=$filter, $include=$include, $page_cursor=$page_cursor); ``` -##### Method alias: -```php + + + + +#### [Get Properties for Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_properties_for_metric) + +```php +## Positional Arguments + +# $id | string + +## Keyword Arguments + +# $additional_fields_metric_property | string[] +# $fields_metric_property | string[] + +$klaviyo->Metrics->getPropertiesForMetric($id, $additional_fields_metric_property=$additional_fields_metric_property, $fields_metric_property=$fields_metric_property); +``` +##### Method alias: +```php +$klaviyo->Metrics->getMetricMetricProperties($id, $additional_fields_metric_property=$additional_fields_metric_property, $fields_metric_property=$fields_metric_property); +``` + + + + +#### [Get Property IDs for Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_property_ids_for_metric) + +```php +## Positional Arguments + +# $id | string + +$klaviyo->Metrics->getPropertyIdsForMetric($id); +``` +##### Method alias: +```php +$klaviyo->Metrics->getMetricRelationshipsMetricProperties($id); +``` + + + + +#### [Query Metric Aggregates](https://developers.klaviyo.com/en/v2024-10-15/reference/query_metric_aggregates) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Metrics->queryMetricAggregates($body); +``` +##### Method alias: +```php +$klaviyo->Metrics->createMetricAggregate($body); +``` + + + + + + +## Profiles + +#### [Bulk Subscribe Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_subscribe_profiles) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->bulkSubscribeProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->subscribeProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->createProfileSubscriptionBulkCreateJob($body); +``` + + + + +#### [Bulk Suppress Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_suppress_profiles) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->bulkSuppressProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->suppressProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->createProfileSuppressionBulkCreateJob($body); +``` + + + + +#### [Bulk Unsubscribe Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_unsubscribe_profiles) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->bulkUnsubscribeProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->unsubscribeProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->createProfileSubscriptionBulkDeleteJob($body); +``` + + + + +#### [Bulk Unsuppress Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_unsuppress_profiles) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->bulkUnsuppressProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->unsuppressProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->createProfileSuppressionBulkDeleteJob($body); +``` + + + + +#### [Create or Update Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/create_or_update_profile) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->createOrUpdateProfile($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->createProfileImport($body); +``` + + + + +#### [Create Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/create_profile) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->createProfile($body); +``` + + + + +#### [Create or Update Push Token](https://developers.klaviyo.com/en/v2024-10-15/reference/create_push_token) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->createPushToken($body); +``` + + + + +#### [Get Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_import_profiles_job) + +```php +## Positional Arguments + +# $job_id | string + +## Keyword Arguments + +# $fields_list | string[] +# $fields_profile_bulk_import_job | string[] +# $include | string[] + +$klaviyo->Profiles->getBulkImportProfilesJob($job_id, $fields_list=$fields_list, $fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $include=$include); +``` +##### Method alias: +```php +$klaviyo->Profiles->getBulkProfileImportJob($job_id, $fields_list=$fields_list, $fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $include=$include); +``` +##### Method alias: +```php $klaviyo->Profiles->getProfileBulkImportJob($job_id, $fields_list=$fields_list, $fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $include=$include); ``` -#### [Get Bulk Profile Import Job Errors](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_import_errors) +#### [Get Bulk Import Profiles Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_import_profiles_jobs) + +```php + +## Keyword Arguments + +# $fields_profile_bulk_import_job | string[] +# $filter | string +# $page_cursor | string +# $page_size | int +# $sort | string + +$klaviyo->Profiles->getBulkImportProfilesJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Profiles->getBulkProfileImportJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileBulkImportJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` + + + + +#### [Get Bulk Suppress Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_suppress_profiles_job) + +```php +## Positional Arguments + +# $job_id | string + +## Keyword Arguments + +# $fields_profile_suppression_bulk_create_job | string[] + +$klaviyo->Profiles->getBulkSuppressProfilesJob($job_id, $fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileSuppressionBulkCreateJob($job_id, $fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job); +``` + + + + +#### [Get Bulk Suppress Profiles Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_suppress_profiles_jobs) + +```php + +## Keyword Arguments + +# $fields_profile_suppression_bulk_create_job | string[] +# $filter | string +# $page_cursor | string +# $sort | string + +$klaviyo->Profiles->getBulkSuppressProfilesJobs($fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileSuppressionBulkCreateJobs($fields_profile_suppression_bulk_create_job=$fields_profile_suppression_bulk_create_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +``` + + + + +#### [Get Bulk Unsuppress Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_unsuppress_profiles_job) + +```php +## Positional Arguments + +# $job_id | string + +## Keyword Arguments + +# $fields_profile_suppression_bulk_delete_job | string[] + +$klaviyo->Profiles->getBulkUnsuppressProfilesJob($job_id, $fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileSuppressionBulkDeleteJob($job_id, $fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job); +``` + + + + +#### [Get Bulk Unsuppress Profiles Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_unsuppress_profiles_jobs) + +```php + +## Keyword Arguments + +# $fields_profile_suppression_bulk_delete_job | string[] +# $filter | string +# $page_cursor | string +# $sort | string + +$klaviyo->Profiles->getBulkUnsuppressProfilesJobs($fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileSuppressionBulkDeleteJobs($fields_profile_suppression_bulk_delete_job=$fields_profile_suppression_bulk_delete_job, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +``` + + + + +#### [Get Errors for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_errors_for_bulk_import_profiles_job) ```php ## Positional Arguments @@ -2929,6 +3522,10 @@ $klaviyo->Profiles->getProfileBulkImportJob($job_id, $fields_list=$fields_list, # $page_cursor | string # $page_size | int +$klaviyo->Profiles->getErrorsForBulkImportProfilesJob($id, $fields_import_error=$fields_import_error, $page_cursor=$page_cursor, $page_size=$page_size); +``` +##### Method alias: +```php $klaviyo->Profiles->getBulkProfileImportJobImportErrors($id, $fields_import_error=$fields_import_error, $page_cursor=$page_cursor, $page_size=$page_size); ``` ##### Method alias: @@ -2939,7 +3536,7 @@ $klaviyo->Profiles->getProfileBulkImportJobImportErrors($id, $fields_import_erro -#### [Get Bulk Profile Import Job Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_lists) +#### [Get List for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_for_bulk_import_profiles_job) ```php ## Positional Arguments @@ -2950,6 +3547,10 @@ $klaviyo->Profiles->getProfileBulkImportJobImportErrors($id, $fields_import_erro # $fields_list | string[] +$klaviyo->Profiles->getListForBulkImportProfilesJob($id, $fields_list=$fields_list); +``` +##### Method alias: +```php $klaviyo->Profiles->getBulkProfileImportJobLists($id, $fields_list=$fields_list); ``` ##### Method alias: @@ -2960,7 +3561,66 @@ $klaviyo->Profiles->getProfileBulkImportJobLists($id, $fields_list=$fields_list) -#### [Get Bulk Profile Import Job Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_profiles) +#### [Get List IDs for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_ids_for_bulk_import_profiles_job) + +```php +## Positional Arguments + +# $id | string + +$klaviyo->Profiles->getListIdsForBulkImportProfilesJob($id); +``` +##### Method alias: +```php +$klaviyo->Profiles->getBulkProfileImportJobRelationshipsLists($id); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileBulkImportJobRelationshipsLists($id); +``` + + + + +#### [Get List IDs for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_ids_for_profile) + +```php +## Positional Arguments + +# $id | string + +$klaviyo->Profiles->getListIdsForProfile($id); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileRelationshipsLists($id); +``` + + + + +#### [Get Lists for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_lists_for_profile) + +```php +## Positional Arguments + +# $id | string + +## Keyword Arguments + +# $fields_list | string[] + +$klaviyo->Profiles->getListsForProfile($id, $fields_list=$fields_list); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileLists($id, $fields_list=$fields_list); +``` + + + + +#### [Get Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile) ```php ## Positional Arguments @@ -2970,10 +3630,80 @@ $klaviyo->Profiles->getProfileBulkImportJobLists($id, $fields_list=$fields_list) ## Keyword Arguments # $additional_fields_profile | string[] +# $fields_list | string[] # $fields_profile | string[] +# $fields_segment | string[] +# $include | string[] + +$klaviyo->Profiles->getProfile($id, $additional_fields_profile=$additional_fields_profile, $fields_list=$fields_list, $fields_profile=$fields_profile, $fields_segment=$fields_segment, $include=$include); +``` + + + + +#### [Get Profile IDs for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_ids_for_bulk_import_profiles_job) + +```php +## Positional Arguments + +# $id | string + +## Keyword Arguments + # $page_cursor | string # $page_size | int +$klaviyo->Profiles->getProfileIdsForBulkImportProfilesJob($id, $page_cursor=$page_cursor, $page_size=$page_size); +``` +##### Method alias: +```php +$klaviyo->Profiles->getBulkProfileImportJobRelationshipsProfiles($id, $page_cursor=$page_cursor, $page_size=$page_size); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileBulkImportJobRelationshipsProfiles($id, $page_cursor=$page_cursor, $page_size=$page_size); +``` + + + + +#### [Get Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profiles) + +```php + +## Keyword Arguments + +# $additional_fields_profile | string[] +# $fields_profile | string[] +# $filter | string +# $page_cursor | string +# $page_size | int +# $sort | string + +$klaviyo->Profiles->getProfiles($additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` + + + + +#### [Get Profiles for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profiles_for_bulk_import_profiles_job) + +```php +## Positional Arguments + +# $id | string + +## Keyword Arguments + +# $additional_fields_profile | string[] +# $fields_profile | string[] +# $page_cursor | string +# $page_size | int + +$klaviyo->Profiles->getProfilesForBulkImportProfilesJob($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $page_cursor=$page_cursor, $page_size=$page_size); +``` +##### Method alias: +```php $klaviyo->Profiles->getBulkProfileImportJobProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $page_cursor=$page_cursor, $page_size=$page_size); ``` ##### Method alias: @@ -2984,132 +3714,236 @@ $klaviyo->Profiles->getProfileBulkImportJobProfiles($id, $additional_fields_prof -#### [Get Bulk Profile Import Job Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_relationships_lists) +#### [Get Segment IDs for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_ids_for_profile) + +```php +## Positional Arguments + +# $id | string + +$klaviyo->Profiles->getSegmentIdsForProfile($id); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileRelationshipsSegments($id); +``` + + + + +#### [Get Segments for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segments_for_profile) + +```php +## Positional Arguments + +# $id | string + +## Keyword Arguments + +# $fields_segment | string[] + +$klaviyo->Profiles->getSegmentsForProfile($id, $fields_segment=$fields_segment); +``` +##### Method alias: +```php +$klaviyo->Profiles->getProfileSegments($id, $fields_segment=$fields_segment); +``` + + + + +#### [Merge Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/merge_profiles) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->mergeProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->createProfileMerge($body); +``` + + + + +#### [Spawn Bulk Profile Import Job](https://developers.klaviyo.com/en/v2024-10-15/reference/spawn_bulk_profile_import_job) + +```php +## Positional Arguments + +# $body | associative array + +$klaviyo->Profiles->spawnBulkProfileImportJob($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->bulkImportProfiles($body); +``` +##### Method alias: +```php +$klaviyo->Profiles->createProfileBulkImportJob($body); +``` + + + + +#### [Update Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/update_profile) + +```php +## Positional Arguments + +# $id | string +# $body | associative array + +$klaviyo->Profiles->updateProfile($id, $body); +``` + + + + + + +## Reporting + +#### [Query Campaign Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_campaign_values) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Profiles->getBulkProfileImportJobRelationshipsLists($id); +## Keyword Arguments + +# $page_cursor | string + +$klaviyo->Reporting->queryCampaignValues($body, $page_cursor=$page_cursor); ``` ##### Method alias: ```php -$klaviyo->Profiles->getProfileBulkImportJobRelationshipsLists($id); +$klaviyo->Reporting->createCampaignValueReport($body, $page_cursor=$page_cursor); ``` -#### [Get Bulk Profile Import Job Relationships Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_relationships_profiles) +#### [Query Flow Series](https://developers.klaviyo.com/en/v2024-10-15/reference/query_flow_series) ```php ## Positional Arguments -# $id | string +# $body | associative array ## Keyword Arguments # $page_cursor | string -# $page_size | int -$klaviyo->Profiles->getBulkProfileImportJobRelationshipsProfiles($id, $page_cursor=$page_cursor, $page_size=$page_size); +$klaviyo->Reporting->queryFlowSeries($body, $page_cursor=$page_cursor); ``` ##### Method alias: ```php -$klaviyo->Profiles->getProfileBulkImportJobRelationshipsProfiles($id, $page_cursor=$page_cursor, $page_size=$page_size); +$klaviyo->Reporting->createFlowSeryReport($body, $page_cursor=$page_cursor); ``` -#### [Get Bulk Profile Import Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_jobs) +#### [Query Flow Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_flow_values) ```php +## Positional Arguments + +# $body | associative array ## Keyword Arguments -# $fields_profile_bulk_import_job | string[] -# $filter | string # $page_cursor | string -# $page_size | int -# $sort | string -$klaviyo->Profiles->getBulkProfileImportJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Reporting->queryFlowValues($body, $page_cursor=$page_cursor); ``` ##### Method alias: ```php -$klaviyo->Profiles->getProfileBulkImportJobs($fields_profile_bulk_import_job=$fields_profile_bulk_import_job, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Reporting->createFlowValueReport($body, $page_cursor=$page_cursor); ``` -#### [Get Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile) +#### [Query Form Series](https://developers.klaviyo.com/en/v2024-10-15/reference/query_form_series) ```php ## Positional Arguments -# $id | string - -## Keyword Arguments - -# $additional_fields_profile | string[] -# $fields_list | string[] -# $fields_profile | string[] -# $fields_segment | string[] -# $include | string[] +# $body | associative array -$klaviyo->Profiles->getProfile($id, $additional_fields_profile=$additional_fields_profile, $fields_list=$fields_list, $fields_profile=$fields_profile, $fields_segment=$fields_segment, $include=$include); +$klaviyo->Reporting->queryFormSeries($body); +``` +##### Method alias: +```php +$klaviyo->Reporting->createFormSeryReport($body); ``` -#### [Get Profile Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_lists) +#### [Query Form Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_form_values) ```php ## Positional Arguments -# $id | string - -## Keyword Arguments - -# $fields_list | string[] +# $body | associative array -$klaviyo->Profiles->getProfileLists($id, $fields_list=$fields_list); +$klaviyo->Reporting->queryFormValues($body); +``` +##### Method alias: +```php +$klaviyo->Reporting->createFormValueReport($body); ``` -#### [Get Profile Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_relationships_lists) +#### [Query Segment Series](https://developers.klaviyo.com/en/v2024-10-15/reference/query_segment_series) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Profiles->getProfileRelationshipsLists($id); +$klaviyo->Reporting->querySegmentSeries($body); +``` +##### Method alias: +```php +$klaviyo->Reporting->createSegmentSeryReport($body); ``` -#### [Get Profile Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_relationships_segments) +#### [Query Segment Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_segment_values) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Profiles->getProfileRelationshipsSegments($id); +$klaviyo->Reporting->querySegmentValues($body); +``` +##### Method alias: +```php +$klaviyo->Reporting->createSegmentValueReport($body); ``` -#### [Get Profile Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_segments) + + +## Reviews + +#### [Get Review](https://developers.klaviyo.com/en/v2024-10-15/reference/get_review) ```php ## Positional Arguments @@ -3118,500 +3952,512 @@ $klaviyo->Profiles->getProfileRelationshipsSegments($id); ## Keyword Arguments -# $fields_segment | string[] +# $fields_event | string[] +# $fields_review | string[] +# $include | string[] -$klaviyo->Profiles->getProfileSegments($id, $fields_segment=$fields_segment); +$klaviyo->Reviews->getReview($id, $fields_event=$fields_event, $fields_review=$fields_review, $include=$include); ``` -#### [Get Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profiles) +#### [Get Reviews](https://developers.klaviyo.com/en/v2024-10-15/reference/get_reviews) ```php ## Keyword Arguments -# $additional_fields_profile | string[] -# $fields_profile | string[] +# $fields_event | string[] +# $fields_review | string[] # $filter | string +# $include | string[] # $page_cursor | string # $page_size | int # $sort | string -$klaviyo->Profiles->getProfiles($additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Reviews->getReviews($fields_event=$fields_event, $fields_review=$fields_review, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Merge Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/merge_profiles) + + +## Segments + +#### [Create Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/create_segment) ```php ## Positional Arguments # $body | associative array -$klaviyo->Profiles->mergeProfiles($body); -``` -##### Method alias: -```php -$klaviyo->Profiles->createProfileMerge($body); +$klaviyo->Segments->createSegment($body); ``` -#### [Spawn Bulk Profile Import Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_bulk_profile_import_job) +#### [Delete Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_segment) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->spawnBulkProfileImportJob($body); -``` -##### Method alias: -```php -$klaviyo->Profiles->createProfileBulkImportJob($body); +$klaviyo->Segments->deleteSegment($id); ``` -#### [Subscribe Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/subscribe_profiles) +#### [Get Profile IDs for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_ids_for_segment) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->subscribeProfiles($body); +## Keyword Arguments + +# $filter | string +# $page_cursor | string +# $page_size | int +# $sort | string + +$klaviyo->Segments->getProfileIdsForSegment($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` ##### Method alias: ```php -$klaviyo->Profiles->createProfileSubscriptionBulkCreateJob($body); +$klaviyo->Segments->getSegmentRelationshipsProfiles($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Suppress Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/suppress_profiles) +#### [Get Profiles for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profiles_for_segment) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->suppressProfiles($body); +## Keyword Arguments + +# $additional_fields_profile | string[] +# $fields_profile | string[] +# $filter | string +# $page_cursor | string +# $page_size | int +# $sort | string + +$klaviyo->Segments->getProfilesForSegment($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` ##### Method alias: ```php -$klaviyo->Profiles->createProfileSuppressionBulkCreateJob($body); +$klaviyo->Segments->getSegmentProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Unsubscribe Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/unsubscribe_profiles) +#### [Get Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->unsubscribeProfiles($body); -``` -##### Method alias: -```php -$klaviyo->Profiles->createProfileSubscriptionBulkDeleteJob($body); +## Keyword Arguments + +# $additional_fields_segment | string[] +# $fields_flow | string[] +# $fields_segment | string[] +# $fields_tag | string[] +# $include | string[] + +$klaviyo->Segments->getSegment($id, $additional_fields_segment=$additional_fields_segment, $fields_flow=$fields_flow, $fields_segment=$fields_segment, $fields_tag=$fields_tag, $include=$include); ``` -#### [Unsuppress Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/unsuppress_profiles) +#### [Get Segment Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_flow_triggers) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Profiles->unsuppressProfiles($body); -``` -##### Method alias: -```php -$klaviyo->Profiles->createProfileSuppressionBulkDeleteJob($body); +## Keyword Arguments + +# $fields_flow | string[] + +$klaviyo->Segments->getSegmentFlowTriggers($id, $fields_flow=$fields_flow); ``` -#### [Update Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/update_profile) +#### [Get Segment Relationships Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_relationships_flow_triggers) ```php ## Positional Arguments # $id | string -# $body | associative array -$klaviyo->Profiles->updateProfile($id, $body); +$klaviyo->Segments->getSegmentRelationshipsFlowTriggers($id); ``` - - -## Reporting - -#### [Query Campaign Values](https://developers.klaviyo.com/en/v2024-07-15/reference/query_campaign_values) +#### [Get Segments](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segments) ```php -## Positional Arguments - -# $body | associative array ## Keyword Arguments +# $fields_flow | string[] +# $fields_segment | string[] +# $fields_tag | string[] +# $filter | string +# $include | string[] # $page_cursor | string +# $sort | string -$klaviyo->Reporting->queryCampaignValues($body, $page_cursor=$page_cursor); -``` -##### Method alias: -```php -$klaviyo->Reporting->createCampaignValueReport($body, $page_cursor=$page_cursor); +$klaviyo->Segments->getSegments($fields_flow=$fields_flow, $fields_segment=$fields_segment, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Query Flow Series](https://developers.klaviyo.com/en/v2024-07-15/reference/query_flow_series) +#### [Get Tag IDs for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_segment) ```php ## Positional Arguments -# $body | associative array - -## Keyword Arguments - -# $page_cursor | string +# $id | string -$klaviyo->Reporting->queryFlowSeries($body, $page_cursor=$page_cursor); +$klaviyo->Segments->getTagIdsForSegment($id); ``` ##### Method alias: ```php -$klaviyo->Reporting->createFlowSeryReport($body, $page_cursor=$page_cursor); +$klaviyo->Segments->getSegmentRelationshipsTags($id); ``` -#### [Query Flow Values](https://developers.klaviyo.com/en/v2024-07-15/reference/query_flow_values) +#### [Get Tags for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tags_for_segment) ```php ## Positional Arguments -# $body | associative array +# $id | string ## Keyword Arguments -# $page_cursor | string +# $fields_tag | string[] -$klaviyo->Reporting->queryFlowValues($body, $page_cursor=$page_cursor); +$klaviyo->Segments->getTagsForSegment($id, $fields_tag=$fields_tag); ``` ##### Method alias: ```php -$klaviyo->Reporting->createFlowValueReport($body, $page_cursor=$page_cursor); +$klaviyo->Segments->getSegmentTags($id, $fields_tag=$fields_tag); ``` - - -## Segments - -#### [Create Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/create_segment) +#### [Update Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/update_segment) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Segments->createSegment($body); +$klaviyo->Segments->updateSegment($id, $body); ``` -#### [Delete Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_segment) + + +## Tags + +#### [Create Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/create_tag) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Segments->deleteSegment($id); +$klaviyo->Tags->createTag($body); ``` -#### [Get Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment) +#### [Create Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/create_tag_group) ```php ## Positional Arguments -# $id | string - -## Keyword Arguments - -# $additional_fields_segment | string[] -# $fields_segment | string[] -# $fields_tag | string[] -# $include | string[] +# $body | associative array -$klaviyo->Segments->getSegment($id, $additional_fields_segment=$additional_fields_segment, $fields_segment=$fields_segment, $fields_tag=$fields_tag, $include=$include); +$klaviyo->Tags->createTagGroup($body); ``` -#### [Get Segment Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_profiles) +#### [Delete Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_tag) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $additional_fields_profile | string[] -# $fields_profile | string[] -# $filter | string -# $page_cursor | string -# $page_size | int -# $sort | string - -$klaviyo->Segments->getSegmentProfiles($id, $additional_fields_profile=$additional_fields_profile, $fields_profile=$fields_profile, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Tags->deleteTag($id); ``` -#### [Get Segment Relationships Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_relationships_profiles) +#### [Delete Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_tag_group) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $filter | string -# $page_cursor | string -# $page_size | int -# $sort | string - -$klaviyo->Segments->getSegmentRelationshipsProfiles($id, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +$klaviyo->Tags->deleteTagGroup($id); ``` -#### [Get Segment Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_relationships_tags) +#### [Get Campaign IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_ids_for_tag) ```php ## Positional Arguments # $id | string -$klaviyo->Segments->getSegmentRelationshipsTags($id); +$klaviyo->Tags->getCampaignIdsForTag($id); +``` +##### Method alias: +```php +$klaviyo->Tags->getTagRelationshipsCampaigns($id); ``` -#### [Get Segment Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_tags) +#### [Get Flow IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_ids_for_tag) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $fields_tag | string[] - -$klaviyo->Segments->getSegmentTags($id, $fields_tag=$fields_tag); +$klaviyo->Tags->getFlowIdsForTag($id); +``` +##### Method alias: +```php +$klaviyo->Tags->getTagRelationshipsFlows($id); ``` -#### [Get Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segments) +#### [Get List IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_ids_for_tag) ```php +## Positional Arguments -## Keyword Arguments - -# $fields_segment | string[] -# $fields_tag | string[] -# $filter | string -# $include | string[] -# $page_cursor | string -# $sort | string +# $id | string -$klaviyo->Segments->getSegments($fields_segment=$fields_segment, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Tags->getListIdsForTag($id); +``` +##### Method alias: +```php +$klaviyo->Tags->getTagRelationshipsLists($id); ``` -#### [Update Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/update_segment) +#### [Get Segment IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_ids_for_tag) ```php ## Positional Arguments # $id | string -# $body | associative array -$klaviyo->Segments->updateSegment($id, $body); +$klaviyo->Tags->getSegmentIdsForTag($id); +``` +##### Method alias: +```php +$klaviyo->Tags->getTagRelationshipsSegments($id); ``` - - -## Tags - -#### [Create Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag) +#### [Get Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Tags->createTag($body); +## Keyword Arguments + +# $fields_tag_group | string[] +# $fields_tag | string[] +# $include | string[] + +$klaviyo->Tags->getTag($id, $fields_tag_group=$fields_tag_group, $fields_tag=$fields_tag, $include=$include); ``` -#### [Create Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_group) +#### [Get Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_group) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Tags->createTagGroup($body); +## Keyword Arguments + +# $fields_tag_group | string[] + +$klaviyo->Tags->getTagGroup($id, $fields_tag_group=$fields_tag_group); ``` -#### [Create Tag Relationships Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_campaigns) +#### [Get Tag Group for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_group_for_tag) ```php ## Positional Arguments # $id | string -# $body | associative array -$klaviyo->Tags->createTagRelationshipsCampaigns($id, $body); +## Keyword Arguments + +# $fields_tag_group | string[] + +$klaviyo->Tags->getTagGroupForTag($id, $fields_tag_group=$fields_tag_group); ``` ##### Method alias: ```php -$klaviyo->Tags->createTagRelationshipsCampaign($id, $body); +$klaviyo->Tags->getTagTagGroup($id, $fields_tag_group=$fields_tag_group); ``` -#### [Create Tag Relationships Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_flows) +#### [Get Tag Group ID for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_group_id_for_tag) ```php ## Positional Arguments # $id | string -# $body | associative array -$klaviyo->Tags->createTagRelationshipsFlows($id, $body); +$klaviyo->Tags->getTagGroupIdForTag($id); ``` ##### Method alias: ```php -$klaviyo->Tags->createTagRelationshipsFlow($id, $body); +$klaviyo->Tags->getTagRelationshipsTagGroup($id); ``` -#### [Create Tag Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_lists) +#### [Get Tag Groups](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_groups) ```php -## Positional Arguments -# $id | string -# $body | associative array +## Keyword Arguments -$klaviyo->Tags->createTagRelationshipsLists($id, $body); -``` -##### Method alias: -```php -$klaviyo->Tags->createTagRelationshipsList($id, $body); +# $fields_tag_group | string[] +# $filter | string +# $page_cursor | string +# $sort | string + +$klaviyo->Tags->getTagGroups($fields_tag_group=$fields_tag_group, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Create Tag Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_segments) +#### [Get Tag IDs for Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_tag_group) ```php ## Positional Arguments # $id | string -# $body | associative array -$klaviyo->Tags->createTagRelationshipsSegments($id, $body); +$klaviyo->Tags->getTagIdsForTagGroup($id); ``` ##### Method alias: ```php -$klaviyo->Tags->createTagRelationshipsSegment($id, $body); +$klaviyo->Tags->getTagGroupRelationshipsTags($id); ``` -#### [Delete Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag) +#### [Get Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tags) ```php -## Positional Arguments -# $id | string +## Keyword Arguments -$klaviyo->Tags->deleteTag($id); +# $fields_tag_group | string[] +# $fields_tag | string[] +# $filter | string +# $include | string[] +# $page_cursor | string +# $sort | string + +$klaviyo->Tags->getTags($fields_tag_group=$fields_tag_group, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); ``` -#### [Delete Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_group) +#### [Get Tags for Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tags_for_tag_group) ```php ## Positional Arguments # $id | string -$klaviyo->Tags->deleteTagGroup($id); +## Keyword Arguments + +# $fields_tag | string[] + +$klaviyo->Tags->getTagsForTagGroup($id, $fields_tag=$fields_tag); +``` +##### Method alias: +```php +$klaviyo->Tags->getTagGroupTags($id, $fields_tag=$fields_tag); ``` -#### [Delete Tag Relationships Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_campaigns) +#### [Remove Tag from Campaigns](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_campaigns) ```php ## Positional Arguments @@ -3619,13 +4465,17 @@ $klaviyo->Tags->deleteTagGroup($id); # $id | string # $body | associative array +$klaviyo->Tags->removeTagFromCampaigns($id, $body); +``` +##### Method alias: +```php $klaviyo->Tags->deleteTagRelationshipsCampaigns($id, $body); ``` -#### [Delete Tag Relationships Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_flows) +#### [Remove Tag from Flows](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_flows) ```php ## Positional Arguments @@ -3633,13 +4483,17 @@ $klaviyo->Tags->deleteTagRelationshipsCampaigns($id, $body); # $id | string # $body | associative array +$klaviyo->Tags->removeTagFromFlows($id, $body); +``` +##### Method alias: +```php $klaviyo->Tags->deleteTagRelationshipsFlows($id, $body); ``` -#### [Delete Tag Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_lists) +#### [Remove Tag from Lists](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_lists) ```php ## Positional Arguments @@ -3647,13 +4501,17 @@ $klaviyo->Tags->deleteTagRelationshipsFlows($id, $body); # $id | string # $body | associative array +$klaviyo->Tags->removeTagFromLists($id, $body); +``` +##### Method alias: +```php $klaviyo->Tags->deleteTagRelationshipsLists($id, $body); ``` -#### [Delete Tag Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_segments) +#### [Remove Tag from Segments](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_segments) ```php ## Positional Arguments @@ -3661,281 +4519,340 @@ $klaviyo->Tags->deleteTagRelationshipsLists($id, $body); # $id | string # $body | associative array +$klaviyo->Tags->removeTagFromSegments($id, $body); +``` +##### Method alias: +```php $klaviyo->Tags->deleteTagRelationshipsSegments($id, $body); ``` -#### [Get Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag) +#### [Tag Campaigns](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_campaigns) ```php ## Positional Arguments # $id | string +# $body | associative array -## Keyword Arguments - -# $fields_tag_group | string[] -# $fields_tag | string[] -# $include | string[] - -$klaviyo->Tags->getTag($id, $fields_tag_group=$fields_tag_group, $fields_tag=$fields_tag, $include=$include); +$klaviyo->Tags->tagCampaigns($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsCampaigns($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsCampaign($id, $body); ``` -#### [Get Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_group) +#### [Tag Flows](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_flows) ```php ## Positional Arguments # $id | string +# $body | associative array -## Keyword Arguments - -# $fields_tag_group | string[] - -$klaviyo->Tags->getTagGroup($id, $fields_tag_group=$fields_tag_group); +$klaviyo->Tags->tagFlows($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsFlows($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsFlow($id, $body); ``` -#### [Get Tag Group Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_group_relationships_tags) +#### [Tag Lists](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_lists) ```php ## Positional Arguments # $id | string +# $body | associative array -$klaviyo->Tags->getTagGroupRelationshipsTags($id); +$klaviyo->Tags->tagLists($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsLists($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsList($id, $body); ``` -#### [Get Tag Group Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_group_tags) +#### [Tag Segments](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_segments) ```php ## Positional Arguments # $id | string +# $body | associative array -## Keyword Arguments - -# $fields_tag | string[] - -$klaviyo->Tags->getTagGroupTags($id, $fields_tag=$fields_tag); +$klaviyo->Tags->tagSegments($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsSegments($id, $body); +``` +##### Method alias: +```php +$klaviyo->Tags->createTagRelationshipsSegment($id, $body); ``` -#### [Get Tag Groups](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_groups) +#### [Update Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/update_tag) ```php +## Positional Arguments -## Keyword Arguments - -# $fields_tag_group | string[] -# $filter | string -# $page_cursor | string -# $sort | string +# $id | string +# $body | associative array -$klaviyo->Tags->getTagGroups($fields_tag_group=$fields_tag_group, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Tags->updateTag($id, $body); ``` -#### [Get Tag Relationships Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_campaigns) +#### [Update Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/update_tag_group) ```php ## Positional Arguments # $id | string +# $body | associative array -$klaviyo->Tags->getTagRelationshipsCampaigns($id); +$klaviyo->Tags->updateTagGroup($id, $body); ``` -#### [Get Tag Relationships Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_flows) + + +## Templates + +#### [Clone Template](https://developers.klaviyo.com/en/v2024-10-15/reference/clone_template) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Tags->getTagRelationshipsFlows($id); +$klaviyo->Templates->cloneTemplate($body); +``` +##### Method alias: +```php +$klaviyo->Templates->createTemplateClone($body); ``` -#### [Get Tag Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_lists) +#### [Create Template](https://developers.klaviyo.com/en/v2024-10-15/reference/create_template) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Tags->getTagRelationshipsLists($id); +$klaviyo->Templates->createTemplate($body); ``` -#### [Get Tag Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_segments) +#### [Create Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/create_universal_content) ```php ## Positional Arguments -# $id | string +# $body | associative array -$klaviyo->Tags->getTagRelationshipsSegments($id); +$klaviyo->Templates->createUniversalContent($body); +``` +##### Method alias: +```php +$klaviyo->Templates->createTemplateUniversalContent($body); ``` -#### [Get Tag Relationships Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_tag_group) +#### [Delete Template](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_template) ```php ## Positional Arguments # $id | string -$klaviyo->Tags->getTagRelationshipsTagGroup($id); +$klaviyo->Templates->deleteTemplate($id); ``` -#### [Get Tag Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_tag_group) +#### [Delete Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_universal_content) ```php ## Positional Arguments # $id | string -## Keyword Arguments - -# $fields_tag_group | string[] - -$klaviyo->Tags->getTagTagGroup($id, $fields_tag_group=$fields_tag_group); +$klaviyo->Templates->deleteUniversalContent($id); +``` +##### Method alias: +```php +$klaviyo->Templates->deleteTemplateUniversalContent($id); ``` -#### [Get Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tags) +#### [Get All Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/get_all_universal_content) ```php ## Keyword Arguments -# $fields_tag_group | string[] -# $fields_tag | string[] +# $fields_template_universal_content | string[] # $filter | string -# $include | string[] # $page_cursor | string +# $page_size | int # $sort | string -$klaviyo->Tags->getTags($fields_tag_group=$fields_tag_group, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->Templates->getAllUniversalContent($fields_template_universal_content=$fields_template_universal_content, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); +``` +##### Method alias: +```php +$klaviyo->Templates->getTemplateUniversalContent($fields_template_universal_content=$fields_template_universal_content, $filter=$filter, $page_cursor=$page_cursor, $page_size=$page_size, $sort=$sort); ``` -#### [Update Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/update_tag) +#### [Get Template](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template) ```php ## Positional Arguments # $id | string -# $body | associative array -$klaviyo->Tags->updateTag($id, $body); -``` +## Keyword Arguments +# $fields_template | string[] +$klaviyo->Templates->getTemplate($id, $fields_template=$fields_template); +``` -#### [Update Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/update_tag_group) -```php -## Positional Arguments -# $id | string -# $body | associative array +#### [Get Templates](https://developers.klaviyo.com/en/v2024-10-15/reference/get_templates) -$klaviyo->Tags->updateTagGroup($id, $body); -``` +```php +## Keyword Arguments +# $fields_template | string[] +# $filter | string +# $page_cursor | string +# $sort | string +$klaviyo->Templates->getTemplates($fields_template=$fields_template, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +``` -## Templates -#### [Create Template](https://developers.klaviyo.com/en/v2024-07-15/reference/create_template) +#### [Get Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/get_universal_content) ```php ## Positional Arguments -# $body | associative array +# $id | string -$klaviyo->Templates->createTemplate($body); +## Keyword Arguments + +# $fields_template_universal_content | string[] + +$klaviyo->Templates->getUniversalContent($id, $fields_template_universal_content=$fields_template_universal_content); ``` -#### [Create Template Clone](https://developers.klaviyo.com/en/v2024-07-15/reference/create_template_clone) +#### [Render Template](https://developers.klaviyo.com/en/v2024-10-15/reference/render_template) ```php ## Positional Arguments # $body | associative array -$klaviyo->Templates->createTemplateClone($body); +$klaviyo->Templates->renderTemplate($body); +``` +##### Method alias: +```php +$klaviyo->Templates->createTemplateRender($body); ``` -#### [Create Template Render](https://developers.klaviyo.com/en/v2024-07-15/reference/create_template_render) +#### [Update Template](https://developers.klaviyo.com/en/v2024-10-15/reference/update_template) ```php ## Positional Arguments +# $id | string # $body | associative array -$klaviyo->Templates->createTemplateRender($body); +$klaviyo->Templates->updateTemplate($id, $body); ``` -#### [Delete Template](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_template) +#### [Update Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/update_universal_content) ```php ## Positional Arguments # $id | string +# $body | associative array -$klaviyo->Templates->deleteTemplate($id); +$klaviyo->Templates->updateUniversalContent($id, $body); +``` +##### Method alias: +```php +$klaviyo->Templates->updateTemplateUniversalContent($id, $body); ``` -#### [Get Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_template) + + +## TrackingSettings + +#### [Get Tracking Setting](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tracking_setting) ```php ## Positional Arguments @@ -3944,32 +4861,31 @@ $klaviyo->Templates->deleteTemplate($id); ## Keyword Arguments -# $fields_template | string[] +# $fields_tracking_setting | string[] -$klaviyo->Templates->getTemplate($id, $fields_template=$fields_template); +$klaviyo->TrackingSettings->getTrackingSetting($id, $fields_tracking_setting=$fields_tracking_setting); ``` -#### [Get Templates](https://developers.klaviyo.com/en/v2024-07-15/reference/get_templates) +#### [Get Tracking Settings](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tracking_settings) ```php ## Keyword Arguments -# $fields_template | string[] -# $filter | string +# $fields_tracking_setting | string[] # $page_cursor | string -# $sort | string +# $page_size | int -$klaviyo->Templates->getTemplates($fields_template=$fields_template, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort); +$klaviyo->TrackingSettings->getTrackingSettings($fields_tracking_setting=$fields_tracking_setting, $page_cursor=$page_cursor, $page_size=$page_size); ``` -#### [Update Template](https://developers.klaviyo.com/en/v2024-07-15/reference/update_template) +#### [Update Tracking Setting](https://developers.klaviyo.com/en/v2024-10-15/reference/update_tracking_setting) ```php ## Positional Arguments @@ -3977,7 +4893,7 @@ $klaviyo->Templates->getTemplates($fields_template=$fields_template, $filter=$fi # $id | string # $body | associative array -$klaviyo->Templates->updateTemplate($id, $body); +$klaviyo->TrackingSettings->updateTrackingSetting($id, $body); ``` @@ -3987,7 +4903,7 @@ $klaviyo->Templates->updateTemplate($id, $body); ## Webhooks -#### [Create Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/create_webhook) +#### [Create Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/create_webhook) ```php ## Positional Arguments @@ -4000,7 +4916,7 @@ $klaviyo->Webhooks->createWebhook($body); -#### [Delete Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_webhook) +#### [Delete Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_webhook) ```php ## Positional Arguments @@ -4013,7 +4929,7 @@ $klaviyo->Webhooks->deleteWebhook($id); -#### [Get Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhook) +#### [Get Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhook) ```php ## Positional Arguments @@ -4031,7 +4947,7 @@ $klaviyo->Webhooks->getWebhook($id, $fields_webhook=$fields_webhook, $include=$i -#### [Get Webhook Topic](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhook_topic) +#### [Get Webhook Topic](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhook_topic) ```php ## Positional Arguments @@ -4044,7 +4960,7 @@ $klaviyo->Webhooks->getWebhookTopic($id); -#### [Get Webhook Topics](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhook_topics) +#### [Get Webhook Topics](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhook_topics) ```php @@ -4054,7 +4970,7 @@ $klaviyo->Webhooks->getWebhookTopics(); -#### [Get Webhooks](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhooks) +#### [Get Webhooks](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhooks) ```php @@ -4069,7 +4985,7 @@ $klaviyo->Webhooks->getWebhooks($fields_webhook=$fields_webhook, $include=$inclu -#### [Update Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/update_webhook) +#### [Update Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/update_webhook) ```php ## Positional Arguments diff --git a/composer.json b/composer.json index 634cc46..8d633cb 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "klaviyo/api", - "version": "10.0.0", + "version": "11.0.0", "description": "PHP SDK for Klaviyo's API.", "keywords": [ "openapitools", diff --git a/lib/API/AccountsApi.php b/lib/API/AccountsApi.php index 58f6b0d..6c2ab5d 100644 --- a/lib/API/AccountsApi.php +++ b/lib/API/AccountsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -122,7 +122,7 @@ public function getConfig() * Get Account * * @param string $id The ID of the account (required) - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -140,7 +140,7 @@ public function getAccount($id, $fields_account = null, $apiKey = null) * Get Account * * @param string $id The ID of the account (required) - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -309,7 +309,7 @@ public function getAccountWithHttpInfo($id, $fields_account = null, $apiKey = nu * Get Account * * @param string $id The ID of the account (required) - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -330,7 +330,7 @@ function ($response) { * Get Account * * @param string $id The ID of the account (required) - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -385,7 +385,7 @@ function ($exception) { * Create request for operation 'getAccount' * * @param string $id The ID of the account (required) - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -399,7 +399,7 @@ public function getAccountRequest($id, $fields_account = null, $apiKey = null) ); } - $resourcePath = '/api/accounts/{id}/'; + $resourcePath = '/api/accounts/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -429,11 +429,11 @@ public function getAccountRequest($id, $fields_account = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -454,7 +454,7 @@ public function getAccountRequest($id, $fields_account = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -478,7 +478,7 @@ public function getAccountRequest($id, $fields_account = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -500,7 +500,7 @@ public function getAccountRequest($id, $fields_account = null, $apiKey = null) * * Get Accounts * - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -517,7 +517,7 @@ public function getAccounts($fields_account = null, $apiKey = null) * * Get Accounts * - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -685,7 +685,7 @@ public function getAccountsWithHttpInfo($fields_account = null, $apiKey = null) * * Get Accounts * - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -705,7 +705,7 @@ function ($response) { * * Get Accounts * - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -759,7 +759,7 @@ function ($exception) { /** * Create request for operation 'getAccounts' * - * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -767,7 +767,7 @@ function ($exception) { public function getAccountsRequest($fields_account = null, $apiKey = null) { - $resourcePath = '/api/accounts/'; + $resourcePath = '/api/accounts'; $formParams = []; $queryParams = []; $headerParams = []; @@ -789,11 +789,11 @@ public function getAccountsRequest($fields_account = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -814,7 +814,7 @@ public function getAccountsRequest($fields_account = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -838,7 +838,7 @@ public function getAccountsRequest($fields_account = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/CampaignsApi.php b/lib/API/CampaignsApi.php index da0cc8d..905e3ad 100644 --- a/lib/API/CampaignsApi.php +++ b/lib/API/CampaignsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -117,36 +117,45 @@ public function getConfig() } /** - * Operation createCampaign + * Operation assignTemplateToCampaignMessage * - * Create Campaign + * Assign Template to Campaign Message * - * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) + * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCampaign($campaign_create_query, $apiKey = null) + public function assignTemplateToCampaignMessage($campaign_message_assign_template_query, $apiKey = null) { - list($response) = $this->createCampaignWithHttpInfo($campaign_create_query, $apiKey); + list($response) = $this->assignTemplateToCampaignMessageWithHttpInfo($campaign_message_assign_template_query, $apiKey); return $response; } /** - * Operation createCampaignWithHttpInfo + * Alias of `assignTemplateToCampaignMessage` * - * Create Campaign + * @deprecated use `assignTemplateToCampaignMessage` instead + */ + public function createCampaignMessageAssignTemplate(...$args) { + return $this->assignTemplateToCampaignMessage(...$args); + } + + /** + * Operation assignTemplateToCampaignMessageWithHttpInfo * - * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) + * Assign Template to Campaign Message + * + * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCampaignWithHttpInfo($campaign_create_query, $apiKey = null) + public function assignTemplateToCampaignMessageWithHttpInfo($campaign_message_assign_template_query, $apiKey = null) { - $request = $this->createCampaignRequest($campaign_create_query, $apiKey); + $request = $this->assignTemplateToCampaignMessageRequest($campaign_message_assign_template_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -302,18 +311,27 @@ public function createCampaignWithHttpInfo($campaign_create_query, $apiKey = nul } /** - * Operation createCampaignAsync + * Alias of `assignTemplateToCampaignMessageWithHttpInfo` * - * Create Campaign + * @deprecated use `assignTemplateToCampaignMessageWithHttpInfo` instead + */ + public function createCampaignMessageAssignTemplateWithHttpInfo(...$args) { + return $this->assignTemplateToCampaignMessageWithHttpInfo(...$args); + } + + /** + * Operation assignTemplateToCampaignMessageAsync * - * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) + * Assign Template to Campaign Message + * + * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignAsync($campaign_create_query, $apiKey = null) + public function assignTemplateToCampaignMessageAsync($campaign_message_assign_template_query, $apiKey = null) { - return $this->createCampaignAsyncWithHttpInfo($campaign_create_query, $apiKey) + return $this->assignTemplateToCampaignMessageAsyncWithHttpInfo($campaign_message_assign_template_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -322,19 +340,28 @@ function ($response) { } /** - * Operation createCampaignAsyncWithHttpInfo + * Alias of `assignTemplateToCampaignMessageAsync` * - * Create Campaign + * @deprecated use `assignTemplateToCampaignMessageAsync` instead + */ + public function createCampaignMessageAssignTemplateAsync(...$args) { + return $this->assignTemplateToCampaignMessageAsync(...$args); + } + + /** + * Operation assignTemplateToCampaignMessageAsyncWithHttpInfo * - * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) + * Assign Template to Campaign Message + * + * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignAsyncWithHttpInfo($campaign_create_query, $apiKey = null) + public function assignTemplateToCampaignMessageAsyncWithHttpInfo($campaign_message_assign_template_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createCampaignRequest($campaign_create_query, $apiKey); + $request = $this->assignTemplateToCampaignMessageRequest($campaign_message_assign_template_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -378,23 +405,32 @@ function ($exception) { } /** - * Create request for operation 'createCampaign' + * Alias of `assignTemplateToCampaignMessageAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) + * @deprecated use `assignTemplateToCampaignMessageAsyncWithHttpInfo` instead + */ + public function createCampaignMessageAssignTemplateAsyncWithHttpInfo(...$args) { + return $this->assignTemplateToCampaignMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'assignTemplateToCampaignMessage' + * + * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCampaignRequest($campaign_create_query, $apiKey = null) + public function assignTemplateToCampaignMessageRequest($campaign_message_assign_template_query, $apiKey = null) { - // verify the required parameter 'campaign_create_query' is set - if ($campaign_create_query === null || (is_array($campaign_create_query) && count($campaign_create_query) === 0)) { + // verify the required parameter 'campaign_message_assign_template_query' is set + if ($campaign_message_assign_template_query === null || (is_array($campaign_message_assign_template_query) && count($campaign_message_assign_template_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_create_query when calling createCampaign' + 'Missing the required parameter $campaign_message_assign_template_query when calling assignTemplateToCampaignMessage' ); } - $resourcePath = '/api/campaigns/'; + $resourcePath = '/api/campaign-message-assign-template'; $formParams = []; $queryParams = []; $headerParams = []; @@ -407,21 +443,21 @@ public function createCampaignRequest($campaign_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($campaign_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_create_query)); + if (isset($campaign_message_assign_template_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_message_assign_template_query)); } else { - $httpBody = $campaign_create_query; + $httpBody = $campaign_message_assign_template_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -438,7 +474,7 @@ public function createCampaignRequest($campaign_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -462,7 +498,7 @@ public function createCampaignRequest($campaign_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -480,36 +516,55 @@ public function createCampaignRequest($campaign_create_query, $apiKey = null) } /** - * Operation createCampaignClone + * Alias of `assignTemplateToCampaignMessageRequest` * - * Create Campaign Clone + * @deprecated use `assignTemplateToCampaignMessageRequest` instead + */ + public function createCampaignMessageAssignTemplateRequest(...$args) { + return $this->assignTemplateToCampaignMessageRequest(...$args); + } + + /** + * Operation cancelCampaignSend * - * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) + * Cancel Campaign Send + * + * @param string $id The ID of the currently sending campaign to cancel or revert (required) + * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function createCampaignClone($campaign_clone_query, $apiKey = null) + public function cancelCampaignSend($id, $campaign_send_job_partial_update_query, $apiKey = null) { - list($response) = $this->createCampaignCloneWithHttpInfo($campaign_clone_query, $apiKey); - return $response; + $this->cancelCampaignSendWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey); } /** - * Operation createCampaignCloneWithHttpInfo + * Alias of `cancelCampaignSend` * - * Create Campaign Clone + * @deprecated use `cancelCampaignSend` instead + */ + public function updateCampaignSendJob(...$args) { + return $this->cancelCampaignSend(...$args); + } + + /** + * Operation cancelCampaignSendWithHttpInfo * - * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) + * Cancel Campaign Send + * + * @param string $id The ID of the currently sending campaign to cancel or revert (required) + * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createCampaignCloneWithHttpInfo($campaign_clone_query, $apiKey = null) + public function cancelCampaignSendWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey = null) { - $request = $this->createCampaignCloneRequest($campaign_clone_query, $apiKey); + $request = $this->cancelCampaignSendRequest($id, $campaign_send_job_partial_update_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -546,103 +601,10 @@ public function createCampaignCloneWithHttpInfo($campaign_clone_query, $apiKey = ); } - switch($statusCode) { - case 201: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -665,18 +627,28 @@ public function createCampaignCloneWithHttpInfo($campaign_clone_query, $apiKey = } /** - * Operation createCampaignCloneAsync + * Alias of `cancelCampaignSendWithHttpInfo` * - * Create Campaign Clone + * @deprecated use `cancelCampaignSendWithHttpInfo` instead + */ + public function updateCampaignSendJobWithHttpInfo(...$args) { + return $this->cancelCampaignSendWithHttpInfo(...$args); + } + + /** + * Operation cancelCampaignSendAsync * - * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) + * Cancel Campaign Send + * + * @param string $id The ID of the currently sending campaign to cancel or revert (required) + * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignCloneAsync($campaign_clone_query, $apiKey = null) + public function cancelCampaignSendAsync($id, $campaign_send_job_partial_update_query, $apiKey = null) { - return $this->createCampaignCloneAsyncWithHttpInfo($campaign_clone_query, $apiKey) + return $this->cancelCampaignSendAsyncWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -685,43 +657,35 @@ function ($response) { } /** - * Operation createCampaignCloneAsyncWithHttpInfo + * Alias of `cancelCampaignSendAsync` * - * Create Campaign Clone + * @deprecated use `cancelCampaignSendAsync` instead + */ + public function updateCampaignSendJobAsync(...$args) { + return $this->cancelCampaignSendAsync(...$args); + } + + /** + * Operation cancelCampaignSendAsyncWithHttpInfo * - * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) + * Cancel Campaign Send + * + * @param string $id The ID of the currently sending campaign to cancel or revert (required) + * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignCloneAsyncWithHttpInfo($campaign_clone_query, $apiKey = null) + public function cancelCampaignSendAsyncWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey = null) { - $returnType = 'array'; - $request = $this->createCampaignCloneRequest($campaign_clone_query, $apiKey); + $returnType = ''; + $request = $this->cancelCampaignSendRequest($id, $campaign_send_job_partial_update_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -741,23 +705,39 @@ function ($exception) { } /** - * Create request for operation 'createCampaignClone' + * Alias of `cancelCampaignSendAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) + * @deprecated use `cancelCampaignSendAsyncWithHttpInfo` instead + */ + public function updateCampaignSendJobAsyncWithHttpInfo(...$args) { + return $this->cancelCampaignSendAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'cancelCampaignSend' + * + * @param string $id The ID of the currently sending campaign to cancel or revert (required) + * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCampaignCloneRequest($campaign_clone_query, $apiKey = null) + public function cancelCampaignSendRequest($id, $campaign_send_job_partial_update_query, $apiKey = null) { - // verify the required parameter 'campaign_clone_query' is set - if ($campaign_clone_query === null || (is_array($campaign_clone_query) && count($campaign_clone_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_clone_query when calling createCampaignClone' + 'Missing the required parameter $id when calling cancelCampaignSend' + ); + } + // verify the required parameter 'campaign_send_job_partial_update_query' is set + if ($campaign_send_job_partial_update_query === null || (is_array($campaign_send_job_partial_update_query) && count($campaign_send_job_partial_update_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_send_job_partial_update_query when calling cancelCampaignSend' ); } - $resourcePath = '/api/campaign-clone/'; + $resourcePath = '/api/campaign-send-jobs/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -766,25 +746,33 @@ public function createCampaignCloneRequest($campaign_clone_query, $apiKey = null - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($campaign_clone_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_clone_query)); + if (isset($campaign_send_job_partial_update_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_send_job_partial_update_query)); } else { - $httpBody = $campaign_clone_query; + $httpBody = $campaign_send_job_partial_update_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -801,7 +789,7 @@ public function createCampaignCloneRequest($campaign_clone_query, $apiKey = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -825,7 +813,7 @@ public function createCampaignCloneRequest($campaign_clone_query, $apiKey = null $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -835,7 +823,7 @@ public function createCampaignCloneRequest($campaign_clone_query, $apiKey = null $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -843,36 +831,45 @@ public function createCampaignCloneRequest($campaign_clone_query, $apiKey = null } /** - * Operation createCampaignMessageAssignTemplate + * Alias of `cancelCampaignSendRequest` + * + * @deprecated use `cancelCampaignSendRequest` instead + */ + public function updateCampaignSendJobRequest(...$args) { + return $this->cancelCampaignSendRequest(...$args); + } + + /** + * Operation createCampaign * - * Assign Campaign Message Template + * Create Campaign * - * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) + * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCampaignMessageAssignTemplate($campaign_message_assign_template_query, $apiKey = null) + public function createCampaign($campaign_create_query, $apiKey = null) { - list($response) = $this->createCampaignMessageAssignTemplateWithHttpInfo($campaign_message_assign_template_query, $apiKey); + list($response) = $this->createCampaignWithHttpInfo($campaign_create_query, $apiKey); return $response; } /** - * Operation createCampaignMessageAssignTemplateWithHttpInfo + * Operation createCampaignWithHttpInfo * - * Assign Campaign Message Template + * Create Campaign * - * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) + * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCampaignMessageAssignTemplateWithHttpInfo($campaign_message_assign_template_query, $apiKey = null) + public function createCampaignWithHttpInfo($campaign_create_query, $apiKey = null) { - $request = $this->createCampaignMessageAssignTemplateRequest($campaign_message_assign_template_query, $apiKey); + $request = $this->createCampaignRequest($campaign_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1028,18 +1025,18 @@ public function createCampaignMessageAssignTemplateWithHttpInfo($campaign_messag } /** - * Operation createCampaignMessageAssignTemplateAsync + * Operation createCampaignAsync * - * Assign Campaign Message Template + * Create Campaign * - * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) + * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignMessageAssignTemplateAsync($campaign_message_assign_template_query, $apiKey = null) + public function createCampaignAsync($campaign_create_query, $apiKey = null) { - return $this->createCampaignMessageAssignTemplateAsyncWithHttpInfo($campaign_message_assign_template_query, $apiKey) + return $this->createCampaignAsyncWithHttpInfo($campaign_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -1048,19 +1045,19 @@ function ($response) { } /** - * Operation createCampaignMessageAssignTemplateAsyncWithHttpInfo + * Operation createCampaignAsyncWithHttpInfo * - * Assign Campaign Message Template + * Create Campaign * - * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) + * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignMessageAssignTemplateAsyncWithHttpInfo($campaign_message_assign_template_query, $apiKey = null) + public function createCampaignAsyncWithHttpInfo($campaign_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createCampaignMessageAssignTemplateRequest($campaign_message_assign_template_query, $apiKey); + $request = $this->createCampaignRequest($campaign_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1104,23 +1101,23 @@ function ($exception) { } /** - * Create request for operation 'createCampaignMessageAssignTemplate' + * Create request for operation 'createCampaign' * - * @param \KlaviyoAPI\Model\CampaignMessageAssignTemplateQuery $campaign_message_assign_template_query Takes a reusable template, clones it, and assigns the non-reusable clone to the message. (required) + * @param \KlaviyoAPI\Model\CampaignCreateQuery $campaign_create_query Creates a campaign from parameters (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCampaignMessageAssignTemplateRequest($campaign_message_assign_template_query, $apiKey = null) + public function createCampaignRequest($campaign_create_query, $apiKey = null) { - // verify the required parameter 'campaign_message_assign_template_query' is set - if ($campaign_message_assign_template_query === null || (is_array($campaign_message_assign_template_query) && count($campaign_message_assign_template_query) === 0)) { + // verify the required parameter 'campaign_create_query' is set + if ($campaign_create_query === null || (is_array($campaign_create_query) && count($campaign_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_message_assign_template_query when calling createCampaignMessageAssignTemplate' + 'Missing the required parameter $campaign_create_query when calling createCampaign' ); } - $resourcePath = '/api/campaign-message-assign-template/'; + $resourcePath = '/api/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1133,21 +1130,21 @@ public function createCampaignMessageAssignTemplateRequest($campaign_message_ass if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($campaign_message_assign_template_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_message_assign_template_query)); + if (isset($campaign_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_create_query)); } else { - $httpBody = $campaign_message_assign_template_query; + $httpBody = $campaign_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1164,7 +1161,7 @@ public function createCampaignMessageAssignTemplateRequest($campaign_message_ass // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1188,7 +1185,7 @@ public function createCampaignMessageAssignTemplateRequest($campaign_message_ass $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1206,36 +1203,45 @@ public function createCampaignMessageAssignTemplateRequest($campaign_message_ass } /** - * Operation createCampaignRecipientEstimationJob + * Operation createCampaignClone * - * Create Campaign Recipient Estimation Job + * Create Campaign Clone * - * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) + * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCampaignRecipientEstimationJob($campaign_recipient_estimation_job_create_query, $apiKey = null) + public function createCampaignClone($campaign_clone_query, $apiKey = null) { - list($response) = $this->createCampaignRecipientEstimationJobWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey); + list($response) = $this->createCampaignCloneWithHttpInfo($campaign_clone_query, $apiKey); return $response; } /** - * Operation createCampaignRecipientEstimationJobWithHttpInfo + * Alias of `createCampaignClone` * - * Create Campaign Recipient Estimation Job + * @deprecated use `createCampaignClone` instead + */ + public function cloneCampaign(...$args) { + return $this->createCampaignClone(...$args); + } + + /** + * Operation createCampaignCloneWithHttpInfo * - * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) + * Create Campaign Clone + * + * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCampaignRecipientEstimationJobWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey = null) + public function createCampaignCloneWithHttpInfo($campaign_clone_query, $apiKey = null) { - $request = $this->createCampaignRecipientEstimationJobRequest($campaign_recipient_estimation_job_create_query, $apiKey); + $request = $this->createCampaignCloneRequest($campaign_clone_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1273,7 +1279,7 @@ public function createCampaignRecipientEstimationJobWithHttpInfo($campaign_recip } switch($statusCode) { - case 202: + case 201: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1361,7 +1367,7 @@ public function createCampaignRecipientEstimationJobWithHttpInfo($campaign_recip } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -1391,18 +1397,27 @@ public function createCampaignRecipientEstimationJobWithHttpInfo($campaign_recip } /** - * Operation createCampaignRecipientEstimationJobAsync + * Alias of `createCampaignCloneWithHttpInfo` * - * Create Campaign Recipient Estimation Job + * @deprecated use `createCampaignCloneWithHttpInfo` instead + */ + public function cloneCampaignWithHttpInfo(...$args) { + return $this->createCampaignCloneWithHttpInfo(...$args); + } + + /** + * Operation createCampaignCloneAsync * - * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) + * Create Campaign Clone + * + * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignRecipientEstimationJobAsync($campaign_recipient_estimation_job_create_query, $apiKey = null) + public function createCampaignCloneAsync($campaign_clone_query, $apiKey = null) { - return $this->createCampaignRecipientEstimationJobAsyncWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey) + return $this->createCampaignCloneAsyncWithHttpInfo($campaign_clone_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -1411,19 +1426,28 @@ function ($response) { } /** - * Operation createCampaignRecipientEstimationJobAsyncWithHttpInfo + * Alias of `createCampaignCloneAsync` + * + * @deprecated use `createCampaignCloneAsync` instead + */ + public function cloneCampaignAsync(...$args) { + return $this->createCampaignCloneAsync(...$args); + } + + /** + * Operation createCampaignCloneAsyncWithHttpInfo * - * Create Campaign Recipient Estimation Job + * Create Campaign Clone * - * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) + * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignRecipientEstimationJobAsyncWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey = null) + public function createCampaignCloneAsyncWithHttpInfo($campaign_clone_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createCampaignRecipientEstimationJobRequest($campaign_recipient_estimation_job_create_query, $apiKey); + $request = $this->createCampaignCloneRequest($campaign_clone_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1467,23 +1491,32 @@ function ($exception) { } /** - * Create request for operation 'createCampaignRecipientEstimationJob' + * Alias of `createCampaignCloneAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) + * @deprecated use `createCampaignCloneAsyncWithHttpInfo` instead + */ + public function cloneCampaignAsyncWithHttpInfo(...$args) { + return $this->createCampaignCloneAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'createCampaignClone' + * + * @param \KlaviyoAPI\Model\CampaignCloneQuery $campaign_clone_query Clones a campaign from an existing campaign (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCampaignRecipientEstimationJobRequest($campaign_recipient_estimation_job_create_query, $apiKey = null) + public function createCampaignCloneRequest($campaign_clone_query, $apiKey = null) { - // verify the required parameter 'campaign_recipient_estimation_job_create_query' is set - if ($campaign_recipient_estimation_job_create_query === null || (is_array($campaign_recipient_estimation_job_create_query) && count($campaign_recipient_estimation_job_create_query) === 0)) { + // verify the required parameter 'campaign_clone_query' is set + if ($campaign_clone_query === null || (is_array($campaign_clone_query) && count($campaign_clone_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_recipient_estimation_job_create_query when calling createCampaignRecipientEstimationJob' + 'Missing the required parameter $campaign_clone_query when calling createCampaignClone' ); } - $resourcePath = '/api/campaign-recipient-estimation-jobs/'; + $resourcePath = '/api/campaign-clone'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1496,21 +1529,21 @@ public function createCampaignRecipientEstimationJobRequest($campaign_recipient_ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($campaign_recipient_estimation_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_recipient_estimation_job_create_query)); + if (isset($campaign_clone_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_clone_query)); } else { - $httpBody = $campaign_recipient_estimation_job_create_query; + $httpBody = $campaign_clone_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1527,7 +1560,7 @@ public function createCampaignRecipientEstimationJobRequest($campaign_recipient_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1551,7 +1584,7 @@ public function createCampaignRecipientEstimationJobRequest($campaign_recipient_ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1569,36 +1602,44 @@ public function createCampaignRecipientEstimationJobRequest($campaign_recipient_ } /** - * Operation createCampaignSendJob + * Alias of `createCampaignCloneRequest` * - * Create Campaign Send Job + * @deprecated use `createCampaignCloneRequest` instead + */ + public function cloneCampaignRequest(...$args) { + return $this->createCampaignCloneRequest(...$args); + } + + /** + * Operation deleteCampaign * - * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) + * Delete Campaign + * + * @param string $id The campaign ID to be deleted (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function createCampaignSendJob($campaign_send_job_create_query, $apiKey = null) + public function deleteCampaign($id, $apiKey = null) { - list($response) = $this->createCampaignSendJobWithHttpInfo($campaign_send_job_create_query, $apiKey); - return $response; + $this->deleteCampaignWithHttpInfo($id, $apiKey); } /** - * Operation createCampaignSendJobWithHttpInfo + * Operation deleteCampaignWithHttpInfo * - * Create Campaign Send Job + * Delete Campaign * - * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) + * @param string $id The campaign ID to be deleted (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createCampaignSendJobWithHttpInfo($campaign_send_job_create_query, $apiKey = null) + public function deleteCampaignWithHttpInfo($id, $apiKey = null) { - $request = $this->createCampaignSendJobRequest($campaign_send_job_create_query, $apiKey); + $request = $this->deleteCampaignRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1635,103 +1676,10 @@ public function createCampaignSendJobWithHttpInfo($campaign_send_job_create_quer ); } - switch($statusCode) { - case 202: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 202: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1754,18 +1702,18 @@ public function createCampaignSendJobWithHttpInfo($campaign_send_job_create_quer } /** - * Operation createCampaignSendJobAsync + * Operation deleteCampaignAsync * - * Create Campaign Send Job + * Delete Campaign * - * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) + * @param string $id The campaign ID to be deleted (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignSendJobAsync($campaign_send_job_create_query, $apiKey = null) + public function deleteCampaignAsync($id, $apiKey = null) { - return $this->createCampaignSendJobAsyncWithHttpInfo($campaign_send_job_create_query, $apiKey) + return $this->deleteCampaignAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -1774,19 +1722,382 @@ function ($response) { } /** - * Operation createCampaignSendJobAsyncWithHttpInfo + * Operation deleteCampaignAsyncWithHttpInfo * - * Create Campaign Send Job + * Delete Campaign * - * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) + * @param string $id The campaign ID to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteCampaignAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = ''; + $request = $this->deleteCampaignRequest($id, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCampaign' + * + * @param string $id The campaign ID to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCampaignRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteCampaign' + ); + } + + $resourcePath = '/api/campaigns/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCampaign + * + * Get Campaign + * + * @param string $id The campaign ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getCampaign($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + { + list($response) = $this->getCampaignWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey); + return $response; + } + + /** + * Operation getCampaignWithHttpInfo + * + * Get Campaign + * + * @param string $id The campaign ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getCampaignWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + { + $request = $this->getCampaignRequest($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCampaignAsync + * + * Get Campaign + * + * @param string $id The campaign ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignAsync($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + { + return $this->getCampaignAsyncWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCampaignAsyncWithHttpInfo + * + * Get Campaign + * + * @param string $id The campaign ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignSendJobAsyncWithHttpInfo($campaign_send_job_create_query, $apiKey = null) + public function getCampaignAsyncWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->createCampaignSendJobRequest($campaign_send_job_create_query, $apiKey); + $request = $this->getCampaignRequest($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1830,52 +2141,94 @@ function ($exception) { } /** - * Create request for operation 'createCampaignSendJob' + * Create request for operation 'getCampaign' * - * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) + * @param string $id The campaign ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCampaignSendJobRequest($campaign_send_job_create_query, $apiKey = null) + public function getCampaignRequest($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) { - // verify the required parameter 'campaign_send_job_create_query' is set - if ($campaign_send_job_create_query === null || (is_array($campaign_send_job_create_query) && count($campaign_send_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_send_job_create_query when calling createCampaignSendJob' + 'Missing the required parameter $id when calling getCampaign' ); } - $resourcePath = '/api/campaign-send-jobs/'; + $resourcePath = '/api/campaigns/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_campaign_message, + 'fields[campaign-message]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_campaign, + 'fields[campaign]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($campaign_send_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_send_job_create_query)); - } else { - $httpBody = $campaign_send_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1890,7 +2243,7 @@ public function createCampaignSendJobRequest($campaign_send_job_create_query, $a // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1914,7 +2267,7 @@ public function createCampaignSendJobRequest($campaign_send_job_create_query, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1924,7 +2277,7 @@ public function createCampaignSendJobRequest($campaign_send_job_create_query, $a $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1932,75 +2285,180 @@ public function createCampaignSendJobRequest($campaign_send_job_create_query, $a } /** - * Operation deleteCampaign + * Operation getCampaignForCampaignMessage * - * Delete Campaign + * Get Campaign for Campaign Message * - * @param string $id The campaign ID to be deleted (required) + * @param string $id (required) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteCampaign($id, $apiKey = null) + public function getCampaignForCampaignMessage($id, $fields_campaign = null, $apiKey = null) { - $this->deleteCampaignWithHttpInfo($id, $apiKey); + list($response) = $this->getCampaignForCampaignMessageWithHttpInfo($id, $fields_campaign, $apiKey); + return $response; + } + + /** + * Alias of `getCampaignForCampaignMessage` + * + * @deprecated use `getCampaignForCampaignMessage` instead + */ + public function getCampaignMessageCampaign(...$args) { + return $this->getCampaignForCampaignMessage(...$args); } - /** - * Operation deleteCampaignWithHttpInfo - * - * Delete Campaign - * - * @param string $id The campaign ID to be deleted (required) - * - * @throws \KlaviyoAPI\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteCampaignWithHttpInfo($id, $apiKey = null) - { - $request = $this->deleteCampaignRequest($id, $apiKey); + /** + * Operation getCampaignForCampaignMessageWithHttpInfo + * + * Get Campaign for Campaign Message + * + * @param string $id (required) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getCampaignForCampaignMessageWithHttpInfo($id, $fields_campaign = null, $apiKey = null) + { + $request = $this->getCampaignForCampaignMessageRequest($id, $fields_campaign, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } - $statusCode = $response->getStatusCode(); + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; } - return [null, $statusCode, $response->getHeaders()]; + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2023,18 +2481,28 @@ public function deleteCampaignWithHttpInfo($id, $apiKey = null) } /** - * Operation deleteCampaignAsync + * Alias of `getCampaignForCampaignMessageWithHttpInfo` * - * Delete Campaign + * @deprecated use `getCampaignForCampaignMessageWithHttpInfo` instead + */ + public function getCampaignMessageCampaignWithHttpInfo(...$args) { + return $this->getCampaignForCampaignMessageWithHttpInfo(...$args); + } + + /** + * Operation getCampaignForCampaignMessageAsync * - * @param string $id The campaign ID to be deleted (required) + * Get Campaign for Campaign Message + * + * @param string $id (required) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignAsync($id, $apiKey = null) + public function getCampaignForCampaignMessageAsync($id, $fields_campaign = null, $apiKey = null) { - return $this->deleteCampaignAsyncWithHttpInfo($id, $apiKey) + return $this->getCampaignForCampaignMessageAsyncWithHttpInfo($id, $fields_campaign, $apiKey) ->then( function ($response) { return $response[0]; @@ -2043,25 +2511,53 @@ function ($response) { } /** - * Operation deleteCampaignAsyncWithHttpInfo + * Alias of `getCampaignForCampaignMessageAsync` * - * Delete Campaign + * @deprecated use `getCampaignForCampaignMessageAsync` instead + */ + public function getCampaignMessageCampaignAsync(...$args) { + return $this->getCampaignForCampaignMessageAsync(...$args); + } + + /** + * Operation getCampaignForCampaignMessageAsyncWithHttpInfo * - * @param string $id The campaign ID to be deleted (required) + * Get Campaign for Campaign Message + * + * @param string $id (required) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignAsyncWithHttpInfo($id, $apiKey = null) + public function getCampaignForCampaignMessageAsyncWithHttpInfo($id, $fields_campaign = null, $apiKey = null) { - $returnType = ''; - $request = $this->deleteCampaignRequest($id, $apiKey); + $returnType = 'array'; + $request = $this->getCampaignForCampaignMessageRequest($id, $fields_campaign, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2081,29 +2577,48 @@ function ($exception) { } /** - * Create request for operation 'deleteCampaign' + * Alias of `getCampaignForCampaignMessageAsyncWithHttpInfo` * - * @param string $id The campaign ID to be deleted (required) + * @deprecated use `getCampaignForCampaignMessageAsyncWithHttpInfo` instead + */ + public function getCampaignMessageCampaignAsyncWithHttpInfo(...$args) { + return $this->getCampaignForCampaignMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getCampaignForCampaignMessage' + * + * @param string $id (required) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCampaignRequest($id, $apiKey = null) + public function getCampaignForCampaignMessageRequest($id, $fields_campaign = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCampaign' + 'Missing the required parameter $id when calling getCampaignForCampaignMessage' ); } - $resourcePath = '/api/campaigns/{id}/'; + $resourcePath = '/api/campaign-messages/{id}/campaign'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_campaign, + 'fields[campaign]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -2118,11 +2633,11 @@ public function deleteCampaignRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2143,7 +2658,7 @@ public function deleteCampaignRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2167,7 +2682,7 @@ public function deleteCampaignRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2177,7 +2692,7 @@ public function deleteCampaignRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2185,44 +2700,54 @@ public function deleteCampaignRequest($id, $apiKey = null) } /** - * Operation getCampaign + * Alias of `getCampaignForCampaignMessageRequest` * - * Get Campaign + * @deprecated use `getCampaignForCampaignMessageRequest` instead + */ + public function getCampaignMessageCampaignRequest(...$args) { + return $this->getCampaignForCampaignMessageRequest(...$args); + } + + /** + * Operation getCampaignIdForCampaignMessage * - * @param string $id The campaign ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Campaign ID for Campaign Message + * + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaign($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + public function getCampaignIdForCampaignMessage($id, $apiKey = null) { - list($response) = $this->getCampaignWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey); + list($response) = $this->getCampaignIdForCampaignMessageWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getCampaignWithHttpInfo + * Alias of `getCampaignIdForCampaignMessage` * - * Get Campaign + * @deprecated use `getCampaignIdForCampaignMessage` instead + */ + public function getCampaignMessageRelationshipsCampaign(...$args) { + return $this->getCampaignIdForCampaignMessage(...$args); + } + + /** + * Operation getCampaignIdForCampaignMessageWithHttpInfo * - * @param string $id The campaign ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Campaign ID for Campaign Message + * + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + public function getCampaignIdForCampaignMessageWithHttpInfo($id, $apiKey = null) { - $request = $this->getCampaignRequest($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey); + $request = $this->getCampaignIdForCampaignMessageRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2378,22 +2903,27 @@ public function getCampaignWithHttpInfo($id, $fields_campaign_message = null, $f } /** - * Operation getCampaignAsync + * Alias of `getCampaignIdForCampaignMessageWithHttpInfo` * - * Get Campaign + * @deprecated use `getCampaignIdForCampaignMessageWithHttpInfo` instead + */ + public function getCampaignMessageRelationshipsCampaignWithHttpInfo(...$args) { + return $this->getCampaignIdForCampaignMessageWithHttpInfo(...$args); + } + + /** + * Operation getCampaignIdForCampaignMessageAsync * - * @param string $id The campaign ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Campaign ID for Campaign Message + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAsync($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + public function getCampaignIdForCampaignMessageAsync($id, $apiKey = null) { - return $this->getCampaignAsyncWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey) + return $this->getCampaignIdForCampaignMessageAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -2402,23 +2932,28 @@ function ($response) { } /** - * Operation getCampaignAsyncWithHttpInfo + * Alias of `getCampaignIdForCampaignMessageAsync` * - * Get Campaign + * @deprecated use `getCampaignIdForCampaignMessageAsync` instead + */ + public function getCampaignMessageRelationshipsCampaignAsync(...$args) { + return $this->getCampaignIdForCampaignMessageAsync(...$args); + } + + /** + * Operation getCampaignIdForCampaignMessageAsyncWithHttpInfo * - * @param string $id The campaign ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Campaign ID for Campaign Message + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAsyncWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + public function getCampaignIdForCampaignMessageAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignRequest($id, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $apiKey); + $request = $this->getCampaignIdForCampaignMessageRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2462,69 +2997,38 @@ function ($exception) { } /** - * Create request for operation 'getCampaign' + * Alias of `getCampaignIdForCampaignMessageAsyncWithHttpInfo` * - * @param string $id The campaign ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @deprecated use `getCampaignIdForCampaignMessageAsyncWithHttpInfo` instead + */ + public function getCampaignMessageRelationshipsCampaignAsyncWithHttpInfo(...$args) { + return $this->getCampaignIdForCampaignMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getCampaignIdForCampaignMessage' + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignRequest($id, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $apiKey = null) + public function getCampaignIdForCampaignMessageRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaign' + 'Missing the required parameter $id when calling getCampaignIdForCampaignMessage' ); } - $resourcePath = '/api/campaigns/{id}/'; + $resourcePath = '/api/campaign-messages/{id}/relationships/campaign'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign_message, - 'fields[campaign-message]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign, - 'fields[campaign]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -2539,11 +3043,11 @@ public function getCampaignRequest($id, $fields_campaign_message = null, $fields if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2564,7 +3068,7 @@ public function getCampaignRequest($id, $fields_campaign_message = null, $fields // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2588,7 +3092,7 @@ public function getCampaignRequest($id, $fields_campaign_message = null, $fields $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2606,44 +3110,53 @@ public function getCampaignRequest($id, $fields_campaign_message = null, $fields } /** - * Operation getCampaignCampaignMessages + * Alias of `getCampaignIdForCampaignMessageRequest` * - * Get Campaign Campaign Messages + * @deprecated use `getCampaignIdForCampaignMessageRequest` instead + */ + public function getCampaignMessageRelationshipsCampaignRequest(...$args) { + return $this->getCampaignIdForCampaignMessageRequest(...$args); + } + + /** + * Operation getCampaignMessage * - * @param string $id (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Campaign Message + * + * @param string $id The message ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignCampaignMessages($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignMessage($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { - list($response) = $this->getCampaignCampaignMessagesWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); + list($response) = $this->getCampaignMessageWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); return $response; } /** - * Operation getCampaignCampaignMessagesWithHttpInfo + * Operation getCampaignMessageWithHttpInfo * - * Get Campaign Campaign Messages + * Get Campaign Message * - * @param string $id (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The message ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignCampaignMessagesWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignMessageWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { - $request = $this->getCampaignCampaignMessagesRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); + $request = $this->getCampaignMessageRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2799,22 +3312,22 @@ public function getCampaignCampaignMessagesWithHttpInfo($id, $fields_campaign_me } /** - * Operation getCampaignCampaignMessagesAsync + * Operation getCampaignMessageAsync * - * Get Campaign Campaign Messages + * Get Campaign Message * - * @param string $id (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The message ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignCampaignMessagesAsync($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignMessageAsync($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { - return $this->getCampaignCampaignMessagesAsyncWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey) + return $this->getCampaignMessageAsyncWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -2823,23 +3336,23 @@ function ($response) { } /** - * Operation getCampaignCampaignMessagesAsyncWithHttpInfo + * Operation getCampaignMessageAsyncWithHttpInfo * - * Get Campaign Campaign Messages + * Get Campaign Message * - * @param string $id (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The message ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignCampaignMessagesAsyncWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignMessageAsyncWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignCampaignMessagesRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); + $request = $this->getCampaignMessageRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2883,27 +3396,27 @@ function ($exception) { } /** - * Create request for operation 'getCampaignCampaignMessages' + * Create request for operation 'getCampaignMessage' * - * @param string $id (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The message ID to be retrieved (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignCampaignMessagesRequest($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignMessageRequest($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignCampaignMessages' + 'Missing the required parameter $id when calling getCampaignMessage' ); } - $resourcePath = '/api/campaigns/{id}/campaign-messages/'; + $resourcePath = '/api/campaign-messages/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2960,11 +3473,11 @@ public function getCampaignCampaignMessagesRequest($id, $fields_campaign_message if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2985,7 +3498,7 @@ public function getCampaignCampaignMessagesRequest($id, $fields_campaign_message // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3009,7 +3522,7 @@ public function getCampaignCampaignMessagesRequest($id, $fields_campaign_message $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3027,44 +3540,38 @@ public function getCampaignCampaignMessagesRequest($id, $fields_campaign_message } /** - * Operation getCampaignMessage + * Operation getCampaignRecipientEstimation * - * Get Campaign Message + * Get Campaign Recipient Estimation * - * @param string $id The message ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) + * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignMessage($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignRecipientEstimation($id, $fields_campaign_recipient_estimation = null, $apiKey = null) { - list($response) = $this->getCampaignMessageWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); + list($response) = $this->getCampaignRecipientEstimationWithHttpInfo($id, $fields_campaign_recipient_estimation, $apiKey); return $response; } /** - * Operation getCampaignMessageWithHttpInfo + * Operation getCampaignRecipientEstimationWithHttpInfo * - * Get Campaign Message + * Get Campaign Recipient Estimation * - * @param string $id The message ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) + * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignMessageWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignRecipientEstimationWithHttpInfo($id, $fields_campaign_recipient_estimation = null, $apiKey = null) { - $request = $this->getCampaignMessageRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); + $request = $this->getCampaignRecipientEstimationRequest($id, $fields_campaign_recipient_estimation, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3220,22 +3727,19 @@ public function getCampaignMessageWithHttpInfo($id, $fields_campaign_message = n } /** - * Operation getCampaignMessageAsync + * Operation getCampaignRecipientEstimationAsync * - * Get Campaign Message + * Get Campaign Recipient Estimation * - * @param string $id The message ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) + * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageAsync($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignRecipientEstimationAsync($id, $fields_campaign_recipient_estimation = null, $apiKey = null) { - return $this->getCampaignMessageAsyncWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey) + return $this->getCampaignRecipientEstimationAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation, $apiKey) ->then( function ($response) { return $response[0]; @@ -3244,23 +3748,20 @@ function ($response) { } /** - * Operation getCampaignMessageAsyncWithHttpInfo + * Operation getCampaignRecipientEstimationAsyncWithHttpInfo * - * Get Campaign Message + * Get Campaign Recipient Estimation * - * @param string $id The message ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) + * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageAsyncWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignRecipientEstimationAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignMessageRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); + $request = $this->getCampaignRecipientEstimationRequest($id, $fields_campaign_recipient_estimation, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3304,27 +3805,24 @@ function ($exception) { } /** - * Create request for operation 'getCampaignMessage' + * Create request for operation 'getCampaignRecipientEstimation' * - * @param string $id The message ID to be retrieved (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) + * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignMessageRequest($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) + public function getCampaignRecipientEstimationRequest($id, $fields_campaign_recipient_estimation = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignMessage' + 'Missing the required parameter $id when calling getCampaignRecipientEstimation' ); } - $resourcePath = '/api/campaign-messages/{id}/'; + $resourcePath = '/api/campaign-recipient-estimations/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3333,35 +3831,8 @@ public function getCampaignMessageRequest($id, $fields_campaign_message = null, // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign_message, - 'fields[campaign-message]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign, - 'fields[campaign]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_template, - 'fields[template]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name + $fields_campaign_recipient_estimation, + 'fields[campaign-recipient-estimation]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -3381,11 +3852,11 @@ public function getCampaignMessageRequest($id, $fields_campaign_message = null, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3406,7 +3877,7 @@ public function getCampaignMessageRequest($id, $fields_campaign_message = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3430,7 +3901,7 @@ public function getCampaignMessageRequest($id, $fields_campaign_message = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3448,38 +3919,38 @@ public function getCampaignMessageRequest($id, $fields_campaign_message = null, } /** - * Operation getCampaignMessageCampaign + * Operation getCampaignRecipientEstimationJob * - * Get Campaign Message Campaign + * Get Campaign Recipient Estimation Job * - * @param string $id (required) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the campaign to get recipient estimation status (required) + * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignMessageCampaign($id, $fields_campaign = null, $apiKey = null) + public function getCampaignRecipientEstimationJob($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) { - list($response) = $this->getCampaignMessageCampaignWithHttpInfo($id, $fields_campaign, $apiKey); + list($response) = $this->getCampaignRecipientEstimationJobWithHttpInfo($id, $fields_campaign_recipient_estimation_job, $apiKey); return $response; } /** - * Operation getCampaignMessageCampaignWithHttpInfo + * Operation getCampaignRecipientEstimationJobWithHttpInfo * - * Get Campaign Message Campaign + * Get Campaign Recipient Estimation Job * - * @param string $id (required) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the campaign to get recipient estimation status (required) + * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignMessageCampaignWithHttpInfo($id, $fields_campaign = null, $apiKey = null) + public function getCampaignRecipientEstimationJobWithHttpInfo($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) { - $request = $this->getCampaignMessageCampaignRequest($id, $fields_campaign, $apiKey); + $request = $this->getCampaignRecipientEstimationJobRequest($id, $fields_campaign_recipient_estimation_job, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3635,19 +4106,19 @@ public function getCampaignMessageCampaignWithHttpInfo($id, $fields_campaign = n } /** - * Operation getCampaignMessageCampaignAsync + * Operation getCampaignRecipientEstimationJobAsync * - * Get Campaign Message Campaign + * Get Campaign Recipient Estimation Job * - * @param string $id (required) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the campaign to get recipient estimation status (required) + * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageCampaignAsync($id, $fields_campaign = null, $apiKey = null) + public function getCampaignRecipientEstimationJobAsync($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) { - return $this->getCampaignMessageCampaignAsyncWithHttpInfo($id, $fields_campaign, $apiKey) + return $this->getCampaignRecipientEstimationJobAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation_job, $apiKey) ->then( function ($response) { return $response[0]; @@ -3656,20 +4127,20 @@ function ($response) { } /** - * Operation getCampaignMessageCampaignAsyncWithHttpInfo + * Operation getCampaignRecipientEstimationJobAsyncWithHttpInfo * - * Get Campaign Message Campaign + * Get Campaign Recipient Estimation Job * - * @param string $id (required) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the campaign to get recipient estimation status (required) + * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageCampaignAsyncWithHttpInfo($id, $fields_campaign = null, $apiKey = null) + public function getCampaignRecipientEstimationJobAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignMessageCampaignRequest($id, $fields_campaign, $apiKey); + $request = $this->getCampaignRecipientEstimationJobRequest($id, $fields_campaign_recipient_estimation_job, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3713,24 +4184,24 @@ function ($exception) { } /** - * Create request for operation 'getCampaignMessageCampaign' + * Create request for operation 'getCampaignRecipientEstimationJob' * - * @param string $id (required) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the campaign to get recipient estimation status (required) + * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignMessageCampaignRequest($id, $fields_campaign = null, $apiKey = null) + public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignMessageCampaign' + 'Missing the required parameter $id when calling getCampaignRecipientEstimationJob' ); } - $resourcePath = '/api/campaign-messages/{id}/campaign/'; + $resourcePath = '/api/campaign-recipient-estimation-jobs/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3739,8 +4210,8 @@ public function getCampaignMessageCampaignRequest($id, $fields_campaign = null, // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign, - 'fields[campaign]', // param base name + $fields_campaign_recipient_estimation_job, + 'fields[campaign-recipient-estimation-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -3760,11 +4231,11 @@ public function getCampaignMessageCampaignRequest($id, $fields_campaign = null, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3785,7 +4256,7 @@ public function getCampaignMessageCampaignRequest($id, $fields_campaign = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3809,7 +4280,7 @@ public function getCampaignMessageCampaignRequest($id, $fields_campaign = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3827,36 +4298,38 @@ public function getCampaignMessageCampaignRequest($id, $fields_campaign = null, } /** - * Operation getCampaignMessageRelationshipsCampaign + * Operation getCampaignSendJob * - * Get Campaign Message Relationships Campaign + * Get Campaign Send Job * - * @param string $id (required) + * @param string $id The ID of the campaign to send (required) + * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignMessageRelationshipsCampaign($id, $apiKey = null) + public function getCampaignSendJob($id, $fields_campaign_send_job = null, $apiKey = null) { - list($response) = $this->getCampaignMessageRelationshipsCampaignWithHttpInfo($id, $apiKey); + list($response) = $this->getCampaignSendJobWithHttpInfo($id, $fields_campaign_send_job, $apiKey); return $response; } /** - * Operation getCampaignMessageRelationshipsCampaignWithHttpInfo + * Operation getCampaignSendJobWithHttpInfo * - * Get Campaign Message Relationships Campaign + * Get Campaign Send Job * - * @param string $id (required) + * @param string $id The ID of the campaign to send (required) + * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignMessageRelationshipsCampaignWithHttpInfo($id, $apiKey = null) + public function getCampaignSendJobWithHttpInfo($id, $fields_campaign_send_job = null, $apiKey = null) { - $request = $this->getCampaignMessageRelationshipsCampaignRequest($id, $apiKey); + $request = $this->getCampaignSendJobRequest($id, $fields_campaign_send_job, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4012,18 +4485,19 @@ public function getCampaignMessageRelationshipsCampaignWithHttpInfo($id, $apiKey } /** - * Operation getCampaignMessageRelationshipsCampaignAsync + * Operation getCampaignSendJobAsync * - * Get Campaign Message Relationships Campaign + * Get Campaign Send Job * - * @param string $id (required) + * @param string $id The ID of the campaign to send (required) + * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageRelationshipsCampaignAsync($id, $apiKey = null) + public function getCampaignSendJobAsync($id, $fields_campaign_send_job = null, $apiKey = null) { - return $this->getCampaignMessageRelationshipsCampaignAsyncWithHttpInfo($id, $apiKey) + return $this->getCampaignSendJobAsyncWithHttpInfo($id, $fields_campaign_send_job, $apiKey) ->then( function ($response) { return $response[0]; @@ -4032,19 +4506,20 @@ function ($response) { } /** - * Operation getCampaignMessageRelationshipsCampaignAsyncWithHttpInfo + * Operation getCampaignSendJobAsyncWithHttpInfo * - * Get Campaign Message Relationships Campaign + * Get Campaign Send Job * - * @param string $id (required) + * @param string $id The ID of the campaign to send (required) + * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageRelationshipsCampaignAsyncWithHttpInfo($id, $apiKey = null) + public function getCampaignSendJobAsyncWithHttpInfo($id, $fields_campaign_send_job = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignMessageRelationshipsCampaignRequest($id, $apiKey); + $request = $this->getCampaignSendJobRequest($id, $fields_campaign_send_job, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4088,29 +4563,39 @@ function ($exception) { } /** - * Create request for operation 'getCampaignMessageRelationshipsCampaign' + * Create request for operation 'getCampaignSendJob' * - * @param string $id (required) + * @param string $id The ID of the campaign to send (required) + * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignMessageRelationshipsCampaignRequest($id, $apiKey = null) + public function getCampaignSendJobRequest($id, $fields_campaign_send_job = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignMessageRelationshipsCampaign' + 'Missing the required parameter $id when calling getCampaignSendJob' ); } - $resourcePath = '/api/campaign-messages/{id}/relationships/campaign/'; + $resourcePath = '/api/campaign-send-jobs/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_campaign_send_job, + 'fields[campaign-send-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -4125,11 +4610,11 @@ public function getCampaignMessageRelationshipsCampaignRequest($id, $apiKey = nu if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4150,7 +4635,7 @@ public function getCampaignMessageRelationshipsCampaignRequest($id, $apiKey = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4174,7 +4659,7 @@ public function getCampaignMessageRelationshipsCampaignRequest($id, $apiKey = nu $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4192,36 +4677,38 @@ public function getCampaignMessageRelationshipsCampaignRequest($id, $apiKey = nu } /** - * Operation getCampaignMessageRelationshipsTemplate + * Operation getCampaignTags * - * Get Campaign Message Relationships Template + * Get Campaign Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignMessageRelationshipsTemplate($id, $apiKey = null) + public function getCampaignTags($id, $fields_tag = null, $apiKey = null) { - list($response) = $this->getCampaignMessageRelationshipsTemplateWithHttpInfo($id, $apiKey); + list($response) = $this->getCampaignTagsWithHttpInfo($id, $fields_tag, $apiKey); return $response; } /** - * Operation getCampaignMessageRelationshipsTemplateWithHttpInfo + * Operation getCampaignTagsWithHttpInfo * - * Get Campaign Message Relationships Template + * Get Campaign Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignMessageRelationshipsTemplateWithHttpInfo($id, $apiKey = null) + public function getCampaignTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) { - $request = $this->getCampaignMessageRelationshipsTemplateRequest($id, $apiKey); + $request = $this->getCampaignTagsRequest($id, $fields_tag, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4377,18 +4864,19 @@ public function getCampaignMessageRelationshipsTemplateWithHttpInfo($id, $apiKey } /** - * Operation getCampaignMessageRelationshipsTemplateAsync + * Operation getCampaignTagsAsync * - * Get Campaign Message Relationships Template + * Get Campaign Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageRelationshipsTemplateAsync($id, $apiKey = null) + public function getCampaignTagsAsync($id, $fields_tag = null, $apiKey = null) { - return $this->getCampaignMessageRelationshipsTemplateAsyncWithHttpInfo($id, $apiKey) + return $this->getCampaignTagsAsyncWithHttpInfo($id, $fields_tag, $apiKey) ->then( function ($response) { return $response[0]; @@ -4397,19 +4885,20 @@ function ($response) { } /** - * Operation getCampaignMessageRelationshipsTemplateAsyncWithHttpInfo + * Operation getCampaignTagsAsyncWithHttpInfo * - * Get Campaign Message Relationships Template + * Get Campaign Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageRelationshipsTemplateAsyncWithHttpInfo($id, $apiKey = null) + public function getCampaignTagsAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignMessageRelationshipsTemplateRequest($id, $apiKey); + $request = $this->getCampaignTagsRequest($id, $fields_tag, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4453,29 +4942,39 @@ function ($exception) { } /** - * Create request for operation 'getCampaignMessageRelationshipsTemplate' + * Create request for operation 'getCampaignTags' * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignMessageRelationshipsTemplateRequest($id, $apiKey = null) + public function getCampaignTagsRequest($id, $fields_tag = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignMessageRelationshipsTemplate' + 'Missing the required parameter $id when calling getCampaignTags' ); } - $resourcePath = '/api/campaign-messages/{id}/relationships/template/'; + $resourcePath = '/api/campaigns/{id}/tags'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -4490,11 +4989,11 @@ public function getCampaignMessageRelationshipsTemplateRequest($id, $apiKey = nu if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4515,7 +5014,7 @@ public function getCampaignMessageRelationshipsTemplateRequest($id, $apiKey = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4539,7 +5038,7 @@ public function getCampaignMessageRelationshipsTemplateRequest($id, $apiKey = nu $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4557,38 +5056,48 @@ public function getCampaignMessageRelationshipsTemplateRequest($id, $apiKey = nu } /** - * Operation getCampaignMessageTemplate + * Operation getCampaigns * - * Get Campaign Message Template + * Get Campaigns * - * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignMessageTemplate($id, $fields_template = null, $apiKey = null) + public function getCampaigns($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getCampaignMessageTemplateWithHttpInfo($id, $fields_template, $apiKey); + list($response) = $this->getCampaignsWithHttpInfo($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey); return $response; } /** - * Operation getCampaignMessageTemplateWithHttpInfo + * Operation getCampaignsWithHttpInfo * - * Get Campaign Message Template + * Get Campaigns * - * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignMessageTemplateWithHttpInfo($id, $fields_template = null, $apiKey = null) + public function getCampaignsWithHttpInfo($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getCampaignMessageTemplateRequest($id, $fields_template, $apiKey); + $request = $this->getCampaignsRequest($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4744,19 +5253,24 @@ public function getCampaignMessageTemplateWithHttpInfo($id, $fields_template = n } /** - * Operation getCampaignMessageTemplateAsync + * Operation getCampaignsAsync * - * Get Campaign Message Template + * Get Campaigns * - * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageTemplateAsync($id, $fields_template = null, $apiKey = null) + public function getCampaignsAsync($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getCampaignMessageTemplateAsyncWithHttpInfo($id, $fields_template, $apiKey) + return $this->getCampaignsAsyncWithHttpInfo($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -4765,20 +5279,25 @@ function ($response) { } /** - * Operation getCampaignMessageTemplateAsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * Get Campaign Message Template + * Get Campaigns * - * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignMessageTemplateAsyncWithHttpInfo($id, $fields_template = null, $apiKey = null) + public function getCampaignsAsyncWithHttpInfo($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignMessageTemplateRequest($id, $fields_template, $apiKey); + $request = $this->getCampaignsRequest($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4822,24 +5341,29 @@ function ($exception) { } /** - * Create request for operation 'getCampaignMessageTemplate' + * Create request for operation 'getCampaigns' * - * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignMessageTemplateRequest($id, $fields_template = null, $apiKey = null) + public function getCampaignsRequest($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'filter' is set + if ($filter === null || (is_array($filter) && count($filter) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignMessageTemplate' + 'Missing the required parameter $filter when calling getCampaigns' ); } - $resourcePath = '/api/campaign-messages/{id}/template/'; + $resourcePath = '/api/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4848,32 +5372,78 @@ public function getCampaignMessageTemplateRequest($id, $fields_template = null, // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_template, - 'fields[template]', // param base name + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_campaign_message, + 'fields[campaign-message]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_campaign, + 'fields[campaign]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4894,7 +5464,7 @@ public function getCampaignMessageTemplateRequest($id, $fields_template = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4918,7 +5488,7 @@ public function getCampaignMessageTemplateRequest($id, $fields_template = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4936,38 +5506,45 @@ public function getCampaignMessageTemplateRequest($id, $fields_template = null, } /** - * Operation getCampaignRecipientEstimation + * Operation getMessageIdsForCampaign * - * Get Campaign Recipient Estimation + * Get Message IDs for Campaign * - * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) - * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignRecipientEstimation($id, $fields_campaign_recipient_estimation = null, $apiKey = null) + public function getMessageIdsForCampaign($id, $apiKey = null) { - list($response) = $this->getCampaignRecipientEstimationWithHttpInfo($id, $fields_campaign_recipient_estimation, $apiKey); + list($response) = $this->getMessageIdsForCampaignWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getCampaignRecipientEstimationWithHttpInfo + * Alias of `getMessageIdsForCampaign` * - * Get Campaign Recipient Estimation + * @deprecated use `getMessageIdsForCampaign` instead + */ + public function getCampaignRelationshipsCampaignMessages(...$args) { + return $this->getMessageIdsForCampaign(...$args); + } + + /** + * Operation getMessageIdsForCampaignWithHttpInfo * - * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) - * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Message IDs for Campaign + * + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRecipientEstimationWithHttpInfo($id, $fields_campaign_recipient_estimation = null, $apiKey = null) + public function getMessageIdsForCampaignWithHttpInfo($id, $apiKey = null) { - $request = $this->getCampaignRecipientEstimationRequest($id, $fields_campaign_recipient_estimation, $apiKey); + $request = $this->getMessageIdsForCampaignRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5123,19 +5700,27 @@ public function getCampaignRecipientEstimationWithHttpInfo($id, $fields_campaign } /** - * Operation getCampaignRecipientEstimationAsync + * Alias of `getMessageIdsForCampaignWithHttpInfo` * - * Get Campaign Recipient Estimation + * @deprecated use `getMessageIdsForCampaignWithHttpInfo` instead + */ + public function getCampaignRelationshipsCampaignMessagesWithHttpInfo(...$args) { + return $this->getMessageIdsForCampaignWithHttpInfo(...$args); + } + + /** + * Operation getMessageIdsForCampaignAsync * - * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) - * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Message IDs for Campaign + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRecipientEstimationAsync($id, $fields_campaign_recipient_estimation = null, $apiKey = null) + public function getMessageIdsForCampaignAsync($id, $apiKey = null) { - return $this->getCampaignRecipientEstimationAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation, $apiKey) + return $this->getMessageIdsForCampaignAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -5144,20 +5729,28 @@ function ($response) { } /** - * Operation getCampaignRecipientEstimationAsyncWithHttpInfo + * Alias of `getMessageIdsForCampaignAsync` * - * Get Campaign Recipient Estimation + * @deprecated use `getMessageIdsForCampaignAsync` instead + */ + public function getCampaignRelationshipsCampaignMessagesAsync(...$args) { + return $this->getMessageIdsForCampaignAsync(...$args); + } + + /** + * Operation getMessageIdsForCampaignAsyncWithHttpInfo * - * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) - * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Message IDs for Campaign + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRecipientEstimationAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation = null, $apiKey = null) + public function getMessageIdsForCampaignAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignRecipientEstimationRequest($id, $fields_campaign_recipient_estimation, $apiKey); + $request = $this->getMessageIdsForCampaignRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5201,39 +5794,38 @@ function ($exception) { } /** - * Create request for operation 'getCampaignRecipientEstimation' + * Alias of `getMessageIdsForCampaignAsyncWithHttpInfo` * - * @param string $id The ID of the campaign for which to get the estimated number of recipients (required) - * @param string[] $fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getMessageIdsForCampaignAsyncWithHttpInfo` instead + */ + public function getCampaignRelationshipsCampaignMessagesAsyncWithHttpInfo(...$args) { + return $this->getMessageIdsForCampaignAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getMessageIdsForCampaign' + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignRecipientEstimationRequest($id, $fields_campaign_recipient_estimation = null, $apiKey = null) + public function getMessageIdsForCampaignRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignRecipientEstimation' + 'Missing the required parameter $id when calling getMessageIdsForCampaign' ); } - $resourcePath = '/api/campaign-recipient-estimations/{id}/'; + $resourcePath = '/api/campaigns/{id}/relationships/campaign-messages'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign_recipient_estimation, - 'fields[campaign-recipient-estimation]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -5248,11 +5840,11 @@ public function getCampaignRecipientEstimationRequest($id, $fields_campaign_reci if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5273,7 +5865,7 @@ public function getCampaignRecipientEstimationRequest($id, $fields_campaign_reci // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5297,7 +5889,7 @@ public function getCampaignRecipientEstimationRequest($id, $fields_campaign_reci $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5315,38 +5907,62 @@ public function getCampaignRecipientEstimationRequest($id, $fields_campaign_reci } /** - * Operation getCampaignRecipientEstimationJob + * Alias of `getMessageIdsForCampaignRequest` * - * Get Campaign Recipient Estimation Job + * @deprecated use `getMessageIdsForCampaignRequest` instead + */ + public function getCampaignRelationshipsCampaignMessagesRequest(...$args) { + return $this->getMessageIdsForCampaignRequest(...$args); + } + + /** + * Operation getMessagesForCampaign * - * @param string $id The ID of the campaign to get recipient estimation status (required) - * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Messages for Campaign + * + * @param string $id (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignRecipientEstimationJob($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) + public function getMessagesForCampaign($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { - list($response) = $this->getCampaignRecipientEstimationJobWithHttpInfo($id, $fields_campaign_recipient_estimation_job, $apiKey); + list($response) = $this->getMessagesForCampaignWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); return $response; } /** - * Operation getCampaignRecipientEstimationJobWithHttpInfo + * Alias of `getMessagesForCampaign` * - * Get Campaign Recipient Estimation Job + * @deprecated use `getMessagesForCampaign` instead + */ + public function getCampaignCampaignMessages(...$args) { + return $this->getMessagesForCampaign(...$args); + } + + /** + * Operation getMessagesForCampaignWithHttpInfo * - * @param string $id The ID of the campaign to get recipient estimation status (required) - * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Messages for Campaign + * + * @param string $id (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRecipientEstimationJobWithHttpInfo($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) + public function getMessagesForCampaignWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { - $request = $this->getCampaignRecipientEstimationJobRequest($id, $fields_campaign_recipient_estimation_job, $apiKey); + $request = $this->getMessagesForCampaignRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5502,19 +6118,31 @@ public function getCampaignRecipientEstimationJobWithHttpInfo($id, $fields_campa } /** - * Operation getCampaignRecipientEstimationJobAsync + * Alias of `getMessagesForCampaignWithHttpInfo` * - * Get Campaign Recipient Estimation Job + * @deprecated use `getMessagesForCampaignWithHttpInfo` instead + */ + public function getCampaignCampaignMessagesWithHttpInfo(...$args) { + return $this->getMessagesForCampaignWithHttpInfo(...$args); + } + + /** + * Operation getMessagesForCampaignAsync * - * @param string $id The ID of the campaign to get recipient estimation status (required) - * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Messages for Campaign + * + * @param string $id (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRecipientEstimationJobAsync($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) + public function getMessagesForCampaignAsync($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { - return $this->getCampaignRecipientEstimationJobAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation_job, $apiKey) + return $this->getMessagesForCampaignAsyncWithHttpInfo($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -5523,20 +6151,32 @@ function ($response) { } /** - * Operation getCampaignRecipientEstimationJobAsyncWithHttpInfo + * Alias of `getMessagesForCampaignAsync` * - * Get Campaign Recipient Estimation Job + * @deprecated use `getMessagesForCampaignAsync` instead + */ + public function getCampaignCampaignMessagesAsync(...$args) { + return $this->getMessagesForCampaignAsync(...$args); + } + + /** + * Operation getMessagesForCampaignAsyncWithHttpInfo * - * @param string $id The ID of the campaign to get recipient estimation status (required) - * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Messages for Campaign + * + * @param string $id (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRecipientEstimationJobAsyncWithHttpInfo($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) + public function getMessagesForCampaignAsyncWithHttpInfo($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignRecipientEstimationJobRequest($id, $fields_campaign_recipient_estimation_job, $apiKey); + $request = $this->getMessagesForCampaignRequest($id, $fields_campaign_message, $fields_campaign, $fields_template, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5580,24 +6220,36 @@ function ($exception) { } /** - * Create request for operation 'getCampaignRecipientEstimationJob' + * Alias of `getMessagesForCampaignAsyncWithHttpInfo` * - * @param string $id The ID of the campaign to get recipient estimation status (required) - * @param string[] $fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getMessagesForCampaignAsyncWithHttpInfo` instead + */ + public function getCampaignCampaignMessagesAsyncWithHttpInfo(...$args) { + return $this->getMessagesForCampaignAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getMessagesForCampaign' + * + * @param string $id (required) + * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_recipient_estimation_job = null, $apiKey = null) + public function getMessagesForCampaignRequest($id, $fields_campaign_message = null, $fields_campaign = null, $fields_template = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignRecipientEstimationJob' + 'Missing the required parameter $id when calling getMessagesForCampaign' ); } - $resourcePath = '/api/campaign-recipient-estimation-jobs/{id}/'; + $resourcePath = '/api/campaigns/{id}/campaign-messages'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5606,8 +6258,35 @@ public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_r // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign_recipient_estimation_job, - 'fields[campaign-recipient-estimation-job]', // param base name + $fields_campaign_message, + 'fields[campaign-message]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_campaign, + 'fields[campaign]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_template, + 'fields[template]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name 'array', // openApiType 'form', // style false, // explode @@ -5627,11 +6306,11 @@ public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_r if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5652,7 +6331,7 @@ public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_r // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5676,7 +6355,7 @@ public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_r $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5694,9 +6373,18 @@ public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_r } /** - * Operation getCampaignRelationshipsCampaignMessages + * Alias of `getMessagesForCampaignRequest` + * + * @deprecated use `getMessagesForCampaignRequest` instead + */ + public function getCampaignCampaignMessagesRequest(...$args) { + return $this->getMessagesForCampaignRequest(...$args); + } + + /** + * Operation getTagIdsForCampaign * - * Get Campaign Relationships Campaign Messages + * Get Tag IDs for Campaign * * @param string $id (required) * @@ -5704,16 +6392,25 @@ public function getCampaignRecipientEstimationJobRequest($id, $fields_campaign_r * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignRelationshipsCampaignMessages($id, $apiKey = null) + public function getTagIdsForCampaign($id, $apiKey = null) { - list($response) = $this->getCampaignRelationshipsCampaignMessagesWithHttpInfo($id, $apiKey); + list($response) = $this->getTagIdsForCampaignWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getCampaignRelationshipsCampaignMessagesWithHttpInfo + * Alias of `getTagIdsForCampaign` * - * Get Campaign Relationships Campaign Messages + * @deprecated use `getTagIdsForCampaign` instead + */ + public function getCampaignRelationshipsTags(...$args) { + return $this->getTagIdsForCampaign(...$args); + } + + /** + * Operation getTagIdsForCampaignWithHttpInfo + * + * Get Tag IDs for Campaign * * @param string $id (required) * @@ -5721,9 +6418,9 @@ public function getCampaignRelationshipsCampaignMessages($id, $apiKey = null) * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRelationshipsCampaignMessagesWithHttpInfo($id, $apiKey = null) + public function getTagIdsForCampaignWithHttpInfo($id, $apiKey = null) { - $request = $this->getCampaignRelationshipsCampaignMessagesRequest($id, $apiKey); + $request = $this->getTagIdsForCampaignRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5879,18 +6576,27 @@ public function getCampaignRelationshipsCampaignMessagesWithHttpInfo($id, $apiKe } /** - * Operation getCampaignRelationshipsCampaignMessagesAsync + * Alias of `getTagIdsForCampaignWithHttpInfo` + * + * @deprecated use `getTagIdsForCampaignWithHttpInfo` instead + */ + public function getCampaignRelationshipsTagsWithHttpInfo(...$args) { + return $this->getTagIdsForCampaignWithHttpInfo(...$args); + } + + /** + * Operation getTagIdsForCampaignAsync * - * Get Campaign Relationships Campaign Messages + * Get Tag IDs for Campaign * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRelationshipsCampaignMessagesAsync($id, $apiKey = null) + public function getTagIdsForCampaignAsync($id, $apiKey = null) { - return $this->getCampaignRelationshipsCampaignMessagesAsyncWithHttpInfo($id, $apiKey) + return $this->getTagIdsForCampaignAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -5899,19 +6605,28 @@ function ($response) { } /** - * Operation getCampaignRelationshipsCampaignMessagesAsyncWithHttpInfo + * Alias of `getTagIdsForCampaignAsync` + * + * @deprecated use `getTagIdsForCampaignAsync` instead + */ + public function getCampaignRelationshipsTagsAsync(...$args) { + return $this->getTagIdsForCampaignAsync(...$args); + } + + /** + * Operation getTagIdsForCampaignAsyncWithHttpInfo * - * Get Campaign Relationships Campaign Messages + * Get Tag IDs for Campaign * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRelationshipsCampaignMessagesAsyncWithHttpInfo($id, $apiKey = null) + public function getTagIdsForCampaignAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignRelationshipsCampaignMessagesRequest($id, $apiKey); + $request = $this->getTagIdsForCampaignRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5955,23 +6670,32 @@ function ($exception) { } /** - * Create request for operation 'getCampaignRelationshipsCampaignMessages' + * Alias of `getTagIdsForCampaignAsyncWithHttpInfo` + * + * @deprecated use `getTagIdsForCampaignAsyncWithHttpInfo` instead + */ + public function getCampaignRelationshipsTagsAsyncWithHttpInfo(...$args) { + return $this->getTagIdsForCampaignAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagIdsForCampaign' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignRelationshipsCampaignMessagesRequest($id, $apiKey = null) + public function getTagIdsForCampaignRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignRelationshipsCampaignMessages' + 'Missing the required parameter $id when calling getTagIdsForCampaign' ); } - $resourcePath = '/api/campaigns/{id}/relationships/campaign-messages/'; + $resourcePath = '/api/campaigns/{id}/relationships/tags'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5992,11 +6716,11 @@ public function getCampaignRelationshipsCampaignMessagesRequest($id, $apiKey = n if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6017,7 +6741,7 @@ public function getCampaignRelationshipsCampaignMessagesRequest($id, $apiKey = n // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6041,7 +6765,7 @@ public function getCampaignRelationshipsCampaignMessagesRequest($id, $apiKey = n $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6059,36 +6783,56 @@ public function getCampaignRelationshipsCampaignMessagesRequest($id, $apiKey = n } /** - * Operation getCampaignRelationshipsTags + * Alias of `getTagIdsForCampaignRequest` + * + * @deprecated use `getTagIdsForCampaignRequest` instead + */ + public function getCampaignRelationshipsTagsRequest(...$args) { + return $this->getTagIdsForCampaignRequest(...$args); + } + + /** + * Operation getTemplateForCampaignMessage * - * Get Campaign Relationships Tags + * Get Template for Campaign Message * * @param string $id (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignRelationshipsTags($id, $apiKey = null) + public function getTemplateForCampaignMessage($id, $fields_template = null, $apiKey = null) { - list($response) = $this->getCampaignRelationshipsTagsWithHttpInfo($id, $apiKey); + list($response) = $this->getTemplateForCampaignMessageWithHttpInfo($id, $fields_template, $apiKey); return $response; } /** - * Operation getCampaignRelationshipsTagsWithHttpInfo + * Alias of `getTemplateForCampaignMessage` + * + * @deprecated use `getTemplateForCampaignMessage` instead + */ + public function getCampaignMessageTemplate(...$args) { + return $this->getTemplateForCampaignMessage(...$args); + } + + /** + * Operation getTemplateForCampaignMessageWithHttpInfo * - * Get Campaign Relationships Tags + * Get Template for Campaign Message * * @param string $id (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRelationshipsTagsWithHttpInfo($id, $apiKey = null) + public function getTemplateForCampaignMessageWithHttpInfo($id, $fields_template = null, $apiKey = null) { - $request = $this->getCampaignRelationshipsTagsRequest($id, $apiKey); + $request = $this->getTemplateForCampaignMessageRequest($id, $fields_template, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6244,18 +6988,28 @@ public function getCampaignRelationshipsTagsWithHttpInfo($id, $apiKey = null) } /** - * Operation getCampaignRelationshipsTagsAsync + * Alias of `getTemplateForCampaignMessageWithHttpInfo` + * + * @deprecated use `getTemplateForCampaignMessageWithHttpInfo` instead + */ + public function getCampaignMessageTemplateWithHttpInfo(...$args) { + return $this->getTemplateForCampaignMessageWithHttpInfo(...$args); + } + + /** + * Operation getTemplateForCampaignMessageAsync * - * Get Campaign Relationships Tags + * Get Template for Campaign Message * * @param string $id (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRelationshipsTagsAsync($id, $apiKey = null) + public function getTemplateForCampaignMessageAsync($id, $fields_template = null, $apiKey = null) { - return $this->getCampaignRelationshipsTagsAsyncWithHttpInfo($id, $apiKey) + return $this->getTemplateForCampaignMessageAsyncWithHttpInfo($id, $fields_template, $apiKey) ->then( function ($response) { return $response[0]; @@ -6264,19 +7018,29 @@ function ($response) { } /** - * Operation getCampaignRelationshipsTagsAsyncWithHttpInfo + * Alias of `getTemplateForCampaignMessageAsync` + * + * @deprecated use `getTemplateForCampaignMessageAsync` instead + */ + public function getCampaignMessageTemplateAsync(...$args) { + return $this->getTemplateForCampaignMessageAsync(...$args); + } + + /** + * Operation getTemplateForCampaignMessageAsyncWithHttpInfo * - * Get Campaign Relationships Tags + * Get Template for Campaign Message * * @param string $id (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignRelationshipsTagsAsyncWithHttpInfo($id, $apiKey = null) + public function getTemplateForCampaignMessageAsyncWithHttpInfo($id, $fields_template = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignRelationshipsTagsRequest($id, $apiKey); + $request = $this->getTemplateForCampaignMessageRequest($id, $fields_template, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6320,29 +7084,48 @@ function ($exception) { } /** - * Create request for operation 'getCampaignRelationshipsTags' + * Alias of `getTemplateForCampaignMessageAsyncWithHttpInfo` + * + * @deprecated use `getTemplateForCampaignMessageAsyncWithHttpInfo` instead + */ + public function getCampaignMessageTemplateAsyncWithHttpInfo(...$args) { + return $this->getTemplateForCampaignMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTemplateForCampaignMessage' * * @param string $id (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignRelationshipsTagsRequest($id, $apiKey = null) + public function getTemplateForCampaignMessageRequest($id, $fields_template = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignRelationshipsTags' + 'Missing the required parameter $id when calling getTemplateForCampaignMessage' ); } - $resourcePath = '/api/campaigns/{id}/relationships/tags/'; + $resourcePath = '/api/campaign-messages/{id}/template'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_template, + 'fields[template]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -6357,11 +7140,11 @@ public function getCampaignRelationshipsTagsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6382,7 +7165,7 @@ public function getCampaignRelationshipsTagsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6406,7 +7189,7 @@ public function getCampaignRelationshipsTagsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6424,38 +7207,54 @@ public function getCampaignRelationshipsTagsRequest($id, $apiKey = null) } /** - * Operation getCampaignSendJob + * Alias of `getTemplateForCampaignMessageRequest` * - * Get Campaign Send Job + * @deprecated use `getTemplateForCampaignMessageRequest` instead + */ + public function getCampaignMessageTemplateRequest(...$args) { + return $this->getTemplateForCampaignMessageRequest(...$args); + } + + /** + * Operation getTemplateIdForCampaignMessage * - * @param string $id The ID of the campaign to send (required) - * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Template ID for Campaign Message + * + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignSendJob($id, $fields_campaign_send_job = null, $apiKey = null) + public function getTemplateIdForCampaignMessage($id, $apiKey = null) { - list($response) = $this->getCampaignSendJobWithHttpInfo($id, $fields_campaign_send_job, $apiKey); + list($response) = $this->getTemplateIdForCampaignMessageWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getCampaignSendJobWithHttpInfo + * Alias of `getTemplateIdForCampaignMessage` * - * Get Campaign Send Job + * @deprecated use `getTemplateIdForCampaignMessage` instead + */ + public function getCampaignMessageRelationshipsTemplate(...$args) { + return $this->getTemplateIdForCampaignMessage(...$args); + } + + /** + * Operation getTemplateIdForCampaignMessageWithHttpInfo + * + * Get Template ID for Campaign Message * - * @param string $id The ID of the campaign to send (required) - * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignSendJobWithHttpInfo($id, $fields_campaign_send_job = null, $apiKey = null) + public function getTemplateIdForCampaignMessageWithHttpInfo($id, $apiKey = null) { - $request = $this->getCampaignSendJobRequest($id, $fields_campaign_send_job, $apiKey); + $request = $this->getTemplateIdForCampaignMessageRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6611,19 +7410,27 @@ public function getCampaignSendJobWithHttpInfo($id, $fields_campaign_send_job = } /** - * Operation getCampaignSendJobAsync + * Alias of `getTemplateIdForCampaignMessageWithHttpInfo` * - * Get Campaign Send Job + * @deprecated use `getTemplateIdForCampaignMessageWithHttpInfo` instead + */ + public function getCampaignMessageRelationshipsTemplateWithHttpInfo(...$args) { + return $this->getTemplateIdForCampaignMessageWithHttpInfo(...$args); + } + + /** + * Operation getTemplateIdForCampaignMessageAsync * - * @param string $id The ID of the campaign to send (required) - * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Template ID for Campaign Message + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSendJobAsync($id, $fields_campaign_send_job = null, $apiKey = null) + public function getTemplateIdForCampaignMessageAsync($id, $apiKey = null) { - return $this->getCampaignSendJobAsyncWithHttpInfo($id, $fields_campaign_send_job, $apiKey) + return $this->getTemplateIdForCampaignMessageAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -6632,20 +7439,28 @@ function ($response) { } /** - * Operation getCampaignSendJobAsyncWithHttpInfo + * Alias of `getTemplateIdForCampaignMessageAsync` * - * Get Campaign Send Job + * @deprecated use `getTemplateIdForCampaignMessageAsync` instead + */ + public function getCampaignMessageRelationshipsTemplateAsync(...$args) { + return $this->getTemplateIdForCampaignMessageAsync(...$args); + } + + /** + * Operation getTemplateIdForCampaignMessageAsyncWithHttpInfo * - * @param string $id The ID of the campaign to send (required) - * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Template ID for Campaign Message + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSendJobAsyncWithHttpInfo($id, $fields_campaign_send_job = null, $apiKey = null) + public function getTemplateIdForCampaignMessageAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignSendJobRequest($id, $fields_campaign_send_job, $apiKey); + $request = $this->getTemplateIdForCampaignMessageRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6689,39 +7504,38 @@ function ($exception) { } /** - * Create request for operation 'getCampaignSendJob' + * Alias of `getTemplateIdForCampaignMessageAsyncWithHttpInfo` * - * @param string $id The ID of the campaign to send (required) - * @param string[] $fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getTemplateIdForCampaignMessageAsyncWithHttpInfo` instead + */ + public function getCampaignMessageRelationshipsTemplateAsyncWithHttpInfo(...$args) { + return $this->getTemplateIdForCampaignMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTemplateIdForCampaignMessage' + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignSendJobRequest($id, $fields_campaign_send_job = null, $apiKey = null) + public function getTemplateIdForCampaignMessageRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignSendJob' + 'Missing the required parameter $id when calling getTemplateIdForCampaignMessage' ); } - $resourcePath = '/api/campaign-send-jobs/{id}/'; + $resourcePath = '/api/campaign-messages/{id}/relationships/template'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign_send_job, - 'fields[campaign-send-job]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -6736,11 +7550,11 @@ public function getCampaignSendJobRequest($id, $fields_campaign_send_job = null, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6761,7 +7575,7 @@ public function getCampaignSendJobRequest($id, $fields_campaign_send_job = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6785,7 +7599,7 @@ public function getCampaignSendJobRequest($id, $fields_campaign_send_job = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6803,38 +7617,54 @@ public function getCampaignSendJobRequest($id, $fields_campaign_send_job = null, } /** - * Operation getCampaignTags + * Alias of `getTemplateIdForCampaignMessageRequest` * - * Get Campaign Tags + * @deprecated use `getTemplateIdForCampaignMessageRequest` instead + */ + public function getCampaignMessageRelationshipsTemplateRequest(...$args) { + return $this->getTemplateIdForCampaignMessageRequest(...$args); + } + + /** + * Operation refreshCampaignRecipientEstimation * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Refresh Campaign Recipient Estimation + * + * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaignTags($id, $fields_tag = null, $apiKey = null) + public function refreshCampaignRecipientEstimation($campaign_recipient_estimation_job_create_query, $apiKey = null) { - list($response) = $this->getCampaignTagsWithHttpInfo($id, $fields_tag, $apiKey); + list($response) = $this->refreshCampaignRecipientEstimationWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey); return $response; } /** - * Operation getCampaignTagsWithHttpInfo + * Alias of `refreshCampaignRecipientEstimation` * - * Get Campaign Tags + * @deprecated use `refreshCampaignRecipientEstimation` instead + */ + public function createCampaignRecipientEstimationJob(...$args) { + return $this->refreshCampaignRecipientEstimation(...$args); + } + + /** + * Operation refreshCampaignRecipientEstimationWithHttpInfo * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Refresh Campaign Recipient Estimation + * + * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function refreshCampaignRecipientEstimationWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey = null) { - $request = $this->getCampaignTagsRequest($id, $fields_tag, $apiKey); + $request = $this->refreshCampaignRecipientEstimationRequest($campaign_recipient_estimation_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6872,7 +7702,7 @@ public function getCampaignTagsWithHttpInfo($id, $fields_tag = null, $apiKey = n } switch($statusCode) { - case 200: + case 202: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -6960,7 +7790,7 @@ public function getCampaignTagsWithHttpInfo($id, $fields_tag = null, $apiKey = n } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -6990,19 +7820,27 @@ public function getCampaignTagsWithHttpInfo($id, $fields_tag = null, $apiKey = n } /** - * Operation getCampaignTagsAsync + * Alias of `refreshCampaignRecipientEstimationWithHttpInfo` * - * Get Campaign Tags + * @deprecated use `refreshCampaignRecipientEstimationWithHttpInfo` instead + */ + public function createCampaignRecipientEstimationJobWithHttpInfo(...$args) { + return $this->refreshCampaignRecipientEstimationWithHttpInfo(...$args); + } + + /** + * Operation refreshCampaignRecipientEstimationAsync * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Refresh Campaign Recipient Estimation + * + * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignTagsAsync($id, $fields_tag = null, $apiKey = null) + public function refreshCampaignRecipientEstimationAsync($campaign_recipient_estimation_job_create_query, $apiKey = null) { - return $this->getCampaignTagsAsyncWithHttpInfo($id, $fields_tag, $apiKey) + return $this->refreshCampaignRecipientEstimationAsyncWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -7011,20 +7849,28 @@ function ($response) { } /** - * Operation getCampaignTagsAsyncWithHttpInfo + * Alias of `refreshCampaignRecipientEstimationAsync` * - * Get Campaign Tags + * @deprecated use `refreshCampaignRecipientEstimationAsync` instead + */ + public function createCampaignRecipientEstimationJobAsync(...$args) { + return $this->refreshCampaignRecipientEstimationAsync(...$args); + } + + /** + * Operation refreshCampaignRecipientEstimationAsyncWithHttpInfo * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Refresh Campaign Recipient Estimation + * + * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignTagsAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function refreshCampaignRecipientEstimationAsyncWithHttpInfo($campaign_recipient_estimation_job_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignTagsRequest($id, $fields_tag, $apiKey); + $request = $this->refreshCampaignRecipientEstimationRequest($campaign_recipient_estimation_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7068,64 +7914,61 @@ function ($exception) { } /** - * Create request for operation 'getCampaignTags' + * Alias of `refreshCampaignRecipientEstimationAsyncWithHttpInfo` * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `refreshCampaignRecipientEstimationAsyncWithHttpInfo` instead + */ + public function createCampaignRecipientEstimationJobAsyncWithHttpInfo(...$args) { + return $this->refreshCampaignRecipientEstimationAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'refreshCampaignRecipientEstimation' + * + * @param \KlaviyoAPI\Model\CampaignRecipientEstimationJobCreateQuery $campaign_recipient_estimation_job_create_query Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignTagsRequest($id, $fields_tag = null, $apiKey = null) + public function refreshCampaignRecipientEstimationRequest($campaign_recipient_estimation_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'campaign_recipient_estimation_job_create_query' is set + if ($campaign_recipient_estimation_job_create_query === null || (is_array($campaign_recipient_estimation_job_create_query) && count($campaign_recipient_estimation_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCampaignTags' + 'Missing the required parameter $campaign_recipient_estimation_job_create_query when calling refreshCampaignRecipientEstimation' ); } - $resourcePath = '/api/campaigns/{id}/tags/'; + $resourcePath = '/api/campaign-recipient-estimation-jobs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($campaign_recipient_estimation_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_recipient_estimation_job_create_query)); + } else { + $httpBody = $campaign_recipient_estimation_job_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7140,7 +7983,7 @@ public function getCampaignTagsRequest($id, $fields_tag = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7164,7 +8007,7 @@ public function getCampaignTagsRequest($id, $fields_tag = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7174,7 +8017,7 @@ public function getCampaignTagsRequest($id, $fields_tag = null, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7182,48 +8025,54 @@ public function getCampaignTagsRequest($id, $fields_tag = null, $apiKey = null) } /** - * Operation getCampaigns + * Alias of `refreshCampaignRecipientEstimationRequest` * - * Get Campaigns + * @deprecated use `refreshCampaignRecipientEstimationRequest` instead + */ + public function createCampaignRecipientEstimationJobRequest(...$args) { + return $this->refreshCampaignRecipientEstimationRequest(...$args); + } + + /** + * Operation sendCampaign * - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Send Campaign + * + * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCampaigns($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function sendCampaign($campaign_send_job_create_query, $apiKey = null) { - list($response) = $this->getCampaignsWithHttpInfo($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey); + list($response) = $this->sendCampaignWithHttpInfo($campaign_send_job_create_query, $apiKey); return $response; } /** - * Operation getCampaignsWithHttpInfo + * Alias of `sendCampaign` * - * Get Campaigns + * @deprecated use `sendCampaign` instead + */ + public function createCampaignSendJob(...$args) { + return $this->sendCampaign(...$args); + } + + /** + * Operation sendCampaignWithHttpInfo * - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Send Campaign + * + * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignsWithHttpInfo($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function sendCampaignWithHttpInfo($campaign_send_job_create_query, $apiKey = null) { - $request = $this->getCampaignsRequest($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey); + $request = $this->sendCampaignRequest($campaign_send_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7261,7 +8110,7 @@ public function getCampaignsWithHttpInfo($filter, $fields_campaign_message = nul } switch($statusCode) { - case 200: + case 202: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7349,7 +8198,7 @@ public function getCampaignsWithHttpInfo($filter, $fields_campaign_message = nul } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -7379,24 +8228,27 @@ public function getCampaignsWithHttpInfo($filter, $fields_campaign_message = nul } /** - * Operation getCampaignsAsync + * Alias of `sendCampaignWithHttpInfo` * - * Get Campaigns + * @deprecated use `sendCampaignWithHttpInfo` instead + */ + public function createCampaignSendJobWithHttpInfo(...$args) { + return $this->sendCampaignWithHttpInfo(...$args); + } + + /** + * Operation sendCampaignAsync * - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Send Campaign + * + * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsAsync($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function sendCampaignAsync($campaign_send_job_create_query, $apiKey = null) { - return $this->getCampaignsAsyncWithHttpInfo($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey) + return $this->sendCampaignAsyncWithHttpInfo($campaign_send_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -7405,25 +8257,28 @@ function ($response) { } /** - * Operation getCampaignsAsyncWithHttpInfo + * Alias of `sendCampaignAsync` * - * Get Campaigns + * @deprecated use `sendCampaignAsync` instead + */ + public function createCampaignSendJobAsync(...$args) { + return $this->sendCampaignAsync(...$args); + } + + /** + * Operation sendCampaignAsyncWithHttpInfo * - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Send Campaign + * + * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsAsyncWithHttpInfo($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function sendCampaignAsyncWithHttpInfo($campaign_send_job_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->getCampaignsRequest($filter, $fields_campaign_message, $fields_campaign, $fields_tag, $include, $page_cursor, $sort, $apiKey); + $request = $this->sendCampaignRequest($campaign_send_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7467,115 +8322,61 @@ function ($exception) { } /** - * Create request for operation 'getCampaigns' + * Alias of `sendCampaignAsyncWithHttpInfo` + * + * @deprecated use `sendCampaignAsyncWithHttpInfo` instead + */ + public function createCampaignSendJobAsyncWithHttpInfo(...$args) { + return $this->sendCampaignAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'sendCampaign' * - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (required) - * @param string[] $fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\CampaignSendJobCreateQuery $campaign_send_job_create_query Trigger the campaign to send asynchronously (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignsRequest($filter, $fields_campaign_message = null, $fields_campaign = null, $fields_tag = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function sendCampaignRequest($campaign_send_job_create_query, $apiKey = null) { - // verify the required parameter 'filter' is set - if ($filter === null || (is_array($filter) && count($filter) === 0)) { + // verify the required parameter 'campaign_send_job_create_query' is set + if ($campaign_send_job_create_query === null || (is_array($campaign_send_job_create_query) && count($campaign_send_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $filter when calling getCampaigns' + 'Missing the required parameter $campaign_send_job_create_query when calling sendCampaign' ); } - $resourcePath = '/api/campaigns/'; + $resourcePath = '/api/campaign-send-jobs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign_message, - 'fields[campaign-message]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_campaign, - 'fields[campaign]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($campaign_send_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_send_job_create_query)); + } else { + $httpBody = $campaign_send_job_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7590,7 +8391,7 @@ public function getCampaignsRequest($filter, $fields_campaign_message = null, $f // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7614,7 +8415,7 @@ public function getCampaignsRequest($filter, $fields_campaign_message = null, $f $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7624,13 +8425,22 @@ public function getCampaignsRequest($filter, $fields_campaign_message = null, $f $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } + /** + * Alias of `sendCampaignRequest` + * + * @deprecated use `sendCampaignRequest` instead + */ + public function createCampaignSendJobRequest(...$args) { + return $this->sendCampaignRequest(...$args); + } + /** * Operation updateCampaign * @@ -7920,7 +8730,7 @@ public function updateCampaignRequest($id, $campaign_partial_update_query, $apiK ); } - $resourcePath = '/api/campaigns/{id}/'; + $resourcePath = '/api/campaigns/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7941,18 +8751,18 @@ public function updateCampaignRequest($id, $campaign_partial_update_query, $apiK if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($campaign_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_partial_update_query)); } else { $httpBody = $campaign_partial_update_query; @@ -7972,7 +8782,7 @@ public function updateCampaignRequest($id, $campaign_partial_update_query, $apiK // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7996,7 +8806,7 @@ public function updateCampaignRequest($id, $campaign_partial_update_query, $apiK $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8302,7 +9112,7 @@ public function updateCampaignMessageRequest($id, $campaign_message_partial_upda ); } - $resourcePath = '/api/campaign-messages/{id}/'; + $resourcePath = '/api/campaign-messages/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8323,18 +9133,18 @@ public function updateCampaignMessageRequest($id, $campaign_message_partial_upda if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($campaign_message_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_message_partial_update_query)); } else { $httpBody = $campaign_message_partial_update_query; @@ -8354,277 +9164,7 @@ public function updateCampaignMessageRequest($id, $campaign_message_partial_upda // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - if ($apiKey == null) { - $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); - } else { - $apiKey = 'Klaviyo-API-Key '.$apiKey; - } - - $headers['Authorization'] = $apiKey; - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $defaultHeaders['revision'] = ['2024-07-15']; - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation updateCampaignSendJob - * - * Update Campaign Send Job - * - * @param string $id The ID of the currently sending campaign to cancel or revert (required) - * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) - * - * @throws \KlaviyoAPI\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function updateCampaignSendJob($id, $campaign_send_job_partial_update_query, $apiKey = null) - { - $this->updateCampaignSendJobWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey); - } - - /** - * Operation updateCampaignSendJobWithHttpInfo - * - * Update Campaign Send Job - * - * @param string $id The ID of the currently sending campaign to cancel or revert (required) - * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) - * - * @throws \KlaviyoAPI\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function updateCampaignSendJobWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey = null) - { - $request = $this->updateCampaignSendJobRequest($id, $campaign_send_job_partial_update_query, $apiKey); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation updateCampaignSendJobAsync - * - * Update Campaign Send Job - * - * @param string $id The ID of the currently sending campaign to cancel or revert (required) - * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updateCampaignSendJobAsync($id, $campaign_send_job_partial_update_query, $apiKey = null) - { - return $this->updateCampaignSendJobAsyncWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation updateCampaignSendJobAsyncWithHttpInfo - * - * Update Campaign Send Job - * - * @param string $id The ID of the currently sending campaign to cancel or revert (required) - * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updateCampaignSendJobAsyncWithHttpInfo($id, $campaign_send_job_partial_update_query, $apiKey = null) - { - $returnType = ''; - $request = $this->updateCampaignSendJobRequest($id, $campaign_send_job_partial_update_query, $apiKey); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'updateCampaignSendJob' - * - * @param string $id The ID of the currently sending campaign to cancel or revert (required) - * @param \KlaviyoAPI\Model\CampaignSendJobPartialUpdateQuery $campaign_send_job_partial_update_query Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function updateCampaignSendJobRequest($id, $campaign_send_job_partial_update_query, $apiKey = null) - { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling updateCampaignSendJob' - ); - } - // verify the required parameter 'campaign_send_job_partial_update_query' is set - if ($campaign_send_job_partial_update_query === null || (is_array($campaign_send_job_partial_update_query) && count($campaign_send_job_partial_update_query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_send_job_partial_update_query when calling updateCampaignSendJob' - ); - } - - $resourcePath = '/api/campaign-send-jobs/{id}/'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } - - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($campaign_send_job_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_send_job_partial_update_query)); - } else { - $httpBody = $campaign_send_job_partial_update_query; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8648,7 +9188,7 @@ public function updateCampaignSendJobRequest($id, $campaign_send_job_partial_upd $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/CatalogsApi.php b/lib/API/CatalogsApi.php index fc95c73..4e8a0da 100644 --- a/lib/API/CatalogsApi.php +++ b/lib/API/CatalogsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -117,35 +117,55 @@ public function getConfig() } /** - * Operation createBackInStockSubscription + * Operation addCategoryToCatalogItem * - * Create Back In Stock Subscription + * Add Category to Catalog Item * - * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query server_bis_subscription_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op catalog_item_category_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createBackInStockSubscription($server_bis_subscription_create_query, $apiKey = null) + public function addCategoryToCatalogItem($id, $catalog_item_category_op, $apiKey = null) { - $this->createBackInStockSubscriptionWithHttpInfo($server_bis_subscription_create_query, $apiKey); + $this->addCategoryToCatalogItemWithHttpInfo($id, $catalog_item_category_op, $apiKey); } /** - * Operation createBackInStockSubscriptionWithHttpInfo + * Alias of `addCategoryToCatalogItem` * - * Create Back In Stock Subscription + * @deprecated use `addCategoryToCatalogItem` instead + */ + public function createCatalogItemRelationshipsCategories(...$args) { + return $this->addCategoryToCatalogItem(...$args); + } + + /** + * Alias of `addCategoryToCatalogItem` * - * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) + * @deprecated use `addCategoryToCatalogItem` instead + */ + public function createCatalogItemRelationshipsCategory(...$args) { + return $this->addCategoryToCatalogItem(...$args); + } + + /** + * Operation addCategoryToCatalogItemWithHttpInfo + * + * Add Category to Catalog Item + * + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createBackInStockSubscriptionWithHttpInfo($server_bis_subscription_create_query, $apiKey = null) + public function addCategoryToCatalogItemWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) { - $request = $this->createBackInStockSubscriptionRequest($server_bis_subscription_create_query, $apiKey); + $request = $this->addCategoryToCatalogItemRequest($id, $catalog_item_category_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -208,18 +228,37 @@ public function createBackInStockSubscriptionWithHttpInfo($server_bis_subscripti } /** - * Operation createBackInStockSubscriptionAsync + * Alias of `addCategoryToCatalogItemWithHttpInfo` * - * Create Back In Stock Subscription + * @deprecated use `addCategoryToCatalogItemWithHttpInfo` instead + */ + public function createCatalogItemRelationshipsCategoriesWithHttpInfo(...$args) { + return $this->addCategoryToCatalogItemWithHttpInfo(...$args); + } + + /** + * Alias of `addCategoryToCatalogItemWithHttpInfo` * - * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) + * @deprecated use `addCategoryToCatalogItemWithHttpInfo` instead + */ + public function createCatalogItemRelationshipsCategoryWithHttpInfo(...$args) { + return $this->addCategoryToCatalogItemWithHttpInfo(...$args); + } + + /** + * Operation addCategoryToCatalogItemAsync + * + * Add Category to Catalog Item + * + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createBackInStockSubscriptionAsync($server_bis_subscription_create_query, $apiKey = null) + public function addCategoryToCatalogItemAsync($id, $catalog_item_category_op, $apiKey = null) { - return $this->createBackInStockSubscriptionAsyncWithHttpInfo($server_bis_subscription_create_query, $apiKey) + return $this->addCategoryToCatalogItemAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -228,19 +267,38 @@ function ($response) { } /** - * Operation createBackInStockSubscriptionAsyncWithHttpInfo + * Alias of `addCategoryToCatalogItemAsync` * - * Create Back In Stock Subscription + * @deprecated use `addCategoryToCatalogItemAsync` instead + */ + public function createCatalogItemRelationshipsCategoriesAsync(...$args) { + return $this->addCategoryToCatalogItemAsync(...$args); + } + + /** + * Alias of `addCategoryToCatalogItemAsync` * - * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) + * @deprecated use `addCategoryToCatalogItemAsync` instead + */ + public function createCatalogItemRelationshipsCategoryAsync(...$args) { + return $this->addCategoryToCatalogItemAsync(...$args); + } + + /** + * Operation addCategoryToCatalogItemAsyncWithHttpInfo + * + * Add Category to Catalog Item + * + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createBackInStockSubscriptionAsyncWithHttpInfo($server_bis_subscription_create_query, $apiKey = null) + public function addCategoryToCatalogItemAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) { $returnType = ''; - $request = $this->createBackInStockSubscriptionRequest($server_bis_subscription_create_query, $apiKey); + $request = $this->addCategoryToCatalogItemRequest($id, $catalog_item_category_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -266,23 +324,48 @@ function ($exception) { } /** - * Create request for operation 'createBackInStockSubscription' + * Alias of `addCategoryToCatalogItemAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) + * @deprecated use `addCategoryToCatalogItemAsyncWithHttpInfo` instead + */ + public function createCatalogItemRelationshipsCategoriesAsyncWithHttpInfo(...$args) { + return $this->addCategoryToCatalogItemAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `addCategoryToCatalogItemAsyncWithHttpInfo` + * + * @deprecated use `addCategoryToCatalogItemAsyncWithHttpInfo` instead + */ + public function createCatalogItemRelationshipsCategoryAsyncWithHttpInfo(...$args) { + return $this->addCategoryToCatalogItemAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'addCategoryToCatalogItem' + * + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createBackInStockSubscriptionRequest($server_bis_subscription_create_query, $apiKey = null) + public function addCategoryToCatalogItemRequest($id, $catalog_item_category_op, $apiKey = null) { - // verify the required parameter 'server_bis_subscription_create_query' is set - if ($server_bis_subscription_create_query === null || (is_array($server_bis_subscription_create_query) && count($server_bis_subscription_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $server_bis_subscription_create_query when calling createBackInStockSubscription' + 'Missing the required parameter $id when calling addCategoryToCatalogItem' + ); + } + // verify the required parameter 'catalog_item_category_op' is set + if ($catalog_item_category_op === null || (is_array($catalog_item_category_op) && count($catalog_item_category_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $catalog_item_category_op when calling addCategoryToCatalogItem' ); } - $resourcePath = '/api/back-in-stock-subscriptions/'; + $resourcePath = '/api/catalog-items/{id}/relationships/categories'; $formParams = []; $queryParams = []; $headerParams = []; @@ -291,25 +374,33 @@ public function createBackInStockSubscriptionRequest($server_bis_subscription_cr + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($server_bis_subscription_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($server_bis_subscription_create_query)); + if (isset($catalog_item_category_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_category_op)); } else { - $httpBody = $server_bis_subscription_create_query; + $httpBody = $catalog_item_category_op; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -326,7 +417,7 @@ public function createBackInStockSubscriptionRequest($server_bis_subscription_cr // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -350,7 +441,7 @@ public function createBackInStockSubscriptionRequest($server_bis_subscription_cr $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -368,36 +459,73 @@ public function createBackInStockSubscriptionRequest($server_bis_subscription_cr } /** - * Operation createCatalogCategory + * Alias of `addCategoryToCatalogItemRequest` * - * Create Catalog Category + * @deprecated use `addCategoryToCatalogItemRequest` instead + */ + public function createCatalogItemRelationshipsCategoriesRequest(...$args) { + return $this->addCategoryToCatalogItemRequest(...$args); + } + + /** + * Alias of `addCategoryToCatalogItemRequest` * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query catalog_category_create_query (required) + * @deprecated use `addCategoryToCatalogItemRequest` instead + */ + public function createCatalogItemRelationshipsCategoryRequest(...$args) { + return $this->addCategoryToCatalogItemRequest(...$args); + } + + /** + * Operation addItemsToCatalogCategory + * + * Add Items to Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op catalog_category_item_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function createCatalogCategory($catalog_category_create_query, $apiKey = null) + public function addItemsToCatalogCategory($id, $catalog_category_item_op, $apiKey = null) { - list($response) = $this->createCatalogCategoryWithHttpInfo($catalog_category_create_query, $apiKey); - return $response; + $this->addItemsToCatalogCategoryWithHttpInfo($id, $catalog_category_item_op, $apiKey); } /** - * Operation createCatalogCategoryWithHttpInfo + * Alias of `addItemsToCatalogCategory` * - * Create Catalog Category + * @deprecated use `addItemsToCatalogCategory` instead + */ + public function createCatalogCategoryRelationshipsItems(...$args) { + return $this->addItemsToCatalogCategory(...$args); + } + + /** + * Alias of `addItemsToCatalogCategory` * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) + * @deprecated use `addItemsToCatalogCategory` instead + */ + public function createCatalogCategoryRelationshipsItem(...$args) { + return $this->addItemsToCatalogCategory(...$args); + } + + /** + * Operation addItemsToCatalogCategoryWithHttpInfo + * + * Add Items to Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createCatalogCategoryWithHttpInfo($catalog_category_create_query, $apiKey = null) + public function addItemsToCatalogCategoryWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) { - $request = $this->createCatalogCategoryRequest($catalog_category_create_query, $apiKey); + $request = $this->addItemsToCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -434,103 +562,10 @@ public function createCatalogCategoryWithHttpInfo($catalog_category_create_query ); } - switch($statusCode) { - case 201: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -553,18 +588,37 @@ public function createCatalogCategoryWithHttpInfo($catalog_category_create_query } /** - * Operation createCatalogCategoryAsync + * Alias of `addItemsToCatalogCategoryWithHttpInfo` * - * Create Catalog Category + * @deprecated use `addItemsToCatalogCategoryWithHttpInfo` instead + */ + public function createCatalogCategoryRelationshipsItemsWithHttpInfo(...$args) { + return $this->addItemsToCatalogCategoryWithHttpInfo(...$args); + } + + /** + * Alias of `addItemsToCatalogCategoryWithHttpInfo` * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) + * @deprecated use `addItemsToCatalogCategoryWithHttpInfo` instead + */ + public function createCatalogCategoryRelationshipsItemWithHttpInfo(...$args) { + return $this->addItemsToCatalogCategoryWithHttpInfo(...$args); + } + + /** + * Operation addItemsToCatalogCategoryAsync + * + * Add Items to Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogCategoryAsync($catalog_category_create_query, $apiKey = null) + public function addItemsToCatalogCategoryAsync($id, $catalog_category_item_op, $apiKey = null) { - return $this->createCatalogCategoryAsyncWithHttpInfo($catalog_category_create_query, $apiKey) + return $this->addItemsToCatalogCategoryAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -573,43 +627,44 @@ function ($response) { } /** - * Operation createCatalogCategoryAsyncWithHttpInfo + * Alias of `addItemsToCatalogCategoryAsync` * - * Create Catalog Category + * @deprecated use `addItemsToCatalogCategoryAsync` instead + */ + public function createCatalogCategoryRelationshipsItemsAsync(...$args) { + return $this->addItemsToCatalogCategoryAsync(...$args); + } + + /** + * Alias of `addItemsToCatalogCategoryAsync` * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) + * @deprecated use `addItemsToCatalogCategoryAsync` instead + */ + public function createCatalogCategoryRelationshipsItemAsync(...$args) { + return $this->addItemsToCatalogCategoryAsync(...$args); + } + + /** + * Operation addItemsToCatalogCategoryAsyncWithHttpInfo + * + * Add Items to Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogCategoryAsyncWithHttpInfo($catalog_category_create_query, $apiKey = null) + public function addItemsToCatalogCategoryAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->createCatalogCategoryRequest($catalog_category_create_query, $apiKey); + $returnType = ''; + $request = $this->addItemsToCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -629,23 +684,48 @@ function ($exception) { } /** - * Create request for operation 'createCatalogCategory' + * Alias of `addItemsToCatalogCategoryAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) + * @deprecated use `addItemsToCatalogCategoryAsyncWithHttpInfo` instead + */ + public function createCatalogCategoryRelationshipsItemsAsyncWithHttpInfo(...$args) { + return $this->addItemsToCatalogCategoryAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `addItemsToCatalogCategoryAsyncWithHttpInfo` + * + * @deprecated use `addItemsToCatalogCategoryAsyncWithHttpInfo` instead + */ + public function createCatalogCategoryRelationshipsItemAsyncWithHttpInfo(...$args) { + return $this->addItemsToCatalogCategoryAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'addItemsToCatalogCategory' + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCatalogCategoryRequest($catalog_category_create_query, $apiKey = null) + public function addItemsToCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey = null) { - // verify the required parameter 'catalog_category_create_query' is set - if ($catalog_category_create_query === null || (is_array($catalog_category_create_query) && count($catalog_category_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_category_create_query when calling createCatalogCategory' + 'Missing the required parameter $id when calling addItemsToCatalogCategory' + ); + } + // verify the required parameter 'catalog_category_item_op' is set + if ($catalog_category_item_op === null || (is_array($catalog_category_item_op) && count($catalog_category_item_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $catalog_category_item_op when calling addItemsToCatalogCategory' ); } - $resourcePath = '/api/catalog-categories/'; + $resourcePath = '/api/catalog-categories/{id}/relationships/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -654,25 +734,33 @@ public function createCatalogCategoryRequest($catalog_category_create_query, $ap + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_category_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_create_query)); + if (isset($catalog_category_item_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_item_op)); } else { - $httpBody = $catalog_category_create_query; + $httpBody = $catalog_category_item_op; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -689,7 +777,7 @@ public function createCatalogCategoryRequest($catalog_category_create_query, $ap // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -713,7 +801,7 @@ public function createCatalogCategoryRequest($catalog_category_create_query, $ap $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -731,46 +819,72 @@ public function createCatalogCategoryRequest($catalog_category_create_query, $ap } /** - * Operation createCatalogCategoryRelationshipsItems + * Alias of `addItemsToCatalogCategoryRequest` + * + * @deprecated use `addItemsToCatalogCategoryRequest` instead + */ + public function createCatalogCategoryRelationshipsItemsRequest(...$args) { + return $this->addItemsToCatalogCategoryRequest(...$args); + } + + /** + * Alias of `addItemsToCatalogCategoryRequest` + * + * @deprecated use `addItemsToCatalogCategoryRequest` instead + */ + public function createCatalogCategoryRelationshipsItemRequest(...$args) { + return $this->addItemsToCatalogCategoryRequest(...$args); + } + + /** + * Operation bulkCreateCatalogCategories * - * Create Catalog Category Relationships Items + * Bulk Create Catalog Categories * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op catalog_category_item_op (required) + * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query catalog_category_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCatalogCategoryRelationshipsItems($id, $catalog_category_item_op, $apiKey = null) + public function bulkCreateCatalogCategories($catalog_category_create_job_create_query, $apiKey = null) { - $this->createCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalog_category_item_op, $apiKey); + list($response) = $this->bulkCreateCatalogCategoriesWithHttpInfo($catalog_category_create_job_create_query, $apiKey); + return $response; } /** - * Alias of `createCatalogCategoryRelationshipsItems` + * Alias of `bulkCreateCatalogCategories` * - * @deprecated use `createCatalogCategoryRelationshipsItems` instead + * @deprecated use `bulkCreateCatalogCategories` instead */ - public function createCatalogCategoryRelationshipsItem(...$args) { - return $this->createCatalogCategoryRelationshipsItems(...$args); + public function spawnCreateCategoriesJob(...$args) { + return $this->bulkCreateCatalogCategories(...$args); } /** - * Operation createCatalogCategoryRelationshipsItemsWithHttpInfo + * Alias of `bulkCreateCatalogCategories` * - * Create Catalog Category Relationships Items + * @deprecated use `bulkCreateCatalogCategories` instead + */ + public function createCatalogCategoryBulkCreateJob(...$args) { + return $this->bulkCreateCatalogCategories(...$args); + } + + /** + * Operation bulkCreateCatalogCategoriesWithHttpInfo * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * Bulk Create Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) + public function bulkCreateCatalogCategoriesWithHttpInfo($catalog_category_create_job_create_query, $apiKey = null) { - $request = $this->createCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey); + $request = $this->bulkCreateCatalogCategoriesRequest($catalog_category_create_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -807,10 +921,103 @@ public function createCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalo ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -833,28 +1040,36 @@ public function createCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalo } /** - * Alias of `createCatalogCategoryRelationshipsItemsWithHttpInfo` + * Alias of `bulkCreateCatalogCategoriesWithHttpInfo` * - * @deprecated use `createCatalogCategoryRelationshipsItemsWithHttpInfo` instead + * @deprecated use `bulkCreateCatalogCategoriesWithHttpInfo` instead */ - public function createCatalogCategoryRelationshipsItemWithHttpInfo(...$args) { - return $this->createCatalogCategoryRelationshipsItemsWithHttpInfo(...$args); + public function spawnCreateCategoriesJobWithHttpInfo(...$args) { + return $this->bulkCreateCatalogCategoriesWithHttpInfo(...$args); } /** - * Operation createCatalogCategoryRelationshipsItemsAsync + * Alias of `bulkCreateCatalogCategoriesWithHttpInfo` * - * Create Catalog Category Relationships Items + * @deprecated use `bulkCreateCatalogCategoriesWithHttpInfo` instead + */ + public function createCatalogCategoryBulkCreateJobWithHttpInfo(...$args) { + return $this->bulkCreateCatalogCategoriesWithHttpInfo(...$args); + } + + /** + * Operation bulkCreateCatalogCategoriesAsync * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * Bulk Create Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogCategoryRelationshipsItemsAsync($id, $catalog_category_item_op, $apiKey = null) + public function bulkCreateCatalogCategoriesAsync($catalog_category_create_job_create_query, $apiKey = null) { - return $this->createCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey) + return $this->bulkCreateCatalogCategoriesAsyncWithHttpInfo($catalog_category_create_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -863,35 +1078,61 @@ function ($response) { } /** - * Alias of `createCatalogCategoryRelationshipsItemsAsync` + * Alias of `bulkCreateCatalogCategoriesAsync` * - * @deprecated use `createCatalogCategoryRelationshipsItemsAsync` instead + * @deprecated use `bulkCreateCatalogCategoriesAsync` instead */ - public function createCatalogCategoryRelationshipsItemAsync(...$args) { - return $this->createCatalogCategoryRelationshipsItemsAsync(...$args); + public function spawnCreateCategoriesJobAsync(...$args) { + return $this->bulkCreateCatalogCategoriesAsync(...$args); + } + + /** + * Alias of `bulkCreateCatalogCategoriesAsync` + * + * @deprecated use `bulkCreateCatalogCategoriesAsync` instead + */ + public function createCatalogCategoryBulkCreateJobAsync(...$args) { + return $this->bulkCreateCatalogCategoriesAsync(...$args); } /** - * Operation createCatalogCategoryRelationshipsItemsAsyncWithHttpInfo + * Operation bulkCreateCatalogCategoriesAsyncWithHttpInfo * - * Create Catalog Category Relationships Items + * Bulk Create Catalog Categories * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) + public function bulkCreateCatalogCategoriesAsyncWithHttpInfo($catalog_category_create_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->createCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey); + $returnType = 'array'; + $request = $this->bulkCreateCatalogCategoriesRequest($catalog_category_create_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -911,39 +1152,41 @@ function ($exception) { } /** - * Alias of `createCatalogCategoryRelationshipsItemsAsyncWithHttpInfo` + * Alias of `bulkCreateCatalogCategoriesAsyncWithHttpInfo` * - * @deprecated use `createCatalogCategoryRelationshipsItemsAsyncWithHttpInfo` instead + * @deprecated use `bulkCreateCatalogCategoriesAsyncWithHttpInfo` instead */ - public function createCatalogCategoryRelationshipsItemAsyncWithHttpInfo(...$args) { - return $this->createCatalogCategoryRelationshipsItemsAsyncWithHttpInfo(...$args); + public function spawnCreateCategoriesJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCatalogCategoriesAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'createCatalogCategoryRelationshipsItems' + * Alias of `bulkCreateCatalogCategoriesAsyncWithHttpInfo` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @deprecated use `bulkCreateCatalogCategoriesAsyncWithHttpInfo` instead + */ + public function createCatalogCategoryBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCatalogCategoriesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkCreateCatalogCategories' + * + * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey = null) + public function bulkCreateCatalogCategoriesRequest($catalog_category_create_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'catalog_category_create_job_create_query' is set + if ($catalog_category_create_job_create_query === null || (is_array($catalog_category_create_job_create_query) && count($catalog_category_create_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling createCatalogCategoryRelationshipsItems' - ); - } - // verify the required parameter 'catalog_category_item_op' is set - if ($catalog_category_item_op === null || (is_array($catalog_category_item_op) && count($catalog_category_item_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_category_item_op when calling createCatalogCategoryRelationshipsItems' + 'Missing the required parameter $catalog_category_create_job_create_query when calling bulkCreateCatalogCategories' ); } - $resourcePath = '/api/catalog-categories/{id}/relationships/items/'; + $resourcePath = '/api/catalog-category-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -952,33 +1195,25 @@ public function createCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_category_item_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_item_op)); + if (isset($catalog_category_create_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_create_job_create_query)); } else { - $httpBody = $catalog_category_item_op; + $httpBody = $catalog_category_create_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -995,7 +1230,7 @@ public function createCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1019,7 +1254,7 @@ public function createCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1037,45 +1272,72 @@ public function createCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat } /** - * Alias of `createCatalogCategoryRelationshipsItemsRequest` + * Alias of `bulkCreateCatalogCategoriesRequest` * - * @deprecated use `createCatalogCategoryRelationshipsItemsRequest` instead + * @deprecated use `bulkCreateCatalogCategoriesRequest` instead */ - public function createCatalogCategoryRelationshipsItemRequest(...$args) { - return $this->createCatalogCategoryRelationshipsItemsRequest(...$args); + public function spawnCreateCategoriesJobRequest(...$args) { + return $this->bulkCreateCatalogCategoriesRequest(...$args); } /** - * Operation createCatalogItem + * Alias of `bulkCreateCatalogCategoriesRequest` * - * Create Catalog Item + * @deprecated use `bulkCreateCatalogCategoriesRequest` instead + */ + public function createCatalogCategoryBulkCreateJobRequest(...$args) { + return $this->bulkCreateCatalogCategoriesRequest(...$args); + } + + /** + * Operation bulkCreateCatalogItems * - * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query catalog_item_create_query (required) + * Bulk Create Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query catalog_item_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCatalogItem($catalog_item_create_query, $apiKey = null) + public function bulkCreateCatalogItems($catalog_item_create_job_create_query, $apiKey = null) { - list($response) = $this->createCatalogItemWithHttpInfo($catalog_item_create_query, $apiKey); + list($response) = $this->bulkCreateCatalogItemsWithHttpInfo($catalog_item_create_job_create_query, $apiKey); return $response; } /** - * Operation createCatalogItemWithHttpInfo + * Alias of `bulkCreateCatalogItems` * - * Create Catalog Item + * @deprecated use `bulkCreateCatalogItems` instead + */ + public function spawnCreateItemsJob(...$args) { + return $this->bulkCreateCatalogItems(...$args); + } + + /** + * Alias of `bulkCreateCatalogItems` * - * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) + * @deprecated use `bulkCreateCatalogItems` instead + */ + public function createCatalogItemBulkCreateJob(...$args) { + return $this->bulkCreateCatalogItems(...$args); + } + + /** + * Operation bulkCreateCatalogItemsWithHttpInfo + * + * Bulk Create Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCatalogItemWithHttpInfo($catalog_item_create_query, $apiKey = null) + public function bulkCreateCatalogItemsWithHttpInfo($catalog_item_create_job_create_query, $apiKey = null) { - $request = $this->createCatalogItemRequest($catalog_item_create_query, $apiKey); + $request = $this->bulkCreateCatalogItemsRequest($catalog_item_create_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1113,7 +1375,7 @@ public function createCatalogItemWithHttpInfo($catalog_item_create_query, $apiKe } switch($statusCode) { - case 201: + case 202: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1201,7 +1463,7 @@ public function createCatalogItemWithHttpInfo($catalog_item_create_query, $apiKe } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -1231,18 +1493,36 @@ public function createCatalogItemWithHttpInfo($catalog_item_create_query, $apiKe } /** - * Operation createCatalogItemAsync + * Alias of `bulkCreateCatalogItemsWithHttpInfo` * - * Create Catalog Item + * @deprecated use `bulkCreateCatalogItemsWithHttpInfo` instead + */ + public function spawnCreateItemsJobWithHttpInfo(...$args) { + return $this->bulkCreateCatalogItemsWithHttpInfo(...$args); + } + + /** + * Alias of `bulkCreateCatalogItemsWithHttpInfo` * - * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) + * @deprecated use `bulkCreateCatalogItemsWithHttpInfo` instead + */ + public function createCatalogItemBulkCreateJobWithHttpInfo(...$args) { + return $this->bulkCreateCatalogItemsWithHttpInfo(...$args); + } + + /** + * Operation bulkCreateCatalogItemsAsync + * + * Bulk Create Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogItemAsync($catalog_item_create_query, $apiKey = null) + public function bulkCreateCatalogItemsAsync($catalog_item_create_job_create_query, $apiKey = null) { - return $this->createCatalogItemAsyncWithHttpInfo($catalog_item_create_query, $apiKey) + return $this->bulkCreateCatalogItemsAsyncWithHttpInfo($catalog_item_create_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -1251,19 +1531,37 @@ function ($response) { } /** - * Operation createCatalogItemAsyncWithHttpInfo + * Alias of `bulkCreateCatalogItemsAsync` * - * Create Catalog Item + * @deprecated use `bulkCreateCatalogItemsAsync` instead + */ + public function spawnCreateItemsJobAsync(...$args) { + return $this->bulkCreateCatalogItemsAsync(...$args); + } + + /** + * Alias of `bulkCreateCatalogItemsAsync` * - * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) + * @deprecated use `bulkCreateCatalogItemsAsync` instead + */ + public function createCatalogItemBulkCreateJobAsync(...$args) { + return $this->bulkCreateCatalogItemsAsync(...$args); + } + + /** + * Operation bulkCreateCatalogItemsAsyncWithHttpInfo + * + * Bulk Create Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogItemAsyncWithHttpInfo($catalog_item_create_query, $apiKey = null) + public function bulkCreateCatalogItemsAsyncWithHttpInfo($catalog_item_create_job_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createCatalogItemRequest($catalog_item_create_query, $apiKey); + $request = $this->bulkCreateCatalogItemsRequest($catalog_item_create_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1307,23 +1605,41 @@ function ($exception) { } /** - * Create request for operation 'createCatalogItem' + * Alias of `bulkCreateCatalogItemsAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) + * @deprecated use `bulkCreateCatalogItemsAsyncWithHttpInfo` instead + */ + public function spawnCreateItemsJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCatalogItemsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkCreateCatalogItemsAsyncWithHttpInfo` + * + * @deprecated use `bulkCreateCatalogItemsAsyncWithHttpInfo` instead + */ + public function createCatalogItemBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCatalogItemsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkCreateCatalogItems' + * + * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCatalogItemRequest($catalog_item_create_query, $apiKey = null) + public function bulkCreateCatalogItemsRequest($catalog_item_create_job_create_query, $apiKey = null) { - // verify the required parameter 'catalog_item_create_query' is set - if ($catalog_item_create_query === null || (is_array($catalog_item_create_query) && count($catalog_item_create_query) === 0)) { + // verify the required parameter 'catalog_item_create_job_create_query' is set + if ($catalog_item_create_job_create_query === null || (is_array($catalog_item_create_job_create_query) && count($catalog_item_create_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_create_query when calling createCatalogItem' + 'Missing the required parameter $catalog_item_create_job_create_query when calling bulkCreateCatalogItems' ); } - $resourcePath = '/api/catalog-items/'; + $resourcePath = '/api/catalog-item-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1336,21 +1652,21 @@ public function createCatalogItemRequest($catalog_item_create_query, $apiKey = n if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_item_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_create_query)); + if (isset($catalog_item_create_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_create_job_create_query)); } else { - $httpBody = $catalog_item_create_query; + $httpBody = $catalog_item_create_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1367,7 +1683,7 @@ public function createCatalogItemRequest($catalog_item_create_query, $apiKey = n // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1391,7 +1707,7 @@ public function createCatalogItemRequest($catalog_item_create_query, $apiKey = n $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1409,46 +1725,72 @@ public function createCatalogItemRequest($catalog_item_create_query, $apiKey = n } /** - * Operation createCatalogItemRelationshipsCategories + * Alias of `bulkCreateCatalogItemsRequest` + * + * @deprecated use `bulkCreateCatalogItemsRequest` instead + */ + public function spawnCreateItemsJobRequest(...$args) { + return $this->bulkCreateCatalogItemsRequest(...$args); + } + + /** + * Alias of `bulkCreateCatalogItemsRequest` + * + * @deprecated use `bulkCreateCatalogItemsRequest` instead + */ + public function createCatalogItemBulkCreateJobRequest(...$args) { + return $this->bulkCreateCatalogItemsRequest(...$args); + } + + /** + * Operation bulkCreateCatalogVariants * - * Create Catalog Item Relationships Categories + * Bulk Create Catalog Variants * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op catalog_item_category_op (required) + * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query catalog_variant_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCatalogItemRelationshipsCategories($id, $catalog_item_category_op, $apiKey = null) + public function bulkCreateCatalogVariants($catalog_variant_create_job_create_query, $apiKey = null) { - $this->createCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catalog_item_category_op, $apiKey); + list($response) = $this->bulkCreateCatalogVariantsWithHttpInfo($catalog_variant_create_job_create_query, $apiKey); + return $response; } /** - * Alias of `createCatalogItemRelationshipsCategories` + * Alias of `bulkCreateCatalogVariants` * - * @deprecated use `createCatalogItemRelationshipsCategories` instead + * @deprecated use `bulkCreateCatalogVariants` instead */ - public function createCatalogItemRelationshipsCategory(...$args) { - return $this->createCatalogItemRelationshipsCategories(...$args); + public function spawnCreateVariantsJob(...$args) { + return $this->bulkCreateCatalogVariants(...$args); } /** - * Operation createCatalogItemRelationshipsCategoriesWithHttpInfo + * Alias of `bulkCreateCatalogVariants` * - * Create Catalog Item Relationships Categories + * @deprecated use `bulkCreateCatalogVariants` instead + */ + public function createCatalogVariantBulkCreateJob(...$args) { + return $this->bulkCreateCatalogVariants(...$args); + } + + /** + * Operation bulkCreateCatalogVariantsWithHttpInfo * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * Bulk Create Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) + public function bulkCreateCatalogVariantsWithHttpInfo($catalog_variant_create_job_create_query, $apiKey = null) { - $request = $this->createCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey); + $request = $this->bulkCreateCatalogVariantsRequest($catalog_variant_create_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1485,10 +1827,103 @@ public function createCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catal ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1511,28 +1946,36 @@ public function createCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catal } /** - * Alias of `createCatalogItemRelationshipsCategoriesWithHttpInfo` + * Alias of `bulkCreateCatalogVariantsWithHttpInfo` * - * @deprecated use `createCatalogItemRelationshipsCategoriesWithHttpInfo` instead + * @deprecated use `bulkCreateCatalogVariantsWithHttpInfo` instead */ - public function createCatalogItemRelationshipsCategoryWithHttpInfo(...$args) { - return $this->createCatalogItemRelationshipsCategoriesWithHttpInfo(...$args); + public function spawnCreateVariantsJobWithHttpInfo(...$args) { + return $this->bulkCreateCatalogVariantsWithHttpInfo(...$args); } /** - * Operation createCatalogItemRelationshipsCategoriesAsync + * Alias of `bulkCreateCatalogVariantsWithHttpInfo` * - * Create Catalog Item Relationships Categories + * @deprecated use `bulkCreateCatalogVariantsWithHttpInfo` instead + */ + public function createCatalogVariantBulkCreateJobWithHttpInfo(...$args) { + return $this->bulkCreateCatalogVariantsWithHttpInfo(...$args); + } + + /** + * Operation bulkCreateCatalogVariantsAsync * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * Bulk Create Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogItemRelationshipsCategoriesAsync($id, $catalog_item_category_op, $apiKey = null) + public function bulkCreateCatalogVariantsAsync($catalog_variant_create_job_create_query, $apiKey = null) { - return $this->createCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey) + return $this->bulkCreateCatalogVariantsAsyncWithHttpInfo($catalog_variant_create_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -1541,37 +1984,63 @@ function ($response) { } /** - * Alias of `createCatalogItemRelationshipsCategoriesAsync` + * Alias of `bulkCreateCatalogVariantsAsync` * - * @deprecated use `createCatalogItemRelationshipsCategoriesAsync` instead + * @deprecated use `bulkCreateCatalogVariantsAsync` instead */ - public function createCatalogItemRelationshipsCategoryAsync(...$args) { - return $this->createCatalogItemRelationshipsCategoriesAsync(...$args); + public function spawnCreateVariantsJobAsync(...$args) { + return $this->bulkCreateCatalogVariantsAsync(...$args); + } + + /** + * Alias of `bulkCreateCatalogVariantsAsync` + * + * @deprecated use `bulkCreateCatalogVariantsAsync` instead + */ + public function createCatalogVariantBulkCreateJobAsync(...$args) { + return $this->bulkCreateCatalogVariantsAsync(...$args); } /** - * Operation createCatalogItemRelationshipsCategoriesAsyncWithHttpInfo + * Operation bulkCreateCatalogVariantsAsyncWithHttpInfo * - * Create Catalog Item Relationships Categories + * Bulk Create Catalog Variants * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) + public function bulkCreateCatalogVariantsAsyncWithHttpInfo($catalog_variant_create_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->createCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey); + $returnType = 'array'; + $request = $this->bulkCreateCatalogVariantsRequest($catalog_variant_create_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1589,39 +2058,41 @@ function ($exception) { } /** - * Alias of `createCatalogItemRelationshipsCategoriesAsyncWithHttpInfo` + * Alias of `bulkCreateCatalogVariantsAsyncWithHttpInfo` * - * @deprecated use `createCatalogItemRelationshipsCategoriesAsyncWithHttpInfo` instead + * @deprecated use `bulkCreateCatalogVariantsAsyncWithHttpInfo` instead */ - public function createCatalogItemRelationshipsCategoryAsyncWithHttpInfo(...$args) { - return $this->createCatalogItemRelationshipsCategoriesAsyncWithHttpInfo(...$args); + public function spawnCreateVariantsJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCatalogVariantsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'createCatalogItemRelationshipsCategories' + * Alias of `bulkCreateCatalogVariantsAsyncWithHttpInfo` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * @deprecated use `bulkCreateCatalogVariantsAsyncWithHttpInfo` instead + */ + public function createCatalogVariantBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCatalogVariantsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkCreateCatalogVariants' + * + * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey = null) + public function bulkCreateCatalogVariantsRequest($catalog_variant_create_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling createCatalogItemRelationshipsCategories' - ); - } - // verify the required parameter 'catalog_item_category_op' is set - if ($catalog_item_category_op === null || (is_array($catalog_item_category_op) && count($catalog_item_category_op) === 0)) { + // verify the required parameter 'catalog_variant_create_job_create_query' is set + if ($catalog_variant_create_job_create_query === null || (is_array($catalog_variant_create_job_create_query) && count($catalog_variant_create_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_category_op when calling createCatalogItemRelationshipsCategories' + 'Missing the required parameter $catalog_variant_create_job_create_query when calling bulkCreateCatalogVariants' ); } - $resourcePath = '/api/catalog-items/{id}/relationships/categories/'; + $resourcePath = '/api/catalog-variant-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1630,33 +2101,25 @@ public function createCatalogItemRelationshipsCategoriesRequest($id, $catalog_it - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_item_category_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_category_op)); + if (isset($catalog_variant_create_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_create_job_create_query)); } else { - $httpBody = $catalog_item_category_op; + $httpBody = $catalog_variant_create_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1673,7 +2136,7 @@ public function createCatalogItemRelationshipsCategoriesRequest($id, $catalog_it // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1697,7 +2160,7 @@ public function createCatalogItemRelationshipsCategoriesRequest($id, $catalog_it $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1715,45 +2178,72 @@ public function createCatalogItemRelationshipsCategoriesRequest($id, $catalog_it } /** - * Alias of `createCatalogItemRelationshipsCategoriesRequest` + * Alias of `bulkCreateCatalogVariantsRequest` * - * @deprecated use `createCatalogItemRelationshipsCategoriesRequest` instead + * @deprecated use `bulkCreateCatalogVariantsRequest` instead */ - public function createCatalogItemRelationshipsCategoryRequest(...$args) { - return $this->createCatalogItemRelationshipsCategoriesRequest(...$args); + public function spawnCreateVariantsJobRequest(...$args) { + return $this->bulkCreateCatalogVariantsRequest(...$args); } /** - * Operation createCatalogVariant + * Alias of `bulkCreateCatalogVariantsRequest` * - * Create Catalog Variant + * @deprecated use `bulkCreateCatalogVariantsRequest` instead + */ + public function createCatalogVariantBulkCreateJobRequest(...$args) { + return $this->bulkCreateCatalogVariantsRequest(...$args); + } + + /** + * Operation bulkDeleteCatalogCategories * - * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query catalog_variant_create_query (required) + * Bulk Delete Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query catalog_category_delete_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCatalogVariant($catalog_variant_create_query, $apiKey = null) + public function bulkDeleteCatalogCategories($catalog_category_delete_job_create_query, $apiKey = null) { - list($response) = $this->createCatalogVariantWithHttpInfo($catalog_variant_create_query, $apiKey); + list($response) = $this->bulkDeleteCatalogCategoriesWithHttpInfo($catalog_category_delete_job_create_query, $apiKey); return $response; } /** - * Operation createCatalogVariantWithHttpInfo + * Alias of `bulkDeleteCatalogCategories` * - * Create Catalog Variant + * @deprecated use `bulkDeleteCatalogCategories` instead + */ + public function spawnDeleteCategoriesJob(...$args) { + return $this->bulkDeleteCatalogCategories(...$args); + } + + /** + * Alias of `bulkDeleteCatalogCategories` * - * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) + * @deprecated use `bulkDeleteCatalogCategories` instead + */ + public function createCatalogCategoryBulkDeleteJob(...$args) { + return $this->bulkDeleteCatalogCategories(...$args); + } + + /** + * Operation bulkDeleteCatalogCategoriesWithHttpInfo + * + * Bulk Delete Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCatalogVariantWithHttpInfo($catalog_variant_create_query, $apiKey = null) + public function bulkDeleteCatalogCategoriesWithHttpInfo($catalog_category_delete_job_create_query, $apiKey = null) { - $request = $this->createCatalogVariantRequest($catalog_variant_create_query, $apiKey); + $request = $this->bulkDeleteCatalogCategoriesRequest($catalog_category_delete_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1791,7 +2281,7 @@ public function createCatalogVariantWithHttpInfo($catalog_variant_create_query, } switch($statusCode) { - case 201: + case 202: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1879,7 +2369,7 @@ public function createCatalogVariantWithHttpInfo($catalog_variant_create_query, } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -1909,18 +2399,36 @@ public function createCatalogVariantWithHttpInfo($catalog_variant_create_query, } /** - * Operation createCatalogVariantAsync + * Alias of `bulkDeleteCatalogCategoriesWithHttpInfo` * - * Create Catalog Variant + * @deprecated use `bulkDeleteCatalogCategoriesWithHttpInfo` instead + */ + public function spawnDeleteCategoriesJobWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogCategoriesWithHttpInfo(...$args); + } + + /** + * Alias of `bulkDeleteCatalogCategoriesWithHttpInfo` * - * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) + * @deprecated use `bulkDeleteCatalogCategoriesWithHttpInfo` instead + */ + public function createCatalogCategoryBulkDeleteJobWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogCategoriesWithHttpInfo(...$args); + } + + /** + * Operation bulkDeleteCatalogCategoriesAsync + * + * Bulk Delete Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogVariantAsync($catalog_variant_create_query, $apiKey = null) + public function bulkDeleteCatalogCategoriesAsync($catalog_category_delete_job_create_query, $apiKey = null) { - return $this->createCatalogVariantAsyncWithHttpInfo($catalog_variant_create_query, $apiKey) + return $this->bulkDeleteCatalogCategoriesAsyncWithHttpInfo($catalog_category_delete_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -1929,19 +2437,37 @@ function ($response) { } /** - * Operation createCatalogVariantAsyncWithHttpInfo + * Alias of `bulkDeleteCatalogCategoriesAsync` * - * Create Catalog Variant + * @deprecated use `bulkDeleteCatalogCategoriesAsync` instead + */ + public function spawnDeleteCategoriesJobAsync(...$args) { + return $this->bulkDeleteCatalogCategoriesAsync(...$args); + } + + /** + * Alias of `bulkDeleteCatalogCategoriesAsync` * - * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) + * @deprecated use `bulkDeleteCatalogCategoriesAsync` instead + */ + public function createCatalogCategoryBulkDeleteJobAsync(...$args) { + return $this->bulkDeleteCatalogCategoriesAsync(...$args); + } + + /** + * Operation bulkDeleteCatalogCategoriesAsyncWithHttpInfo + * + * Bulk Delete Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCatalogVariantAsyncWithHttpInfo($catalog_variant_create_query, $apiKey = null) + public function bulkDeleteCatalogCategoriesAsyncWithHttpInfo($catalog_category_delete_job_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createCatalogVariantRequest($catalog_variant_create_query, $apiKey); + $request = $this->bulkDeleteCatalogCategoriesRequest($catalog_category_delete_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1985,23 +2511,41 @@ function ($exception) { } /** - * Create request for operation 'createCatalogVariant' + * Alias of `bulkDeleteCatalogCategoriesAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) + * @deprecated use `bulkDeleteCatalogCategoriesAsyncWithHttpInfo` instead + */ + public function spawnDeleteCategoriesJobAsyncWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogCategoriesAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkDeleteCatalogCategoriesAsyncWithHttpInfo` + * + * @deprecated use `bulkDeleteCatalogCategoriesAsyncWithHttpInfo` instead + */ + public function createCatalogCategoryBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogCategoriesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkDeleteCatalogCategories' + * + * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCatalogVariantRequest($catalog_variant_create_query, $apiKey = null) + public function bulkDeleteCatalogCategoriesRequest($catalog_category_delete_job_create_query, $apiKey = null) { - // verify the required parameter 'catalog_variant_create_query' is set - if ($catalog_variant_create_query === null || (is_array($catalog_variant_create_query) && count($catalog_variant_create_query) === 0)) { + // verify the required parameter 'catalog_category_delete_job_create_query' is set + if ($catalog_category_delete_job_create_query === null || (is_array($catalog_category_delete_job_create_query) && count($catalog_category_delete_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_variant_create_query when calling createCatalogVariant' + 'Missing the required parameter $catalog_category_delete_job_create_query when calling bulkDeleteCatalogCategories' ); } - $resourcePath = '/api/catalog-variants/'; + $resourcePath = '/api/catalog-category-bulk-delete-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2014,21 +2558,21 @@ public function createCatalogVariantRequest($catalog_variant_create_query, $apiK if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_variant_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_create_query)); + if (isset($catalog_category_delete_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_delete_job_create_query)); } else { - $httpBody = $catalog_variant_create_query; + $httpBody = $catalog_category_delete_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2045,7 +2589,7 @@ public function createCatalogVariantRequest($catalog_variant_create_query, $apiK // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2069,7 +2613,7 @@ public function createCatalogVariantRequest($catalog_variant_create_query, $apiK $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2087,35 +2631,72 @@ public function createCatalogVariantRequest($catalog_variant_create_query, $apiK } /** - * Operation deleteCatalogCategory + * Alias of `bulkDeleteCatalogCategoriesRequest` * - * Delete Catalog Category + * @deprecated use `bulkDeleteCatalogCategoriesRequest` instead + */ + public function spawnDeleteCategoriesJobRequest(...$args) { + return $this->bulkDeleteCatalogCategoriesRequest(...$args); + } + + /** + * Alias of `bulkDeleteCatalogCategoriesRequest` * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkDeleteCatalogCategoriesRequest` instead + */ + public function createCatalogCategoryBulkDeleteJobRequest(...$args) { + return $this->bulkDeleteCatalogCategoriesRequest(...$args); + } + + /** + * Operation bulkDeleteCatalogItems + * + * Bulk Delete Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query catalog_item_delete_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteCatalogCategory($id, $apiKey = null) + public function bulkDeleteCatalogItems($catalog_item_delete_job_create_query, $apiKey = null) { - $this->deleteCatalogCategoryWithHttpInfo($id, $apiKey); + list($response) = $this->bulkDeleteCatalogItemsWithHttpInfo($catalog_item_delete_job_create_query, $apiKey); + return $response; } /** - * Operation deleteCatalogCategoryWithHttpInfo + * Alias of `bulkDeleteCatalogItems` * - * Delete Catalog Category + * @deprecated use `bulkDeleteCatalogItems` instead + */ + public function spawnDeleteItemsJob(...$args) { + return $this->bulkDeleteCatalogItems(...$args); + } + + /** + * Alias of `bulkDeleteCatalogItems` * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkDeleteCatalogItems` instead + */ + public function createCatalogItemBulkDeleteJob(...$args) { + return $this->bulkDeleteCatalogItems(...$args); + } + + /** + * Operation bulkDeleteCatalogItemsWithHttpInfo + * + * Bulk Delete Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCatalogCategoryWithHttpInfo($id, $apiKey = null) + public function bulkDeleteCatalogItemsWithHttpInfo($catalog_item_delete_job_create_query, $apiKey = null) { - $request = $this->deleteCatalogCategoryRequest($id, $apiKey); + $request = $this->bulkDeleteCatalogItemsRequest($catalog_item_delete_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2152,71 +2733,218 @@ public function deleteCatalogCategoryWithHttpInfo($id, $apiKey = null) ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - } catch (ApiException $e) { - switch ($e->getCode()) { + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } - /** - * Operation deleteCatalogCategoryAsync - * - * Delete Catalog Category - * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteCatalogCategoryAsync($id, $apiKey = null) - { - return $this->deleteCatalogCategoryAsyncWithHttpInfo($id, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } /** - * Operation deleteCatalogCategoryAsyncWithHttpInfo + * Alias of `bulkDeleteCatalogItemsWithHttpInfo` * - * Delete Catalog Category + * @deprecated use `bulkDeleteCatalogItemsWithHttpInfo` instead + */ + public function spawnDeleteItemsJobWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogItemsWithHttpInfo(...$args); + } + + /** + * Alias of `bulkDeleteCatalogItemsWithHttpInfo` * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkDeleteCatalogItemsWithHttpInfo` instead + */ + public function createCatalogItemBulkDeleteJobWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogItemsWithHttpInfo(...$args); + } + + /** + * Operation bulkDeleteCatalogItemsAsync + * + * Bulk Delete Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogCategoryAsyncWithHttpInfo($id, $apiKey = null) + public function bulkDeleteCatalogItemsAsync($catalog_item_delete_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->deleteCatalogCategoryRequest($id, $apiKey); + return $this->bulkDeleteCatalogItemsAsyncWithHttpInfo($catalog_item_delete_job_create_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `bulkDeleteCatalogItemsAsync` + * + * @deprecated use `bulkDeleteCatalogItemsAsync` instead + */ + public function spawnDeleteItemsJobAsync(...$args) { + return $this->bulkDeleteCatalogItemsAsync(...$args); + } + + /** + * Alias of `bulkDeleteCatalogItemsAsync` + * + * @deprecated use `bulkDeleteCatalogItemsAsync` instead + */ + public function createCatalogItemBulkDeleteJobAsync(...$args) { + return $this->bulkDeleteCatalogItemsAsync(...$args); + } + + /** + * Operation bulkDeleteCatalogItemsAsyncWithHttpInfo + * + * Bulk Delete Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkDeleteCatalogItemsAsyncWithHttpInfo($catalog_item_delete_job_create_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->bulkDeleteCatalogItemsRequest($catalog_item_delete_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2236,23 +2964,41 @@ function ($exception) { } /** - * Create request for operation 'deleteCatalogCategory' + * Alias of `bulkDeleteCatalogItemsAsyncWithHttpInfo` * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkDeleteCatalogItemsAsyncWithHttpInfo` instead + */ + public function spawnDeleteItemsJobAsyncWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogItemsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkDeleteCatalogItemsAsyncWithHttpInfo` + * + * @deprecated use `bulkDeleteCatalogItemsAsyncWithHttpInfo` instead + */ + public function createCatalogItemBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogItemsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkDeleteCatalogItems' + * + * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCatalogCategoryRequest($id, $apiKey = null) + public function bulkDeleteCatalogItemsRequest($catalog_item_delete_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'catalog_item_delete_job_create_query' is set + if ($catalog_item_delete_job_create_query === null || (is_array($catalog_item_delete_job_create_query) && count($catalog_item_delete_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCatalogCategory' + 'Missing the required parameter $catalog_item_delete_job_create_query when calling bulkDeleteCatalogItems' ); } - $resourcePath = '/api/catalog-categories/{id}/'; + $resourcePath = '/api/catalog-item-bulk-delete-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2261,29 +3007,27 @@ public function deleteCatalogCategoryRequest($id, $apiKey = null) - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($catalog_item_delete_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_delete_job_create_query)); + } else { + $httpBody = $catalog_item_delete_job_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2298,7 +3042,7 @@ public function deleteCatalogCategoryRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2322,7 +3066,7 @@ public function deleteCatalogCategoryRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2332,7 +3076,7 @@ public function deleteCatalogCategoryRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2340,37 +3084,72 @@ public function deleteCatalogCategoryRequest($id, $apiKey = null) } /** - * Operation deleteCatalogCategoryRelationshipsItems + * Alias of `bulkDeleteCatalogItemsRequest` * - * Delete Catalog Category Relationships Items + * @deprecated use `bulkDeleteCatalogItemsRequest` instead + */ + public function spawnDeleteItemsJobRequest(...$args) { + return $this->bulkDeleteCatalogItemsRequest(...$args); + } + + /** + * Alias of `bulkDeleteCatalogItemsRequest` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op catalog_category_item_op (required) + * @deprecated use `bulkDeleteCatalogItemsRequest` instead + */ + public function createCatalogItemBulkDeleteJobRequest(...$args) { + return $this->bulkDeleteCatalogItemsRequest(...$args); + } + + /** + * Operation bulkDeleteCatalogVariants + * + * Bulk Delete Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query catalog_variant_delete_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteCatalogCategoryRelationshipsItems($id, $catalog_category_item_op, $apiKey = null) + public function bulkDeleteCatalogVariants($catalog_variant_delete_job_create_query, $apiKey = null) { - $this->deleteCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalog_category_item_op, $apiKey); + list($response) = $this->bulkDeleteCatalogVariantsWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey); + return $response; + } + + /** + * Alias of `bulkDeleteCatalogVariants` + * + * @deprecated use `bulkDeleteCatalogVariants` instead + */ + public function spawnDeleteVariantsJob(...$args) { + return $this->bulkDeleteCatalogVariants(...$args); } /** - * Operation deleteCatalogCategoryRelationshipsItemsWithHttpInfo + * Alias of `bulkDeleteCatalogVariants` * - * Delete Catalog Category Relationships Items + * @deprecated use `bulkDeleteCatalogVariants` instead + */ + public function createCatalogVariantBulkDeleteJob(...$args) { + return $this->bulkDeleteCatalogVariants(...$args); + } + + /** + * Operation bulkDeleteCatalogVariantsWithHttpInfo * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * Bulk Delete Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) + public function bulkDeleteCatalogVariantsWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey = null) { - $request = $this->deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey); + $request = $this->bulkDeleteCatalogVariantsRequest($catalog_variant_delete_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2392,25 +3171,118 @@ public function deleteCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalo ); } - $statusCode = $response->getStatusCode(); + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; } - return [null, $statusCode, $response->getHeaders()]; + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2433,19 +3305,36 @@ public function deleteCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalo } /** - * Operation deleteCatalogCategoryRelationshipsItemsAsync + * Alias of `bulkDeleteCatalogVariantsWithHttpInfo` + * + * @deprecated use `bulkDeleteCatalogVariantsWithHttpInfo` instead + */ + public function spawnDeleteVariantsJobWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogVariantsWithHttpInfo(...$args); + } + + /** + * Alias of `bulkDeleteCatalogVariantsWithHttpInfo` + * + * @deprecated use `bulkDeleteCatalogVariantsWithHttpInfo` instead + */ + public function createCatalogVariantBulkDeleteJobWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogVariantsWithHttpInfo(...$args); + } + + /** + * Operation bulkDeleteCatalogVariantsAsync * - * Delete Catalog Category Relationships Items + * Bulk Delete Catalog Variants * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogCategoryRelationshipsItemsAsync($id, $catalog_category_item_op, $apiKey = null) + public function bulkDeleteCatalogVariantsAsync($catalog_variant_delete_job_create_query, $apiKey = null) { - return $this->deleteCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey) + return $this->bulkDeleteCatalogVariantsAsyncWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -2454,26 +3343,61 @@ function ($response) { } /** - * Operation deleteCatalogCategoryRelationshipsItemsAsyncWithHttpInfo + * Alias of `bulkDeleteCatalogVariantsAsync` * - * Delete Catalog Category Relationships Items + * @deprecated use `bulkDeleteCatalogVariantsAsync` instead + */ + public function spawnDeleteVariantsJobAsync(...$args) { + return $this->bulkDeleteCatalogVariantsAsync(...$args); + } + + /** + * Alias of `bulkDeleteCatalogVariantsAsync` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @deprecated use `bulkDeleteCatalogVariantsAsync` instead + */ + public function createCatalogVariantBulkDeleteJobAsync(...$args) { + return $this->bulkDeleteCatalogVariantsAsync(...$args); + } + + /** + * Operation bulkDeleteCatalogVariantsAsyncWithHttpInfo + * + * Bulk Delete Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) + public function bulkDeleteCatalogVariantsAsyncWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey); + $returnType = 'array'; + $request = $this->bulkDeleteCatalogVariantsRequest($catalog_variant_delete_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2493,30 +3417,41 @@ function ($exception) { } /** - * Create request for operation 'deleteCatalogCategoryRelationshipsItems' + * Alias of `bulkDeleteCatalogVariantsAsyncWithHttpInfo` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @deprecated use `bulkDeleteCatalogVariantsAsyncWithHttpInfo` instead + */ + public function spawnDeleteVariantsJobAsyncWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogVariantsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkDeleteCatalogVariantsAsyncWithHttpInfo` + * + * @deprecated use `bulkDeleteCatalogVariantsAsyncWithHttpInfo` instead + */ + public function createCatalogVariantBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->bulkDeleteCatalogVariantsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkDeleteCatalogVariants' + * + * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey = null) + public function bulkDeleteCatalogVariantsRequest($catalog_variant_delete_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCatalogCategoryRelationshipsItems' - ); - } - // verify the required parameter 'catalog_category_item_op' is set - if ($catalog_category_item_op === null || (is_array($catalog_category_item_op) && count($catalog_category_item_op) === 0)) { + // verify the required parameter 'catalog_variant_delete_job_create_query' is set + if ($catalog_variant_delete_job_create_query === null || (is_array($catalog_variant_delete_job_create_query) && count($catalog_variant_delete_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_category_item_op when calling deleteCatalogCategoryRelationshipsItems' + 'Missing the required parameter $catalog_variant_delete_job_create_query when calling bulkDeleteCatalogVariants' ); } - $resourcePath = '/api/catalog-categories/{id}/relationships/items/'; + $resourcePath = '/api/catalog-variant-bulk-delete-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2525,33 +3460,25 @@ public function deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_category_item_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_item_op)); + if (isset($catalog_variant_delete_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_delete_job_create_query)); } else { - $httpBody = $catalog_category_item_op; + $httpBody = $catalog_variant_delete_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2568,7 +3495,7 @@ public function deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2592,7 +3519,7 @@ public function deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2602,7 +3529,7 @@ public function deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2610,35 +3537,72 @@ public function deleteCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat } /** - * Operation deleteCatalogItem + * Alias of `bulkDeleteCatalogVariantsRequest` * - * Delete Catalog Item + * @deprecated use `bulkDeleteCatalogVariantsRequest` instead + */ + public function spawnDeleteVariantsJobRequest(...$args) { + return $this->bulkDeleteCatalogVariantsRequest(...$args); + } + + /** + * Alias of `bulkDeleteCatalogVariantsRequest` * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkDeleteCatalogVariantsRequest` instead + */ + public function createCatalogVariantBulkDeleteJobRequest(...$args) { + return $this->bulkDeleteCatalogVariantsRequest(...$args); + } + + /** + * Operation bulkUpdateCatalogCategories + * + * Bulk Update Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query catalog_category_update_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteCatalogItem($id, $apiKey = null) + public function bulkUpdateCatalogCategories($catalog_category_update_job_create_query, $apiKey = null) { - $this->deleteCatalogItemWithHttpInfo($id, $apiKey); + list($response) = $this->bulkUpdateCatalogCategoriesWithHttpInfo($catalog_category_update_job_create_query, $apiKey); + return $response; } /** - * Operation deleteCatalogItemWithHttpInfo + * Alias of `bulkUpdateCatalogCategories` * - * Delete Catalog Item + * @deprecated use `bulkUpdateCatalogCategories` instead + */ + public function spawnUpdateCategoriesJob(...$args) { + return $this->bulkUpdateCatalogCategories(...$args); + } + + /** + * Alias of `bulkUpdateCatalogCategories` * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogCategories` instead + */ + public function createCatalogCategoryBulkUpdateJob(...$args) { + return $this->bulkUpdateCatalogCategories(...$args); + } + + /** + * Operation bulkUpdateCatalogCategoriesWithHttpInfo + * + * Bulk Update Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCatalogItemWithHttpInfo($id, $apiKey = null) + public function bulkUpdateCatalogCategoriesWithHttpInfo($catalog_category_update_job_create_query, $apiKey = null) { - $request = $this->deleteCatalogItemRequest($id, $apiKey); + $request = $this->bulkUpdateCatalogCategoriesRequest($catalog_category_update_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2660,25 +3624,118 @@ public function deleteCatalogItemWithHttpInfo($id, $apiKey = null) ); } - $statusCode = $response->getStatusCode(); + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; } - return [null, $statusCode, $response->getHeaders()]; + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2701,18 +3758,36 @@ public function deleteCatalogItemWithHttpInfo($id, $apiKey = null) } /** - * Operation deleteCatalogItemAsync + * Alias of `bulkUpdateCatalogCategoriesWithHttpInfo` * - * Delete Catalog Item + * @deprecated use `bulkUpdateCatalogCategoriesWithHttpInfo` instead + */ + public function spawnUpdateCategoriesJobWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogCategoriesWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUpdateCatalogCategoriesWithHttpInfo` * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogCategoriesWithHttpInfo` instead + */ + public function createCatalogCategoryBulkUpdateJobWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogCategoriesWithHttpInfo(...$args); + } + + /** + * Operation bulkUpdateCatalogCategoriesAsync + * + * Bulk Update Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogItemAsync($id, $apiKey = null) + public function bulkUpdateCatalogCategoriesAsync($catalog_category_update_job_create_query, $apiKey = null) { - return $this->deleteCatalogItemAsyncWithHttpInfo($id, $apiKey) + return $this->bulkUpdateCatalogCategoriesAsyncWithHttpInfo($catalog_category_update_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -2721,25 +3796,61 @@ function ($response) { } /** - * Operation deleteCatalogItemAsyncWithHttpInfo + * Alias of `bulkUpdateCatalogCategoriesAsync` * - * Delete Catalog Item + * @deprecated use `bulkUpdateCatalogCategoriesAsync` instead + */ + public function spawnUpdateCategoriesJobAsync(...$args) { + return $this->bulkUpdateCatalogCategoriesAsync(...$args); + } + + /** + * Alias of `bulkUpdateCatalogCategoriesAsync` * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogCategoriesAsync` instead + */ + public function createCatalogCategoryBulkUpdateJobAsync(...$args) { + return $this->bulkUpdateCatalogCategoriesAsync(...$args); + } + + /** + * Operation bulkUpdateCatalogCategoriesAsyncWithHttpInfo + * + * Bulk Update Catalog Categories + * + * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogItemAsyncWithHttpInfo($id, $apiKey = null) + public function bulkUpdateCatalogCategoriesAsyncWithHttpInfo($catalog_category_update_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->deleteCatalogItemRequest($id, $apiKey); + $returnType = 'array'; + $request = $this->bulkUpdateCatalogCategoriesRequest($catalog_category_update_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2759,23 +3870,41 @@ function ($exception) { } /** - * Create request for operation 'deleteCatalogItem' + * Alias of `bulkUpdateCatalogCategoriesAsyncWithHttpInfo` * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogCategoriesAsyncWithHttpInfo` instead + */ + public function spawnUpdateCategoriesJobAsyncWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogCategoriesAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUpdateCatalogCategoriesAsyncWithHttpInfo` + * + * @deprecated use `bulkUpdateCatalogCategoriesAsyncWithHttpInfo` instead + */ + public function createCatalogCategoryBulkUpdateJobAsyncWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogCategoriesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkUpdateCatalogCategories' + * + * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCatalogItemRequest($id, $apiKey = null) + public function bulkUpdateCatalogCategoriesRequest($catalog_category_update_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'catalog_category_update_job_create_query' is set + if ($catalog_category_update_job_create_query === null || (is_array($catalog_category_update_job_create_query) && count($catalog_category_update_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCatalogItem' + 'Missing the required parameter $catalog_category_update_job_create_query when calling bulkUpdateCatalogCategories' ); } - $resourcePath = '/api/catalog-items/{id}/'; + $resourcePath = '/api/catalog-category-bulk-update-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2784,29 +3913,27 @@ public function deleteCatalogItemRequest($id, $apiKey = null) - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($catalog_category_update_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_update_job_create_query)); + } else { + $httpBody = $catalog_category_update_job_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2821,7 +3948,7 @@ public function deleteCatalogItemRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2845,7 +3972,7 @@ public function deleteCatalogItemRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2855,7 +3982,7 @@ public function deleteCatalogItemRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2863,37 +3990,72 @@ public function deleteCatalogItemRequest($id, $apiKey = null) } /** - * Operation deleteCatalogItemRelationshipsCategories + * Alias of `bulkUpdateCatalogCategoriesRequest` * - * Delete Catalog Item Relationships Categories + * @deprecated use `bulkUpdateCatalogCategoriesRequest` instead + */ + public function spawnUpdateCategoriesJobRequest(...$args) { + return $this->bulkUpdateCatalogCategoriesRequest(...$args); + } + + /** + * Alias of `bulkUpdateCatalogCategoriesRequest` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op catalog_item_category_op (required) + * @deprecated use `bulkUpdateCatalogCategoriesRequest` instead + */ + public function createCatalogCategoryBulkUpdateJobRequest(...$args) { + return $this->bulkUpdateCatalogCategoriesRequest(...$args); + } + + /** + * Operation bulkUpdateCatalogItems + * + * Bulk Update Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query catalog_item_update_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteCatalogItemRelationshipsCategories($id, $catalog_item_category_op, $apiKey = null) + public function bulkUpdateCatalogItems($catalog_item_update_job_create_query, $apiKey = null) { - $this->deleteCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catalog_item_category_op, $apiKey); + list($response) = $this->bulkUpdateCatalogItemsWithHttpInfo($catalog_item_update_job_create_query, $apiKey); + return $response; } /** - * Operation deleteCatalogItemRelationshipsCategoriesWithHttpInfo + * Alias of `bulkUpdateCatalogItems` * - * Delete Catalog Item Relationships Categories + * @deprecated use `bulkUpdateCatalogItems` instead + */ + public function spawnUpdateItemsJob(...$args) { + return $this->bulkUpdateCatalogItems(...$args); + } + + /** + * Alias of `bulkUpdateCatalogItems` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * @deprecated use `bulkUpdateCatalogItems` instead + */ + public function createCatalogItemBulkUpdateJob(...$args) { + return $this->bulkUpdateCatalogItems(...$args); + } + + /** + * Operation bulkUpdateCatalogItemsWithHttpInfo + * + * Bulk Update Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) + public function bulkUpdateCatalogItemsWithHttpInfo($catalog_item_update_job_create_query, $apiKey = null) { - $request = $this->deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey); + $request = $this->bulkUpdateCatalogItemsRequest($catalog_item_update_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2915,25 +4077,118 @@ public function deleteCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catal ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; } - return [null, $statusCode, $response->getHeaders()]; + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2956,19 +4211,36 @@ public function deleteCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catal } /** - * Operation deleteCatalogItemRelationshipsCategoriesAsync + * Alias of `bulkUpdateCatalogItemsWithHttpInfo` + * + * @deprecated use `bulkUpdateCatalogItemsWithHttpInfo` instead + */ + public function spawnUpdateItemsJobWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogItemsWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUpdateCatalogItemsWithHttpInfo` + * + * @deprecated use `bulkUpdateCatalogItemsWithHttpInfo` instead + */ + public function createCatalogItemBulkUpdateJobWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogItemsWithHttpInfo(...$args); + } + + /** + * Operation bulkUpdateCatalogItemsAsync * - * Delete Catalog Item Relationships Categories + * Bulk Update Catalog Items * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogItemRelationshipsCategoriesAsync($id, $catalog_item_category_op, $apiKey = null) + public function bulkUpdateCatalogItemsAsync($catalog_item_update_job_create_query, $apiKey = null) { - return $this->deleteCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey) + return $this->bulkUpdateCatalogItemsAsyncWithHttpInfo($catalog_item_update_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -2977,26 +4249,61 @@ function ($response) { } /** - * Operation deleteCatalogItemRelationshipsCategoriesAsyncWithHttpInfo + * Alias of `bulkUpdateCatalogItemsAsync` * - * Delete Catalog Item Relationships Categories + * @deprecated use `bulkUpdateCatalogItemsAsync` instead + */ + public function spawnUpdateItemsJobAsync(...$args) { + return $this->bulkUpdateCatalogItemsAsync(...$args); + } + + /** + * Alias of `bulkUpdateCatalogItemsAsync` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * @deprecated use `bulkUpdateCatalogItemsAsync` instead + */ + public function createCatalogItemBulkUpdateJobAsync(...$args) { + return $this->bulkUpdateCatalogItemsAsync(...$args); + } + + /** + * Operation bulkUpdateCatalogItemsAsyncWithHttpInfo + * + * Bulk Update Catalog Items + * + * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) + public function bulkUpdateCatalogItemsAsyncWithHttpInfo($catalog_item_update_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey); + $returnType = 'array'; + $request = $this->bulkUpdateCatalogItemsRequest($catalog_item_update_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -3016,30 +4323,41 @@ function ($exception) { } /** - * Create request for operation 'deleteCatalogItemRelationshipsCategories' + * Alias of `bulkUpdateCatalogItemsAsyncWithHttpInfo` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) + * @deprecated use `bulkUpdateCatalogItemsAsyncWithHttpInfo` instead + */ + public function spawnUpdateItemsJobAsyncWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogItemsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUpdateCatalogItemsAsyncWithHttpInfo` + * + * @deprecated use `bulkUpdateCatalogItemsAsyncWithHttpInfo` instead + */ + public function createCatalogItemBulkUpdateJobAsyncWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogItemsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkUpdateCatalogItems' + * + * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey = null) + public function bulkUpdateCatalogItemsRequest($catalog_item_update_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCatalogItemRelationshipsCategories' - ); - } - // verify the required parameter 'catalog_item_category_op' is set - if ($catalog_item_category_op === null || (is_array($catalog_item_category_op) && count($catalog_item_category_op) === 0)) { + // verify the required parameter 'catalog_item_update_job_create_query' is set + if ($catalog_item_update_job_create_query === null || (is_array($catalog_item_update_job_create_query) && count($catalog_item_update_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_category_op when calling deleteCatalogItemRelationshipsCategories' + 'Missing the required parameter $catalog_item_update_job_create_query when calling bulkUpdateCatalogItems' ); } - $resourcePath = '/api/catalog-items/{id}/relationships/categories/'; + $resourcePath = '/api/catalog-item-bulk-update-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3048,33 +4366,25 @@ public function deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_it - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_item_category_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_category_op)); + if (isset($catalog_item_update_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_update_job_create_query)); } else { - $httpBody = $catalog_item_category_op; + $httpBody = $catalog_item_update_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3091,7 +4401,7 @@ public function deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_it // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3115,7 +4425,7 @@ public function deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_it $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3125,7 +4435,7 @@ public function deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_it $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3133,35 +4443,72 @@ public function deleteCatalogItemRelationshipsCategoriesRequest($id, $catalog_it } /** - * Operation deleteCatalogVariant + * Alias of `bulkUpdateCatalogItemsRequest` * - * Delete Catalog Variant + * @deprecated use `bulkUpdateCatalogItemsRequest` instead + */ + public function spawnUpdateItemsJobRequest(...$args) { + return $this->bulkUpdateCatalogItemsRequest(...$args); + } + + /** + * Alias of `bulkUpdateCatalogItemsRequest` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogItemsRequest` instead + */ + public function createCatalogItemBulkUpdateJobRequest(...$args) { + return $this->bulkUpdateCatalogItemsRequest(...$args); + } + + /** + * Operation bulkUpdateCatalogVariants + * + * Bulk Update Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query catalog_variant_update_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteCatalogVariant($id, $apiKey = null) + public function bulkUpdateCatalogVariants($catalog_variant_update_job_create_query, $apiKey = null) { - $this->deleteCatalogVariantWithHttpInfo($id, $apiKey); + list($response) = $this->bulkUpdateCatalogVariantsWithHttpInfo($catalog_variant_update_job_create_query, $apiKey); + return $response; } /** - * Operation deleteCatalogVariantWithHttpInfo + * Alias of `bulkUpdateCatalogVariants` * - * Delete Catalog Variant + * @deprecated use `bulkUpdateCatalogVariants` instead + */ + public function spawnUpdateVariantsJob(...$args) { + return $this->bulkUpdateCatalogVariants(...$args); + } + + /** + * Alias of `bulkUpdateCatalogVariants` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogVariants` instead + */ + public function createCatalogVariantBulkUpdateJob(...$args) { + return $this->bulkUpdateCatalogVariants(...$args); + } + + /** + * Operation bulkUpdateCatalogVariantsWithHttpInfo + * + * Bulk Update Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCatalogVariantWithHttpInfo($id, $apiKey = null) + public function bulkUpdateCatalogVariantsWithHttpInfo($catalog_variant_update_job_create_query, $apiKey = null) { - $request = $this->deleteCatalogVariantRequest($id, $apiKey); + $request = $this->bulkUpdateCatalogVariantsRequest($catalog_variant_update_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3198,10 +4545,103 @@ public function deleteCatalogVariantWithHttpInfo($id, $apiKey = null) ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3224,18 +4664,36 @@ public function deleteCatalogVariantWithHttpInfo($id, $apiKey = null) } /** - * Operation deleteCatalogVariantAsync + * Alias of `bulkUpdateCatalogVariantsWithHttpInfo` + * + * @deprecated use `bulkUpdateCatalogVariantsWithHttpInfo` instead + */ + public function spawnUpdateVariantsJobWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogVariantsWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUpdateCatalogVariantsWithHttpInfo` + * + * @deprecated use `bulkUpdateCatalogVariantsWithHttpInfo` instead + */ + public function createCatalogVariantBulkUpdateJobWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogVariantsWithHttpInfo(...$args); + } + + /** + * Operation bulkUpdateCatalogVariantsAsync * - * Delete Catalog Variant + * Bulk Update Catalog Variants * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogVariantAsync($id, $apiKey = null) + public function bulkUpdateCatalogVariantsAsync($catalog_variant_update_job_create_query, $apiKey = null) { - return $this->deleteCatalogVariantAsyncWithHttpInfo($id, $apiKey) + return $this->bulkUpdateCatalogVariantsAsyncWithHttpInfo($catalog_variant_update_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -3244,25 +4702,61 @@ function ($response) { } /** - * Operation deleteCatalogVariantAsyncWithHttpInfo + * Alias of `bulkUpdateCatalogVariantsAsync` * - * Delete Catalog Variant + * @deprecated use `bulkUpdateCatalogVariantsAsync` instead + */ + public function spawnUpdateVariantsJobAsync(...$args) { + return $this->bulkUpdateCatalogVariantsAsync(...$args); + } + + /** + * Alias of `bulkUpdateCatalogVariantsAsync` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogVariantsAsync` instead + */ + public function createCatalogVariantBulkUpdateJobAsync(...$args) { + return $this->bulkUpdateCatalogVariantsAsync(...$args); + } + + /** + * Operation bulkUpdateCatalogVariantsAsyncWithHttpInfo + * + * Bulk Update Catalog Variants + * + * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCatalogVariantAsyncWithHttpInfo($id, $apiKey = null) + public function bulkUpdateCatalogVariantsAsyncWithHttpInfo($catalog_variant_update_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->deleteCatalogVariantRequest($id, $apiKey); + $returnType = 'array'; + $request = $this->bulkUpdateCatalogVariantsRequest($catalog_variant_update_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -3282,23 +4776,41 @@ function ($exception) { } /** - * Create request for operation 'deleteCatalogVariant' + * Alias of `bulkUpdateCatalogVariantsAsyncWithHttpInfo` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @deprecated use `bulkUpdateCatalogVariantsAsyncWithHttpInfo` instead + */ + public function spawnUpdateVariantsJobAsyncWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogVariantsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUpdateCatalogVariantsAsyncWithHttpInfo` + * + * @deprecated use `bulkUpdateCatalogVariantsAsyncWithHttpInfo` instead + */ + public function createCatalogVariantBulkUpdateJobAsyncWithHttpInfo(...$args) { + return $this->bulkUpdateCatalogVariantsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkUpdateCatalogVariants' + * + * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCatalogVariantRequest($id, $apiKey = null) + public function bulkUpdateCatalogVariantsRequest($catalog_variant_update_job_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'catalog_variant_update_job_create_query' is set + if ($catalog_variant_update_job_create_query === null || (is_array($catalog_variant_update_job_create_query) && count($catalog_variant_update_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCatalogVariant' + 'Missing the required parameter $catalog_variant_update_job_create_query when calling bulkUpdateCatalogVariants' ); } - $resourcePath = '/api/catalog-variants/{id}/'; + $resourcePath = '/api/catalog-variant-bulk-update-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3307,29 +4819,27 @@ public function deleteCatalogVariantRequest($id, $apiKey = null) - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($catalog_variant_update_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_update_job_create_query)); + } else { + $httpBody = $catalog_variant_update_job_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -3344,7 +4854,7 @@ public function deleteCatalogVariantRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3368,7 +4878,7 @@ public function deleteCatalogVariantRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3378,7 +4888,7 @@ public function deleteCatalogVariantRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3386,42 +4896,53 @@ public function deleteCatalogVariantRequest($id, $apiKey = null) } /** - * Operation getCatalogCategories + * Alias of `bulkUpdateCatalogVariantsRequest` * - * Get Catalog Categories + * @deprecated use `bulkUpdateCatalogVariantsRequest` instead + */ + public function spawnUpdateVariantsJobRequest(...$args) { + return $this->bulkUpdateCatalogVariantsRequest(...$args); + } + + /** + * Alias of `bulkUpdateCatalogVariantsRequest` + * + * @deprecated use `bulkUpdateCatalogVariantsRequest` instead + */ + public function createCatalogVariantBulkUpdateJobRequest(...$args) { + return $this->bulkUpdateCatalogVariantsRequest(...$args); + } + + /** + * Operation createBackInStockSubscription + * + * Create Back In Stock Subscription * - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query server_bis_subscription_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getCatalogCategories($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createBackInStockSubscription($server_bis_subscription_create_query, $apiKey = null) { - list($response) = $this->getCatalogCategoriesWithHttpInfo($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); - return $response; + $this->createBackInStockSubscriptionWithHttpInfo($server_bis_subscription_create_query, $apiKey); } /** - * Operation getCatalogCategoriesWithHttpInfo + * Operation createBackInStockSubscriptionWithHttpInfo * - * Get Catalog Categories + * Create Back In Stock Subscription * - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogCategoriesWithHttpInfo($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createBackInStockSubscriptionWithHttpInfo($server_bis_subscription_create_query, $apiKey = null) { - $request = $this->getCatalogCategoriesRequest($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); + $request = $this->createBackInStockSubscriptionRequest($server_bis_subscription_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3458,103 +4979,10 @@ public function getCatalogCategoriesWithHttpInfo($fields_catalog_category = null ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3577,21 +5005,18 @@ public function getCatalogCategoriesWithHttpInfo($fields_catalog_category = null } /** - * Operation getCatalogCategoriesAsync + * Operation createBackInStockSubscriptionAsync * - * Get Catalog Categories + * Create Back In Stock Subscription * - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogCategoriesAsync($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createBackInStockSubscriptionAsync($server_bis_subscription_create_query, $apiKey = null) { - return $this->getCatalogCategoriesAsyncWithHttpInfo($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey) + return $this->createBackInStockSubscriptionAsyncWithHttpInfo($server_bis_subscription_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -3600,46 +5025,25 @@ function ($response) { } /** - * Operation getCatalogCategoriesAsyncWithHttpInfo + * Operation createBackInStockSubscriptionAsyncWithHttpInfo * - * Get Catalog Categories + * Create Back In Stock Subscription * - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getCatalogCategoriesAsyncWithHttpInfo($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) - { - $returnType = 'array'; - $request = $this->getCatalogCategoriesRequest($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createBackInStockSubscriptionAsyncWithHttpInfo($server_bis_subscription_create_query, $apiKey = null) + { + $returnType = ''; + $request = $this->createBackInStockSubscriptionRequest($server_bis_subscription_create_query, $apiKey); - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -3659,79 +5063,52 @@ function ($exception) { } /** - * Create request for operation 'getCatalogCategories' + * Create request for operation 'createBackInStockSubscription' * - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\ServerBISSubscriptionCreateQuery $server_bis_subscription_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogCategoriesRequest($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createBackInStockSubscriptionRequest($server_bis_subscription_create_query, $apiKey = null) { + // verify the required parameter 'server_bis_subscription_create_query' is set + if ($server_bis_subscription_create_query === null || (is_array($server_bis_subscription_create_query) && count($server_bis_subscription_create_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $server_bis_subscription_create_query when calling createBackInStockSubscription' + ); + } - $resourcePath = '/api/catalog-categories/'; + $resourcePath = '/api/back-in-stock-subscriptions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category, - 'fields[catalog-category]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($server_bis_subscription_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($server_bis_subscription_create_query)); + } else { + $httpBody = $server_bis_subscription_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -3746,7 +5123,7 @@ public function getCatalogCategoriesRequest($fields_catalog_category = null, $fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3770,7 +5147,7 @@ public function getCatalogCategoriesRequest($fields_catalog_category = null, $fi $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3780,7 +5157,7 @@ public function getCatalogCategoriesRequest($fields_catalog_category = null, $fi $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3788,38 +5165,36 @@ public function getCatalogCategoriesRequest($fields_catalog_category = null, $fi } /** - * Operation getCatalogCategory + * Operation createCatalogCategory * - * Get Catalog Category + * Create Catalog Category * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query catalog_category_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCatalogCategory($id, $fields_catalog_category = null, $apiKey = null) + public function createCatalogCategory($catalog_category_create_query, $apiKey = null) { - list($response) = $this->getCatalogCategoryWithHttpInfo($id, $fields_catalog_category, $apiKey); + list($response) = $this->createCatalogCategoryWithHttpInfo($catalog_category_create_query, $apiKey); return $response; } /** - * Operation getCatalogCategoryWithHttpInfo + * Operation createCatalogCategoryWithHttpInfo * - * Get Catalog Category + * Create Catalog Category * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogCategoryWithHttpInfo($id, $fields_catalog_category = null, $apiKey = null) + public function createCatalogCategoryWithHttpInfo($catalog_category_create_query, $apiKey = null) { - $request = $this->getCatalogCategoryRequest($id, $fields_catalog_category, $apiKey); + $request = $this->createCatalogCategoryRequest($catalog_category_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3857,7 +5232,7 @@ public function getCatalogCategoryWithHttpInfo($id, $fields_catalog_category = n } switch($statusCode) { - case 200: + case 201: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3945,7 +5320,7 @@ public function getCatalogCategoryWithHttpInfo($id, $fields_catalog_category = n } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -3975,19 +5350,18 @@ public function getCatalogCategoryWithHttpInfo($id, $fields_catalog_category = n } /** - * Operation getCatalogCategoryAsync + * Operation createCatalogCategoryAsync * - * Get Catalog Category + * Create Catalog Category * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogCategoryAsync($id, $fields_catalog_category = null, $apiKey = null) + public function createCatalogCategoryAsync($catalog_category_create_query, $apiKey = null) { - return $this->getCatalogCategoryAsyncWithHttpInfo($id, $fields_catalog_category, $apiKey) + return $this->createCatalogCategoryAsyncWithHttpInfo($catalog_category_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -3996,20 +5370,19 @@ function ($response) { } /** - * Operation getCatalogCategoryAsyncWithHttpInfo + * Operation createCatalogCategoryAsyncWithHttpInfo * - * Get Catalog Category + * Create Catalog Category * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogCategoryAsyncWithHttpInfo($id, $fields_catalog_category = null, $apiKey = null) + public function createCatalogCategoryAsyncWithHttpInfo($catalog_category_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->getCatalogCategoryRequest($id, $fields_catalog_category, $apiKey); + $request = $this->createCatalogCategoryRequest($catalog_category_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4053,64 +5426,52 @@ function ($exception) { } /** - * Create request for operation 'getCatalogCategory' + * Create request for operation 'createCatalogCategory' * - * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param \KlaviyoAPI\Model\CatalogCategoryCreateQuery $catalog_category_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogCategoryRequest($id, $fields_catalog_category = null, $apiKey = null) + public function createCatalogCategoryRequest($catalog_category_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'catalog_category_create_query' is set + if ($catalog_category_create_query === null || (is_array($catalog_category_create_query) && count($catalog_category_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogCategory' + 'Missing the required parameter $catalog_category_create_query when calling createCatalogCategory' ); } - $resourcePath = '/api/catalog-categories/{id}/'; + $resourcePath = '/api/catalog-categories'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category, - 'fields[catalog-category]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($catalog_category_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_create_query)); + } else { + $httpBody = $catalog_category_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -4125,7 +5486,7 @@ public function getCatalogCategoryRequest($id, $fields_catalog_category = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4149,7 +5510,7 @@ public function getCatalogCategoryRequest($id, $fields_catalog_category = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4159,7 +5520,7 @@ public function getCatalogCategoryRequest($id, $fields_catalog_category = null, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4167,48 +5528,36 @@ public function getCatalogCategoryRequest($id, $fields_catalog_category = null, } /** - * Operation getCatalogCategoryItems + * Operation createCatalogItem * - * Get Catalog Category Items + * Create Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query catalog_item_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCatalogCategoryItems($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createCatalogItem($catalog_item_create_query, $apiKey = null) { - list($response) = $this->getCatalogCategoryItemsWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); + list($response) = $this->createCatalogItemWithHttpInfo($catalog_item_create_query, $apiKey); return $response; } /** - * Operation getCatalogCategoryItemsWithHttpInfo + * Operation createCatalogItemWithHttpInfo * - * Get Catalog Category Items + * Create Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogCategoryItemsWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createCatalogItemWithHttpInfo($catalog_item_create_query, $apiKey = null) { - $request = $this->getCatalogCategoryItemsRequest($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->createCatalogItemRequest($catalog_item_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4246,7 +5595,7 @@ public function getCatalogCategoryItemsWithHttpInfo($id, $fields_catalog_item = } switch($statusCode) { - case 200: + case 201: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4334,7 +5683,7 @@ public function getCatalogCategoryItemsWithHttpInfo($id, $fields_catalog_item = } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -4364,24 +5713,18 @@ public function getCatalogCategoryItemsWithHttpInfo($id, $fields_catalog_item = } /** - * Operation getCatalogCategoryItemsAsync + * Operation createCatalogItemAsync * - * Get Catalog Category Items + * Create Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogCategoryItemsAsync($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createCatalogItemAsync($catalog_item_create_query, $apiKey = null) { - return $this->getCatalogCategoryItemsAsyncWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey) + return $this->createCatalogItemAsyncWithHttpInfo($catalog_item_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -4390,25 +5733,19 @@ function ($response) { } /** - * Operation getCatalogCategoryItemsAsyncWithHttpInfo + * Operation createCatalogItemAsyncWithHttpInfo * - * Get Catalog Category Items + * Create Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogCategoryItemsAsyncWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function createCatalogItemAsyncWithHttpInfo($catalog_item_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->getCatalogCategoryItemsRequest($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->createCatalogItemRequest($catalog_item_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4451,115 +5788,53 @@ function ($exception) { ); } - /** - * Create request for operation 'getCatalogCategoryItems' - * - * @param string $id (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getCatalogCategoryItemsRequest($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) - { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogCategoryItems' - ); - } - - $resourcePath = '/api/catalog-categories/{id}/items/'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item, - 'fields[catalog-item]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant, - 'fields[catalog-variant]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath + /** + * Create request for operation 'createCatalogItem' + * + * @param \KlaviyoAPI\Model\CatalogItemCreateQuery $catalog_item_create_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createCatalogItemRequest($catalog_item_create_query, $apiKey = null) + { + // verify the required parameter 'catalog_item_create_query' is set + if ($catalog_item_create_query === null || (is_array($catalog_item_create_query) && count($catalog_item_create_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $catalog_item_create_query when calling createCatalogItem' ); } + $resourcePath = '/api/catalog-items'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($catalog_item_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_create_query)); + } else { + $httpBody = $catalog_item_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -4574,7 +5849,7 @@ public function getCatalogCategoryItemsRequest($id, $fields_catalog_item = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4598,7 +5873,7 @@ public function getCatalogCategoryItemsRequest($id, $fields_catalog_item = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4608,7 +5883,7 @@ public function getCatalogCategoryItemsRequest($id, $fields_catalog_item = null, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4616,38 +5891,36 @@ public function getCatalogCategoryItemsRequest($id, $fields_catalog_item = null, } /** - * Operation getCatalogCategoryRelationshipsItems + * Operation createCatalogVariant * - * Get Catalog Category Relationships Items + * Create Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query catalog_variant_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCatalogCategoryRelationshipsItems($id, $page_cursor = null, $apiKey = null) + public function createCatalogVariant($catalog_variant_create_query, $apiKey = null) { - list($response) = $this->getCatalogCategoryRelationshipsItemsWithHttpInfo($id, $page_cursor, $apiKey); + list($response) = $this->createCatalogVariantWithHttpInfo($catalog_variant_create_query, $apiKey); return $response; } /** - * Operation getCatalogCategoryRelationshipsItemsWithHttpInfo + * Operation createCatalogVariantWithHttpInfo * - * Get Catalog Category Relationships Items + * Create Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogCategoryRelationshipsItemsWithHttpInfo($id, $page_cursor = null, $apiKey = null) + public function createCatalogVariantWithHttpInfo($catalog_variant_create_query, $apiKey = null) { - $request = $this->getCatalogCategoryRelationshipsItemsRequest($id, $page_cursor, $apiKey); + $request = $this->createCatalogVariantRequest($catalog_variant_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4685,7 +5958,7 @@ public function getCatalogCategoryRelationshipsItemsWithHttpInfo($id, $page_curs } switch($statusCode) { - case 200: + case 201: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4773,7 +6046,7 @@ public function getCatalogCategoryRelationshipsItemsWithHttpInfo($id, $page_curs } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -4803,19 +6076,18 @@ public function getCatalogCategoryRelationshipsItemsWithHttpInfo($id, $page_curs } /** - * Operation getCatalogCategoryRelationshipsItemsAsync + * Operation createCatalogVariantAsync * - * Get Catalog Category Relationships Items + * Create Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogCategoryRelationshipsItemsAsync($id, $page_cursor = null, $apiKey = null) + public function createCatalogVariantAsync($catalog_variant_create_query, $apiKey = null) { - return $this->getCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $page_cursor, $apiKey) + return $this->createCatalogVariantAsyncWithHttpInfo($catalog_variant_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -4824,20 +6096,19 @@ function ($response) { } /** - * Operation getCatalogCategoryRelationshipsItemsAsyncWithHttpInfo + * Operation createCatalogVariantAsyncWithHttpInfo * - * Get Catalog Category Relationships Items + * Create Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $page_cursor = null, $apiKey = null) + public function createCatalogVariantAsyncWithHttpInfo($catalog_variant_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->getCatalogCategoryRelationshipsItemsRequest($id, $page_cursor, $apiKey); + $request = $this->createCatalogVariantRequest($catalog_variant_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4881,64 +6152,52 @@ function ($exception) { } /** - * Create request for operation 'getCatalogCategoryRelationshipsItems' + * Create request for operation 'createCatalogVariant' * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param \KlaviyoAPI\Model\CatalogVariantCreateQuery $catalog_variant_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogCategoryRelationshipsItemsRequest($id, $page_cursor = null, $apiKey = null) + public function createCatalogVariantRequest($catalog_variant_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'catalog_variant_create_query' is set + if ($catalog_variant_create_query === null || (is_array($catalog_variant_create_query) && count($catalog_variant_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogCategoryRelationshipsItems' + 'Missing the required parameter $catalog_variant_create_query when calling createCatalogVariant' ); } - $resourcePath = '/api/catalog-categories/{id}/relationships/items/'; + $resourcePath = '/api/catalog-variants'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($catalog_variant_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_create_query)); + } else { + $httpBody = $catalog_variant_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -4953,7 +6212,7 @@ public function getCatalogCategoryRelationshipsItemsRequest($id, $page_cursor = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4977,7 +6236,7 @@ public function getCatalogCategoryRelationshipsItemsRequest($id, $page_cursor = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4987,7 +6246,7 @@ public function getCatalogCategoryRelationshipsItemsRequest($id, $page_cursor = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4995,42 +6254,35 @@ public function getCatalogCategoryRelationshipsItemsRequest($id, $page_cursor = } /** - * Operation getCatalogItem + * Operation deleteCatalogCategory * - * Get Catalog Item + * Delete Catalog Category * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getCatalogItem($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function deleteCatalogCategory($id, $apiKey = null) { - list($response) = $this->getCatalogItemWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey); - return $response; + $this->deleteCatalogCategoryWithHttpInfo($id, $apiKey); } /** - * Operation getCatalogItemWithHttpInfo + * Operation deleteCatalogCategoryWithHttpInfo * - * Get Catalog Item + * Delete Catalog Category * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogItemWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function deleteCatalogCategoryWithHttpInfo($id, $apiKey = null) { - $request = $this->getCatalogItemRequest($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey); + $request = $this->deleteCatalogCategoryRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5067,103 +6319,10 @@ public function getCatalogItemWithHttpInfo($id, $fields_catalog_item = null, $fi ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5186,21 +6345,18 @@ public function getCatalogItemWithHttpInfo($id, $fields_catalog_item = null, $fi } /** - * Operation getCatalogItemAsync + * Operation deleteCatalogCategoryAsync * - * Get Catalog Item + * Delete Catalog Category * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemAsync($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function deleteCatalogCategoryAsync($id, $apiKey = null) { - return $this->getCatalogItemAsyncWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey) + return $this->deleteCatalogCategoryAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -5209,46 +6365,25 @@ function ($response) { } /** - * Operation getCatalogItemAsyncWithHttpInfo + * Operation deleteCatalogCategoryAsyncWithHttpInfo * - * Get Catalog Item + * Delete Catalog Category * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemAsyncWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) - { - $returnType = 'array'; - $request = $this->getCatalogItemRequest($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } + public function deleteCatalogCategoryAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = ''; + $request = $this->deleteCatalogCategoryRequest($id, $apiKey); - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -5268,59 +6403,29 @@ function ($exception) { } /** - * Create request for operation 'getCatalogItem' + * Create request for operation 'deleteCatalogCategory' * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogItemRequest($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function deleteCatalogCategoryRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogItem' + 'Missing the required parameter $id when calling deleteCatalogCategory' ); } - $resourcePath = '/api/catalog-items/{id}/'; + $resourcePath = '/api/catalog-categories/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item, - 'fields[catalog-item]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant, - 'fields[catalog-variant]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -5335,11 +6440,11 @@ public function getCatalogItemRequest($id, $fields_catalog_item = null, $fields_ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5360,7 +6465,7 @@ public function getCatalogItemRequest($id, $fields_catalog_item = null, $fields_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5384,7 +6489,7 @@ public function getCatalogItemRequest($id, $fields_catalog_item = null, $fields_ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5394,7 +6499,7 @@ public function getCatalogItemRequest($id, $fields_catalog_item = null, $fields_ $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5402,44 +6507,35 @@ public function getCatalogItemRequest($id, $fields_catalog_item = null, $fields_ } /** - * Operation getCatalogItemCategories + * Operation deleteCatalogItem * - * Get Catalog Item Categories + * Delete Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getCatalogItemCategories($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function deleteCatalogItem($id, $apiKey = null) { - list($response) = $this->getCatalogItemCategoriesWithHttpInfo($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); - return $response; + $this->deleteCatalogItemWithHttpInfo($id, $apiKey); } /** - * Operation getCatalogItemCategoriesWithHttpInfo + * Operation deleteCatalogItemWithHttpInfo * - * Get Catalog Item Categories + * Delete Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogItemCategoriesWithHttpInfo($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function deleteCatalogItemWithHttpInfo($id, $apiKey = null) { - $request = $this->getCatalogItemCategoriesRequest($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); + $request = $this->deleteCatalogItemRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5476,103 +6572,10 @@ public function getCatalogItemCategoriesWithHttpInfo($id, $fields_catalog_catego ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5595,22 +6598,18 @@ public function getCatalogItemCategoriesWithHttpInfo($id, $fields_catalog_catego } /** - * Operation getCatalogItemCategoriesAsync + * Operation deleteCatalogItemAsync * - * Get Catalog Item Categories + * Delete Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemCategoriesAsync($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function deleteCatalogItemAsync($id, $apiKey = null) { - return $this->getCatalogItemCategoriesAsyncWithHttpInfo($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey) + return $this->deleteCatalogItemAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -5619,47 +6618,25 @@ function ($response) { } /** - * Operation getCatalogItemCategoriesAsyncWithHttpInfo + * Operation deleteCatalogItemAsyncWithHttpInfo * - * Get Catalog Item Categories + * Delete Catalog Item * - * @param string $id (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemCategoriesAsyncWithHttpInfo($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function deleteCatalogItemAsyncWithHttpInfo($id, $apiKey = null) { - $returnType = 'array'; - $request = $this->getCatalogItemCategoriesRequest($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); + $returnType = ''; + $request = $this->deleteCatalogItemRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -5670,78 +6647,38 @@ function ($exception) { $statusCode, $exception->getRequest()->getUri() ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getCatalogItemCategories' - * - * @param string $id (required) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getCatalogItemCategoriesRequest($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) - { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogItemCategories' - ); - } - - $resourcePath = '/api/catalog-items/{id}/categories/'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category, - 'fields[catalog-category]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCatalogItem' + * + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCatalogItemRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteCatalogItem' + ); + } + + $resourcePath = '/api/catalog-items/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // path params @@ -5756,11 +6693,11 @@ public function getCatalogItemCategoriesRequest($id, $fields_catalog_category = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5781,7 +6718,7 @@ public function getCatalogItemCategoriesRequest($id, $fields_catalog_category = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5805,7 +6742,7 @@ public function getCatalogItemCategoriesRequest($id, $fields_catalog_category = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5815,7 +6752,7 @@ public function getCatalogItemCategoriesRequest($id, $fields_catalog_category = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5823,38 +6760,35 @@ public function getCatalogItemCategoriesRequest($id, $fields_catalog_category = } /** - * Operation getCatalogItemRelationshipsCategories + * Operation deleteCatalogVariant * - * Get Catalog Item Relationships Categories + * Delete Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getCatalogItemRelationshipsCategories($id, $page_cursor = null, $apiKey = null) + public function deleteCatalogVariant($id, $apiKey = null) { - list($response) = $this->getCatalogItemRelationshipsCategoriesWithHttpInfo($id, $page_cursor, $apiKey); - return $response; + $this->deleteCatalogVariantWithHttpInfo($id, $apiKey); } /** - * Operation getCatalogItemRelationshipsCategoriesWithHttpInfo + * Operation deleteCatalogVariantWithHttpInfo * - * Get Catalog Item Relationships Categories + * Delete Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogItemRelationshipsCategoriesWithHttpInfo($id, $page_cursor = null, $apiKey = null) + public function deleteCatalogVariantWithHttpInfo($id, $apiKey = null) { - $request = $this->getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor, $apiKey); + $request = $this->deleteCatalogVariantRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5891,103 +6825,10 @@ public function getCatalogItemRelationshipsCategoriesWithHttpInfo($id, $page_cur ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6010,19 +6851,18 @@ public function getCatalogItemRelationshipsCategoriesWithHttpInfo($id, $page_cur } /** - * Operation getCatalogItemRelationshipsCategoriesAsync + * Operation deleteCatalogVariantAsync * - * Get Catalog Item Relationships Categories + * Delete Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemRelationshipsCategoriesAsync($id, $page_cursor = null, $apiKey = null) + public function deleteCatalogVariantAsync($id, $apiKey = null) { - return $this->getCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $page_cursor, $apiKey) + return $this->deleteCatalogVariantAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -6031,44 +6871,25 @@ function ($response) { } /** - * Operation getCatalogItemRelationshipsCategoriesAsyncWithHttpInfo + * Operation deleteCatalogVariantAsyncWithHttpInfo * - * Get Catalog Item Relationships Categories + * Delete Catalog Variant * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $page_cursor = null, $apiKey = null) + public function deleteCatalogVariantAsyncWithHttpInfo($id, $apiKey = null) { - $returnType = 'array'; - $request = $this->getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor, $apiKey); + $returnType = ''; + $request = $this->deleteCatalogVariantRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -6088,39 +6909,29 @@ function ($exception) { } /** - * Create request for operation 'getCatalogItemRelationshipsCategories' + * Create request for operation 'deleteCatalogVariant' * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor = null, $apiKey = null) + public function deleteCatalogVariantRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogItemRelationshipsCategories' + 'Missing the required parameter $id when calling deleteCatalogVariant' ); } - $resourcePath = '/api/catalog-items/{id}/relationships/categories/'; + $resourcePath = '/api/catalog-variants/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params @@ -6135,11 +6946,11 @@ public function getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6160,7 +6971,7 @@ public function getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6184,7 +6995,7 @@ public function getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6194,7 +7005,7 @@ public function getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6202,44 +7013,60 @@ public function getCatalogItemRelationshipsCategoriesRequest($id, $page_cursor = } /** - * Operation getCatalogItemVariants + * Operation getBulkCreateCatalogItemsJob * - * Get Catalog Item Variants + * Get Bulk Create Catalog Items Job * - * @param string $id (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCatalogItemVariants($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJob($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { - list($response) = $this->getCatalogItemVariantsWithHttpInfo($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); + list($response) = $this->getBulkCreateCatalogItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey); return $response; } /** - * Operation getCatalogItemVariantsWithHttpInfo + * Alias of `getBulkCreateCatalogItemsJob` + * + * @deprecated use `getBulkCreateCatalogItemsJob` instead + */ + public function getCreateItemsJob(...$args) { + return $this->getBulkCreateCatalogItemsJob(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJob` + * + * @deprecated use `getBulkCreateCatalogItemsJob` instead + */ + public function getCatalogItemBulkCreateJob(...$args) { + return $this->getBulkCreateCatalogItemsJob(...$args); + } + + /** + * Operation getBulkCreateCatalogItemsJobWithHttpInfo * - * Get Catalog Item Variants + * Get Bulk Create Catalog Items Job * - * @param string $id (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogItemVariantsWithHttpInfo($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { - $request = $this->getCatalogItemVariantsRequest($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); + $request = $this->getBulkCreateCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6395,22 +7222,39 @@ public function getCatalogItemVariantsWithHttpInfo($id, $fields_catalog_variant } /** - * Operation getCatalogItemVariantsAsync + * Alias of `getBulkCreateCatalogItemsJobWithHttpInfo` + * + * @deprecated use `getBulkCreateCatalogItemsJobWithHttpInfo` instead + */ + public function getCreateItemsJobWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobWithHttpInfo` * - * Get Catalog Item Variants + * @deprecated use `getBulkCreateCatalogItemsJobWithHttpInfo` instead + */ + public function getCatalogItemBulkCreateJobWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobWithHttpInfo(...$args); + } + + /** + * Operation getBulkCreateCatalogItemsJobAsync + * + * Get Bulk Create Catalog Items Job * - * @param string $id (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemVariantsAsync($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobAsync($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { - return $this->getCatalogItemVariantsAsyncWithHttpInfo($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey) + return $this->getBulkCreateCatalogItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -6419,23 +7263,40 @@ function ($response) { } /** - * Operation getCatalogItemVariantsAsyncWithHttpInfo + * Alias of `getBulkCreateCatalogItemsJobAsync` + * + * @deprecated use `getBulkCreateCatalogItemsJobAsync` instead + */ + public function getCreateItemsJobAsync(...$args) { + return $this->getBulkCreateCatalogItemsJobAsync(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobAsync` + * + * @deprecated use `getBulkCreateCatalogItemsJobAsync` instead + */ + public function getCatalogItemBulkCreateJobAsync(...$args) { + return $this->getBulkCreateCatalogItemsJobAsync(...$args); + } + + /** + * Operation getBulkCreateCatalogItemsJobAsyncWithHttpInfo * - * Get Catalog Item Variants + * Get Bulk Create Catalog Items Job * - * @param string $id (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemVariantsAsyncWithHttpInfo($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCatalogItemVariantsRequest($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); + $request = $this->getBulkCreateCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6479,27 +7340,44 @@ function ($exception) { } /** - * Create request for operation 'getCatalogItemVariants' + * Alias of `getBulkCreateCatalogItemsJobAsyncWithHttpInfo` + * + * @deprecated use `getBulkCreateCatalogItemsJobAsyncWithHttpInfo` instead + */ + public function getCreateItemsJobAsyncWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobAsyncWithHttpInfo` * - * @param string $id (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @deprecated use `getBulkCreateCatalogItemsJobAsyncWithHttpInfo` instead + */ + public function getCatalogItemBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkCreateCatalogItemsJob' + * + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogItemVariantsRequest($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogItemVariants' + 'Missing the required parameter $job_id when calling getBulkCreateCatalogItemsJob' ); } - $resourcePath = '/api/catalog-items/{id}/variants/'; + $resourcePath = '/api/catalog-item-bulk-create-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6508,47 +7386,38 @@ public function getCatalogItemVariantsRequest($id, $fields_catalog_variant = nul // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant, - 'fields[catalog-variant]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType + $fields_catalog_item_bulk_create_job, + 'fields[catalog-item-bulk-create-job]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType + $fields_catalog_item, + 'fields[catalog-item]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType + $include, + 'include', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // path params - if ($id !== null) { + if ($job_id !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'job_id' . '}', + ObjectSerializer::toPathValue($job_id), $resourcePath ); } @@ -6556,11 +7425,11 @@ public function getCatalogItemVariantsRequest($id, $fields_catalog_variant = nul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6581,7 +7450,7 @@ public function getCatalogItemVariantsRequest($id, $fields_catalog_variant = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6605,7 +7474,7 @@ public function getCatalogItemVariantsRequest($id, $fields_catalog_variant = nul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6623,46 +7492,76 @@ public function getCatalogItemVariantsRequest($id, $fields_catalog_variant = nul } /** - * Operation getCatalogItems + * Alias of `getBulkCreateCatalogItemsJobRequest` * - * Get Catalog Items + * @deprecated use `getBulkCreateCatalogItemsJobRequest` instead + */ + public function getCreateItemsJobRequest(...$args) { + return $this->getBulkCreateCatalogItemsJobRequest(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobRequest` * - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @deprecated use `getBulkCreateCatalogItemsJobRequest` instead + */ + public function getCatalogItemBulkCreateJobRequest(...$args) { + return $this->getBulkCreateCatalogItemsJobRequest(...$args); + } + + /** + * Operation getBulkCreateCatalogItemsJobs + * + * Get Bulk Create Catalog Items Jobs + * + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCatalogItems($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobs($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getCatalogItemsWithHttpInfo($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); + list($response) = $this->getBulkCreateCatalogItemsJobsWithHttpInfo($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Operation getCatalogItemsWithHttpInfo + * Alias of `getBulkCreateCatalogItemsJobs` * - * Get Catalog Items + * @deprecated use `getBulkCreateCatalogItemsJobs` instead + */ + public function getCreateItemsJobs(...$args) { + return $this->getBulkCreateCatalogItemsJobs(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobs` + * + * @deprecated use `getBulkCreateCatalogItemsJobs` instead + */ + public function getCatalogItemBulkCreateJobs(...$args) { + return $this->getBulkCreateCatalogItemsJobs(...$args); + } + + /** + * Operation getBulkCreateCatalogItemsJobsWithHttpInfo + * + * Get Bulk Create Catalog Items Jobs * - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogItemsWithHttpInfo($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobsWithHttpInfo($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getCatalogItemsRequest($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getBulkCreateCatalogItemsJobsRequest($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6818,23 +7717,38 @@ public function getCatalogItemsWithHttpInfo($fields_catalog_item = null, $fields } /** - * Operation getCatalogItemsAsync + * Alias of `getBulkCreateCatalogItemsJobsWithHttpInfo` * - * Get Catalog Items + * @deprecated use `getBulkCreateCatalogItemsJobsWithHttpInfo` instead + */ + public function getCreateItemsJobsWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobsWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobsWithHttpInfo` + * + * @deprecated use `getBulkCreateCatalogItemsJobsWithHttpInfo` instead + */ + public function getCatalogItemBulkCreateJobsWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobsWithHttpInfo(...$args); + } + + /** + * Operation getBulkCreateCatalogItemsJobsAsync * - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get Bulk Create Catalog Items Jobs + * + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemsAsync($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobsAsync($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getCatalogItemsAsyncWithHttpInfo($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey) + return $this->getBulkCreateCatalogItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -6843,24 +7757,39 @@ function ($response) { } /** - * Operation getCatalogItemsAsyncWithHttpInfo + * Alias of `getBulkCreateCatalogItemsJobsAsync` * - * Get Catalog Items + * @deprecated use `getBulkCreateCatalogItemsJobsAsync` instead + */ + public function getCreateItemsJobsAsync(...$args) { + return $this->getBulkCreateCatalogItemsJobsAsync(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobsAsync` + * + * @deprecated use `getBulkCreateCatalogItemsJobsAsync` instead + */ + public function getCatalogItemBulkCreateJobsAsync(...$args) { + return $this->getBulkCreateCatalogItemsJobsAsync(...$args); + } + + /** + * Operation getBulkCreateCatalogItemsJobsAsyncWithHttpInfo + * + * Get Bulk Create Catalog Items Jobs * - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogItemsAsyncWithHttpInfo($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCatalogItemsRequest($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getBulkCreateCatalogItemsJobsRequest($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6904,22 +7833,37 @@ function ($exception) { } /** - * Create request for operation 'getCatalogItems' + * Alias of `getBulkCreateCatalogItemsJobsAsyncWithHttpInfo` + * + * @deprecated use `getBulkCreateCatalogItemsJobsAsyncWithHttpInfo` instead + */ + public function getCreateItemsJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobsAsyncWithHttpInfo` + * + * @deprecated use `getBulkCreateCatalogItemsJobsAsyncWithHttpInfo` instead + */ + public function getCatalogItemBulkCreateJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkCreateCatalogItemsJobsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkCreateCatalogItemsJobs' * - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogItemsRequest($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkCreateCatalogItemsJobsRequest($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $resourcePath = '/api/catalog-items/'; + $resourcePath = '/api/catalog-item-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6928,17 +7872,8 @@ public function getCatalogItemsRequest($fields_catalog_item = null, $fields_cata // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item, - 'fields[catalog-item]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant, - 'fields[catalog-variant]', // param base name + $fields_catalog_item_bulk_create_job, + 'fields[catalog-item-bulk-create-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -6954,15 +7889,6 @@ public function getCatalogItemsRequest($fields_catalog_item = null, $fields_cata false // required ) ?? []); // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, 'page[cursor]', // param base name @@ -6971,26 +7897,17 @@ public function getCatalogItemsRequest($fields_catalog_item = null, $fields_cata true, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -7011,7 +7928,7 @@ public function getCatalogItemsRequest($fields_catalog_item = null, $fields_cata // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7035,7 +7952,7 @@ public function getCatalogItemsRequest($fields_catalog_item = null, $fields_cata $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7053,38 +7970,74 @@ public function getCatalogItemsRequest($fields_catalog_item = null, $fields_cata } /** - * Operation getCatalogVariant + * Alias of `getBulkCreateCatalogItemsJobsRequest` * - * Get Catalog Variant + * @deprecated use `getBulkCreateCatalogItemsJobsRequest` instead + */ + public function getCreateItemsJobsRequest(...$args) { + return $this->getBulkCreateCatalogItemsJobsRequest(...$args); + } + + /** + * Alias of `getBulkCreateCatalogItemsJobsRequest` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getBulkCreateCatalogItemsJobsRequest` instead + */ + public function getCatalogItemBulkCreateJobsRequest(...$args) { + return $this->getBulkCreateCatalogItemsJobsRequest(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJob + * + * Get Bulk Delete Catalog Items Job + * + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCatalogVariant($id, $fields_catalog_variant = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJob($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) { - list($response) = $this->getCatalogVariantWithHttpInfo($id, $fields_catalog_variant, $apiKey); + list($response) = $this->getBulkDeleteCatalogItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job, $apiKey); return $response; } /** - * Operation getCatalogVariantWithHttpInfo + * Alias of `getBulkDeleteCatalogItemsJob` * - * Get Catalog Variant + * @deprecated use `getBulkDeleteCatalogItemsJob` instead + */ + public function getDeleteItemsJob(...$args) { + return $this->getBulkDeleteCatalogItemsJob(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJob` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getBulkDeleteCatalogItemsJob` instead + */ + public function getCatalogItemBulkDeleteJob(...$args) { + return $this->getBulkDeleteCatalogItemsJob(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJobWithHttpInfo + * + * Get Bulk Delete Catalog Items Job + * + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogVariantWithHttpInfo($id, $fields_catalog_variant = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) { - $request = $this->getCatalogVariantRequest($id, $fields_catalog_variant, $apiKey); + $request = $this->getBulkDeleteCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_delete_job, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7240,19 +8193,37 @@ public function getCatalogVariantWithHttpInfo($id, $fields_catalog_variant = nul } /** - * Operation getCatalogVariantAsync + * Alias of `getBulkDeleteCatalogItemsJobWithHttpInfo` * - * Get Catalog Variant + * @deprecated use `getBulkDeleteCatalogItemsJobWithHttpInfo` instead + */ + public function getDeleteItemsJobWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobWithHttpInfo` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getBulkDeleteCatalogItemsJobWithHttpInfo` instead + */ + public function getCatalogItemBulkDeleteJobWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobWithHttpInfo(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJobAsync + * + * Get Bulk Delete Catalog Items Job + * + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogVariantAsync($id, $fields_catalog_variant = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobAsync($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) { - return $this->getCatalogVariantAsyncWithHttpInfo($id, $fields_catalog_variant, $apiKey) + return $this->getBulkDeleteCatalogItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job, $apiKey) ->then( function ($response) { return $response[0]; @@ -7261,20 +8232,38 @@ function ($response) { } /** - * Operation getCatalogVariantAsyncWithHttpInfo + * Alias of `getBulkDeleteCatalogItemsJobAsync` * - * Get Catalog Variant + * @deprecated use `getBulkDeleteCatalogItemsJobAsync` instead + */ + public function getDeleteItemsJobAsync(...$args) { + return $this->getBulkDeleteCatalogItemsJobAsync(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobAsync` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getBulkDeleteCatalogItemsJobAsync` instead + */ + public function getCatalogItemBulkDeleteJobAsync(...$args) { + return $this->getBulkDeleteCatalogItemsJobAsync(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJobAsyncWithHttpInfo + * + * Get Bulk Delete Catalog Items Job + * + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogVariantAsyncWithHttpInfo($id, $fields_catalog_variant = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCatalogVariantRequest($id, $fields_catalog_variant, $apiKey); + $request = $this->getBulkDeleteCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_delete_job, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7318,24 +8307,42 @@ function ($exception) { } /** - * Create request for operation 'getCatalogVariant' + * Alias of `getBulkDeleteCatalogItemsJobAsyncWithHttpInfo` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `getBulkDeleteCatalogItemsJobAsyncWithHttpInfo` instead + */ + public function getDeleteItemsJobAsyncWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobAsyncWithHttpInfo` + * + * @deprecated use `getBulkDeleteCatalogItemsJobAsyncWithHttpInfo` instead + */ + public function getCatalogItemBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkDeleteCatalogItemsJob' + * + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCatalogVariant' + 'Missing the required parameter $job_id when calling getBulkDeleteCatalogItemsJob' ); } - $resourcePath = '/api/catalog-variants/{id}/'; + $resourcePath = '/api/catalog-item-bulk-delete-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7344,8 +8351,8 @@ public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $a // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant, - 'fields[catalog-variant]', // param base name + $fields_catalog_item_bulk_delete_job, + 'fields[catalog-item-bulk-delete-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -7354,10 +8361,10 @@ public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $a // path params - if ($id !== null) { + if ($job_id !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'job_id' . '}', + ObjectSerializer::toPathValue($job_id), $resourcePath ); } @@ -7365,11 +8372,11 @@ public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $a if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -7390,7 +8397,7 @@ public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $a // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7414,7 +8421,7 @@ public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7432,42 +8439,76 @@ public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $a } /** - * Operation getCatalogVariants + * Alias of `getBulkDeleteCatalogItemsJobRequest` * - * Get Catalog Variants + * @deprecated use `getBulkDeleteCatalogItemsJobRequest` instead + */ + public function getDeleteItemsJobRequest(...$args) { + return $this->getBulkDeleteCatalogItemsJobRequest(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobRequest` + * + * @deprecated use `getBulkDeleteCatalogItemsJobRequest` instead + */ + public function getCatalogItemBulkDeleteJobRequest(...$args) { + return $this->getBulkDeleteCatalogItemsJobRequest(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJobs * - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get Bulk Delete Catalog Items Jobs + * + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCatalogVariants($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobs($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getCatalogVariantsWithHttpInfo($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); + list($response) = $this->getBulkDeleteCatalogItemsJobsWithHttpInfo($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Operation getCatalogVariantsWithHttpInfo + * Alias of `getBulkDeleteCatalogItemsJobs` * - * Get Catalog Variants + * @deprecated use `getBulkDeleteCatalogItemsJobs` instead + */ + public function getDeleteItemsJobs(...$args) { + return $this->getBulkDeleteCatalogItemsJobs(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobs` + * + * @deprecated use `getBulkDeleteCatalogItemsJobs` instead + */ + public function getCatalogItemBulkDeleteJobs(...$args) { + return $this->getBulkDeleteCatalogItemsJobs(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJobsWithHttpInfo + * + * Get Bulk Delete Catalog Items Jobs * - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCatalogVariantsWithHttpInfo($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobsWithHttpInfo($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getCatalogVariantsRequest($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); + $request = $this->getBulkDeleteCatalogItemsJobsRequest($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7623,21 +8664,38 @@ public function getCatalogVariantsWithHttpInfo($fields_catalog_variant = null, $ } /** - * Operation getCatalogVariantsAsync + * Alias of `getBulkDeleteCatalogItemsJobsWithHttpInfo` * - * Get Catalog Variants + * @deprecated use `getBulkDeleteCatalogItemsJobsWithHttpInfo` instead + */ + public function getDeleteItemsJobsWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobsWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobsWithHttpInfo` * - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @deprecated use `getBulkDeleteCatalogItemsJobsWithHttpInfo` instead + */ + public function getCatalogItemBulkDeleteJobsWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobsWithHttpInfo(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJobsAsync + * + * Get Bulk Delete Catalog Items Jobs + * + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogVariantsAsync($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobsAsync($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getCatalogVariantsAsyncWithHttpInfo($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey) + return $this->getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -7646,22 +8704,39 @@ function ($response) { } /** - * Operation getCatalogVariantsAsyncWithHttpInfo + * Alias of `getBulkDeleteCatalogItemsJobsAsync` * - * Get Catalog Variants + * @deprecated use `getBulkDeleteCatalogItemsJobsAsync` instead + */ + public function getDeleteItemsJobsAsync(...$args) { + return $this->getBulkDeleteCatalogItemsJobsAsync(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobsAsync` + * + * @deprecated use `getBulkDeleteCatalogItemsJobsAsync` instead + */ + public function getCatalogItemBulkDeleteJobsAsync(...$args) { + return $this->getBulkDeleteCatalogItemsJobsAsync(...$args); + } + + /** + * Operation getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo + * + * Get Bulk Delete Catalog Items Jobs * - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCatalogVariantsAsyncWithHttpInfo($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCatalogVariantsRequest($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); + $request = $this->getBulkDeleteCatalogItemsJobsRequest($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7705,20 +8780,37 @@ function ($exception) { } /** - * Create request for operation 'getCatalogVariants' + * Alias of `getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo` + * + * @deprecated use `getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo` instead + */ + public function getDeleteItemsJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo` + * + * @deprecated use `getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo` instead + */ + public function getCatalogItemBulkDeleteJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkDeleteCatalogItemsJobsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkDeleteCatalogItemsJobs' * - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCatalogVariantsRequest($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getBulkDeleteCatalogItemsJobsRequest($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $resourcePath = '/api/catalog-variants/'; + $resourcePath = '/api/catalog-item-bulk-delete-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7727,8 +8819,8 @@ public function getCatalogVariantsRequest($fields_catalog_variant = null, $filte // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant, - 'fields[catalog-variant]', // param base name + $fields_catalog_item_bulk_delete_job, + 'fields[catalog-item-bulk-delete-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -7752,26 +8844,17 @@ public function getCatalogVariantsRequest($fields_catalog_variant = null, $filte true, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -7792,7 +8875,7 @@ public function getCatalogVariantsRequest($fields_catalog_variant = null, $filte // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7816,7 +8899,7 @@ public function getCatalogVariantsRequest($fields_catalog_variant = null, $filte $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7834,51 +8917,78 @@ public function getCatalogVariantsRequest($fields_catalog_variant = null, $filte } /** - * Operation getCreateCategoriesJob + * Alias of `getBulkDeleteCatalogItemsJobsRequest` * - * Get Create Categories Job + * @deprecated use `getBulkDeleteCatalogItemsJobsRequest` instead + */ + public function getDeleteItemsJobsRequest(...$args) { + return $this->getBulkDeleteCatalogItemsJobsRequest(...$args); + } + + /** + * Alias of `getBulkDeleteCatalogItemsJobsRequest` + * + * @deprecated use `getBulkDeleteCatalogItemsJobsRequest` instead + */ + public function getCatalogItemBulkDeleteJobsRequest(...$args) { + return $this->getBulkDeleteCatalogItemsJobsRequest(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJob + * + * Get Bulk Update Catalog Items Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCreateCategoriesJob($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJob($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { - list($response) = $this->getCreateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey); + list($response) = $this->getBulkUpdateCatalogItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey); return $response; } /** - * Alias of `getCreateCategoriesJob` + * Alias of `getBulkUpdateCatalogItemsJob` * - * @deprecated use `getCreateCategoriesJob` instead + * @deprecated use `getBulkUpdateCatalogItemsJob` instead */ - public function getCatalogCategoryBulkCreateJob(...$args) { - return $this->getCreateCategoriesJob(...$args); + public function getUpdateItemsJob(...$args) { + return $this->getBulkUpdateCatalogItemsJob(...$args); } /** - * Operation getCreateCategoriesJobWithHttpInfo + * Alias of `getBulkUpdateCatalogItemsJob` * - * Get Create Categories Job + * @deprecated use `getBulkUpdateCatalogItemsJob` instead + */ + public function getCatalogItemBulkUpdateJob(...$args) { + return $this->getBulkUpdateCatalogItemsJob(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJobWithHttpInfo + * + * Get Bulk Update Catalog Items Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCreateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { - $request = $this->getCreateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey); + $request = $this->getBulkUpdateCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -8034,30 +9144,39 @@ public function getCreateCategoriesJobWithHttpInfo($job_id, $fields_catalog_cate } /** - * Alias of `getCreateCategoriesJobWithHttpInfo` + * Alias of `getBulkUpdateCatalogItemsJobWithHttpInfo` * - * @deprecated use `getCreateCategoriesJobWithHttpInfo` instead + * @deprecated use `getBulkUpdateCatalogItemsJobWithHttpInfo` instead */ - public function getCatalogCategoryBulkCreateJobWithHttpInfo(...$args) { - return $this->getCreateCategoriesJobWithHttpInfo(...$args); + public function getUpdateItemsJobWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobWithHttpInfo(...$args); } /** - * Operation getCreateCategoriesJobAsync + * Alias of `getBulkUpdateCatalogItemsJobWithHttpInfo` * - * Get Create Categories Job + * @deprecated use `getBulkUpdateCatalogItemsJobWithHttpInfo` instead + */ + public function getCatalogItemBulkUpdateJobWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobWithHttpInfo(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJobAsync + * + * Get Bulk Update Catalog Items Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateCategoriesJobAsync($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobAsync($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { - return $this->getCreateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey) + return $this->getBulkUpdateCatalogItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -8066,31 +9185,40 @@ function ($response) { } /** - * Alias of `getCreateCategoriesJobAsync` + * Alias of `getBulkUpdateCatalogItemsJobAsync` * - * @deprecated use `getCreateCategoriesJobAsync` instead + * @deprecated use `getBulkUpdateCatalogItemsJobAsync` instead */ - public function getCatalogCategoryBulkCreateJobAsync(...$args) { - return $this->getCreateCategoriesJobAsync(...$args); + public function getUpdateItemsJobAsync(...$args) { + return $this->getBulkUpdateCatalogItemsJobAsync(...$args); } /** - * Operation getCreateCategoriesJobAsyncWithHttpInfo + * Alias of `getBulkUpdateCatalogItemsJobAsync` * - * Get Create Categories Job + * @deprecated use `getBulkUpdateCatalogItemsJobAsync` instead + */ + public function getCatalogItemBulkUpdateJobAsync(...$args) { + return $this->getBulkUpdateCatalogItemsJobAsync(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJobAsyncWithHttpInfo + * + * Get Bulk Update Catalog Items Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCreateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey); + $request = $this->getBulkUpdateCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8134,35 +9262,44 @@ function ($exception) { } /** - * Alias of `getCreateCategoriesJobAsyncWithHttpInfo` + * Alias of `getBulkUpdateCatalogItemsJobAsyncWithHttpInfo` * - * @deprecated use `getCreateCategoriesJobAsyncWithHttpInfo` instead + * @deprecated use `getBulkUpdateCatalogItemsJobAsyncWithHttpInfo` instead */ - public function getCatalogCategoryBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->getCreateCategoriesJobAsyncWithHttpInfo(...$args); + public function getUpdateItemsJobAsyncWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getCreateCategoriesJob' + * Alias of `getBulkUpdateCatalogItemsJobAsyncWithHttpInfo` + * + * @deprecated use `getBulkUpdateCatalogItemsJobAsyncWithHttpInfo` instead + */ + public function getCatalogItemBulkUpdateJobAsyncWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkUpdateCatalogItemsJob' * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobRequest($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) { // verify the required parameter 'job_id' is set if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getCreateCategoriesJob' + 'Missing the required parameter $job_id when calling getBulkUpdateCatalogItemsJob' ); } - $resourcePath = '/api/catalog-category-bulk-create-jobs/{job_id}/'; + $resourcePath = '/api/catalog-item-bulk-update-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8171,8 +9308,8 @@ public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_ // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category_bulk_create_job, - 'fields[catalog-category-bulk-create-job]', // param base name + $fields_catalog_item_bulk_update_job, + 'fields[catalog-item-bulk-update-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -8180,8 +9317,8 @@ public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_ ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category, - 'fields[catalog-category]', // param base name + $fields_catalog_item, + 'fields[catalog-item]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -8210,11 +9347,11 @@ public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -8235,7 +9372,7 @@ public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8259,7 +9396,7 @@ public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8277,58 +9414,76 @@ public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_ } /** - * Alias of `getCreateCategoriesJobRequest` + * Alias of `getBulkUpdateCatalogItemsJobRequest` * - * @deprecated use `getCreateCategoriesJobRequest` instead + * @deprecated use `getBulkUpdateCatalogItemsJobRequest` instead */ - public function getCatalogCategoryBulkCreateJobRequest(...$args) { - return $this->getCreateCategoriesJobRequest(...$args); + public function getUpdateItemsJobRequest(...$args) { + return $this->getBulkUpdateCatalogItemsJobRequest(...$args); } /** - * Operation getCreateCategoriesJobs + * Alias of `getBulkUpdateCatalogItemsJobRequest` * - * Get Create Categories Jobs + * @deprecated use `getBulkUpdateCatalogItemsJobRequest` instead + */ + public function getCatalogItemBulkUpdateJobRequest(...$args) { + return $this->getBulkUpdateCatalogItemsJobRequest(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJobs + * + * Get Bulk Update Catalog Items Jobs * - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCreateCategoriesJobs($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobs($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getCreateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getBulkUpdateCatalogItemsJobsWithHttpInfo($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `getCreateCategoriesJobs` + * Alias of `getBulkUpdateCatalogItemsJobs` * - * @deprecated use `getCreateCategoriesJobs` instead + * @deprecated use `getBulkUpdateCatalogItemsJobs` instead */ - public function getCatalogCategoryBulkCreateJobs(...$args) { - return $this->getCreateCategoriesJobs(...$args); + public function getUpdateItemsJobs(...$args) { + return $this->getBulkUpdateCatalogItemsJobs(...$args); } /** - * Operation getCreateCategoriesJobsWithHttpInfo + * Alias of `getBulkUpdateCatalogItemsJobs` * - * Get Create Categories Jobs + * @deprecated use `getBulkUpdateCatalogItemsJobs` instead + */ + public function getCatalogItemBulkUpdateJobs(...$args) { + return $this->getBulkUpdateCatalogItemsJobs(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJobsWithHttpInfo + * + * Get Bulk Update Catalog Items Jobs * - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCreateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobsWithHttpInfo($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getCreateCategoriesJobsRequest($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getBulkUpdateCatalogItemsJobsRequest($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -8484,29 +9639,38 @@ public function getCreateCategoriesJobsWithHttpInfo($fields_catalog_category_bul } /** - * Alias of `getCreateCategoriesJobsWithHttpInfo` + * Alias of `getBulkUpdateCatalogItemsJobsWithHttpInfo` * - * @deprecated use `getCreateCategoriesJobsWithHttpInfo` instead + * @deprecated use `getBulkUpdateCatalogItemsJobsWithHttpInfo` instead */ - public function getCatalogCategoryBulkCreateJobsWithHttpInfo(...$args) { - return $this->getCreateCategoriesJobsWithHttpInfo(...$args); + public function getUpdateItemsJobsWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobsWithHttpInfo(...$args); } /** - * Operation getCreateCategoriesJobsAsync + * Alias of `getBulkUpdateCatalogItemsJobsWithHttpInfo` * - * Get Create Categories Jobs + * @deprecated use `getBulkUpdateCatalogItemsJobsWithHttpInfo` instead + */ + public function getCatalogItemBulkUpdateJobsWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobsWithHttpInfo(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJobsAsync + * + * Get Bulk Update Catalog Items Jobs * - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateCategoriesJobsAsync($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobsAsync($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getCreateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey) + return $this->getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -8515,30 +9679,39 @@ function ($response) { } /** - * Alias of `getCreateCategoriesJobsAsync` + * Alias of `getBulkUpdateCatalogItemsJobsAsync` * - * @deprecated use `getCreateCategoriesJobsAsync` instead + * @deprecated use `getBulkUpdateCatalogItemsJobsAsync` instead */ - public function getCatalogCategoryBulkCreateJobsAsync(...$args) { - return $this->getCreateCategoriesJobsAsync(...$args); + public function getUpdateItemsJobsAsync(...$args) { + return $this->getBulkUpdateCatalogItemsJobsAsync(...$args); } /** - * Operation getCreateCategoriesJobsAsyncWithHttpInfo + * Alias of `getBulkUpdateCatalogItemsJobsAsync` * - * Get Create Categories Jobs + * @deprecated use `getBulkUpdateCatalogItemsJobsAsync` instead + */ + public function getCatalogItemBulkUpdateJobsAsync(...$args) { + return $this->getBulkUpdateCatalogItemsJobsAsync(...$args); + } + + /** + * Operation getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo + * + * Get Bulk Update Catalog Items Jobs * - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCreateCategoriesJobsRequest($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getBulkUpdateCatalogItemsJobsRequest($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8582,28 +9755,37 @@ function ($exception) { } /** - * Alias of `getCreateCategoriesJobsAsyncWithHttpInfo` + * Alias of `getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo` * - * @deprecated use `getCreateCategoriesJobsAsyncWithHttpInfo` instead + * @deprecated use `getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo` instead */ - public function getCatalogCategoryBulkCreateJobsAsyncWithHttpInfo(...$args) { - return $this->getCreateCategoriesJobsAsyncWithHttpInfo(...$args); + public function getUpdateItemsJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getCreateCategoriesJobs' + * Alias of `getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo` + * + * @deprecated use `getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo` instead + */ + public function getCatalogItemBulkUpdateJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkUpdateCatalogItemsJobsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkUpdateCatalogItemsJobs' * - * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCreateCategoriesJobsRequest($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getBulkUpdateCatalogItemsJobsRequest($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $resourcePath = '/api/catalog-category-bulk-create-jobs/'; + $resourcePath = '/api/catalog-item-bulk-update-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8612,8 +9794,8 @@ public function getCreateCategoriesJobsRequest($fields_catalog_category_bulk_cre // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category_bulk_create_job, - 'fields[catalog-category-bulk-create-job]', // param base name + $fields_catalog_item_bulk_update_job, + 'fields[catalog-item-bulk-update-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -8643,11 +9825,11 @@ public function getCreateCategoriesJobsRequest($fields_catalog_category_bulk_cre if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -8668,7 +9850,7 @@ public function getCreateCategoriesJobsRequest($fields_catalog_category_bulk_cre // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8692,7 +9874,7 @@ public function getCreateCategoriesJobsRequest($fields_catalog_category_bulk_cre $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8710,60 +9892,60 @@ public function getCreateCategoriesJobsRequest($fields_catalog_category_bulk_cre } /** - * Alias of `getCreateCategoriesJobsRequest` + * Alias of `getBulkUpdateCatalogItemsJobsRequest` * - * @deprecated use `getCreateCategoriesJobsRequest` instead + * @deprecated use `getBulkUpdateCatalogItemsJobsRequest` instead */ - public function getCatalogCategoryBulkCreateJobsRequest(...$args) { - return $this->getCreateCategoriesJobsRequest(...$args); + public function getUpdateItemsJobsRequest(...$args) { + return $this->getBulkUpdateCatalogItemsJobsRequest(...$args); + } + + /** + * Alias of `getBulkUpdateCatalogItemsJobsRequest` + * + * @deprecated use `getBulkUpdateCatalogItemsJobsRequest` instead + */ + public function getCatalogItemBulkUpdateJobsRequest(...$args) { + return $this->getBulkUpdateCatalogItemsJobsRequest(...$args); } /** - * Operation getCreateItemsJob + * Operation getCatalogCategories * - * Get Create Items Job + * Get Catalog Categories * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCreateItemsJob($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getCatalogCategories($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getCreateItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey); + list($response) = $this->getCatalogCategoriesWithHttpInfo($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `getCreateItemsJob` - * - * @deprecated use `getCreateItemsJob` instead - */ - public function getCatalogItemBulkCreateJob(...$args) { - return $this->getCreateItemsJob(...$args); - } - - /** - * Operation getCreateItemsJobWithHttpInfo + * Operation getCatalogCategoriesWithHttpInfo * - * Get Create Items Job + * Get Catalog Categories * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCreateItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getCatalogCategoriesWithHttpInfo($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey); + $request = $this->getCatalogCategoriesRequest($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -8919,30 +10101,21 @@ public function getCreateItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk } /** - * Alias of `getCreateItemsJobWithHttpInfo` - * - * @deprecated use `getCreateItemsJobWithHttpInfo` instead - */ - public function getCatalogItemBulkCreateJobWithHttpInfo(...$args) { - return $this->getCreateItemsJobWithHttpInfo(...$args); - } - - /** - * Operation getCreateItemsJobAsync + * Operation getCatalogCategoriesAsync * - * Get Create Items Job + * Get Catalog Categories * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateItemsJobAsync($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getCatalogCategoriesAsync($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getCreateItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey) + return $this->getCatalogCategoriesAsyncWithHttpInfo($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -8951,31 +10124,22 @@ function ($response) { } /** - * Alias of `getCreateItemsJobAsync` - * - * @deprecated use `getCreateItemsJobAsync` instead - */ - public function getCatalogItemBulkCreateJobAsync(...$args) { - return $this->getCreateItemsJobAsync(...$args); - } - - /** - * Operation getCreateItemsJobAsyncWithHttpInfo + * Operation getCatalogCategoriesAsyncWithHttpInfo * - * Get Create Items Job + * Get Catalog Categories * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getCatalogCategoriesAsyncWithHttpInfo($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_create_job, $fields_catalog_item, $include, $apiKey); + $request = $this->getCatalogCategoriesRequest($fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9019,35 +10183,20 @@ function ($exception) { } /** - * Alias of `getCreateItemsJobAsyncWithHttpInfo` - * - * @deprecated use `getCreateItemsJobAsyncWithHttpInfo` instead - */ - public function getCatalogItemBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->getCreateItemsJobAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'getCreateItemsJob' + * Create request for operation 'getCatalogCategories' * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_create_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getCatalogCategoriesRequest($fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'job_id' is set - if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getCreateItemsJob' - ); - } - $resourcePath = '/api/catalog-item-bulk-create-jobs/{job_id}/'; + $resourcePath = '/api/catalog-categories'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9056,8 +10205,8 @@ public function getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_crea // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item_bulk_create_job, - 'fields[catalog-item-bulk-create-job]', // param base name + $fields_catalog_category, + 'fields[catalog-category]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -9065,41 +10214,42 @@ public function getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_crea ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item, - 'fields[catalog-item]', // param base name - 'array', // openApiType + $filter, + 'filter', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode false // required ) ?? []); - // path params - if ($job_id !== null) { - $resourcePath = str_replace( - '{' . 'job_id' . '}', - ObjectSerializer::toPathValue($job_id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -9120,7 +10270,7 @@ public function getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_crea // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -9144,7 +10294,7 @@ public function getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_crea $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -9162,58 +10312,38 @@ public function getCreateItemsJobRequest($job_id, $fields_catalog_item_bulk_crea } /** - * Alias of `getCreateItemsJobRequest` - * - * @deprecated use `getCreateItemsJobRequest` instead - */ - public function getCatalogItemBulkCreateJobRequest(...$args) { - return $this->getCreateItemsJobRequest(...$args); - } - - /** - * Operation getCreateItemsJobs + * Operation getCatalogCategory * - * Get Create Items Jobs + * Get Catalog Category * - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCreateItemsJobs($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogCategory($id, $fields_catalog_category = null, $apiKey = null) { - list($response) = $this->getCreateItemsJobsWithHttpInfo($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getCatalogCategoryWithHttpInfo($id, $fields_catalog_category, $apiKey); return $response; } /** - * Alias of `getCreateItemsJobs` - * - * @deprecated use `getCreateItemsJobs` instead - */ - public function getCatalogItemBulkCreateJobs(...$args) { - return $this->getCreateItemsJobs(...$args); - } - - /** - * Operation getCreateItemsJobsWithHttpInfo + * Operation getCatalogCategoryWithHttpInfo * - * Get Create Items Jobs + * Get Catalog Category * - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCreateItemsJobsWithHttpInfo($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogCategoryWithHttpInfo($id, $fields_catalog_category = null, $apiKey = null) { - $request = $this->getCreateItemsJobsRequest($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getCatalogCategoryRequest($id, $fields_catalog_category, $apiKey); try { $options = $this->createHttpClientOption(); @@ -9369,29 +10499,19 @@ public function getCreateItemsJobsWithHttpInfo($fields_catalog_item_bulk_create_ } /** - * Alias of `getCreateItemsJobsWithHttpInfo` - * - * @deprecated use `getCreateItemsJobsWithHttpInfo` instead - */ - public function getCatalogItemBulkCreateJobsWithHttpInfo(...$args) { - return $this->getCreateItemsJobsWithHttpInfo(...$args); - } - - /** - * Operation getCreateItemsJobsAsync + * Operation getCatalogCategoryAsync * - * Get Create Items Jobs + * Get Catalog Category * - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateItemsJobsAsync($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogCategoryAsync($id, $fields_catalog_category = null, $apiKey = null) { - return $this->getCreateItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey) + return $this->getCatalogCategoryAsyncWithHttpInfo($id, $fields_catalog_category, $apiKey) ->then( function ($response) { return $response[0]; @@ -9400,30 +10520,20 @@ function ($response) { } /** - * Alias of `getCreateItemsJobsAsync` - * - * @deprecated use `getCreateItemsJobsAsync` instead - */ - public function getCatalogItemBulkCreateJobsAsync(...$args) { - return $this->getCreateItemsJobsAsync(...$args); - } - - /** - * Operation getCreateItemsJobsAsyncWithHttpInfo + * Operation getCatalogCategoryAsyncWithHttpInfo * - * Get Create Items Jobs + * Get Catalog Category * - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogCategoryAsyncWithHttpInfo($id, $fields_catalog_category = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCreateItemsJobsRequest($fields_catalog_item_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getCatalogCategoryRequest($id, $fields_catalog_category, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9467,28 +10577,24 @@ function ($exception) { } /** - * Alias of `getCreateItemsJobsAsyncWithHttpInfo` - * - * @deprecated use `getCreateItemsJobsAsyncWithHttpInfo` instead - */ - public function getCatalogItemBulkCreateJobsAsyncWithHttpInfo(...$args) { - return $this->getCreateItemsJobsAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'getCreateItemsJobs' + * Create request for operation 'getCatalogCategory' * - * @param string[] $fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCreateItemsJobsRequest($fields_catalog_item_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogCategoryRequest($id, $fields_catalog_category = null, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getCatalogCategory' + ); + } - $resourcePath = '/api/catalog-item-bulk-create-jobs/'; + $resourcePath = '/api/catalog-categories/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9497,42 +10603,32 @@ public function getCreateItemsJobsRequest($fields_catalog_item_bulk_create_job = // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item_bulk_create_job, - 'fields[catalog-item-bulk-create-job]', // param base name + $fields_catalog_category, + 'fields[catalog-category]', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -9553,7 +10649,7 @@ public function getCreateItemsJobsRequest($fields_catalog_item_bulk_create_job = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -9577,7 +10673,7 @@ public function getCreateItemsJobsRequest($fields_catalog_item_bulk_create_job = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -9595,60 +10691,42 @@ public function getCreateItemsJobsRequest($fields_catalog_item_bulk_create_job = } /** - * Alias of `getCreateItemsJobsRequest` - * - * @deprecated use `getCreateItemsJobsRequest` instead - */ - public function getCatalogItemBulkCreateJobsRequest(...$args) { - return $this->getCreateItemsJobsRequest(...$args); - } - - /** - * Operation getCreateVariantsJob + * Operation getCatalogItem * - * Get Create Variants Job + * Get Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCreateVariantsJob($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getCatalogItem($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - list($response) = $this->getCreateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey); + list($response) = $this->getCatalogItemWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey); return $response; } /** - * Alias of `getCreateVariantsJob` - * - * @deprecated use `getCreateVariantsJob` instead - */ - public function getCatalogVariantBulkCreateJob(...$args) { - return $this->getCreateVariantsJob(...$args); - } - - /** - * Operation getCreateVariantsJobWithHttpInfo + * Operation getCatalogItemWithHttpInfo * - * Get Create Variants Job + * Get Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCreateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getCatalogItemWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - $request = $this->getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey); + $request = $this->getCatalogItemRequest($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -9804,30 +10882,21 @@ public function getCreateVariantsJobWithHttpInfo($job_id, $fields_catalog_varian } /** - * Alias of `getCreateVariantsJobWithHttpInfo` - * - * @deprecated use `getCreateVariantsJobWithHttpInfo` instead - */ - public function getCatalogVariantBulkCreateJobWithHttpInfo(...$args) { - return $this->getCreateVariantsJobWithHttpInfo(...$args); - } - - /** - * Operation getCreateVariantsJobAsync + * Operation getCatalogItemAsync * - * Get Create Variants Job + * Get Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateVariantsJobAsync($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getCatalogItemAsync($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - return $this->getCreateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey) + return $this->getCatalogItemAsyncWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -9836,31 +10905,22 @@ function ($response) { } /** - * Alias of `getCreateVariantsJobAsync` - * - * @deprecated use `getCreateVariantsJobAsync` instead - */ - public function getCatalogVariantBulkCreateJobAsync(...$args) { - return $this->getCreateVariantsJobAsync(...$args); - } - - /** - * Operation getCreateVariantsJobAsyncWithHttpInfo + * Operation getCatalogItemAsyncWithHttpInfo * - * Get Create Variants Job + * Get Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getCatalogItemAsyncWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey); + $request = $this->getCatalogItemRequest($id, $fields_catalog_item, $fields_catalog_variant, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9904,35 +10964,26 @@ function ($exception) { } /** - * Alias of `getCreateVariantsJobAsyncWithHttpInfo` - * - * @deprecated use `getCreateVariantsJobAsyncWithHttpInfo` instead - */ - public function getCatalogVariantBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->getCreateVariantsJobAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'getCreateVariantsJob' + * Create request for operation 'getCatalogItem' * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getCatalogItemRequest($id, $fields_catalog_item = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - // verify the required parameter 'job_id' is set - if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getCreateVariantsJob' + 'Missing the required parameter $id when calling getCatalogItem' ); } - $resourcePath = '/api/catalog-variant-bulk-create-jobs/{job_id}/'; + $resourcePath = '/api/catalog-items/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9941,8 +10992,8 @@ public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bul // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant_bulk_create_job, - 'fields[catalog-variant-bulk-create-job]', // param base name + $fields_catalog_item, + 'fields[catalog-item]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -9969,10 +11020,10 @@ public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bul // path params - if ($job_id !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'job_id' . '}', - ObjectSerializer::toPathValue($job_id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -9980,11 +11031,11 @@ public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -10005,7 +11056,7 @@ public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -10029,7 +11080,7 @@ public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -10041,64 +11092,52 @@ public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bul return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Alias of `getCreateVariantsJobRequest` - * - * @deprecated use `getCreateVariantsJobRequest` instead - */ - public function getCatalogVariantBulkCreateJobRequest(...$args) { - return $this->getCreateVariantsJobRequest(...$args); + $headers, + $httpBody + ); } /** - * Operation getCreateVariantsJobs + * Operation getCatalogItems * - * Get Create Variants Jobs + * Get Catalog Items * - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCreateVariantsJobs($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogItems($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getCreateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getCatalogItemsWithHttpInfo($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `getCreateVariantsJobs` - * - * @deprecated use `getCreateVariantsJobs` instead - */ - public function getCatalogVariantBulkCreateJobs(...$args) { - return $this->getCreateVariantsJobs(...$args); - } - - /** - * Operation getCreateVariantsJobsWithHttpInfo + * Operation getCatalogItemsWithHttpInfo * - * Get Create Variants Jobs + * Get Catalog Items * - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCreateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogItemsWithHttpInfo($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getCatalogItemsRequest($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -10254,29 +11293,23 @@ public function getCreateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_c } /** - * Alias of `getCreateVariantsJobsWithHttpInfo` - * - * @deprecated use `getCreateVariantsJobsWithHttpInfo` instead - */ - public function getCatalogVariantBulkCreateJobsWithHttpInfo(...$args) { - return $this->getCreateVariantsJobsWithHttpInfo(...$args); - } - - /** - * Operation getCreateVariantsJobsAsync + * Operation getCatalogItemsAsync * - * Get Create Variants Jobs + * Get Catalog Items * - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateVariantsJobsAsync($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogItemsAsync($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getCreateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey) + return $this->getCatalogItemsAsyncWithHttpInfo($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -10285,30 +11318,24 @@ function ($response) { } /** - * Alias of `getCreateVariantsJobsAsync` - * - * @deprecated use `getCreateVariantsJobsAsync` instead - */ - public function getCatalogVariantBulkCreateJobsAsync(...$args) { - return $this->getCreateVariantsJobsAsync(...$args); - } - - /** - * Operation getCreateVariantsJobsAsyncWithHttpInfo + * Operation getCatalogItemsAsyncWithHttpInfo * - * Get Create Variants Jobs + * Get Catalog Items * - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCreateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogItemsAsyncWithHttpInfo($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getCatalogItemsRequest($fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10352,28 +11379,22 @@ function ($exception) { } /** - * Alias of `getCreateVariantsJobsAsyncWithHttpInfo` - * - * @deprecated use `getCreateVariantsJobsAsyncWithHttpInfo` instead - */ - public function getCatalogVariantBulkCreateJobsAsyncWithHttpInfo(...$args) { - return $this->getCreateVariantsJobsAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'getCreateVariantsJobs' + * Create request for operation 'getCatalogItems' * - * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogItemsRequest($fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $resourcePath = '/api/catalog-variant-bulk-create-jobs/'; + $resourcePath = '/api/catalog-items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10382,8 +11403,17 @@ public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant_bulk_create_job, - 'fields[catalog-variant-bulk-create-job]', // param base name + $fields_catalog_item, + 'fields[catalog-item]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_variant, + 'fields[catalog-variant]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -10399,6 +11429,15 @@ public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, 'page[cursor]', // param base name @@ -10407,17 +11446,26 @@ public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -10438,7 +11486,7 @@ public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -10462,7 +11510,7 @@ public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -10480,56 +11528,38 @@ public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create } /** - * Alias of `getCreateVariantsJobsRequest` - * - * @deprecated use `getCreateVariantsJobsRequest` instead - */ - public function getCatalogVariantBulkCreateJobsRequest(...$args) { - return $this->getCreateVariantsJobsRequest(...$args); - } - - /** - * Operation getDeleteCategoriesJob + * Operation getCatalogVariant * - * Get Delete Categories Job + * Get Catalog Variant * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getDeleteCategoriesJob($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) + public function getCatalogVariant($id, $fields_catalog_variant = null, $apiKey = null) { - list($response) = $this->getDeleteCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job, $apiKey); + list($response) = $this->getCatalogVariantWithHttpInfo($id, $fields_catalog_variant, $apiKey); return $response; } /** - * Alias of `getDeleteCategoriesJob` - * - * @deprecated use `getDeleteCategoriesJob` instead - */ - public function getCatalogCategoryBulkDeleteJob(...$args) { - return $this->getDeleteCategoriesJob(...$args); - } - - /** - * Operation getDeleteCategoriesJobWithHttpInfo + * Operation getCatalogVariantWithHttpInfo * - * Get Delete Categories Job + * Get Catalog Variant * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getDeleteCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) + public function getCatalogVariantWithHttpInfo($id, $fields_catalog_variant = null, $apiKey = null) { - $request = $this->getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_bulk_delete_job, $apiKey); + $request = $this->getCatalogVariantRequest($id, $fields_catalog_variant, $apiKey); try { $options = $this->createHttpClientOption(); @@ -10685,28 +11715,19 @@ public function getDeleteCategoriesJobWithHttpInfo($job_id, $fields_catalog_cate } /** - * Alias of `getDeleteCategoriesJobWithHttpInfo` - * - * @deprecated use `getDeleteCategoriesJobWithHttpInfo` instead - */ - public function getCatalogCategoryBulkDeleteJobWithHttpInfo(...$args) { - return $this->getDeleteCategoriesJobWithHttpInfo(...$args); - } - - /** - * Operation getDeleteCategoriesJobAsync + * Operation getCatalogVariantAsync * - * Get Delete Categories Job + * Get Catalog Variant * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteCategoriesJobAsync($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) + public function getCatalogVariantAsync($id, $fields_catalog_variant = null, $apiKey = null) { - return $this->getDeleteCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job, $apiKey) + return $this->getCatalogVariantAsyncWithHttpInfo($id, $fields_catalog_variant, $apiKey) ->then( function ($response) { return $response[0]; @@ -10715,29 +11736,20 @@ function ($response) { } /** - * Alias of `getDeleteCategoriesJobAsync` - * - * @deprecated use `getDeleteCategoriesJobAsync` instead - */ - public function getCatalogCategoryBulkDeleteJobAsync(...$args) { - return $this->getDeleteCategoriesJobAsync(...$args); - } - - /** - * Operation getDeleteCategoriesJobAsyncWithHttpInfo + * Operation getCatalogVariantAsyncWithHttpInfo * - * Get Delete Categories Job + * Get Catalog Variant * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) + public function getCatalogVariantAsyncWithHttpInfo($id, $fields_catalog_variant = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_bulk_delete_job, $apiKey); + $request = $this->getCatalogVariantRequest($id, $fields_catalog_variant, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10781,33 +11793,24 @@ function ($exception) { } /** - * Alias of `getDeleteCategoriesJobAsyncWithHttpInfo` - * - * @deprecated use `getDeleteCategoriesJobAsyncWithHttpInfo` instead - */ - public function getCatalogCategoryBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->getDeleteCategoriesJobAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'getDeleteCategoriesJob' + * Create request for operation 'getCatalogVariant' * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) + public function getCatalogVariantRequest($id, $fields_catalog_variant = null, $apiKey = null) { - // verify the required parameter 'job_id' is set - if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getDeleteCategoriesJob' + 'Missing the required parameter $id when calling getCatalogVariant' ); } - $resourcePath = '/api/catalog-category-bulk-delete-jobs/{job_id}/'; + $resourcePath = '/api/catalog-variants/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10816,8 +11819,8 @@ public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_ // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category_bulk_delete_job, - 'fields[catalog-category-bulk-delete-job]', // param base name + $fields_catalog_variant, + 'fields[catalog-variant]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -10826,10 +11829,10 @@ public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_ // path params - if ($job_id !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'job_id' . '}', - ObjectSerializer::toPathValue($job_id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -10837,11 +11840,11 @@ public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -10862,7 +11865,7 @@ public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -10886,7 +11889,7 @@ public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -10904,58 +11907,42 @@ public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_ } /** - * Alias of `getDeleteCategoriesJobRequest` - * - * @deprecated use `getDeleteCategoriesJobRequest` instead - */ - public function getCatalogCategoryBulkDeleteJobRequest(...$args) { - return $this->getDeleteCategoriesJobRequest(...$args); - } - - /** - * Operation getDeleteCategoriesJobs + * Operation getCatalogVariants * - * Get Delete Categories Jobs + * Get Catalog Variants * - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getDeleteCategoriesJobs($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogVariants($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getDeleteCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getCatalogVariantsWithHttpInfo($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `getDeleteCategoriesJobs` - * - * @deprecated use `getDeleteCategoriesJobs` instead - */ - public function getCatalogCategoryBulkDeleteJobs(...$args) { - return $this->getDeleteCategoriesJobs(...$args); - } - - /** - * Operation getDeleteCategoriesJobsWithHttpInfo + * Operation getCatalogVariantsWithHttpInfo * - * Get Delete Categories Jobs + * Get Catalog Variants * - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getDeleteCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogVariantsWithHttpInfo($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey); + $request = $this->getCatalogVariantsRequest($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -11111,29 +12098,21 @@ public function getDeleteCategoriesJobsWithHttpInfo($fields_catalog_category_bul } /** - * Alias of `getDeleteCategoriesJobsWithHttpInfo` - * - * @deprecated use `getDeleteCategoriesJobsWithHttpInfo` instead - */ - public function getCatalogCategoryBulkDeleteJobsWithHttpInfo(...$args) { - return $this->getDeleteCategoriesJobsWithHttpInfo(...$args); - } - - /** - * Operation getDeleteCategoriesJobsAsync + * Operation getCatalogVariantsAsync * - * Get Delete Categories Jobs + * Get Catalog Variants * - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteCategoriesJobsAsync($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogVariantsAsync($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getDeleteCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey) + return $this->getCatalogVariantsAsyncWithHttpInfo($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -11142,30 +12121,22 @@ function ($response) { } /** - * Alias of `getDeleteCategoriesJobsAsync` - * - * @deprecated use `getDeleteCategoriesJobsAsync` instead - */ - public function getCatalogCategoryBulkDeleteJobsAsync(...$args) { - return $this->getDeleteCategoriesJobsAsync(...$args); - } - - /** - * Operation getDeleteCategoriesJobsAsyncWithHttpInfo + * Operation getCatalogVariantsAsyncWithHttpInfo * - * Get Delete Categories Jobs + * Get Catalog Variants * - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogVariantsAsyncWithHttpInfo($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey); + $request = $this->getCatalogVariantsRequest($fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11209,28 +12180,20 @@ function ($exception) { } /** - * Alias of `getDeleteCategoriesJobsAsyncWithHttpInfo` - * - * @deprecated use `getDeleteCategoriesJobsAsyncWithHttpInfo` instead - */ - public function getCatalogCategoryBulkDeleteJobsAsyncWithHttpInfo(...$args) { - return $this->getDeleteCategoriesJobsAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'getDeleteCategoriesJobs' + * Create request for operation 'getCatalogVariants' * - * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCatalogVariantsRequest($fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $resourcePath = '/api/catalog-category-bulk-delete-jobs/'; + $resourcePath = '/api/catalog-variants'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11239,8 +12202,8 @@ public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_del // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category_bulk_delete_job, - 'fields[catalog-category-bulk-delete-job]', // param base name + $fields_catalog_variant, + 'fields[catalog-variant]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -11264,17 +12227,26 @@ public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_del true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -11295,7 +12267,7 @@ public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_del // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -11319,7 +12291,7 @@ public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_del $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -11337,56 +12309,53 @@ public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_del } /** - * Alias of `getDeleteCategoriesJobsRequest` - * - * @deprecated use `getDeleteCategoriesJobsRequest` instead - */ - public function getCatalogCategoryBulkDeleteJobsRequest(...$args) { - return $this->getDeleteCategoriesJobsRequest(...$args); - } - - /** - * Operation getDeleteItemsJob + * Operation getCategoriesForCatalogItem * - * Get Delete Items Job + * Get Categories for Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getDeleteItemsJob($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) + public function getCategoriesForCatalogItem($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getDeleteItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job, $apiKey); + list($response) = $this->getCategoriesForCatalogItemWithHttpInfo($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `getDeleteItemsJob` + * Alias of `getCategoriesForCatalogItem` * - * @deprecated use `getDeleteItemsJob` instead + * @deprecated use `getCategoriesForCatalogItem` instead */ - public function getCatalogItemBulkDeleteJob(...$args) { - return $this->getDeleteItemsJob(...$args); + public function getCatalogItemCategories(...$args) { + return $this->getCategoriesForCatalogItem(...$args); } /** - * Operation getDeleteItemsJobWithHttpInfo + * Operation getCategoriesForCatalogItemWithHttpInfo * - * Get Delete Items Job + * Get Categories for Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getDeleteItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) + public function getCategoriesForCatalogItemWithHttpInfo($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_delete_job, $apiKey); + $request = $this->getCategoriesForCatalogItemRequest($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -11542,28 +12511,31 @@ public function getDeleteItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk } /** - * Alias of `getDeleteItemsJobWithHttpInfo` + * Alias of `getCategoriesForCatalogItemWithHttpInfo` * - * @deprecated use `getDeleteItemsJobWithHttpInfo` instead + * @deprecated use `getCategoriesForCatalogItemWithHttpInfo` instead */ - public function getCatalogItemBulkDeleteJobWithHttpInfo(...$args) { - return $this->getDeleteItemsJobWithHttpInfo(...$args); + public function getCatalogItemCategoriesWithHttpInfo(...$args) { + return $this->getCategoriesForCatalogItemWithHttpInfo(...$args); } /** - * Operation getDeleteItemsJobAsync + * Operation getCategoriesForCatalogItemAsync * - * Get Delete Items Job + * Get Categories for Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteItemsJobAsync($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) + public function getCategoriesForCatalogItemAsync($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getDeleteItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job, $apiKey) + return $this->getCategoriesForCatalogItemAsyncWithHttpInfo($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -11572,29 +12544,32 @@ function ($response) { } /** - * Alias of `getDeleteItemsJobAsync` + * Alias of `getCategoriesForCatalogItemAsync` * - * @deprecated use `getDeleteItemsJobAsync` instead + * @deprecated use `getCategoriesForCatalogItemAsync` instead */ - public function getCatalogItemBulkDeleteJobAsync(...$args) { - return $this->getDeleteItemsJobAsync(...$args); + public function getCatalogItemCategoriesAsync(...$args) { + return $this->getCategoriesForCatalogItemAsync(...$args); } /** - * Operation getDeleteItemsJobAsyncWithHttpInfo + * Operation getCategoriesForCatalogItemAsyncWithHttpInfo * - * Get Delete Items Job + * Get Categories for Catalog Item * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) + public function getCategoriesForCatalogItemAsyncWithHttpInfo($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_delete_job, $apiKey); + $request = $this->getCategoriesForCatalogItemRequest($id, $fields_catalog_category, $filter, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11638,33 +12613,36 @@ function ($exception) { } /** - * Alias of `getDeleteItemsJobAsyncWithHttpInfo` + * Alias of `getCategoriesForCatalogItemAsyncWithHttpInfo` * - * @deprecated use `getDeleteItemsJobAsyncWithHttpInfo` instead + * @deprecated use `getCategoriesForCatalogItemAsyncWithHttpInfo` instead */ - public function getCatalogItemBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->getDeleteItemsJobAsyncWithHttpInfo(...$args); + public function getCatalogItemCategoriesAsyncWithHttpInfo(...$args) { + return $this->getCategoriesForCatalogItemAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getDeleteItemsJob' + * Create request for operation 'getCategoriesForCatalogItem' * - * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_delete_job = null, $apiKey = null) + public function getCategoriesForCatalogItemRequest($id, $fields_catalog_category = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'job_id' is set - if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getDeleteItemsJob' + 'Missing the required parameter $id when calling getCategoriesForCatalogItem' ); } - $resourcePath = '/api/catalog-item-bulk-delete-jobs/{job_id}/'; + $resourcePath = '/api/catalog-items/{id}/categories'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11673,20 +12651,47 @@ public function getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_dele // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item_bulk_delete_job, - 'fields[catalog-item-bulk-delete-job]', // param base name + $fields_catalog_category, + 'fields[catalog-category]', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params - if ($job_id !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'job_id' . '}', - ObjectSerializer::toPathValue($job_id), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -11694,11 +12699,11 @@ public function getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_dele if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -11719,7 +12724,7 @@ public function getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_dele // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -11743,7 +12748,7 @@ public function getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_dele $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -11761,58 +12766,56 @@ public function getDeleteItemsJobRequest($job_id, $fields_catalog_item_bulk_dele } /** - * Alias of `getDeleteItemsJobRequest` + * Alias of `getCategoriesForCatalogItemRequest` * - * @deprecated use `getDeleteItemsJobRequest` instead + * @deprecated use `getCategoriesForCatalogItemRequest` instead */ - public function getCatalogItemBulkDeleteJobRequest(...$args) { - return $this->getDeleteItemsJobRequest(...$args); + public function getCatalogItemCategoriesRequest(...$args) { + return $this->getCategoriesForCatalogItemRequest(...$args); } /** - * Operation getDeleteItemsJobs + * Operation getCategoryIdsForCatalogItem * - * Get Delete Items Jobs + * Get Category IDs for Catalog Item * - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getDeleteItemsJobs($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCategoryIdsForCatalogItem($id, $page_cursor = null, $apiKey = null) { - list($response) = $this->getDeleteItemsJobsWithHttpInfo($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getCategoryIdsForCatalogItemWithHttpInfo($id, $page_cursor, $apiKey); return $response; } /** - * Alias of `getDeleteItemsJobs` + * Alias of `getCategoryIdsForCatalogItem` * - * @deprecated use `getDeleteItemsJobs` instead + * @deprecated use `getCategoryIdsForCatalogItem` instead */ - public function getCatalogItemBulkDeleteJobs(...$args) { - return $this->getDeleteItemsJobs(...$args); + public function getCatalogItemRelationshipsCategories(...$args) { + return $this->getCategoryIdsForCatalogItem(...$args); } /** - * Operation getDeleteItemsJobsWithHttpInfo + * Operation getCategoryIdsForCatalogItemWithHttpInfo * - * Get Delete Items Jobs + * Get Category IDs for Catalog Item * - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getDeleteItemsJobsWithHttpInfo($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCategoryIdsForCatalogItemWithHttpInfo($id, $page_cursor = null, $apiKey = null) { - $request = $this->getDeleteItemsJobsRequest($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey); + $request = $this->getCategoryIdsForCatalogItemRequest($id, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -11968,29 +12971,28 @@ public function getDeleteItemsJobsWithHttpInfo($fields_catalog_item_bulk_delete_ } /** - * Alias of `getDeleteItemsJobsWithHttpInfo` + * Alias of `getCategoryIdsForCatalogItemWithHttpInfo` * - * @deprecated use `getDeleteItemsJobsWithHttpInfo` instead + * @deprecated use `getCategoryIdsForCatalogItemWithHttpInfo` instead */ - public function getCatalogItemBulkDeleteJobsWithHttpInfo(...$args) { - return $this->getDeleteItemsJobsWithHttpInfo(...$args); + public function getCatalogItemRelationshipsCategoriesWithHttpInfo(...$args) { + return $this->getCategoryIdsForCatalogItemWithHttpInfo(...$args); } /** - * Operation getDeleteItemsJobsAsync + * Operation getCategoryIdsForCatalogItemAsync * - * Get Delete Items Jobs + * Get Category IDs for Catalog Item * - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteItemsJobsAsync($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCategoryIdsForCatalogItemAsync($id, $page_cursor = null, $apiKey = null) { - return $this->getDeleteItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey) + return $this->getCategoryIdsForCatalogItemAsyncWithHttpInfo($id, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -11999,30 +13001,29 @@ function ($response) { } /** - * Alias of `getDeleteItemsJobsAsync` + * Alias of `getCategoryIdsForCatalogItemAsync` * - * @deprecated use `getDeleteItemsJobsAsync` instead + * @deprecated use `getCategoryIdsForCatalogItemAsync` instead */ - public function getCatalogItemBulkDeleteJobsAsync(...$args) { - return $this->getDeleteItemsJobsAsync(...$args); + public function getCatalogItemRelationshipsCategoriesAsync(...$args) { + return $this->getCategoryIdsForCatalogItemAsync(...$args); } /** - * Operation getDeleteItemsJobsAsyncWithHttpInfo + * Operation getCategoryIdsForCatalogItemAsyncWithHttpInfo * - * Get Delete Items Jobs + * Get Category IDs for Catalog Item * - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCategoryIdsForCatalogItemAsyncWithHttpInfo($id, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getDeleteItemsJobsRequest($fields_catalog_item_bulk_delete_job, $filter, $page_cursor, $apiKey); + $request = $this->getCategoryIdsForCatalogItemRequest($id, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12066,52 +13067,39 @@ function ($exception) { } /** - * Alias of `getDeleteItemsJobsAsyncWithHttpInfo` + * Alias of `getCategoryIdsForCatalogItemAsyncWithHttpInfo` * - * @deprecated use `getDeleteItemsJobsAsyncWithHttpInfo` instead + * @deprecated use `getCategoryIdsForCatalogItemAsyncWithHttpInfo` instead */ - public function getCatalogItemBulkDeleteJobsAsyncWithHttpInfo(...$args) { - return $this->getDeleteItemsJobsAsyncWithHttpInfo(...$args); + public function getCatalogItemRelationshipsCategoriesAsyncWithHttpInfo(...$args) { + return $this->getCategoryIdsForCatalogItemAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getDeleteItemsJobs' + * Create request for operation 'getCategoryIdsForCatalogItem' * - * @param string[] $fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeleteItemsJobsRequest($fields_catalog_item_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCategoryIdsForCatalogItemRequest($id, $page_cursor = null, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getCategoryIdsForCatalogItem' + ); + } - $resourcePath = '/api/catalog-item-bulk-delete-jobs/'; + $resourcePath = '/api/catalog-items/{id}/relationships/categories'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item_bulk_delete_job, - 'fields[catalog-item-bulk-delete-job]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, @@ -12123,15 +13111,23 @@ public function getDeleteItemsJobsRequest($fields_catalog_item_bulk_delete_job = ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -12152,7 +13148,7 @@ public function getDeleteItemsJobsRequest($fields_catalog_item_bulk_delete_job = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -12176,7 +13172,7 @@ public function getDeleteItemsJobsRequest($fields_catalog_item_bulk_delete_job = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -12194,56 +13190,60 @@ public function getDeleteItemsJobsRequest($fields_catalog_item_bulk_delete_job = } /** - * Alias of `getDeleteItemsJobsRequest` + * Alias of `getCategoryIdsForCatalogItemRequest` * - * @deprecated use `getDeleteItemsJobsRequest` instead + * @deprecated use `getCategoryIdsForCatalogItemRequest` instead */ - public function getCatalogItemBulkDeleteJobsRequest(...$args) { - return $this->getDeleteItemsJobsRequest(...$args); + public function getCatalogItemRelationshipsCategoriesRequest(...$args) { + return $this->getCategoryIdsForCatalogItemRequest(...$args); } /** - * Operation getDeleteVariantsJob + * Operation getCreateCategoriesJob * - * Get Delete Variants Job + * Get Create Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getDeleteVariantsJob($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) + public function getCreateCategoriesJob($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { - list($response) = $this->getDeleteVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey); + list($response) = $this->getCreateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey); return $response; } /** - * Alias of `getDeleteVariantsJob` + * Alias of `getCreateCategoriesJob` * - * @deprecated use `getDeleteVariantsJob` instead + * @deprecated use `getCreateCategoriesJob` instead */ - public function getCatalogVariantBulkDeleteJob(...$args) { - return $this->getDeleteVariantsJob(...$args); + public function getCatalogCategoryBulkCreateJob(...$args) { + return $this->getCreateCategoriesJob(...$args); } /** - * Operation getDeleteVariantsJobWithHttpInfo + * Operation getCreateCategoriesJobWithHttpInfo * - * Get Delete Variants Job + * Get Create Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getDeleteVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) + public function getCreateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { - $request = $this->getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey); + $request = $this->getCreateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -12399,28 +13399,30 @@ public function getDeleteVariantsJobWithHttpInfo($job_id, $fields_catalog_varian } /** - * Alias of `getDeleteVariantsJobWithHttpInfo` + * Alias of `getCreateCategoriesJobWithHttpInfo` * - * @deprecated use `getDeleteVariantsJobWithHttpInfo` instead + * @deprecated use `getCreateCategoriesJobWithHttpInfo` instead */ - public function getCatalogVariantBulkDeleteJobWithHttpInfo(...$args) { - return $this->getDeleteVariantsJobWithHttpInfo(...$args); + public function getCatalogCategoryBulkCreateJobWithHttpInfo(...$args) { + return $this->getCreateCategoriesJobWithHttpInfo(...$args); } /** - * Operation getDeleteVariantsJobAsync + * Operation getCreateCategoriesJobAsync * - * Get Delete Variants Job + * Get Create Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteVariantsJobAsync($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) + public function getCreateCategoriesJobAsync($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { - return $this->getDeleteVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey) + return $this->getCreateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -12429,29 +13431,31 @@ function ($response) { } /** - * Alias of `getDeleteVariantsJobAsync` + * Alias of `getCreateCategoriesJobAsync` * - * @deprecated use `getDeleteVariantsJobAsync` instead + * @deprecated use `getCreateCategoriesJobAsync` instead */ - public function getCatalogVariantBulkDeleteJobAsync(...$args) { - return $this->getDeleteVariantsJobAsync(...$args); + public function getCatalogCategoryBulkCreateJobAsync(...$args) { + return $this->getCreateCategoriesJobAsync(...$args); } /** - * Operation getDeleteVariantsJobAsyncWithHttpInfo + * Operation getCreateCategoriesJobAsyncWithHttpInfo * - * Get Delete Variants Job + * Get Create Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) + public function getCreateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey); + $request = $this->getCreateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_create_job, $fields_catalog_category, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12495,33 +13499,35 @@ function ($exception) { } /** - * Alias of `getDeleteVariantsJobAsyncWithHttpInfo` + * Alias of `getCreateCategoriesJobAsyncWithHttpInfo` * - * @deprecated use `getDeleteVariantsJobAsyncWithHttpInfo` instead + * @deprecated use `getCreateCategoriesJobAsyncWithHttpInfo` instead */ - public function getCatalogVariantBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->getDeleteVariantsJobAsyncWithHttpInfo(...$args); + public function getCatalogCategoryBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->getCreateCategoriesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getDeleteVariantsJob' + * Create request for operation 'getCreateCategoriesJob' * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) + public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { // verify the required parameter 'job_id' is set if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getDeleteVariantsJob' + 'Missing the required parameter $job_id when calling getCreateCategoriesJob' ); } - $resourcePath = '/api/catalog-variant-bulk-delete-jobs/{job_id}/'; + $resourcePath = '/api/catalog-category-bulk-create-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12530,8 +13536,26 @@ public function getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bul // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant_bulk_delete_job, - 'fields[catalog-variant-bulk-delete-job]', // param base name + $fields_catalog_category_bulk_create_job, + 'fields[catalog-category-bulk-create-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_category, + 'fields[catalog-category]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name 'array', // openApiType 'form', // style false, // explode @@ -12551,11 +13575,11 @@ public function getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -12576,7 +13600,7 @@ public function getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -12600,7 +13624,7 @@ public function getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -12618,58 +13642,58 @@ public function getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bul } /** - * Alias of `getDeleteVariantsJobRequest` + * Alias of `getCreateCategoriesJobRequest` * - * @deprecated use `getDeleteVariantsJobRequest` instead - */ - public function getCatalogVariantBulkDeleteJobRequest(...$args) { - return $this->getDeleteVariantsJobRequest(...$args); + * @deprecated use `getCreateCategoriesJobRequest` instead + */ + public function getCatalogCategoryBulkCreateJobRequest(...$args) { + return $this->getCreateCategoriesJobRequest(...$args); } /** - * Operation getDeleteVariantsJobs + * Operation getCreateCategoriesJobs * - * Get Delete Variants Jobs + * Get Create Categories Jobs * - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getDeleteVariantsJobs($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateCategoriesJobs($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getDeleteVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getCreateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `getDeleteVariantsJobs` + * Alias of `getCreateCategoriesJobs` * - * @deprecated use `getDeleteVariantsJobs` instead + * @deprecated use `getCreateCategoriesJobs` instead */ - public function getCatalogVariantBulkDeleteJobs(...$args) { - return $this->getDeleteVariantsJobs(...$args); + public function getCatalogCategoryBulkCreateJobs(...$args) { + return $this->getCreateCategoriesJobs(...$args); } /** - * Operation getDeleteVariantsJobsWithHttpInfo + * Operation getCreateCategoriesJobsWithHttpInfo * - * Get Delete Variants Jobs + * Get Create Categories Jobs * - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getDeleteVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey); + $request = $this->getCreateCategoriesJobsRequest($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -12825,29 +13849,29 @@ public function getDeleteVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_d } /** - * Alias of `getDeleteVariantsJobsWithHttpInfo` + * Alias of `getCreateCategoriesJobsWithHttpInfo` * - * @deprecated use `getDeleteVariantsJobsWithHttpInfo` instead + * @deprecated use `getCreateCategoriesJobsWithHttpInfo` instead */ - public function getCatalogVariantBulkDeleteJobsWithHttpInfo(...$args) { - return $this->getDeleteVariantsJobsWithHttpInfo(...$args); + public function getCatalogCategoryBulkCreateJobsWithHttpInfo(...$args) { + return $this->getCreateCategoriesJobsWithHttpInfo(...$args); } /** - * Operation getDeleteVariantsJobsAsync + * Operation getCreateCategoriesJobsAsync * - * Get Delete Variants Jobs + * Get Create Categories Jobs * - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteVariantsJobsAsync($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateCategoriesJobsAsync($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getDeleteVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey) + return $this->getCreateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -12856,30 +13880,30 @@ function ($response) { } /** - * Alias of `getDeleteVariantsJobsAsync` + * Alias of `getCreateCategoriesJobsAsync` * - * @deprecated use `getDeleteVariantsJobsAsync` instead + * @deprecated use `getCreateCategoriesJobsAsync` instead */ - public function getCatalogVariantBulkDeleteJobsAsync(...$args) { - return $this->getDeleteVariantsJobsAsync(...$args); + public function getCatalogCategoryBulkCreateJobsAsync(...$args) { + return $this->getCreateCategoriesJobsAsync(...$args); } /** - * Operation getDeleteVariantsJobsAsyncWithHttpInfo + * Operation getCreateCategoriesJobsAsyncWithHttpInfo * - * Get Delete Variants Jobs + * Get Create Categories Jobs * - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeleteVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey); + $request = $this->getCreateCategoriesJobsRequest($fields_catalog_category_bulk_create_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12923,28 +13947,28 @@ function ($exception) { } /** - * Alias of `getDeleteVariantsJobsAsyncWithHttpInfo` + * Alias of `getCreateCategoriesJobsAsyncWithHttpInfo` * - * @deprecated use `getDeleteVariantsJobsAsyncWithHttpInfo` instead + * @deprecated use `getCreateCategoriesJobsAsyncWithHttpInfo` instead */ - public function getCatalogVariantBulkDeleteJobsAsyncWithHttpInfo(...$args) { - return $this->getDeleteVariantsJobsAsyncWithHttpInfo(...$args); + public function getCatalogCategoryBulkCreateJobsAsyncWithHttpInfo(...$args) { + return $this->getCreateCategoriesJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getDeleteVariantsJobs' + * Create request for operation 'getCreateCategoriesJobs' * - * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateCategoriesJobsRequest($fields_catalog_category_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $resourcePath = '/api/catalog-variant-bulk-delete-jobs/'; + $resourcePath = '/api/catalog-category-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12953,8 +13977,8 @@ public function getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant_bulk_delete_job, - 'fields[catalog-variant-bulk-delete-job]', // param base name + $fields_catalog_category_bulk_create_job, + 'fields[catalog-category-bulk-create-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -12984,11 +14008,11 @@ public function getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -13009,7 +14033,7 @@ public function getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -13033,7 +14057,7 @@ public function getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -13051,60 +14075,60 @@ public function getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete } /** - * Alias of `getDeleteVariantsJobsRequest` + * Alias of `getCreateCategoriesJobsRequest` * - * @deprecated use `getDeleteVariantsJobsRequest` instead + * @deprecated use `getCreateCategoriesJobsRequest` instead */ - public function getCatalogVariantBulkDeleteJobsRequest(...$args) { - return $this->getDeleteVariantsJobsRequest(...$args); + public function getCatalogCategoryBulkCreateJobsRequest(...$args) { + return $this->getCreateCategoriesJobsRequest(...$args); } /** - * Operation getUpdateCategoriesJob + * Operation getCreateVariantsJob * - * Get Update Categories Job + * Get Create Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getUpdateCategoriesJob($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getCreateVariantsJob($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - list($response) = $this->getUpdateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey); + list($response) = $this->getCreateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey); return $response; } /** - * Alias of `getUpdateCategoriesJob` + * Alias of `getCreateVariantsJob` * - * @deprecated use `getUpdateCategoriesJob` instead + * @deprecated use `getCreateVariantsJob` instead */ - public function getCatalogCategoryBulkUpdateJob(...$args) { - return $this->getUpdateCategoriesJob(...$args); + public function getCatalogVariantBulkCreateJob(...$args) { + return $this->getCreateVariantsJob(...$args); } /** - * Operation getUpdateCategoriesJobWithHttpInfo + * Operation getCreateVariantsJobWithHttpInfo * - * Get Update Categories Job + * Get Create Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getUpdateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getCreateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - $request = $this->getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey); + $request = $this->getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -13260,30 +14284,30 @@ public function getUpdateCategoriesJobWithHttpInfo($job_id, $fields_catalog_cate } /** - * Alias of `getUpdateCategoriesJobWithHttpInfo` + * Alias of `getCreateVariantsJobWithHttpInfo` * - * @deprecated use `getUpdateCategoriesJobWithHttpInfo` instead + * @deprecated use `getCreateVariantsJobWithHttpInfo` instead */ - public function getCatalogCategoryBulkUpdateJobWithHttpInfo(...$args) { - return $this->getUpdateCategoriesJobWithHttpInfo(...$args); + public function getCatalogVariantBulkCreateJobWithHttpInfo(...$args) { + return $this->getCreateVariantsJobWithHttpInfo(...$args); } /** - * Operation getUpdateCategoriesJobAsync + * Operation getCreateVariantsJobAsync * - * Get Update Categories Job + * Get Create Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateCategoriesJobAsync($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getCreateVariantsJobAsync($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - return $this->getUpdateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey) + return $this->getCreateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -13292,31 +14316,31 @@ function ($response) { } /** - * Alias of `getUpdateCategoriesJobAsync` + * Alias of `getCreateVariantsJobAsync` * - * @deprecated use `getUpdateCategoriesJobAsync` instead + * @deprecated use `getCreateVariantsJobAsync` instead */ - public function getCatalogCategoryBulkUpdateJobAsync(...$args) { - return $this->getUpdateCategoriesJobAsync(...$args); + public function getCatalogVariantBulkCreateJobAsync(...$args) { + return $this->getCreateVariantsJobAsync(...$args); } /** - * Operation getUpdateCategoriesJobAsyncWithHttpInfo + * Operation getCreateVariantsJobAsyncWithHttpInfo * - * Get Update Categories Job + * Get Create Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getCreateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey); + $request = $this->getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_create_job, $fields_catalog_variant, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13360,35 +14384,35 @@ function ($exception) { } /** - * Alias of `getUpdateCategoriesJobAsyncWithHttpInfo` + * Alias of `getCreateVariantsJobAsyncWithHttpInfo` * - * @deprecated use `getUpdateCategoriesJobAsyncWithHttpInfo` instead + * @deprecated use `getCreateVariantsJobAsyncWithHttpInfo` instead */ - public function getCatalogCategoryBulkUpdateJobAsyncWithHttpInfo(...$args) { - return $this->getUpdateCategoriesJobAsyncWithHttpInfo(...$args); + public function getCatalogVariantBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->getCreateVariantsJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getUpdateCategoriesJob' + * Create request for operation 'getCreateVariantsJob' * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) + public function getCreateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_create_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { // verify the required parameter 'job_id' is set if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getUpdateCategoriesJob' + 'Missing the required parameter $job_id when calling getCreateVariantsJob' ); } - $resourcePath = '/api/catalog-category-bulk-update-jobs/{job_id}/'; + $resourcePath = '/api/catalog-variant-bulk-create-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13397,8 +14421,8 @@ public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_ // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category_bulk_update_job, - 'fields[catalog-category-bulk-update-job]', // param base name + $fields_catalog_variant_bulk_create_job, + 'fields[catalog-variant-bulk-create-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -13406,8 +14430,8 @@ public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_ ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category, - 'fields[catalog-category]', // param base name + $fields_catalog_variant, + 'fields[catalog-variant]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -13436,11 +14460,11 @@ public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -13461,7 +14485,7 @@ public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -13485,7 +14509,7 @@ public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -13503,58 +14527,58 @@ public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_ } /** - * Alias of `getUpdateCategoriesJobRequest` + * Alias of `getCreateVariantsJobRequest` * - * @deprecated use `getUpdateCategoriesJobRequest` instead + * @deprecated use `getCreateVariantsJobRequest` instead */ - public function getCatalogCategoryBulkUpdateJobRequest(...$args) { - return $this->getUpdateCategoriesJobRequest(...$args); + public function getCatalogVariantBulkCreateJobRequest(...$args) { + return $this->getCreateVariantsJobRequest(...$args); } /** - * Operation getUpdateCategoriesJobs + * Operation getCreateVariantsJobs * - * Get Update Categories Jobs + * Get Create Variants Jobs * - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getUpdateCategoriesJobs($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateVariantsJobs($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getUpdateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getCreateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `getUpdateCategoriesJobs` + * Alias of `getCreateVariantsJobs` * - * @deprecated use `getUpdateCategoriesJobs` instead + * @deprecated use `getCreateVariantsJobs` instead */ - public function getCatalogCategoryBulkUpdateJobs(...$args) { - return $this->getUpdateCategoriesJobs(...$args); + public function getCatalogVariantBulkCreateJobs(...$args) { + return $this->getCreateVariantsJobs(...$args); } /** - * Operation getUpdateCategoriesJobsWithHttpInfo + * Operation getCreateVariantsJobsWithHttpInfo * - * Get Update Categories Jobs + * Get Create Variants Jobs * - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getUpdateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey); + $request = $this->getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -13710,29 +14734,29 @@ public function getUpdateCategoriesJobsWithHttpInfo($fields_catalog_category_bul } /** - * Alias of `getUpdateCategoriesJobsWithHttpInfo` + * Alias of `getCreateVariantsJobsWithHttpInfo` * - * @deprecated use `getUpdateCategoriesJobsWithHttpInfo` instead + * @deprecated use `getCreateVariantsJobsWithHttpInfo` instead */ - public function getCatalogCategoryBulkUpdateJobsWithHttpInfo(...$args) { - return $this->getUpdateCategoriesJobsWithHttpInfo(...$args); + public function getCatalogVariantBulkCreateJobsWithHttpInfo(...$args) { + return $this->getCreateVariantsJobsWithHttpInfo(...$args); } /** - * Operation getUpdateCategoriesJobsAsync + * Operation getCreateVariantsJobsAsync * - * Get Update Categories Jobs + * Get Create Variants Jobs * - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateCategoriesJobsAsync($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateVariantsJobsAsync($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getUpdateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey) + return $this->getCreateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -13741,30 +14765,30 @@ function ($response) { } /** - * Alias of `getUpdateCategoriesJobsAsync` + * Alias of `getCreateVariantsJobsAsync` * - * @deprecated use `getUpdateCategoriesJobsAsync` instead + * @deprecated use `getCreateVariantsJobsAsync` instead */ - public function getCatalogCategoryBulkUpdateJobsAsync(...$args) { - return $this->getUpdateCategoriesJobsAsync(...$args); + public function getCatalogVariantBulkCreateJobsAsync(...$args) { + return $this->getCreateVariantsJobsAsync(...$args); } /** - * Operation getUpdateCategoriesJobsAsyncWithHttpInfo + * Operation getCreateVariantsJobsAsyncWithHttpInfo * - * Get Update Categories Jobs + * Get Create Variants Jobs * - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey); + $request = $this->getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13808,28 +14832,28 @@ function ($exception) { } /** - * Alias of `getUpdateCategoriesJobsAsyncWithHttpInfo` + * Alias of `getCreateVariantsJobsAsyncWithHttpInfo` * - * @deprecated use `getUpdateCategoriesJobsAsyncWithHttpInfo` instead + * @deprecated use `getCreateVariantsJobsAsyncWithHttpInfo` instead */ - public function getCatalogCategoryBulkUpdateJobsAsyncWithHttpInfo(...$args) { - return $this->getUpdateCategoriesJobsAsyncWithHttpInfo(...$args); + public function getCatalogVariantBulkCreateJobsAsyncWithHttpInfo(...$args) { + return $this->getCreateVariantsJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getUpdateCategoriesJobs' + * Create request for operation 'getCreateVariantsJobs' * - * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCreateVariantsJobsRequest($fields_catalog_variant_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $resourcePath = '/api/catalog-category-bulk-update-jobs/'; + $resourcePath = '/api/catalog-variant-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13838,8 +14862,8 @@ public function getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_upd // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_category_bulk_update_job, - 'fields[catalog-category-bulk-update-job]', // param base name + $fields_catalog_variant_bulk_create_job, + 'fields[catalog-variant-bulk-create-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -13869,11 +14893,11 @@ public function getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_upd if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -13894,7 +14918,7 @@ public function getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_upd // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -13918,7 +14942,7 @@ public function getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_upd $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -13936,60 +14960,56 @@ public function getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_upd } /** - * Alias of `getUpdateCategoriesJobsRequest` + * Alias of `getCreateVariantsJobsRequest` * - * @deprecated use `getUpdateCategoriesJobsRequest` instead + * @deprecated use `getCreateVariantsJobsRequest` instead */ - public function getCatalogCategoryBulkUpdateJobsRequest(...$args) { - return $this->getUpdateCategoriesJobsRequest(...$args); + public function getCatalogVariantBulkCreateJobsRequest(...$args) { + return $this->getCreateVariantsJobsRequest(...$args); } /** - * Operation getUpdateItemsJob + * Operation getDeleteCategoriesJob * - * Get Update Items Job + * Get Delete Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getUpdateItemsJob($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getDeleteCategoriesJob($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) { - list($response) = $this->getUpdateItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey); + list($response) = $this->getDeleteCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job, $apiKey); return $response; } /** - * Alias of `getUpdateItemsJob` + * Alias of `getDeleteCategoriesJob` * - * @deprecated use `getUpdateItemsJob` instead + * @deprecated use `getDeleteCategoriesJob` instead */ - public function getCatalogItemBulkUpdateJob(...$args) { - return $this->getUpdateItemsJob(...$args); + public function getCatalogCategoryBulkDeleteJob(...$args) { + return $this->getDeleteCategoriesJob(...$args); } /** - * Operation getUpdateItemsJobWithHttpInfo + * Operation getDeleteCategoriesJobWithHttpInfo * - * Get Update Items Job + * Get Delete Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getUpdateItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getDeleteCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) { - $request = $this->getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey); + $request = $this->getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_bulk_delete_job, $apiKey); try { $options = $this->createHttpClientOption(); @@ -14145,30 +15165,28 @@ public function getUpdateItemsJobWithHttpInfo($job_id, $fields_catalog_item_bulk } /** - * Alias of `getUpdateItemsJobWithHttpInfo` + * Alias of `getDeleteCategoriesJobWithHttpInfo` * - * @deprecated use `getUpdateItemsJobWithHttpInfo` instead + * @deprecated use `getDeleteCategoriesJobWithHttpInfo` instead */ - public function getCatalogItemBulkUpdateJobWithHttpInfo(...$args) { - return $this->getUpdateItemsJobWithHttpInfo(...$args); + public function getCatalogCategoryBulkDeleteJobWithHttpInfo(...$args) { + return $this->getDeleteCategoriesJobWithHttpInfo(...$args); } /** - * Operation getUpdateItemsJobAsync + * Operation getDeleteCategoriesJobAsync * - * Get Update Items Job + * Get Delete Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateItemsJobAsync($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getDeleteCategoriesJobAsync($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) { - return $this->getUpdateItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey) + return $this->getDeleteCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job, $apiKey) ->then( function ($response) { return $response[0]; @@ -14177,31 +15195,29 @@ function ($response) { } /** - * Alias of `getUpdateItemsJobAsync` + * Alias of `getDeleteCategoriesJobAsync` * - * @deprecated use `getUpdateItemsJobAsync` instead + * @deprecated use `getDeleteCategoriesJobAsync` instead */ - public function getCatalogItemBulkUpdateJobAsync(...$args) { - return $this->getUpdateItemsJobAsync(...$args); + public function getCatalogCategoryBulkDeleteJobAsync(...$args) { + return $this->getDeleteCategoriesJobAsync(...$args); } /** - * Operation getUpdateItemsJobAsyncWithHttpInfo + * Operation getDeleteCategoriesJobAsyncWithHttpInfo * - * Get Update Items Job + * Get Delete Categories Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateItemsJobAsyncWithHttpInfo($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getDeleteCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_update_job, $fields_catalog_item, $include, $apiKey); + $request = $this->getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_bulk_delete_job, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14245,35 +15261,33 @@ function ($exception) { } /** - * Alias of `getUpdateItemsJobAsyncWithHttpInfo` + * Alias of `getDeleteCategoriesJobAsyncWithHttpInfo` * - * @deprecated use `getUpdateItemsJobAsyncWithHttpInfo` instead + * @deprecated use `getDeleteCategoriesJobAsyncWithHttpInfo` instead */ - public function getCatalogItemBulkUpdateJobAsyncWithHttpInfo(...$args) { - return $this->getUpdateItemsJobAsyncWithHttpInfo(...$args); + public function getCatalogCategoryBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->getDeleteCategoriesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getUpdateItemsJob' + * Create request for operation 'getDeleteCategoriesJob' * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_update_job = null, $fields_catalog_item = null, $include = null, $apiKey = null) + public function getDeleteCategoriesJobRequest($job_id, $fields_catalog_category_bulk_delete_job = null, $apiKey = null) { // verify the required parameter 'job_id' is set if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getUpdateItemsJob' + 'Missing the required parameter $job_id when calling getDeleteCategoriesJob' ); } - $resourcePath = '/api/catalog-item-bulk-update-jobs/{job_id}/'; + $resourcePath = '/api/catalog-category-bulk-delete-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14282,26 +15296,8 @@ public function getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_upda // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item_bulk_update_job, - 'fields[catalog-item-bulk-update-job]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item, - 'fields[catalog-item]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name + $fields_catalog_category_bulk_delete_job, + 'fields[catalog-category-bulk-delete-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -14321,11 +15317,11 @@ public function getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_upda if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -14346,7 +15342,7 @@ public function getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_upda // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -14370,7 +15366,7 @@ public function getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_upda $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -14388,58 +15384,58 @@ public function getUpdateItemsJobRequest($job_id, $fields_catalog_item_bulk_upda } /** - * Alias of `getUpdateItemsJobRequest` + * Alias of `getDeleteCategoriesJobRequest` * - * @deprecated use `getUpdateItemsJobRequest` instead + * @deprecated use `getDeleteCategoriesJobRequest` instead */ - public function getCatalogItemBulkUpdateJobRequest(...$args) { - return $this->getUpdateItemsJobRequest(...$args); + public function getCatalogCategoryBulkDeleteJobRequest(...$args) { + return $this->getDeleteCategoriesJobRequest(...$args); } /** - * Operation getUpdateItemsJobs + * Operation getDeleteCategoriesJobs * - * Get Update Items Jobs + * Get Delete Categories Jobs * - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getUpdateItemsJobs($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteCategoriesJobs($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getUpdateItemsJobsWithHttpInfo($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getDeleteCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `getUpdateItemsJobs` + * Alias of `getDeleteCategoriesJobs` * - * @deprecated use `getUpdateItemsJobs` instead + * @deprecated use `getDeleteCategoriesJobs` instead */ - public function getCatalogItemBulkUpdateJobs(...$args) { - return $this->getUpdateItemsJobs(...$args); + public function getCatalogCategoryBulkDeleteJobs(...$args) { + return $this->getDeleteCategoriesJobs(...$args); } /** - * Operation getUpdateItemsJobsWithHttpInfo + * Operation getDeleteCategoriesJobsWithHttpInfo * - * Get Update Items Jobs + * Get Delete Categories Jobs * - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getUpdateItemsJobsWithHttpInfo($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey); + $request = $this->getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -14595,29 +15591,29 @@ public function getUpdateItemsJobsWithHttpInfo($fields_catalog_item_bulk_update_ } /** - * Alias of `getUpdateItemsJobsWithHttpInfo` + * Alias of `getDeleteCategoriesJobsWithHttpInfo` * - * @deprecated use `getUpdateItemsJobsWithHttpInfo` instead + * @deprecated use `getDeleteCategoriesJobsWithHttpInfo` instead */ - public function getCatalogItemBulkUpdateJobsWithHttpInfo(...$args) { - return $this->getUpdateItemsJobsWithHttpInfo(...$args); + public function getCatalogCategoryBulkDeleteJobsWithHttpInfo(...$args) { + return $this->getDeleteCategoriesJobsWithHttpInfo(...$args); } /** - * Operation getUpdateItemsJobsAsync + * Operation getDeleteCategoriesJobsAsync * - * Get Update Items Jobs + * Get Delete Categories Jobs * - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateItemsJobsAsync($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteCategoriesJobsAsync($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getUpdateItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey) + return $this->getDeleteCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -14626,30 +15622,30 @@ function ($response) { } /** - * Alias of `getUpdateItemsJobsAsync` + * Alias of `getDeleteCategoriesJobsAsync` * - * @deprecated use `getUpdateItemsJobsAsync` instead + * @deprecated use `getDeleteCategoriesJobsAsync` instead */ - public function getCatalogItemBulkUpdateJobsAsync(...$args) { - return $this->getUpdateItemsJobsAsync(...$args); + public function getCatalogCategoryBulkDeleteJobsAsync(...$args) { + return $this->getDeleteCategoriesJobsAsync(...$args); } /** - * Operation getUpdateItemsJobsAsyncWithHttpInfo + * Operation getDeleteCategoriesJobsAsyncWithHttpInfo * - * Get Update Items Jobs + * Get Delete Categories Jobs * - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateItemsJobsAsyncWithHttpInfo($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job, $filter, $page_cursor, $apiKey); + $request = $this->getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14693,28 +15689,28 @@ function ($exception) { } /** - * Alias of `getUpdateItemsJobsAsyncWithHttpInfo` + * Alias of `getDeleteCategoriesJobsAsyncWithHttpInfo` * - * @deprecated use `getUpdateItemsJobsAsyncWithHttpInfo` instead + * @deprecated use `getDeleteCategoriesJobsAsyncWithHttpInfo` instead */ - public function getCatalogItemBulkUpdateJobsAsyncWithHttpInfo(...$args) { - return $this->getUpdateItemsJobsAsyncWithHttpInfo(...$args); + public function getCatalogCategoryBulkDeleteJobsAsyncWithHttpInfo(...$args) { + return $this->getDeleteCategoriesJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getUpdateItemsJobs' + * Create request for operation 'getDeleteCategoriesJobs' * - * @param string[] $fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $resourcePath = '/api/catalog-item-bulk-update-jobs/'; + $resourcePath = '/api/catalog-category-bulk-delete-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14723,8 +15719,8 @@ public function getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job = // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_item_bulk_update_job, - 'fields[catalog-item-bulk-update-job]', // param base name + $fields_catalog_category_bulk_delete_job, + 'fields[catalog-category-bulk-delete-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -14754,11 +15750,11 @@ public function getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -14779,7 +15775,7 @@ public function getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -14803,7 +15799,7 @@ public function getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -14821,60 +15817,56 @@ public function getUpdateItemsJobsRequest($fields_catalog_item_bulk_update_job = } /** - * Alias of `getUpdateItemsJobsRequest` + * Alias of `getDeleteCategoriesJobsRequest` * - * @deprecated use `getUpdateItemsJobsRequest` instead + * @deprecated use `getDeleteCategoriesJobsRequest` instead */ - public function getCatalogItemBulkUpdateJobsRequest(...$args) { - return $this->getUpdateItemsJobsRequest(...$args); + public function getCatalogCategoryBulkDeleteJobsRequest(...$args) { + return $this->getDeleteCategoriesJobsRequest(...$args); } /** - * Operation getUpdateVariantsJob + * Operation getDeleteVariantsJob * - * Get Update Variants Job + * Get Delete Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getUpdateVariantsJob($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getDeleteVariantsJob($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) { - list($response) = $this->getUpdateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey); + list($response) = $this->getDeleteVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey); return $response; } /** - * Alias of `getUpdateVariantsJob` + * Alias of `getDeleteVariantsJob` * - * @deprecated use `getUpdateVariantsJob` instead + * @deprecated use `getDeleteVariantsJob` instead */ - public function getCatalogVariantBulkUpdateJob(...$args) { - return $this->getUpdateVariantsJob(...$args); + public function getCatalogVariantBulkDeleteJob(...$args) { + return $this->getDeleteVariantsJob(...$args); } /** - * Operation getUpdateVariantsJobWithHttpInfo + * Operation getDeleteVariantsJobWithHttpInfo * - * Get Update Variants Job + * Get Delete Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getUpdateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getDeleteVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) { - $request = $this->getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey); + $request = $this->getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey); try { $options = $this->createHttpClientOption(); @@ -15030,30 +16022,28 @@ public function getUpdateVariantsJobWithHttpInfo($job_id, $fields_catalog_varian } /** - * Alias of `getUpdateVariantsJobWithHttpInfo` + * Alias of `getDeleteVariantsJobWithHttpInfo` * - * @deprecated use `getUpdateVariantsJobWithHttpInfo` instead + * @deprecated use `getDeleteVariantsJobWithHttpInfo` instead */ - public function getCatalogVariantBulkUpdateJobWithHttpInfo(...$args) { - return $this->getUpdateVariantsJobWithHttpInfo(...$args); + public function getCatalogVariantBulkDeleteJobWithHttpInfo(...$args) { + return $this->getDeleteVariantsJobWithHttpInfo(...$args); } /** - * Operation getUpdateVariantsJobAsync + * Operation getDeleteVariantsJobAsync * - * Get Update Variants Job + * Get Delete Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateVariantsJobAsync($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getDeleteVariantsJobAsync($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) { - return $this->getUpdateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey) + return $this->getDeleteVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey) ->then( function ($response) { return $response[0]; @@ -15062,31 +16052,29 @@ function ($response) { } /** - * Alias of `getUpdateVariantsJobAsync` + * Alias of `getDeleteVariantsJobAsync` * - * @deprecated use `getUpdateVariantsJobAsync` instead + * @deprecated use `getDeleteVariantsJobAsync` instead */ - public function getCatalogVariantBulkUpdateJobAsync(...$args) { - return $this->getUpdateVariantsJobAsync(...$args); + public function getCatalogVariantBulkDeleteJobAsync(...$args) { + return $this->getDeleteVariantsJobAsync(...$args); } /** - * Operation getUpdateVariantsJobAsyncWithHttpInfo + * Operation getDeleteVariantsJobAsyncWithHttpInfo * - * Get Update Variants Job + * Get Delete Variants Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getDeleteVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey); + $request = $this->getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bulk_delete_job, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15130,35 +16118,33 @@ function ($exception) { } /** - * Alias of `getUpdateVariantsJobAsyncWithHttpInfo` + * Alias of `getDeleteVariantsJobAsyncWithHttpInfo` * - * @deprecated use `getUpdateVariantsJobAsyncWithHttpInfo` instead + * @deprecated use `getDeleteVariantsJobAsyncWithHttpInfo` instead */ - public function getCatalogVariantBulkUpdateJobAsyncWithHttpInfo(...$args) { - return $this->getUpdateVariantsJobAsyncWithHttpInfo(...$args); + public function getCatalogVariantBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->getDeleteVariantsJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getUpdateVariantsJob' + * Create request for operation 'getDeleteVariantsJob' * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) + public function getDeleteVariantsJobRequest($job_id, $fields_catalog_variant_bulk_delete_job = null, $apiKey = null) { // verify the required parameter 'job_id' is set if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getUpdateVariantsJob' + 'Missing the required parameter $job_id when calling getDeleteVariantsJob' ); } - $resourcePath = '/api/catalog-variant-bulk-update-jobs/{job_id}/'; + $resourcePath = '/api/catalog-variant-bulk-delete-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15167,26 +16153,8 @@ public function getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bul // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant_bulk_update_job, - 'fields[catalog-variant-bulk-update-job]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant, - 'fields[catalog-variant]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name + $fields_catalog_variant_bulk_delete_job, + 'fields[catalog-variant-bulk-delete-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -15206,11 +16174,11 @@ public function getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -15231,7 +16199,7 @@ public function getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -15255,7 +16223,7 @@ public function getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -15273,58 +16241,58 @@ public function getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bul } /** - * Alias of `getUpdateVariantsJobRequest` + * Alias of `getDeleteVariantsJobRequest` * - * @deprecated use `getUpdateVariantsJobRequest` instead + * @deprecated use `getDeleteVariantsJobRequest` instead */ - public function getCatalogVariantBulkUpdateJobRequest(...$args) { - return $this->getUpdateVariantsJobRequest(...$args); + public function getCatalogVariantBulkDeleteJobRequest(...$args) { + return $this->getDeleteVariantsJobRequest(...$args); } /** - * Operation getUpdateVariantsJobs + * Operation getDeleteVariantsJobs * - * Get Update Variants Jobs + * Get Delete Variants Jobs * - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getUpdateVariantsJobs($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteVariantsJobs($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getUpdateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getDeleteVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `getUpdateVariantsJobs` + * Alias of `getDeleteVariantsJobs` * - * @deprecated use `getUpdateVariantsJobs` instead + * @deprecated use `getDeleteVariantsJobs` instead */ - public function getCatalogVariantBulkUpdateJobs(...$args) { - return $this->getUpdateVariantsJobs(...$args); + public function getCatalogVariantBulkDeleteJobs(...$args) { + return $this->getDeleteVariantsJobs(...$args); } /** - * Operation getUpdateVariantsJobsWithHttpInfo + * Operation getDeleteVariantsJobsWithHttpInfo * - * Get Update Variants Jobs + * Get Delete Variants Jobs * - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getUpdateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey); + $request = $this->getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -15480,29 +16448,29 @@ public function getUpdateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_u } /** - * Alias of `getUpdateVariantsJobsWithHttpInfo` + * Alias of `getDeleteVariantsJobsWithHttpInfo` * - * @deprecated use `getUpdateVariantsJobsWithHttpInfo` instead + * @deprecated use `getDeleteVariantsJobsWithHttpInfo` instead */ - public function getCatalogVariantBulkUpdateJobsWithHttpInfo(...$args) { - return $this->getUpdateVariantsJobsWithHttpInfo(...$args); + public function getCatalogVariantBulkDeleteJobsWithHttpInfo(...$args) { + return $this->getDeleteVariantsJobsWithHttpInfo(...$args); } /** - * Operation getUpdateVariantsJobsAsync + * Operation getDeleteVariantsJobsAsync * - * Get Update Variants Jobs + * Get Delete Variants Jobs * - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateVariantsJobsAsync($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteVariantsJobsAsync($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getUpdateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey) + return $this->getDeleteVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -15511,30 +16479,30 @@ function ($response) { } /** - * Alias of `getUpdateVariantsJobsAsync` + * Alias of `getDeleteVariantsJobsAsync` * - * @deprecated use `getUpdateVariantsJobsAsync` instead + * @deprecated use `getDeleteVariantsJobsAsync` instead */ - public function getCatalogVariantBulkUpdateJobsAsync(...$args) { - return $this->getUpdateVariantsJobsAsync(...$args); + public function getCatalogVariantBulkDeleteJobsAsync(...$args) { + return $this->getDeleteVariantsJobsAsync(...$args); } /** - * Operation getUpdateVariantsJobsAsyncWithHttpInfo + * Operation getDeleteVariantsJobsAsyncWithHttpInfo * - * Get Update Variants Jobs + * Get Delete Variants Jobs * - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUpdateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey); + $request = $this->getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15578,28 +16546,28 @@ function ($exception) { } /** - * Alias of `getUpdateVariantsJobsAsyncWithHttpInfo` + * Alias of `getDeleteVariantsJobsAsyncWithHttpInfo` * - * @deprecated use `getUpdateVariantsJobsAsyncWithHttpInfo` instead + * @deprecated use `getDeleteVariantsJobsAsyncWithHttpInfo` instead */ - public function getCatalogVariantBulkUpdateJobsAsyncWithHttpInfo(...$args) { - return $this->getUpdateVariantsJobsAsyncWithHttpInfo(...$args); + public function getCatalogVariantBulkDeleteJobsAsyncWithHttpInfo(...$args) { + return $this->getDeleteVariantsJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getUpdateVariantsJobs' + * Create request for operation 'getDeleteVariantsJobs' * - * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getDeleteVariantsJobsRequest($fields_catalog_variant_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $resourcePath = '/api/catalog-variant-bulk-update-jobs/'; + $resourcePath = '/api/catalog-variant-bulk-delete-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15608,8 +16576,8 @@ public function getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_catalog_variant_bulk_update_job, - 'fields[catalog-variant-bulk-update-job]', // param base name + $fields_catalog_variant_bulk_delete_job, + 'fields[catalog-variant-bulk-delete-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -15639,11 +16607,11 @@ public function getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -15664,7 +16632,7 @@ public function getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -15688,7 +16656,7 @@ public function getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -15706,54 +16674,56 @@ public function getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update } /** - * Alias of `getUpdateVariantsJobsRequest` + * Alias of `getDeleteVariantsJobsRequest` * - * @deprecated use `getUpdateVariantsJobsRequest` instead + * @deprecated use `getDeleteVariantsJobsRequest` instead */ - public function getCatalogVariantBulkUpdateJobsRequest(...$args) { - return $this->getUpdateVariantsJobsRequest(...$args); + public function getCatalogVariantBulkDeleteJobsRequest(...$args) { + return $this->getDeleteVariantsJobsRequest(...$args); } /** - * Operation spawnCreateCategoriesJob + * Operation getItemIdsForCatalogCategory * - * Spawn Create Categories Job + * Get Item IDs for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query catalog_category_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnCreateCategoriesJob($catalog_category_create_job_create_query, $apiKey = null) + public function getItemIdsForCatalogCategory($id, $page_cursor = null, $apiKey = null) { - list($response) = $this->spawnCreateCategoriesJobWithHttpInfo($catalog_category_create_job_create_query, $apiKey); + list($response) = $this->getItemIdsForCatalogCategoryWithHttpInfo($id, $page_cursor, $apiKey); return $response; } /** - * Alias of `spawnCreateCategoriesJob` + * Alias of `getItemIdsForCatalogCategory` * - * @deprecated use `spawnCreateCategoriesJob` instead + * @deprecated use `getItemIdsForCatalogCategory` instead */ - public function createCatalogCategoryBulkCreateJob(...$args) { - return $this->spawnCreateCategoriesJob(...$args); + public function getCatalogCategoryRelationshipsItems(...$args) { + return $this->getItemIdsForCatalogCategory(...$args); } /** - * Operation spawnCreateCategoriesJobWithHttpInfo + * Operation getItemIdsForCatalogCategoryWithHttpInfo * - * Spawn Create Categories Job + * Get Item IDs for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnCreateCategoriesJobWithHttpInfo($catalog_category_create_job_create_query, $apiKey = null) + public function getItemIdsForCatalogCategoryWithHttpInfo($id, $page_cursor = null, $apiKey = null) { - $request = $this->spawnCreateCategoriesJobRequest($catalog_category_create_job_create_query, $apiKey); + $request = $this->getItemIdsForCatalogCategoryRequest($id, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -15791,7 +16761,7 @@ public function spawnCreateCategoriesJobWithHttpInfo($catalog_category_create_jo } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -15879,7 +16849,7 @@ public function spawnCreateCategoriesJobWithHttpInfo($catalog_category_create_jo } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -15909,27 +16879,28 @@ public function spawnCreateCategoriesJobWithHttpInfo($catalog_category_create_jo } /** - * Alias of `spawnCreateCategoriesJobWithHttpInfo` + * Alias of `getItemIdsForCatalogCategoryWithHttpInfo` * - * @deprecated use `spawnCreateCategoriesJobWithHttpInfo` instead + * @deprecated use `getItemIdsForCatalogCategoryWithHttpInfo` instead */ - public function createCatalogCategoryBulkCreateJobWithHttpInfo(...$args) { - return $this->spawnCreateCategoriesJobWithHttpInfo(...$args); + public function getCatalogCategoryRelationshipsItemsWithHttpInfo(...$args) { + return $this->getItemIdsForCatalogCategoryWithHttpInfo(...$args); } /** - * Operation spawnCreateCategoriesJobAsync + * Operation getItemIdsForCatalogCategoryAsync * - * Spawn Create Categories Job + * Get Item IDs for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCreateCategoriesJobAsync($catalog_category_create_job_create_query, $apiKey = null) + public function getItemIdsForCatalogCategoryAsync($id, $page_cursor = null, $apiKey = null) { - return $this->spawnCreateCategoriesJobAsyncWithHttpInfo($catalog_category_create_job_create_query, $apiKey) + return $this->getItemIdsForCatalogCategoryAsyncWithHttpInfo($id, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -15938,28 +16909,29 @@ function ($response) { } /** - * Alias of `spawnCreateCategoriesJobAsync` + * Alias of `getItemIdsForCatalogCategoryAsync` * - * @deprecated use `spawnCreateCategoriesJobAsync` instead + * @deprecated use `getItemIdsForCatalogCategoryAsync` instead */ - public function createCatalogCategoryBulkCreateJobAsync(...$args) { - return $this->spawnCreateCategoriesJobAsync(...$args); + public function getCatalogCategoryRelationshipsItemsAsync(...$args) { + return $this->getItemIdsForCatalogCategoryAsync(...$args); } /** - * Operation spawnCreateCategoriesJobAsyncWithHttpInfo + * Operation getItemIdsForCatalogCategoryAsyncWithHttpInfo * - * Spawn Create Categories Job + * Get Item IDs for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCreateCategoriesJobAsyncWithHttpInfo($catalog_category_create_job_create_query, $apiKey = null) + public function getItemIdsForCatalogCategoryAsyncWithHttpInfo($id, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnCreateCategoriesJobRequest($catalog_category_create_job_create_query, $apiKey); + $request = $this->getItemIdsForCatalogCategoryRequest($id, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16003,61 +16975,73 @@ function ($exception) { } /** - * Alias of `spawnCreateCategoriesJobAsyncWithHttpInfo` + * Alias of `getItemIdsForCatalogCategoryAsyncWithHttpInfo` * - * @deprecated use `spawnCreateCategoriesJobAsyncWithHttpInfo` instead + * @deprecated use `getItemIdsForCatalogCategoryAsyncWithHttpInfo` instead */ - public function createCatalogCategoryBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->spawnCreateCategoriesJobAsyncWithHttpInfo(...$args); + public function getCatalogCategoryRelationshipsItemsAsyncWithHttpInfo(...$args) { + return $this->getItemIdsForCatalogCategoryAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnCreateCategoriesJob' + * Create request for operation 'getItemIdsForCatalogCategory' * - * @param \KlaviyoAPI\Model\CatalogCategoryCreateJobCreateQuery $catalog_category_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnCreateCategoriesJobRequest($catalog_category_create_job_create_query, $apiKey = null) + public function getItemIdsForCatalogCategoryRequest($id, $page_cursor = null, $apiKey = null) { - // verify the required parameter 'catalog_category_create_job_create_query' is set - if ($catalog_category_create_job_create_query === null || (is_array($catalog_category_create_job_create_query) && count($catalog_category_create_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_category_create_job_create_query when calling spawnCreateCategoriesJob' + 'Missing the required parameter $id when calling getItemIdsForCatalogCategory' ); } - $resourcePath = '/api/catalog-category-bulk-create-jobs/'; + $resourcePath = '/api/catalog-categories/{id}/relationships/items'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($catalog_category_create_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_create_job_create_query)); - } else { - $httpBody = $catalog_category_create_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -16072,7 +17056,7 @@ public function spawnCreateCategoriesJobRequest($catalog_category_create_job_cre // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -16096,7 +17080,7 @@ public function spawnCreateCategoriesJobRequest($catalog_category_create_job_cre $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -16106,7 +17090,7 @@ public function spawnCreateCategoriesJobRequest($catalog_category_create_job_cre $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -16114,54 +17098,66 @@ public function spawnCreateCategoriesJobRequest($catalog_category_create_job_cre } /** - * Alias of `spawnCreateCategoriesJobRequest` + * Alias of `getItemIdsForCatalogCategoryRequest` * - * @deprecated use `spawnCreateCategoriesJobRequest` instead + * @deprecated use `getItemIdsForCatalogCategoryRequest` instead */ - public function createCatalogCategoryBulkCreateJobRequest(...$args) { - return $this->spawnCreateCategoriesJobRequest(...$args); + public function getCatalogCategoryRelationshipsItemsRequest(...$args) { + return $this->getItemIdsForCatalogCategoryRequest(...$args); } /** - * Operation spawnCreateItemsJob + * Operation getItemsForCatalogCategory * - * Spawn Create Items Job + * Get Items for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query catalog_item_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnCreateItemsJob($catalog_item_create_job_create_query, $apiKey = null) + public function getItemsForCatalogCategory($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->spawnCreateItemsJobWithHttpInfo($catalog_item_create_job_create_query, $apiKey); + list($response) = $this->getItemsForCatalogCategoryWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `spawnCreateItemsJob` + * Alias of `getItemsForCatalogCategory` * - * @deprecated use `spawnCreateItemsJob` instead + * @deprecated use `getItemsForCatalogCategory` instead */ - public function createCatalogItemBulkCreateJob(...$args) { - return $this->spawnCreateItemsJob(...$args); + public function getCatalogCategoryItems(...$args) { + return $this->getItemsForCatalogCategory(...$args); } /** - * Operation spawnCreateItemsJobWithHttpInfo + * Operation getItemsForCatalogCategoryWithHttpInfo * - * Spawn Create Items Job + * Get Items for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnCreateItemsJobWithHttpInfo($catalog_item_create_job_create_query, $apiKey = null) + public function getItemsForCatalogCategoryWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->spawnCreateItemsJobRequest($catalog_item_create_job_create_query, $apiKey); + $request = $this->getItemsForCatalogCategoryRequest($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -16199,7 +17195,7 @@ public function spawnCreateItemsJobWithHttpInfo($catalog_item_create_job_create_ } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -16287,7 +17283,7 @@ public function spawnCreateItemsJobWithHttpInfo($catalog_item_create_job_create_ } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -16317,27 +17313,33 @@ public function spawnCreateItemsJobWithHttpInfo($catalog_item_create_job_create_ } /** - * Alias of `spawnCreateItemsJobWithHttpInfo` + * Alias of `getItemsForCatalogCategoryWithHttpInfo` * - * @deprecated use `spawnCreateItemsJobWithHttpInfo` instead + * @deprecated use `getItemsForCatalogCategoryWithHttpInfo` instead */ - public function createCatalogItemBulkCreateJobWithHttpInfo(...$args) { - return $this->spawnCreateItemsJobWithHttpInfo(...$args); + public function getCatalogCategoryItemsWithHttpInfo(...$args) { + return $this->getItemsForCatalogCategoryWithHttpInfo(...$args); } /** - * Operation spawnCreateItemsJobAsync + * Operation getItemsForCatalogCategoryAsync * - * Spawn Create Items Job + * Get Items for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCreateItemsJobAsync($catalog_item_create_job_create_query, $apiKey = null) + public function getItemsForCatalogCategoryAsync($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->spawnCreateItemsJobAsyncWithHttpInfo($catalog_item_create_job_create_query, $apiKey) + return $this->getItemsForCatalogCategoryAsyncWithHttpInfo($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -16346,28 +17348,34 @@ function ($response) { } /** - * Alias of `spawnCreateItemsJobAsync` + * Alias of `getItemsForCatalogCategoryAsync` * - * @deprecated use `spawnCreateItemsJobAsync` instead + * @deprecated use `getItemsForCatalogCategoryAsync` instead */ - public function createCatalogItemBulkCreateJobAsync(...$args) { - return $this->spawnCreateItemsJobAsync(...$args); + public function getCatalogCategoryItemsAsync(...$args) { + return $this->getItemsForCatalogCategoryAsync(...$args); } /** - * Operation spawnCreateItemsJobAsyncWithHttpInfo + * Operation getItemsForCatalogCategoryAsyncWithHttpInfo * - * Spawn Create Items Job + * Get Items for Catalog Category * - * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCreateItemsJobAsyncWithHttpInfo($catalog_item_create_job_create_query, $apiKey = null) + public function getItemsForCatalogCategoryAsyncWithHttpInfo($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnCreateItemsJobRequest($catalog_item_create_job_create_query, $apiKey); + $request = $this->getItemsForCatalogCategoryRequest($id, $fields_catalog_item, $fields_catalog_variant, $filter, $include, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16411,61 +17419,123 @@ function ($exception) { } /** - * Alias of `spawnCreateItemsJobAsyncWithHttpInfo` + * Alias of `getItemsForCatalogCategoryAsyncWithHttpInfo` * - * @deprecated use `spawnCreateItemsJobAsyncWithHttpInfo` instead + * @deprecated use `getItemsForCatalogCategoryAsyncWithHttpInfo` instead */ - public function createCatalogItemBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->spawnCreateItemsJobAsyncWithHttpInfo(...$args); + public function getCatalogCategoryItemsAsyncWithHttpInfo(...$args) { + return $this->getItemsForCatalogCategoryAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnCreateItemsJob' + * Create request for operation 'getItemsForCatalogCategory' * - * @param \KlaviyoAPI\Model\CatalogItemCreateJobCreateQuery $catalog_item_create_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnCreateItemsJobRequest($catalog_item_create_job_create_query, $apiKey = null) + public function getItemsForCatalogCategoryRequest($id, $fields_catalog_item = null, $fields_catalog_variant = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'catalog_item_create_job_create_query' is set - if ($catalog_item_create_job_create_query === null || (is_array($catalog_item_create_job_create_query) && count($catalog_item_create_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_create_job_create_query when calling spawnCreateItemsJob' + 'Missing the required parameter $id when calling getItemsForCatalogCategory' ); } - $resourcePath = '/api/catalog-item-bulk-create-jobs/'; + $resourcePath = '/api/catalog-categories/{id}/items'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_item, + 'fields[catalog-item]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_variant, + 'fields[catalog-variant]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($catalog_item_create_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_create_job_create_query)); - } else { - $httpBody = $catalog_item_create_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -16480,7 +17550,7 @@ public function spawnCreateItemsJobRequest($catalog_item_create_job_create_query // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -16504,7 +17574,7 @@ public function spawnCreateItemsJobRequest($catalog_item_create_job_create_query $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -16514,7 +17584,7 @@ public function spawnCreateItemsJobRequest($catalog_item_create_job_create_query $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -16522,54 +17592,60 @@ public function spawnCreateItemsJobRequest($catalog_item_create_job_create_query } /** - * Alias of `spawnCreateItemsJobRequest` + * Alias of `getItemsForCatalogCategoryRequest` * - * @deprecated use `spawnCreateItemsJobRequest` instead + * @deprecated use `getItemsForCatalogCategoryRequest` instead */ - public function createCatalogItemBulkCreateJobRequest(...$args) { - return $this->spawnCreateItemsJobRequest(...$args); + public function getCatalogCategoryItemsRequest(...$args) { + return $this->getItemsForCatalogCategoryRequest(...$args); } /** - * Operation spawnCreateVariantsJob + * Operation getUpdateCategoriesJob * - * Spawn Create Variants Job + * Get Update Categories Job * - * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query catalog_variant_create_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnCreateVariantsJob($catalog_variant_create_job_create_query, $apiKey = null) + public function getUpdateCategoriesJob($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { - list($response) = $this->spawnCreateVariantsJobWithHttpInfo($catalog_variant_create_job_create_query, $apiKey); + list($response) = $this->getUpdateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey); return $response; } /** - * Alias of `spawnCreateVariantsJob` + * Alias of `getUpdateCategoriesJob` * - * @deprecated use `spawnCreateVariantsJob` instead + * @deprecated use `getUpdateCategoriesJob` instead */ - public function createCatalogVariantBulkCreateJob(...$args) { - return $this->spawnCreateVariantsJob(...$args); + public function getCatalogCategoryBulkUpdateJob(...$args) { + return $this->getUpdateCategoriesJob(...$args); } /** - * Operation spawnCreateVariantsJobWithHttpInfo + * Operation getUpdateCategoriesJobWithHttpInfo * - * Spawn Create Variants Job + * Get Update Categories Job * - * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnCreateVariantsJobWithHttpInfo($catalog_variant_create_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { - $request = $this->spawnCreateVariantsJobRequest($catalog_variant_create_job_create_query, $apiKey); + $request = $this->getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -16607,7 +17683,7 @@ public function spawnCreateVariantsJobWithHttpInfo($catalog_variant_create_job_c } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -16695,7 +17771,7 @@ public function spawnCreateVariantsJobWithHttpInfo($catalog_variant_create_job_c } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -16725,27 +17801,30 @@ public function spawnCreateVariantsJobWithHttpInfo($catalog_variant_create_job_c } /** - * Alias of `spawnCreateVariantsJobWithHttpInfo` + * Alias of `getUpdateCategoriesJobWithHttpInfo` * - * @deprecated use `spawnCreateVariantsJobWithHttpInfo` instead + * @deprecated use `getUpdateCategoriesJobWithHttpInfo` instead */ - public function createCatalogVariantBulkCreateJobWithHttpInfo(...$args) { - return $this->spawnCreateVariantsJobWithHttpInfo(...$args); + public function getCatalogCategoryBulkUpdateJobWithHttpInfo(...$args) { + return $this->getUpdateCategoriesJobWithHttpInfo(...$args); } /** - * Operation spawnCreateVariantsJobAsync + * Operation getUpdateCategoriesJobAsync * - * Spawn Create Variants Job + * Get Update Categories Job * - * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCreateVariantsJobAsync($catalog_variant_create_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobAsync($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { - return $this->spawnCreateVariantsJobAsyncWithHttpInfo($catalog_variant_create_job_create_query, $apiKey) + return $this->getUpdateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -16754,28 +17833,31 @@ function ($response) { } /** - * Alias of `spawnCreateVariantsJobAsync` + * Alias of `getUpdateCategoriesJobAsync` * - * @deprecated use `spawnCreateVariantsJobAsync` instead + * @deprecated use `getUpdateCategoriesJobAsync` instead */ - public function createCatalogVariantBulkCreateJobAsync(...$args) { - return $this->spawnCreateVariantsJobAsync(...$args); + public function getCatalogCategoryBulkUpdateJobAsync(...$args) { + return $this->getUpdateCategoriesJobAsync(...$args); } /** - * Operation spawnCreateVariantsJobAsyncWithHttpInfo + * Operation getUpdateCategoriesJobAsyncWithHttpInfo * - * Spawn Create Variants Job + * Get Update Categories Job * - * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCreateVariantsJobAsyncWithHttpInfo($catalog_variant_create_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobAsyncWithHttpInfo($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnCreateVariantsJobRequest($catalog_variant_create_job_create_query, $apiKey); + $request = $this->getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_update_job, $fields_catalog_category, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16819,61 +17901,93 @@ function ($exception) { } /** - * Alias of `spawnCreateVariantsJobAsyncWithHttpInfo` + * Alias of `getUpdateCategoriesJobAsyncWithHttpInfo` * - * @deprecated use `spawnCreateVariantsJobAsyncWithHttpInfo` instead + * @deprecated use `getUpdateCategoriesJobAsyncWithHttpInfo` instead */ - public function createCatalogVariantBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->spawnCreateVariantsJobAsyncWithHttpInfo(...$args); + public function getCatalogCategoryBulkUpdateJobAsyncWithHttpInfo(...$args) { + return $this->getUpdateCategoriesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnCreateVariantsJob' + * Create request for operation 'getUpdateCategoriesJob' * - * @param \KlaviyoAPI\Model\CatalogVariantCreateJobCreateQuery $catalog_variant_create_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnCreateVariantsJobRequest($catalog_variant_create_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_update_job = null, $fields_catalog_category = null, $include = null, $apiKey = null) { - // verify the required parameter 'catalog_variant_create_job_create_query' is set - if ($catalog_variant_create_job_create_query === null || (is_array($catalog_variant_create_job_create_query) && count($catalog_variant_create_job_create_query) === 0)) { + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_variant_create_job_create_query when calling spawnCreateVariantsJob' + 'Missing the required parameter $job_id when calling getUpdateCategoriesJob' ); } - $resourcePath = '/api/catalog-variant-bulk-create-jobs/'; + $resourcePath = '/api/catalog-category-bulk-update-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_category_bulk_update_job, + 'fields[catalog-category-bulk-update-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_category, + 'fields[catalog-category]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // path params + if ($job_id !== null) { + $resourcePath = str_replace( + '{' . 'job_id' . '}', + ObjectSerializer::toPathValue($job_id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($catalog_variant_create_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_create_job_create_query)); - } else { - $httpBody = $catalog_variant_create_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -16888,7 +18002,7 @@ public function spawnCreateVariantsJobRequest($catalog_variant_create_job_create // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -16912,7 +18026,7 @@ public function spawnCreateVariantsJobRequest($catalog_variant_create_job_create $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -16922,7 +18036,7 @@ public function spawnCreateVariantsJobRequest($catalog_variant_create_job_create $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -16930,54 +18044,58 @@ public function spawnCreateVariantsJobRequest($catalog_variant_create_job_create } /** - * Alias of `spawnCreateVariantsJobRequest` + * Alias of `getUpdateCategoriesJobRequest` * - * @deprecated use `spawnCreateVariantsJobRequest` instead + * @deprecated use `getUpdateCategoriesJobRequest` instead */ - public function createCatalogVariantBulkCreateJobRequest(...$args) { - return $this->spawnCreateVariantsJobRequest(...$args); + public function getCatalogCategoryBulkUpdateJobRequest(...$args) { + return $this->getUpdateCategoriesJobRequest(...$args); } /** - * Operation spawnDeleteCategoriesJob + * Operation getUpdateCategoriesJobs * - * Spawn Delete Categories Job + * Get Update Categories Jobs * - * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query catalog_category_delete_job_create_query (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnDeleteCategoriesJob($catalog_category_delete_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobs($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->spawnDeleteCategoriesJobWithHttpInfo($catalog_category_delete_job_create_query, $apiKey); + list($response) = $this->getUpdateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `spawnDeleteCategoriesJob` + * Alias of `getUpdateCategoriesJobs` * - * @deprecated use `spawnDeleteCategoriesJob` instead + * @deprecated use `getUpdateCategoriesJobs` instead */ - public function createCatalogCategoryBulkDeleteJob(...$args) { - return $this->spawnDeleteCategoriesJob(...$args); + public function getCatalogCategoryBulkUpdateJobs(...$args) { + return $this->getUpdateCategoriesJobs(...$args); } /** - * Operation spawnDeleteCategoriesJobWithHttpInfo + * Operation getUpdateCategoriesJobsWithHttpInfo * - * Spawn Delete Categories Job + * Get Update Categories Jobs * - * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnDeleteCategoriesJobWithHttpInfo($catalog_category_delete_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobsWithHttpInfo($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->spawnDeleteCategoriesJobRequest($catalog_category_delete_job_create_query, $apiKey); + $request = $this->getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -17015,7 +18133,7 @@ public function spawnDeleteCategoriesJobWithHttpInfo($catalog_category_delete_jo } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17103,7 +18221,7 @@ public function spawnDeleteCategoriesJobWithHttpInfo($catalog_category_delete_jo } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -17133,27 +18251,29 @@ public function spawnDeleteCategoriesJobWithHttpInfo($catalog_category_delete_jo } /** - * Alias of `spawnDeleteCategoriesJobWithHttpInfo` + * Alias of `getUpdateCategoriesJobsWithHttpInfo` * - * @deprecated use `spawnDeleteCategoriesJobWithHttpInfo` instead + * @deprecated use `getUpdateCategoriesJobsWithHttpInfo` instead */ - public function createCatalogCategoryBulkDeleteJobWithHttpInfo(...$args) { - return $this->spawnDeleteCategoriesJobWithHttpInfo(...$args); + public function getCatalogCategoryBulkUpdateJobsWithHttpInfo(...$args) { + return $this->getUpdateCategoriesJobsWithHttpInfo(...$args); } /** - * Operation spawnDeleteCategoriesJobAsync + * Operation getUpdateCategoriesJobsAsync * - * Spawn Delete Categories Job + * Get Update Categories Jobs * - * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnDeleteCategoriesJobAsync($catalog_category_delete_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobsAsync($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->spawnDeleteCategoriesJobAsyncWithHttpInfo($catalog_category_delete_job_create_query, $apiKey) + return $this->getUpdateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -17162,28 +18282,30 @@ function ($response) { } /** - * Alias of `spawnDeleteCategoriesJobAsync` + * Alias of `getUpdateCategoriesJobsAsync` * - * @deprecated use `spawnDeleteCategoriesJobAsync` instead + * @deprecated use `getUpdateCategoriesJobsAsync` instead */ - public function createCatalogCategoryBulkDeleteJobAsync(...$args) { - return $this->spawnDeleteCategoriesJobAsync(...$args); + public function getCatalogCategoryBulkUpdateJobsAsync(...$args) { + return $this->getUpdateCategoriesJobsAsync(...$args); } /** - * Operation spawnDeleteCategoriesJobAsyncWithHttpInfo + * Operation getUpdateCategoriesJobsAsyncWithHttpInfo * - * Spawn Delete Categories Job + * Get Update Categories Jobs * - * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnDeleteCategoriesJobAsyncWithHttpInfo($catalog_category_delete_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobsAsyncWithHttpInfo($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnDeleteCategoriesJobRequest($catalog_category_delete_job_create_query, $apiKey); + $request = $this->getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_update_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17227,61 +18349,78 @@ function ($exception) { } /** - * Alias of `spawnDeleteCategoriesJobAsyncWithHttpInfo` + * Alias of `getUpdateCategoriesJobsAsyncWithHttpInfo` * - * @deprecated use `spawnDeleteCategoriesJobAsyncWithHttpInfo` instead + * @deprecated use `getUpdateCategoriesJobsAsyncWithHttpInfo` instead */ - public function createCatalogCategoryBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->spawnDeleteCategoriesJobAsyncWithHttpInfo(...$args); + public function getCatalogCategoryBulkUpdateJobsAsyncWithHttpInfo(...$args) { + return $this->getUpdateCategoriesJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnDeleteCategoriesJob' + * Create request for operation 'getUpdateCategoriesJobs' * - * @param \KlaviyoAPI\Model\CatalogCategoryDeleteJobCreateQuery $catalog_category_delete_job_create_query (required) + * @param string[] $fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnDeleteCategoriesJobRequest($catalog_category_delete_job_create_query, $apiKey = null) + public function getUpdateCategoriesJobsRequest($fields_catalog_category_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - // verify the required parameter 'catalog_category_delete_job_create_query' is set - if ($catalog_category_delete_job_create_query === null || (is_array($catalog_category_delete_job_create_query) && count($catalog_category_delete_job_create_query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_category_delete_job_create_query when calling spawnDeleteCategoriesJob' - ); - } - $resourcePath = '/api/catalog-category-bulk-delete-jobs/'; + $resourcePath = '/api/catalog-category-bulk-update-jobs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_category_bulk_update_job, + 'fields[catalog-category-bulk-update-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($catalog_category_delete_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_delete_job_create_query)); - } else { - $httpBody = $catalog_category_delete_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -17296,7 +18435,7 @@ public function spawnDeleteCategoriesJobRequest($catalog_category_delete_job_cre // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -17320,7 +18459,7 @@ public function spawnDeleteCategoriesJobRequest($catalog_category_delete_job_cre $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -17330,7 +18469,7 @@ public function spawnDeleteCategoriesJobRequest($catalog_category_delete_job_cre $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17338,54 +18477,60 @@ public function spawnDeleteCategoriesJobRequest($catalog_category_delete_job_cre } /** - * Alias of `spawnDeleteCategoriesJobRequest` + * Alias of `getUpdateCategoriesJobsRequest` * - * @deprecated use `spawnDeleteCategoriesJobRequest` instead + * @deprecated use `getUpdateCategoriesJobsRequest` instead */ - public function createCatalogCategoryBulkDeleteJobRequest(...$args) { - return $this->spawnDeleteCategoriesJobRequest(...$args); + public function getCatalogCategoryBulkUpdateJobsRequest(...$args) { + return $this->getUpdateCategoriesJobsRequest(...$args); } /** - * Operation spawnDeleteItemsJob + * Operation getUpdateVariantsJob * - * Spawn Delete Items Job + * Get Update Variants Job * - * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query catalog_item_delete_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnDeleteItemsJob($catalog_item_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJob($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - list($response) = $this->spawnDeleteItemsJobWithHttpInfo($catalog_item_delete_job_create_query, $apiKey); + list($response) = $this->getUpdateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey); return $response; } /** - * Alias of `spawnDeleteItemsJob` + * Alias of `getUpdateVariantsJob` * - * @deprecated use `spawnDeleteItemsJob` instead + * @deprecated use `getUpdateVariantsJob` instead */ - public function createCatalogItemBulkDeleteJob(...$args) { - return $this->spawnDeleteItemsJob(...$args); + public function getCatalogVariantBulkUpdateJob(...$args) { + return $this->getUpdateVariantsJob(...$args); } /** - * Operation spawnDeleteItemsJobWithHttpInfo + * Operation getUpdateVariantsJobWithHttpInfo * - * Spawn Delete Items Job + * Get Update Variants Job * - * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnDeleteItemsJobWithHttpInfo($catalog_item_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - $request = $this->spawnDeleteItemsJobRequest($catalog_item_delete_job_create_query, $apiKey); + $request = $this->getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -17423,7 +18568,7 @@ public function spawnDeleteItemsJobWithHttpInfo($catalog_item_delete_job_create_ } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17511,7 +18656,7 @@ public function spawnDeleteItemsJobWithHttpInfo($catalog_item_delete_job_create_ } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -17541,27 +18686,30 @@ public function spawnDeleteItemsJobWithHttpInfo($catalog_item_delete_job_create_ } /** - * Alias of `spawnDeleteItemsJobWithHttpInfo` + * Alias of `getUpdateVariantsJobWithHttpInfo` * - * @deprecated use `spawnDeleteItemsJobWithHttpInfo` instead + * @deprecated use `getUpdateVariantsJobWithHttpInfo` instead */ - public function createCatalogItemBulkDeleteJobWithHttpInfo(...$args) { - return $this->spawnDeleteItemsJobWithHttpInfo(...$args); + public function getCatalogVariantBulkUpdateJobWithHttpInfo(...$args) { + return $this->getUpdateVariantsJobWithHttpInfo(...$args); } /** - * Operation spawnDeleteItemsJobAsync + * Operation getUpdateVariantsJobAsync * - * Spawn Delete Items Job + * Get Update Variants Job * - * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnDeleteItemsJobAsync($catalog_item_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobAsync($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - return $this->spawnDeleteItemsJobAsyncWithHttpInfo($catalog_item_delete_job_create_query, $apiKey) + return $this->getUpdateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -17570,28 +18718,31 @@ function ($response) { } /** - * Alias of `spawnDeleteItemsJobAsync` + * Alias of `getUpdateVariantsJobAsync` * - * @deprecated use `spawnDeleteItemsJobAsync` instead + * @deprecated use `getUpdateVariantsJobAsync` instead */ - public function createCatalogItemBulkDeleteJobAsync(...$args) { - return $this->spawnDeleteItemsJobAsync(...$args); + public function getCatalogVariantBulkUpdateJobAsync(...$args) { + return $this->getUpdateVariantsJobAsync(...$args); } /** - * Operation spawnDeleteItemsJobAsyncWithHttpInfo + * Operation getUpdateVariantsJobAsyncWithHttpInfo * - * Spawn Delete Items Job + * Get Update Variants Job * - * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnDeleteItemsJobAsyncWithHttpInfo($catalog_item_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobAsyncWithHttpInfo($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnDeleteItemsJobRequest($catalog_item_delete_job_create_query, $apiKey); + $request = $this->getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_update_job, $fields_catalog_variant, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17635,61 +18786,93 @@ function ($exception) { } /** - * Alias of `spawnDeleteItemsJobAsyncWithHttpInfo` + * Alias of `getUpdateVariantsJobAsyncWithHttpInfo` * - * @deprecated use `spawnDeleteItemsJobAsyncWithHttpInfo` instead + * @deprecated use `getUpdateVariantsJobAsyncWithHttpInfo` instead */ - public function createCatalogItemBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->spawnDeleteItemsJobAsyncWithHttpInfo(...$args); + public function getCatalogVariantBulkUpdateJobAsyncWithHttpInfo(...$args) { + return $this->getUpdateVariantsJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnDeleteItemsJob' + * Create request for operation 'getUpdateVariantsJob' * - * @param \KlaviyoAPI\Model\CatalogItemDeleteJobCreateQuery $catalog_item_delete_job_create_query (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnDeleteItemsJobRequest($catalog_item_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobRequest($job_id, $fields_catalog_variant_bulk_update_job = null, $fields_catalog_variant = null, $include = null, $apiKey = null) { - // verify the required parameter 'catalog_item_delete_job_create_query' is set - if ($catalog_item_delete_job_create_query === null || (is_array($catalog_item_delete_job_create_query) && count($catalog_item_delete_job_create_query) === 0)) { + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_delete_job_create_query when calling spawnDeleteItemsJob' + 'Missing the required parameter $job_id when calling getUpdateVariantsJob' ); } - $resourcePath = '/api/catalog-item-bulk-delete-jobs/'; + $resourcePath = '/api/catalog-variant-bulk-update-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_variant_bulk_update_job, + 'fields[catalog-variant-bulk-update-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_variant, + 'fields[catalog-variant]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // path params + if ($job_id !== null) { + $resourcePath = str_replace( + '{' . 'job_id' . '}', + ObjectSerializer::toPathValue($job_id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($catalog_item_delete_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_delete_job_create_query)); - } else { - $httpBody = $catalog_item_delete_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -17704,7 +18887,7 @@ public function spawnDeleteItemsJobRequest($catalog_item_delete_job_create_query // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -17728,7 +18911,7 @@ public function spawnDeleteItemsJobRequest($catalog_item_delete_job_create_query $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -17738,7 +18921,7 @@ public function spawnDeleteItemsJobRequest($catalog_item_delete_job_create_query $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17746,54 +18929,58 @@ public function spawnDeleteItemsJobRequest($catalog_item_delete_job_create_query } /** - * Alias of `spawnDeleteItemsJobRequest` + * Alias of `getUpdateVariantsJobRequest` * - * @deprecated use `spawnDeleteItemsJobRequest` instead + * @deprecated use `getUpdateVariantsJobRequest` instead */ - public function createCatalogItemBulkDeleteJobRequest(...$args) { - return $this->spawnDeleteItemsJobRequest(...$args); + public function getCatalogVariantBulkUpdateJobRequest(...$args) { + return $this->getUpdateVariantsJobRequest(...$args); } /** - * Operation spawnDeleteVariantsJob + * Operation getUpdateVariantsJobs * - * Spawn Delete Variants Job + * Get Update Variants Jobs * - * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query catalog_variant_delete_job_create_query (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnDeleteVariantsJob($catalog_variant_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobs($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->spawnDeleteVariantsJobWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey); + list($response) = $this->getUpdateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `spawnDeleteVariantsJob` + * Alias of `getUpdateVariantsJobs` * - * @deprecated use `spawnDeleteVariantsJob` instead + * @deprecated use `getUpdateVariantsJobs` instead */ - public function createCatalogVariantBulkDeleteJob(...$args) { - return $this->spawnDeleteVariantsJob(...$args); + public function getCatalogVariantBulkUpdateJobs(...$args) { + return $this->getUpdateVariantsJobs(...$args); } /** - * Operation spawnDeleteVariantsJobWithHttpInfo + * Operation getUpdateVariantsJobsWithHttpInfo * - * Spawn Delete Variants Job + * Get Update Variants Jobs * - * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnDeleteVariantsJobWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobsWithHttpInfo($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->spawnDeleteVariantsJobRequest($catalog_variant_delete_job_create_query, $apiKey); + $request = $this->getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -17831,7 +19018,7 @@ public function spawnDeleteVariantsJobWithHttpInfo($catalog_variant_delete_job_c } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17919,7 +19106,7 @@ public function spawnDeleteVariantsJobWithHttpInfo($catalog_variant_delete_job_c } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -17949,27 +19136,29 @@ public function spawnDeleteVariantsJobWithHttpInfo($catalog_variant_delete_job_c } /** - * Alias of `spawnDeleteVariantsJobWithHttpInfo` + * Alias of `getUpdateVariantsJobsWithHttpInfo` * - * @deprecated use `spawnDeleteVariantsJobWithHttpInfo` instead + * @deprecated use `getUpdateVariantsJobsWithHttpInfo` instead */ - public function createCatalogVariantBulkDeleteJobWithHttpInfo(...$args) { - return $this->spawnDeleteVariantsJobWithHttpInfo(...$args); + public function getCatalogVariantBulkUpdateJobsWithHttpInfo(...$args) { + return $this->getUpdateVariantsJobsWithHttpInfo(...$args); } /** - * Operation spawnDeleteVariantsJobAsync + * Operation getUpdateVariantsJobsAsync * - * Spawn Delete Variants Job + * Get Update Variants Jobs * - * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnDeleteVariantsJobAsync($catalog_variant_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobsAsync($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->spawnDeleteVariantsJobAsyncWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey) + return $this->getUpdateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -17978,28 +19167,30 @@ function ($response) { } /** - * Alias of `spawnDeleteVariantsJobAsync` + * Alias of `getUpdateVariantsJobsAsync` * - * @deprecated use `spawnDeleteVariantsJobAsync` instead + * @deprecated use `getUpdateVariantsJobsAsync` instead */ - public function createCatalogVariantBulkDeleteJobAsync(...$args) { - return $this->spawnDeleteVariantsJobAsync(...$args); + public function getCatalogVariantBulkUpdateJobsAsync(...$args) { + return $this->getUpdateVariantsJobsAsync(...$args); } /** - * Operation spawnDeleteVariantsJobAsyncWithHttpInfo + * Operation getUpdateVariantsJobsAsyncWithHttpInfo * - * Spawn Delete Variants Job + * Get Update Variants Jobs * - * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnDeleteVariantsJobAsyncWithHttpInfo($catalog_variant_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobsAsyncWithHttpInfo($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnDeleteVariantsJobRequest($catalog_variant_delete_job_create_query, $apiKey); + $request = $this->getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18043,61 +19234,78 @@ function ($exception) { } /** - * Alias of `spawnDeleteVariantsJobAsyncWithHttpInfo` + * Alias of `getUpdateVariantsJobsAsyncWithHttpInfo` * - * @deprecated use `spawnDeleteVariantsJobAsyncWithHttpInfo` instead + * @deprecated use `getUpdateVariantsJobsAsyncWithHttpInfo` instead */ - public function createCatalogVariantBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->spawnDeleteVariantsJobAsyncWithHttpInfo(...$args); + public function getCatalogVariantBulkUpdateJobsAsyncWithHttpInfo(...$args) { + return $this->getUpdateVariantsJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnDeleteVariantsJob' + * Create request for operation 'getUpdateVariantsJobs' * - * @param \KlaviyoAPI\Model\CatalogVariantDeleteJobCreateQuery $catalog_variant_delete_job_create_query (required) + * @param string[] $fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnDeleteVariantsJobRequest($catalog_variant_delete_job_create_query, $apiKey = null) + public function getUpdateVariantsJobsRequest($fields_catalog_variant_bulk_update_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - // verify the required parameter 'catalog_variant_delete_job_create_query' is set - if ($catalog_variant_delete_job_create_query === null || (is_array($catalog_variant_delete_job_create_query) && count($catalog_variant_delete_job_create_query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_variant_delete_job_create_query when calling spawnDeleteVariantsJob' - ); - } - $resourcePath = '/api/catalog-variant-bulk-delete-jobs/'; + $resourcePath = '/api/catalog-variant-bulk-update-jobs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_variant_bulk_update_job, + 'fields[catalog-variant-bulk-update-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($catalog_variant_delete_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_delete_job_create_query)); - } else { - $httpBody = $catalog_variant_delete_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -18112,7 +19320,7 @@ public function spawnDeleteVariantsJobRequest($catalog_variant_delete_job_create // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -18136,7 +19344,7 @@ public function spawnDeleteVariantsJobRequest($catalog_variant_delete_job_create $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -18146,7 +19354,7 @@ public function spawnDeleteVariantsJobRequest($catalog_variant_delete_job_create $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18154,54 +19362,62 @@ public function spawnDeleteVariantsJobRequest($catalog_variant_delete_job_create } /** - * Alias of `spawnDeleteVariantsJobRequest` + * Alias of `getUpdateVariantsJobsRequest` * - * @deprecated use `spawnDeleteVariantsJobRequest` instead + * @deprecated use `getUpdateVariantsJobsRequest` instead */ - public function createCatalogVariantBulkDeleteJobRequest(...$args) { - return $this->spawnDeleteVariantsJobRequest(...$args); + public function getCatalogVariantBulkUpdateJobsRequest(...$args) { + return $this->getUpdateVariantsJobsRequest(...$args); } /** - * Operation spawnUpdateCategoriesJob + * Operation getVariantsForCatalogItem * - * Spawn Update Categories Job + * Get Variants for Catalog Item * - * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query catalog_category_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnUpdateCategoriesJob($catalog_category_update_job_create_query, $apiKey = null) + public function getVariantsForCatalogItem($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->spawnUpdateCategoriesJobWithHttpInfo($catalog_category_update_job_create_query, $apiKey); + list($response) = $this->getVariantsForCatalogItemWithHttpInfo($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `spawnUpdateCategoriesJob` + * Alias of `getVariantsForCatalogItem` * - * @deprecated use `spawnUpdateCategoriesJob` instead + * @deprecated use `getVariantsForCatalogItem` instead */ - public function createCatalogCategoryBulkUpdateJob(...$args) { - return $this->spawnUpdateCategoriesJob(...$args); + public function getCatalogItemVariants(...$args) { + return $this->getVariantsForCatalogItem(...$args); } /** - * Operation spawnUpdateCategoriesJobWithHttpInfo + * Operation getVariantsForCatalogItemWithHttpInfo * - * Spawn Update Categories Job + * Get Variants for Catalog Item * - * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnUpdateCategoriesJobWithHttpInfo($catalog_category_update_job_create_query, $apiKey = null) + public function getVariantsForCatalogItemWithHttpInfo($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->spawnUpdateCategoriesJobRequest($catalog_category_update_job_create_query, $apiKey); + $request = $this->getVariantsForCatalogItemRequest($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -18239,7 +19455,7 @@ public function spawnUpdateCategoriesJobWithHttpInfo($catalog_category_update_jo } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -18327,7 +19543,7 @@ public function spawnUpdateCategoriesJobWithHttpInfo($catalog_category_update_jo } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -18357,27 +19573,31 @@ public function spawnUpdateCategoriesJobWithHttpInfo($catalog_category_update_jo } /** - * Alias of `spawnUpdateCategoriesJobWithHttpInfo` + * Alias of `getVariantsForCatalogItemWithHttpInfo` * - * @deprecated use `spawnUpdateCategoriesJobWithHttpInfo` instead + * @deprecated use `getVariantsForCatalogItemWithHttpInfo` instead */ - public function createCatalogCategoryBulkUpdateJobWithHttpInfo(...$args) { - return $this->spawnUpdateCategoriesJobWithHttpInfo(...$args); + public function getCatalogItemVariantsWithHttpInfo(...$args) { + return $this->getVariantsForCatalogItemWithHttpInfo(...$args); } /** - * Operation spawnUpdateCategoriesJobAsync + * Operation getVariantsForCatalogItemAsync * - * Spawn Update Categories Job + * Get Variants for Catalog Item * - * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnUpdateCategoriesJobAsync($catalog_category_update_job_create_query, $apiKey = null) + public function getVariantsForCatalogItemAsync($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->spawnUpdateCategoriesJobAsyncWithHttpInfo($catalog_category_update_job_create_query, $apiKey) + return $this->getVariantsForCatalogItemAsyncWithHttpInfo($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -18386,28 +19606,32 @@ function ($response) { } /** - * Alias of `spawnUpdateCategoriesJobAsync` + * Alias of `getVariantsForCatalogItemAsync` * - * @deprecated use `spawnUpdateCategoriesJobAsync` instead + * @deprecated use `getVariantsForCatalogItemAsync` instead */ - public function createCatalogCategoryBulkUpdateJobAsync(...$args) { - return $this->spawnUpdateCategoriesJobAsync(...$args); + public function getCatalogItemVariantsAsync(...$args) { + return $this->getVariantsForCatalogItemAsync(...$args); } /** - * Operation spawnUpdateCategoriesJobAsyncWithHttpInfo + * Operation getVariantsForCatalogItemAsyncWithHttpInfo * - * Spawn Update Categories Job + * Get Variants for Catalog Item * - * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnUpdateCategoriesJobAsyncWithHttpInfo($catalog_category_update_job_create_query, $apiKey = null) + public function getVariantsForCatalogItemAsyncWithHttpInfo($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnUpdateCategoriesJobRequest($catalog_category_update_job_create_query, $apiKey); + $request = $this->getVariantsForCatalogItemRequest($id, $fields_catalog_variant, $filter, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18451,61 +19675,103 @@ function ($exception) { } /** - * Alias of `spawnUpdateCategoriesJobAsyncWithHttpInfo` + * Alias of `getVariantsForCatalogItemAsyncWithHttpInfo` * - * @deprecated use `spawnUpdateCategoriesJobAsyncWithHttpInfo` instead + * @deprecated use `getVariantsForCatalogItemAsyncWithHttpInfo` instead */ - public function createCatalogCategoryBulkUpdateJobAsyncWithHttpInfo(...$args) { - return $this->spawnUpdateCategoriesJobAsyncWithHttpInfo(...$args); + public function getCatalogItemVariantsAsyncWithHttpInfo(...$args) { + return $this->getVariantsForCatalogItemAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnUpdateCategoriesJob' + * Create request for operation 'getVariantsForCatalogItem' * - * @param \KlaviyoAPI\Model\CatalogCategoryUpdateJobCreateQuery $catalog_category_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param string[] $fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnUpdateCategoriesJobRequest($catalog_category_update_job_create_query, $apiKey = null) + public function getVariantsForCatalogItemRequest($id, $fields_catalog_variant = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'catalog_category_update_job_create_query' is set - if ($catalog_category_update_job_create_query === null || (is_array($catalog_category_update_job_create_query) && count($catalog_category_update_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_category_update_job_create_query when calling spawnUpdateCategoriesJob' + 'Missing the required parameter $id when calling getVariantsForCatalogItem' ); } - $resourcePath = '/api/catalog-category-bulk-update-jobs/'; + $resourcePath = '/api/catalog-items/{id}/variants'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_catalog_variant, + 'fields[catalog-variant]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($catalog_category_update_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_update_job_create_query)); - } else { - $httpBody = $catalog_category_update_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -18520,7 +19786,7 @@ public function spawnUpdateCategoriesJobRequest($catalog_category_update_job_cre // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -18544,7 +19810,7 @@ public function spawnUpdateCategoriesJobRequest($catalog_category_update_job_cre $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -18554,7 +19820,7 @@ public function spawnUpdateCategoriesJobRequest($catalog_category_update_job_cre $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18562,187 +19828,95 @@ public function spawnUpdateCategoriesJobRequest($catalog_category_update_job_cre } /** - * Alias of `spawnUpdateCategoriesJobRequest` + * Alias of `getVariantsForCatalogItemRequest` * - * @deprecated use `spawnUpdateCategoriesJobRequest` instead + * @deprecated use `getVariantsForCatalogItemRequest` instead */ - public function createCatalogCategoryBulkUpdateJobRequest(...$args) { - return $this->spawnUpdateCategoriesJobRequest(...$args); + public function getCatalogItemVariantsRequest(...$args) { + return $this->getVariantsForCatalogItemRequest(...$args); } /** - * Operation spawnUpdateItemsJob + * Operation removeCategoriesFromCatalogItem * - * Spawn Update Items Job + * Remove Categories from Catalog Item * - * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query catalog_item_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op catalog_item_category_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function spawnUpdateItemsJob($catalog_item_update_job_create_query, $apiKey = null) + public function removeCategoriesFromCatalogItem($id, $catalog_item_category_op, $apiKey = null) { - list($response) = $this->spawnUpdateItemsJobWithHttpInfo($catalog_item_update_job_create_query, $apiKey); - return $response; + $this->removeCategoriesFromCatalogItemWithHttpInfo($id, $catalog_item_category_op, $apiKey); } /** - * Alias of `spawnUpdateItemsJob` + * Alias of `removeCategoriesFromCatalogItem` * - * @deprecated use `spawnUpdateItemsJob` instead + * @deprecated use `removeCategoriesFromCatalogItem` instead */ - public function createCatalogItemBulkUpdateJob(...$args) { - return $this->spawnUpdateItemsJob(...$args); + public function deleteCatalogItemRelationshipsCategories(...$args) { + return $this->removeCategoriesFromCatalogItem(...$args); } /** - * Operation spawnUpdateItemsJobWithHttpInfo + * Operation removeCategoriesFromCatalogItemWithHttpInfo * - * Spawn Update Items Job + * Remove Categories from Catalog Item * - * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function spawnUpdateItemsJobWithHttpInfo($catalog_item_update_job_create_query, $apiKey = null) - { - $request = $this->spawnUpdateItemsJobRequest($catalog_item_update_job_create_query, $apiKey); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 202: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } + public function removeCategoriesFromCatalogItemWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) + { + $request = $this->removeCategoriesFromCatalogItemRequest($id, $catalog_item_category_op, $apiKey); - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); } - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); } - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 202: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18765,27 +19939,28 @@ public function spawnUpdateItemsJobWithHttpInfo($catalog_item_update_job_create_ } /** - * Alias of `spawnUpdateItemsJobWithHttpInfo` + * Alias of `removeCategoriesFromCatalogItemWithHttpInfo` * - * @deprecated use `spawnUpdateItemsJobWithHttpInfo` instead + * @deprecated use `removeCategoriesFromCatalogItemWithHttpInfo` instead */ - public function createCatalogItemBulkUpdateJobWithHttpInfo(...$args) { - return $this->spawnUpdateItemsJobWithHttpInfo(...$args); + public function deleteCatalogItemRelationshipsCategoriesWithHttpInfo(...$args) { + return $this->removeCategoriesFromCatalogItemWithHttpInfo(...$args); } /** - * Operation spawnUpdateItemsJobAsync + * Operation removeCategoriesFromCatalogItemAsync * - * Spawn Update Items Job + * Remove Categories from Catalog Item * - * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnUpdateItemsJobAsync($catalog_item_update_job_create_query, $apiKey = null) + public function removeCategoriesFromCatalogItemAsync($id, $catalog_item_category_op, $apiKey = null) { - return $this->spawnUpdateItemsJobAsyncWithHttpInfo($catalog_item_update_job_create_query, $apiKey) + return $this->removeCategoriesFromCatalogItemAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -18794,52 +19969,35 @@ function ($response) { } /** - * Alias of `spawnUpdateItemsJobAsync` + * Alias of `removeCategoriesFromCatalogItemAsync` * - * @deprecated use `spawnUpdateItemsJobAsync` instead + * @deprecated use `removeCategoriesFromCatalogItemAsync` instead */ - public function createCatalogItemBulkUpdateJobAsync(...$args) { - return $this->spawnUpdateItemsJobAsync(...$args); + public function deleteCatalogItemRelationshipsCategoriesAsync(...$args) { + return $this->removeCategoriesFromCatalogItemAsync(...$args); } /** - * Operation spawnUpdateItemsJobAsyncWithHttpInfo + * Operation removeCategoriesFromCatalogItemAsyncWithHttpInfo * - * Spawn Update Items Job + * Remove Categories from Catalog Item * - * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnUpdateItemsJobAsyncWithHttpInfo($catalog_item_update_job_create_query, $apiKey = null) + public function removeCategoriesFromCatalogItemAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->spawnUpdateItemsJobRequest($catalog_item_update_job_create_query, $apiKey); + $returnType = ''; + $request = $this->removeCategoriesFromCatalogItemRequest($id, $catalog_item_category_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -18859,32 +20017,39 @@ function ($exception) { } /** - * Alias of `spawnUpdateItemsJobAsyncWithHttpInfo` + * Alias of `removeCategoriesFromCatalogItemAsyncWithHttpInfo` * - * @deprecated use `spawnUpdateItemsJobAsyncWithHttpInfo` instead + * @deprecated use `removeCategoriesFromCatalogItemAsyncWithHttpInfo` instead */ - public function createCatalogItemBulkUpdateJobAsyncWithHttpInfo(...$args) { - return $this->spawnUpdateItemsJobAsyncWithHttpInfo(...$args); + public function deleteCatalogItemRelationshipsCategoriesAsyncWithHttpInfo(...$args) { + return $this->removeCategoriesFromCatalogItemAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnUpdateItemsJob' + * Create request for operation 'removeCategoriesFromCatalogItem' * - * @param \KlaviyoAPI\Model\CatalogItemUpdateJobCreateQuery $catalog_item_update_job_create_query (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnUpdateItemsJobRequest($catalog_item_update_job_create_query, $apiKey = null) + public function removeCategoriesFromCatalogItemRequest($id, $catalog_item_category_op, $apiKey = null) { - // verify the required parameter 'catalog_item_update_job_create_query' is set - if ($catalog_item_update_job_create_query === null || (is_array($catalog_item_update_job_create_query) && count($catalog_item_update_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling removeCategoriesFromCatalogItem' + ); + } + // verify the required parameter 'catalog_item_category_op' is set + if ($catalog_item_category_op === null || (is_array($catalog_item_category_op) && count($catalog_item_category_op) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_update_job_create_query when calling spawnUpdateItemsJob' + 'Missing the required parameter $catalog_item_category_op when calling removeCategoriesFromCatalogItem' ); } - $resourcePath = '/api/catalog-item-bulk-update-jobs/'; + $resourcePath = '/api/catalog-items/{id}/relationships/categories'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18893,25 +20058,33 @@ public function spawnUpdateItemsJobRequest($catalog_item_update_job_create_query + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_item_update_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_update_job_create_query)); + if (isset($catalog_item_category_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_category_op)); } else { - $httpBody = $catalog_item_update_job_create_query; + $httpBody = $catalog_item_category_op; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -18928,7 +20101,7 @@ public function spawnUpdateItemsJobRequest($catalog_item_update_job_create_query // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -18952,7 +20125,7 @@ public function spawnUpdateItemsJobRequest($catalog_item_update_job_create_query $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -18962,7 +20135,7 @@ public function spawnUpdateItemsJobRequest($catalog_item_update_job_create_query $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18970,54 +20143,55 @@ public function spawnUpdateItemsJobRequest($catalog_item_update_job_create_query } /** - * Alias of `spawnUpdateItemsJobRequest` + * Alias of `removeCategoriesFromCatalogItemRequest` * - * @deprecated use `spawnUpdateItemsJobRequest` instead + * @deprecated use `removeCategoriesFromCatalogItemRequest` instead */ - public function createCatalogItemBulkUpdateJobRequest(...$args) { - return $this->spawnUpdateItemsJobRequest(...$args); + public function deleteCatalogItemRelationshipsCategoriesRequest(...$args) { + return $this->removeCategoriesFromCatalogItemRequest(...$args); } /** - * Operation spawnUpdateVariantsJob + * Operation removeItemsFromCatalogCategory * - * Spawn Update Variants Job + * Remove Items from Catalog Category * - * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query catalog_variant_update_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op catalog_category_item_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function spawnUpdateVariantsJob($catalog_variant_update_job_create_query, $apiKey = null) + public function removeItemsFromCatalogCategory($id, $catalog_category_item_op, $apiKey = null) { - list($response) = $this->spawnUpdateVariantsJobWithHttpInfo($catalog_variant_update_job_create_query, $apiKey); - return $response; + $this->removeItemsFromCatalogCategoryWithHttpInfo($id, $catalog_category_item_op, $apiKey); } /** - * Alias of `spawnUpdateVariantsJob` + * Alias of `removeItemsFromCatalogCategory` * - * @deprecated use `spawnUpdateVariantsJob` instead + * @deprecated use `removeItemsFromCatalogCategory` instead */ - public function createCatalogVariantBulkUpdateJob(...$args) { - return $this->spawnUpdateVariantsJob(...$args); + public function deleteCatalogCategoryRelationshipsItems(...$args) { + return $this->removeItemsFromCatalogCategory(...$args); } /** - * Operation spawnUpdateVariantsJobWithHttpInfo + * Operation removeItemsFromCatalogCategoryWithHttpInfo * - * Spawn Update Variants Job + * Remove Items from Catalog Category * - * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function spawnUpdateVariantsJobWithHttpInfo($catalog_variant_update_job_create_query, $apiKey = null) + public function removeItemsFromCatalogCategoryWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) { - $request = $this->spawnUpdateVariantsJobRequest($catalog_variant_update_job_create_query, $apiKey); + $request = $this->removeItemsFromCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -19054,103 +20228,10 @@ public function spawnUpdateVariantsJobWithHttpInfo($catalog_variant_update_job_c ); } - switch($statusCode) { - case 202: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 202: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19173,27 +20254,28 @@ public function spawnUpdateVariantsJobWithHttpInfo($catalog_variant_update_job_c } /** - * Alias of `spawnUpdateVariantsJobWithHttpInfo` + * Alias of `removeItemsFromCatalogCategoryWithHttpInfo` * - * @deprecated use `spawnUpdateVariantsJobWithHttpInfo` instead + * @deprecated use `removeItemsFromCatalogCategoryWithHttpInfo` instead */ - public function createCatalogVariantBulkUpdateJobWithHttpInfo(...$args) { - return $this->spawnUpdateVariantsJobWithHttpInfo(...$args); + public function deleteCatalogCategoryRelationshipsItemsWithHttpInfo(...$args) { + return $this->removeItemsFromCatalogCategoryWithHttpInfo(...$args); } /** - * Operation spawnUpdateVariantsJobAsync + * Operation removeItemsFromCatalogCategoryAsync * - * Spawn Update Variants Job + * Remove Items from Catalog Category * - * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnUpdateVariantsJobAsync($catalog_variant_update_job_create_query, $apiKey = null) + public function removeItemsFromCatalogCategoryAsync($id, $catalog_category_item_op, $apiKey = null) { - return $this->spawnUpdateVariantsJobAsyncWithHttpInfo($catalog_variant_update_job_create_query, $apiKey) + return $this->removeItemsFromCatalogCategoryAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -19202,52 +20284,35 @@ function ($response) { } /** - * Alias of `spawnUpdateVariantsJobAsync` + * Alias of `removeItemsFromCatalogCategoryAsync` * - * @deprecated use `spawnUpdateVariantsJobAsync` instead + * @deprecated use `removeItemsFromCatalogCategoryAsync` instead */ - public function createCatalogVariantBulkUpdateJobAsync(...$args) { - return $this->spawnUpdateVariantsJobAsync(...$args); + public function deleteCatalogCategoryRelationshipsItemsAsync(...$args) { + return $this->removeItemsFromCatalogCategoryAsync(...$args); } /** - * Operation spawnUpdateVariantsJobAsyncWithHttpInfo - * - * Spawn Update Variants Job + * Operation removeItemsFromCatalogCategoryAsyncWithHttpInfo * - * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) + * Remove Items from Catalog Category * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function spawnUpdateVariantsJobAsyncWithHttpInfo($catalog_variant_update_job_create_query, $apiKey = null) - { - $returnType = 'array'; - $request = $this->spawnUpdateVariantsJobRequest($catalog_variant_update_job_create_query, $apiKey); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeItemsFromCatalogCategoryAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) + { + $returnType = ''; + $request = $this->removeItemsFromCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey); - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -19267,32 +20332,39 @@ function ($exception) { } /** - * Alias of `spawnUpdateVariantsJobAsyncWithHttpInfo` + * Alias of `removeItemsFromCatalogCategoryAsyncWithHttpInfo` * - * @deprecated use `spawnUpdateVariantsJobAsyncWithHttpInfo` instead + * @deprecated use `removeItemsFromCatalogCategoryAsyncWithHttpInfo` instead */ - public function createCatalogVariantBulkUpdateJobAsyncWithHttpInfo(...$args) { - return $this->spawnUpdateVariantsJobAsyncWithHttpInfo(...$args); + public function deleteCatalogCategoryRelationshipsItemsAsyncWithHttpInfo(...$args) { + return $this->removeItemsFromCatalogCategoryAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnUpdateVariantsJob' + * Create request for operation 'removeItemsFromCatalogCategory' * - * @param \KlaviyoAPI\Model\CatalogVariantUpdateJobCreateQuery $catalog_variant_update_job_create_query (required) + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnUpdateVariantsJobRequest($catalog_variant_update_job_create_query, $apiKey = null) + public function removeItemsFromCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey = null) { - // verify the required parameter 'catalog_variant_update_job_create_query' is set - if ($catalog_variant_update_job_create_query === null || (is_array($catalog_variant_update_job_create_query) && count($catalog_variant_update_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_variant_update_job_create_query when calling spawnUpdateVariantsJob' + 'Missing the required parameter $id when calling removeItemsFromCatalogCategory' + ); + } + // verify the required parameter 'catalog_category_item_op' is set + if ($catalog_category_item_op === null || (is_array($catalog_category_item_op) && count($catalog_category_item_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $catalog_category_item_op when calling removeItemsFromCatalogCategory' ); } - $resourcePath = '/api/catalog-variant-bulk-update-jobs/'; + $resourcePath = '/api/catalog-categories/{id}/relationships/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19301,25 +20373,33 @@ public function spawnUpdateVariantsJobRequest($catalog_variant_update_job_create + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_variant_update_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_update_job_create_query)); + if (isset($catalog_category_item_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_item_op)); } else { - $httpBody = $catalog_variant_update_job_create_query; + $httpBody = $catalog_category_item_op; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -19336,7 +20416,7 @@ public function spawnUpdateVariantsJobRequest($catalog_variant_update_job_create // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -19360,7 +20440,7 @@ public function spawnUpdateVariantsJobRequest($catalog_variant_update_job_create $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -19370,7 +20450,7 @@ public function spawnUpdateVariantsJobRequest($catalog_variant_update_job_create $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19378,12 +20458,12 @@ public function spawnUpdateVariantsJobRequest($catalog_variant_update_job_create } /** - * Alias of `spawnUpdateVariantsJobRequest` + * Alias of `removeItemsFromCatalogCategoryRequest` * - * @deprecated use `spawnUpdateVariantsJobRequest` instead + * @deprecated use `removeItemsFromCatalogCategoryRequest` instead */ - public function createCatalogVariantBulkUpdateJobRequest(...$args) { - return $this->spawnUpdateVariantsJobRequest(...$args); + public function deleteCatalogCategoryRelationshipsItemsRequest(...$args) { + return $this->removeItemsFromCatalogCategoryRequest(...$args); } /** @@ -19675,7 +20755,7 @@ public function updateCatalogCategoryRequest($id, $catalog_category_update_query ); } - $resourcePath = '/api/catalog-categories/{id}/'; + $resourcePath = '/api/catalog-categories/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19696,18 +20776,18 @@ public function updateCatalogCategoryRequest($id, $catalog_category_update_query if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($catalog_category_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_update_query)); } else { $httpBody = $catalog_category_update_query; @@ -19727,7 +20807,7 @@ public function updateCatalogCategoryRequest($id, $catalog_category_update_query // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -19751,7 +20831,7 @@ public function updateCatalogCategoryRequest($id, $catalog_category_update_query $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -19769,37 +20849,38 @@ public function updateCatalogCategoryRequest($id, $catalog_category_update_query } /** - * Operation updateCatalogCategoryRelationshipsItems + * Operation updateCatalogItem * - * Update Catalog Category Relationships Items + * Update Catalog Item * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op catalog_category_item_op (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query catalog_item_update_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function updateCatalogCategoryRelationshipsItems($id, $catalog_category_item_op, $apiKey = null) + public function updateCatalogItem($id, $catalog_item_update_query, $apiKey = null) { - $this->updateCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalog_category_item_op, $apiKey); + list($response) = $this->updateCatalogItemWithHttpInfo($id, $catalog_item_update_query, $apiKey); + return $response; } /** - * Operation updateCatalogCategoryRelationshipsItemsWithHttpInfo + * Operation updateCatalogItemWithHttpInfo * - * Update Catalog Category Relationships Items + * Update Catalog Item * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function updateCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) + public function updateCatalogItemWithHttpInfo($id, $catalog_item_update_query, $apiKey = null) { - $request = $this->updateCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey); + $request = $this->updateCatalogItemRequest($id, $catalog_item_update_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -19836,10 +20917,103 @@ public function updateCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalo ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19862,19 +21036,19 @@ public function updateCatalogCategoryRelationshipsItemsWithHttpInfo($id, $catalo } /** - * Operation updateCatalogCategoryRelationshipsItemsAsync + * Operation updateCatalogItemAsync * - * Update Catalog Category Relationships Items + * Update Catalog Item * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogCategoryRelationshipsItemsAsync($id, $catalog_category_item_op, $apiKey = null) + public function updateCatalogItemAsync($id, $catalog_item_update_query, $apiKey = null) { - return $this->updateCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey) + return $this->updateCatalogItemAsyncWithHttpInfo($id, $catalog_item_update_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -19883,26 +21057,44 @@ function ($response) { } /** - * Operation updateCatalogCategoryRelationshipsItemsAsyncWithHttpInfo + * Operation updateCatalogItemAsyncWithHttpInfo * - * Update Catalog Category Relationships Items + * Update Catalog Item * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogCategoryRelationshipsItemsAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) + public function updateCatalogItemAsyncWithHttpInfo($id, $catalog_item_update_query, $apiKey = null) { - $returnType = ''; - $request = $this->updateCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey); + $returnType = 'array'; + $request = $this->updateCatalogItemRequest($id, $catalog_item_update_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -19922,30 +21114,30 @@ function ($exception) { } /** - * Create request for operation 'updateCatalogCategoryRelationshipsItems' + * Create request for operation 'updateCatalogItem' * - * @param string $id (required) - * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCatalogCategoryRelationshipsItemsRequest($id, $catalog_category_item_op, $apiKey = null) + public function updateCatalogItemRequest($id, $catalog_item_update_query, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling updateCatalogCategoryRelationshipsItems' + 'Missing the required parameter $id when calling updateCatalogItem' ); } - // verify the required parameter 'catalog_category_item_op' is set - if ($catalog_category_item_op === null || (is_array($catalog_category_item_op) && count($catalog_category_item_op) === 0)) { + // verify the required parameter 'catalog_item_update_query' is set + if ($catalog_item_update_query === null || (is_array($catalog_item_update_query) && count($catalog_item_update_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_category_item_op when calling updateCatalogCategoryRelationshipsItems' + 'Missing the required parameter $catalog_item_update_query when calling updateCatalogItem' ); } - $resourcePath = '/api/catalog-categories/{id}/relationships/items/'; + $resourcePath = '/api/catalog-items/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19966,21 +21158,21 @@ public function updateCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_category_item_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_item_op)); + if (isset($catalog_item_update_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_update_query)); } else { - $httpBody = $catalog_category_item_op; + $httpBody = $catalog_item_update_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -19997,7 +21189,7 @@ public function updateCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -20021,7 +21213,7 @@ public function updateCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -20039,38 +21231,38 @@ public function updateCatalogCategoryRelationshipsItemsRequest($id, $catalog_cat } /** - * Operation updateCatalogItem + * Operation updateCatalogVariant * - * Update Catalog Item + * Update Catalog Variant * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query catalog_item_update_query (required) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query catalog_variant_update_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function updateCatalogItem($id, $catalog_item_update_query, $apiKey = null) + public function updateCatalogVariant($id, $catalog_variant_update_query, $apiKey = null) { - list($response) = $this->updateCatalogItemWithHttpInfo($id, $catalog_item_update_query, $apiKey); + list($response) = $this->updateCatalogVariantWithHttpInfo($id, $catalog_variant_update_query, $apiKey); return $response; } /** - * Operation updateCatalogItemWithHttpInfo + * Operation updateCatalogVariantWithHttpInfo * - * Update Catalog Item + * Update Catalog Variant * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function updateCatalogItemWithHttpInfo($id, $catalog_item_update_query, $apiKey = null) + public function updateCatalogVariantWithHttpInfo($id, $catalog_variant_update_query, $apiKey = null) { - $request = $this->updateCatalogItemRequest($id, $catalog_item_update_query, $apiKey); + $request = $this->updateCatalogVariantRequest($id, $catalog_variant_update_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -20226,19 +21418,19 @@ public function updateCatalogItemWithHttpInfo($id, $catalog_item_update_query, $ } /** - * Operation updateCatalogItemAsync + * Operation updateCatalogVariantAsync * - * Update Catalog Item + * Update Catalog Variant * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogItemAsync($id, $catalog_item_update_query, $apiKey = null) + public function updateCatalogVariantAsync($id, $catalog_variant_update_query, $apiKey = null) { - return $this->updateCatalogItemAsyncWithHttpInfo($id, $catalog_item_update_query, $apiKey) + return $this->updateCatalogVariantAsyncWithHttpInfo($id, $catalog_variant_update_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -20247,20 +21439,20 @@ function ($response) { } /** - * Operation updateCatalogItemAsyncWithHttpInfo - * - * Update Catalog Item + * Operation updateCatalogVariantAsyncWithHttpInfo * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) + * Update Catalog Variant + * + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogItemAsyncWithHttpInfo($id, $catalog_item_update_query, $apiKey = null) + public function updateCatalogVariantAsyncWithHttpInfo($id, $catalog_variant_update_query, $apiKey = null) { $returnType = 'array'; - $request = $this->updateCatalogItemRequest($id, $catalog_item_update_query, $apiKey); + $request = $this->updateCatalogVariantRequest($id, $catalog_variant_update_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20304,30 +21496,30 @@ function ($exception) { } /** - * Create request for operation 'updateCatalogItem' + * Create request for operation 'updateCatalogVariant' * - * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogItemUpdateQuery $catalog_item_update_query (required) + * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCatalogItemRequest($id, $catalog_item_update_query, $apiKey = null) + public function updateCatalogVariantRequest($id, $catalog_variant_update_query, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling updateCatalogItem' + 'Missing the required parameter $id when calling updateCatalogVariant' ); } - // verify the required parameter 'catalog_item_update_query' is set - if ($catalog_item_update_query === null || (is_array($catalog_item_update_query) && count($catalog_item_update_query) === 0)) { + // verify the required parameter 'catalog_variant_update_query' is set + if ($catalog_variant_update_query === null || (is_array($catalog_variant_update_query) && count($catalog_variant_update_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_update_query when calling updateCatalogItem' + 'Missing the required parameter $catalog_variant_update_query when calling updateCatalogVariant' ); } - $resourcePath = '/api/catalog-items/{id}/'; + $resourcePath = '/api/catalog-variants/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20348,21 +21540,21 @@ public function updateCatalogItemRequest($id, $catalog_item_update_query, $apiKe if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_item_update_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_update_query)); + if (isset($catalog_variant_update_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_update_query)); } else { - $httpBody = $catalog_item_update_query; + $httpBody = $catalog_variant_update_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -20379,7 +21571,7 @@ public function updateCatalogItemRequest($id, $catalog_item_update_query, $apiKe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -20403,7 +21595,7 @@ public function updateCatalogItemRequest($id, $catalog_item_update_query, $apiKe $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -20421,37 +21613,46 @@ public function updateCatalogItemRequest($id, $catalog_item_update_query, $apiKe } /** - * Operation updateCatalogItemRelationshipsCategories + * Operation updateCategoriesForCatalogItem * - * Update Catalog Item Relationships Categories + * Update Categories for Catalog Item * - * @param string $id (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op catalog_item_category_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updateCatalogItemRelationshipsCategories($id, $catalog_item_category_op, $apiKey = null) + public function updateCategoriesForCatalogItem($id, $catalog_item_category_op, $apiKey = null) { - $this->updateCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catalog_item_category_op, $apiKey); + $this->updateCategoriesForCatalogItemWithHttpInfo($id, $catalog_item_category_op, $apiKey); + } + + /** + * Alias of `updateCategoriesForCatalogItem` + * + * @deprecated use `updateCategoriesForCatalogItem` instead + */ + public function updateCatalogItemRelationshipsCategories(...$args) { + return $this->updateCategoriesForCatalogItem(...$args); } /** - * Operation updateCatalogItemRelationshipsCategoriesWithHttpInfo + * Operation updateCategoriesForCatalogItemWithHttpInfo * - * Update Catalog Item Relationships Categories + * Update Categories for Catalog Item * - * @param string $id (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) + public function updateCategoriesForCatalogItemWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) { - $request = $this->updateCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey); + $request = $this->updateCategoriesForCatalogItemRequest($id, $catalog_item_category_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -20514,19 +21715,28 @@ public function updateCatalogItemRelationshipsCategoriesWithHttpInfo($id, $catal } /** - * Operation updateCatalogItemRelationshipsCategoriesAsync + * Alias of `updateCategoriesForCatalogItemWithHttpInfo` + * + * @deprecated use `updateCategoriesForCatalogItemWithHttpInfo` instead + */ + public function updateCatalogItemRelationshipsCategoriesWithHttpInfo(...$args) { + return $this->updateCategoriesForCatalogItemWithHttpInfo(...$args); + } + + /** + * Operation updateCategoriesForCatalogItemAsync * - * Update Catalog Item Relationships Categories + * Update Categories for Catalog Item * - * @param string $id (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogItemRelationshipsCategoriesAsync($id, $catalog_item_category_op, $apiKey = null) + public function updateCategoriesForCatalogItemAsync($id, $catalog_item_category_op, $apiKey = null) { - return $this->updateCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey) + return $this->updateCategoriesForCatalogItemAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -20535,20 +21745,29 @@ function ($response) { } /** - * Operation updateCatalogItemRelationshipsCategoriesAsyncWithHttpInfo + * Alias of `updateCategoriesForCatalogItemAsync` + * + * @deprecated use `updateCategoriesForCatalogItemAsync` instead + */ + public function updateCatalogItemRelationshipsCategoriesAsync(...$args) { + return $this->updateCategoriesForCatalogItemAsync(...$args); + } + + /** + * Operation updateCategoriesForCatalogItemAsyncWithHttpInfo * - * Update Catalog Item Relationships Categories + * Update Categories for Catalog Item * - * @param string $id (required) + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogItemRelationshipsCategoriesAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) + public function updateCategoriesForCatalogItemAsyncWithHttpInfo($id, $catalog_item_category_op, $apiKey = null) { $returnType = ''; - $request = $this->updateCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey); + $request = $this->updateCategoriesForCatalogItemRequest($id, $catalog_item_category_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20574,30 +21793,39 @@ function ($exception) { } /** - * Create request for operation 'updateCatalogItemRelationshipsCategories' + * Alias of `updateCategoriesForCatalogItemAsyncWithHttpInfo` * - * @param string $id (required) + * @deprecated use `updateCategoriesForCatalogItemAsyncWithHttpInfo` instead + */ + public function updateCatalogItemRelationshipsCategoriesAsyncWithHttpInfo(...$args) { + return $this->updateCategoriesForCatalogItemAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'updateCategoriesForCatalogItem' + * + * @param string $id The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) * @param \KlaviyoAPI\Model\CatalogItemCategoryOp $catalog_item_category_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCatalogItemRelationshipsCategoriesRequest($id, $catalog_item_category_op, $apiKey = null) + public function updateCategoriesForCatalogItemRequest($id, $catalog_item_category_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling updateCatalogItemRelationshipsCategories' + 'Missing the required parameter $id when calling updateCategoriesForCatalogItem' ); } // verify the required parameter 'catalog_item_category_op' is set if ($catalog_item_category_op === null || (is_array($catalog_item_category_op) && count($catalog_item_category_op) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_item_category_op when calling updateCatalogItemRelationshipsCategories' + 'Missing the required parameter $catalog_item_category_op when calling updateCategoriesForCatalogItem' ); } - $resourcePath = '/api/catalog-items/{id}/relationships/categories/'; + $resourcePath = '/api/catalog-items/{id}/relationships/categories'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20618,18 +21846,18 @@ public function updateCatalogItemRelationshipsCategoriesRequest($id, $catalog_it if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($catalog_item_category_op)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_item_category_op)); } else { $httpBody = $catalog_item_category_op; @@ -20649,7 +21877,7 @@ public function updateCatalogItemRelationshipsCategoriesRequest($id, $catalog_it // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -20673,7 +21901,7 @@ public function updateCatalogItemRelationshipsCategoriesRequest($id, $catalog_it $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -20691,38 +21919,55 @@ public function updateCatalogItemRelationshipsCategoriesRequest($id, $catalog_it } /** - * Operation updateCatalogVariant + * Alias of `updateCategoriesForCatalogItemRequest` * - * Update Catalog Variant + * @deprecated use `updateCategoriesForCatalogItemRequest` instead + */ + public function updateCatalogItemRelationshipsCategoriesRequest(...$args) { + return $this->updateCategoriesForCatalogItemRequest(...$args); + } + + /** + * Operation updateItemsForCatalogCategory * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query catalog_variant_update_query (required) + * Update Items for Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op catalog_category_item_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function updateCatalogVariant($id, $catalog_variant_update_query, $apiKey = null) + public function updateItemsForCatalogCategory($id, $catalog_category_item_op, $apiKey = null) { - list($response) = $this->updateCatalogVariantWithHttpInfo($id, $catalog_variant_update_query, $apiKey); - return $response; + $this->updateItemsForCatalogCategoryWithHttpInfo($id, $catalog_category_item_op, $apiKey); } /** - * Operation updateCatalogVariantWithHttpInfo + * Alias of `updateItemsForCatalogCategory` * - * Update Catalog Variant + * @deprecated use `updateItemsForCatalogCategory` instead + */ + public function updateCatalogCategoryRelationshipsItems(...$args) { + return $this->updateItemsForCatalogCategory(...$args); + } + + /** + * Operation updateItemsForCatalogCategoryWithHttpInfo * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) + * Update Items for Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateCatalogVariantWithHttpInfo($id, $catalog_variant_update_query, $apiKey = null) + public function updateItemsForCatalogCategoryWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) { - $request = $this->updateCatalogVariantRequest($id, $catalog_variant_update_query, $apiKey); + $request = $this->updateItemsForCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -20759,103 +22004,10 @@ public function updateCatalogVariantWithHttpInfo($id, $catalog_variant_update_qu ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20878,19 +22030,28 @@ public function updateCatalogVariantWithHttpInfo($id, $catalog_variant_update_qu } /** - * Operation updateCatalogVariantAsync + * Alias of `updateItemsForCatalogCategoryWithHttpInfo` * - * Update Catalog Variant + * @deprecated use `updateItemsForCatalogCategoryWithHttpInfo` instead + */ + public function updateCatalogCategoryRelationshipsItemsWithHttpInfo(...$args) { + return $this->updateItemsForCatalogCategoryWithHttpInfo(...$args); + } + + /** + * Operation updateItemsForCatalogCategoryAsync * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) + * Update Items for Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogVariantAsync($id, $catalog_variant_update_query, $apiKey = null) + public function updateItemsForCatalogCategoryAsync($id, $catalog_category_item_op, $apiKey = null) { - return $this->updateCatalogVariantAsyncWithHttpInfo($id, $catalog_variant_update_query, $apiKey) + return $this->updateItemsForCatalogCategoryAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -20899,44 +22060,35 @@ function ($response) { } /** - * Operation updateCatalogVariantAsyncWithHttpInfo + * Alias of `updateItemsForCatalogCategoryAsync` * - * Update Catalog Variant + * @deprecated use `updateItemsForCatalogCategoryAsync` instead + */ + public function updateCatalogCategoryRelationshipsItemsAsync(...$args) { + return $this->updateItemsForCatalogCategoryAsync(...$args); + } + + /** + * Operation updateItemsForCatalogCategoryAsyncWithHttpInfo * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) + * Update Items for Catalog Category + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCatalogVariantAsyncWithHttpInfo($id, $catalog_variant_update_query, $apiKey = null) + public function updateItemsForCatalogCategoryAsyncWithHttpInfo($id, $catalog_category_item_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->updateCatalogVariantRequest($id, $catalog_variant_update_query, $apiKey); + $returnType = ''; + $request = $this->updateItemsForCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -20956,30 +22108,39 @@ function ($exception) { } /** - * Create request for operation 'updateCatalogVariant' + * Alias of `updateItemsForCatalogCategoryAsyncWithHttpInfo` * - * @param string $id The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) - * @param \KlaviyoAPI\Model\CatalogVariantUpdateQuery $catalog_variant_update_query (required) + * @deprecated use `updateItemsForCatalogCategoryAsyncWithHttpInfo` instead + */ + public function updateCatalogCategoryRelationshipsItemsAsyncWithHttpInfo(...$args) { + return $this->updateItemsForCatalogCategoryAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'updateItemsForCatalogCategory' + * + * @param string $id The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. (required) + * @param \KlaviyoAPI\Model\CatalogCategoryItemOp $catalog_category_item_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCatalogVariantRequest($id, $catalog_variant_update_query, $apiKey = null) + public function updateItemsForCatalogCategoryRequest($id, $catalog_category_item_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling updateCatalogVariant' + 'Missing the required parameter $id when calling updateItemsForCatalogCategory' ); } - // verify the required parameter 'catalog_variant_update_query' is set - if ($catalog_variant_update_query === null || (is_array($catalog_variant_update_query) && count($catalog_variant_update_query) === 0)) { + // verify the required parameter 'catalog_category_item_op' is set + if ($catalog_category_item_op === null || (is_array($catalog_category_item_op) && count($catalog_category_item_op) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalog_variant_update_query when calling updateCatalogVariant' + 'Missing the required parameter $catalog_category_item_op when calling updateItemsForCatalogCategory' ); } - $resourcePath = '/api/catalog-variants/{id}/'; + $resourcePath = '/api/catalog-categories/{id}/relationships/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21000,21 +22161,21 @@ public function updateCatalogVariantRequest($id, $catalog_variant_update_query, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($catalog_variant_update_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_variant_update_query)); + if (isset($catalog_category_item_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_item_op)); } else { - $httpBody = $catalog_variant_update_query; + $httpBody = $catalog_category_item_op; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -21031,7 +22192,7 @@ public function updateCatalogVariantRequest($id, $catalog_variant_update_query, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -21055,7 +22216,7 @@ public function updateCatalogVariantRequest($id, $catalog_variant_update_query, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -21072,6 +22233,15 @@ public function updateCatalogVariantRequest($id, $catalog_variant_update_query, ); } + /** + * Alias of `updateItemsForCatalogCategoryRequest` + * + * @deprecated use `updateItemsForCatalogCategoryRequest` instead + */ + public function updateCatalogCategoryRelationshipsItemsRequest(...$args) { + return $this->updateItemsForCatalogCategoryRequest(...$args); + } + /** * Create http client option * diff --git a/lib/API/CouponsApi.php b/lib/API/CouponsApi.php index a397026..ae11051 100644 --- a/lib/API/CouponsApi.php +++ b/lib/API/CouponsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -117,36 +117,54 @@ public function getConfig() } /** - * Operation createCoupon + * Operation bulkCreateCouponCodes * - * Create Coupon + * Bulk Create Coupon Codes * - * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query coupon_create_query (required) + * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query coupon_code_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCoupon($coupon_create_query, $apiKey = null) + public function bulkCreateCouponCodes($coupon_code_create_job_create_query, $apiKey = null) { - list($response) = $this->createCouponWithHttpInfo($coupon_create_query, $apiKey); + list($response) = $this->bulkCreateCouponCodesWithHttpInfo($coupon_code_create_job_create_query, $apiKey); return $response; } /** - * Operation createCouponWithHttpInfo + * Alias of `bulkCreateCouponCodes` * - * Create Coupon + * @deprecated use `bulkCreateCouponCodes` instead + */ + public function spawnCouponCodeBulkCreateJob(...$args) { + return $this->bulkCreateCouponCodes(...$args); + } + + /** + * Alias of `bulkCreateCouponCodes` * - * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) + * @deprecated use `bulkCreateCouponCodes` instead + */ + public function createCouponCodeBulkCreateJob(...$args) { + return $this->bulkCreateCouponCodes(...$args); + } + + /** + * Operation bulkCreateCouponCodesWithHttpInfo + * + * Bulk Create Coupon Codes + * + * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCouponWithHttpInfo($coupon_create_query, $apiKey = null) + public function bulkCreateCouponCodesWithHttpInfo($coupon_code_create_job_create_query, $apiKey = null) { - $request = $this->createCouponRequest($coupon_create_query, $apiKey); + $request = $this->bulkCreateCouponCodesRequest($coupon_code_create_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -184,7 +202,7 @@ public function createCouponWithHttpInfo($coupon_create_query, $apiKey = null) } switch($statusCode) { - case 201: + case 202: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -272,7 +290,7 @@ public function createCouponWithHttpInfo($coupon_create_query, $apiKey = null) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -302,18 +320,36 @@ public function createCouponWithHttpInfo($coupon_create_query, $apiKey = null) } /** - * Operation createCouponAsync + * Alias of `bulkCreateCouponCodesWithHttpInfo` * - * Create Coupon + * @deprecated use `bulkCreateCouponCodesWithHttpInfo` instead + */ + public function spawnCouponCodeBulkCreateJobWithHttpInfo(...$args) { + return $this->bulkCreateCouponCodesWithHttpInfo(...$args); + } + + /** + * Alias of `bulkCreateCouponCodesWithHttpInfo` * - * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) + * @deprecated use `bulkCreateCouponCodesWithHttpInfo` instead + */ + public function createCouponCodeBulkCreateJobWithHttpInfo(...$args) { + return $this->bulkCreateCouponCodesWithHttpInfo(...$args); + } + + /** + * Operation bulkCreateCouponCodesAsync + * + * Bulk Create Coupon Codes + * + * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponAsync($coupon_create_query, $apiKey = null) + public function bulkCreateCouponCodesAsync($coupon_code_create_job_create_query, $apiKey = null) { - return $this->createCouponAsyncWithHttpInfo($coupon_create_query, $apiKey) + return $this->bulkCreateCouponCodesAsyncWithHttpInfo($coupon_code_create_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -322,19 +358,37 @@ function ($response) { } /** - * Operation createCouponAsyncWithHttpInfo + * Alias of `bulkCreateCouponCodesAsync` * - * Create Coupon + * @deprecated use `bulkCreateCouponCodesAsync` instead + */ + public function spawnCouponCodeBulkCreateJobAsync(...$args) { + return $this->bulkCreateCouponCodesAsync(...$args); + } + + /** + * Alias of `bulkCreateCouponCodesAsync` * - * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) + * @deprecated use `bulkCreateCouponCodesAsync` instead + */ + public function createCouponCodeBulkCreateJobAsync(...$args) { + return $this->bulkCreateCouponCodesAsync(...$args); + } + + /** + * Operation bulkCreateCouponCodesAsyncWithHttpInfo + * + * Bulk Create Coupon Codes + * + * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponAsyncWithHttpInfo($coupon_create_query, $apiKey = null) + public function bulkCreateCouponCodesAsyncWithHttpInfo($coupon_code_create_job_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createCouponRequest($coupon_create_query, $apiKey); + $request = $this->bulkCreateCouponCodesRequest($coupon_code_create_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -378,23 +432,41 @@ function ($exception) { } /** - * Create request for operation 'createCoupon' + * Alias of `bulkCreateCouponCodesAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) + * @deprecated use `bulkCreateCouponCodesAsyncWithHttpInfo` instead + */ + public function spawnCouponCodeBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCouponCodesAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkCreateCouponCodesAsyncWithHttpInfo` + * + * @deprecated use `bulkCreateCouponCodesAsyncWithHttpInfo` instead + */ + public function createCouponCodeBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->bulkCreateCouponCodesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkCreateCouponCodes' + * + * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCouponRequest($coupon_create_query, $apiKey = null) + public function bulkCreateCouponCodesRequest($coupon_code_create_job_create_query, $apiKey = null) { - // verify the required parameter 'coupon_create_query' is set - if ($coupon_create_query === null || (is_array($coupon_create_query) && count($coupon_create_query) === 0)) { + // verify the required parameter 'coupon_code_create_job_create_query' is set + if ($coupon_code_create_job_create_query === null || (is_array($coupon_code_create_job_create_query) && count($coupon_code_create_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $coupon_create_query when calling createCoupon' + 'Missing the required parameter $coupon_code_create_job_create_query when calling bulkCreateCouponCodes' ); } - $resourcePath = '/api/coupons/'; + $resourcePath = '/api/coupon-code-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -407,21 +479,21 @@ public function createCouponRequest($coupon_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($coupon_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_create_query)); + if (isset($coupon_code_create_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_code_create_job_create_query)); } else { - $httpBody = $coupon_create_query; + $httpBody = $coupon_code_create_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -438,7 +510,7 @@ public function createCouponRequest($coupon_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -462,7 +534,7 @@ public function createCouponRequest($coupon_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -480,36 +552,54 @@ public function createCouponRequest($coupon_create_query, $apiKey = null) } /** - * Operation createCouponCode + * Alias of `bulkCreateCouponCodesRequest` * - * Create Coupon Code + * @deprecated use `bulkCreateCouponCodesRequest` instead + */ + public function spawnCouponCodeBulkCreateJobRequest(...$args) { + return $this->bulkCreateCouponCodesRequest(...$args); + } + + /** + * Alias of `bulkCreateCouponCodesRequest` * - * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query coupon_code_create_query (required) + * @deprecated use `bulkCreateCouponCodesRequest` instead + */ + public function createCouponCodeBulkCreateJobRequest(...$args) { + return $this->bulkCreateCouponCodesRequest(...$args); + } + + /** + * Operation createCoupon + * + * Create Coupon + * + * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query coupon_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createCouponCode($coupon_code_create_query, $apiKey = null) + public function createCoupon($coupon_create_query, $apiKey = null) { - list($response) = $this->createCouponCodeWithHttpInfo($coupon_code_create_query, $apiKey); + list($response) = $this->createCouponWithHttpInfo($coupon_create_query, $apiKey); return $response; } /** - * Operation createCouponCodeWithHttpInfo + * Operation createCouponWithHttpInfo * - * Create Coupon Code + * Create Coupon * - * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) + * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createCouponCodeWithHttpInfo($coupon_code_create_query, $apiKey = null) + public function createCouponWithHttpInfo($coupon_create_query, $apiKey = null) { - $request = $this->createCouponCodeRequest($coupon_code_create_query, $apiKey); + $request = $this->createCouponRequest($coupon_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -547,7 +637,7 @@ public function createCouponCodeWithHttpInfo($coupon_code_create_query, $apiKey } switch($statusCode) { - case 200: + case 201: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -635,7 +725,7 @@ public function createCouponCodeWithHttpInfo($coupon_code_create_query, $apiKey } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -665,18 +755,18 @@ public function createCouponCodeWithHttpInfo($coupon_code_create_query, $apiKey } /** - * Operation createCouponCodeAsync + * Operation createCouponAsync * - * Create Coupon Code + * Create Coupon * - * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) + * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponCodeAsync($coupon_code_create_query, $apiKey = null) + public function createCouponAsync($coupon_create_query, $apiKey = null) { - return $this->createCouponCodeAsyncWithHttpInfo($coupon_code_create_query, $apiKey) + return $this->createCouponAsyncWithHttpInfo($coupon_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -685,19 +775,19 @@ function ($response) { } /** - * Operation createCouponCodeAsyncWithHttpInfo + * Operation createCouponAsyncWithHttpInfo * - * Create Coupon Code + * Create Coupon * - * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) + * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponCodeAsyncWithHttpInfo($coupon_code_create_query, $apiKey = null) + public function createCouponAsyncWithHttpInfo($coupon_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createCouponCodeRequest($coupon_code_create_query, $apiKey); + $request = $this->createCouponRequest($coupon_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -741,23 +831,23 @@ function ($exception) { } /** - * Create request for operation 'createCouponCode' + * Create request for operation 'createCoupon' * - * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) + * @param \KlaviyoAPI\Model\CouponCreateQuery $coupon_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createCouponCodeRequest($coupon_code_create_query, $apiKey = null) + public function createCouponRequest($coupon_create_query, $apiKey = null) { - // verify the required parameter 'coupon_code_create_query' is set - if ($coupon_code_create_query === null || (is_array($coupon_code_create_query) && count($coupon_code_create_query) === 0)) { + // verify the required parameter 'coupon_create_query' is set + if ($coupon_create_query === null || (is_array($coupon_create_query) && count($coupon_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $coupon_code_create_query when calling createCouponCode' + 'Missing the required parameter $coupon_create_query when calling createCoupon' ); } - $resourcePath = '/api/coupon-codes/'; + $resourcePath = '/api/coupons'; $formParams = []; $queryParams = []; $headerParams = []; @@ -770,21 +860,21 @@ public function createCouponCodeRequest($coupon_code_create_query, $apiKey = nul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($coupon_code_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_code_create_query)); + if (isset($coupon_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_create_query)); } else { - $httpBody = $coupon_code_create_query; + $httpBody = $coupon_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -801,7 +891,7 @@ public function createCouponCodeRequest($coupon_code_create_query, $apiKey = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -825,7 +915,7 @@ public function createCouponCodeRequest($coupon_code_create_query, $apiKey = nul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -843,35 +933,36 @@ public function createCouponCodeRequest($coupon_code_create_query, $apiKey = nul } /** - * Operation deleteCoupon + * Operation createCouponCode * - * Delete Coupon + * Create Coupon Code * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query coupon_code_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteCoupon($id, $apiKey = null) + public function createCouponCode($coupon_code_create_query, $apiKey = null) { - $this->deleteCouponWithHttpInfo($id, $apiKey); + list($response) = $this->createCouponCodeWithHttpInfo($coupon_code_create_query, $apiKey); + return $response; } /** - * Operation deleteCouponWithHttpInfo + * Operation createCouponCodeWithHttpInfo * - * Delete Coupon + * Create Coupon Code * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCouponWithHttpInfo($id, $apiKey = null) + public function createCouponCodeWithHttpInfo($coupon_code_create_query, $apiKey = null) { - $request = $this->deleteCouponRequest($id, $apiKey); + $request = $this->createCouponCodeRequest($coupon_code_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -908,71 +999,182 @@ public function deleteCouponWithHttpInfo($id, $apiKey = null) ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - } catch (ApiException $e) { - switch ($e->getCode()) { + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } - /** - * Operation deleteCouponAsync - * - * Delete Coupon - * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteCouponAsync($id, $apiKey = null) - { - return $this->deleteCouponAsyncWithHttpInfo($id, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } - /** - * Operation deleteCouponAsyncWithHttpInfo + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createCouponCodeAsync * - * Delete Coupon + * Create Coupon Code * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCouponAsyncWithHttpInfo($id, $apiKey = null) + public function createCouponCodeAsync($coupon_code_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->deleteCouponRequest($id, $apiKey); + return $this->createCouponCodeAsyncWithHttpInfo($coupon_code_create_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCouponCodeAsyncWithHttpInfo + * + * Create Coupon Code + * + * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCouponCodeAsyncWithHttpInfo($coupon_code_create_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->createCouponCodeRequest($coupon_code_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -992,23 +1194,23 @@ function ($exception) { } /** - * Create request for operation 'deleteCoupon' + * Create request for operation 'createCouponCode' * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param \KlaviyoAPI\Model\CouponCodeCreateQuery $coupon_code_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCouponRequest($id, $apiKey = null) + public function createCouponCodeRequest($coupon_code_create_query, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'coupon_code_create_query' is set + if ($coupon_code_create_query === null || (is_array($coupon_code_create_query) && count($coupon_code_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCoupon' + 'Missing the required parameter $coupon_code_create_query when calling createCouponCode' ); } - $resourcePath = '/api/coupons/{id}/'; + $resourcePath = '/api/coupon-codes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1017,29 +1219,27 @@ public function deleteCouponRequest($id, $apiKey = null) - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($coupon_code_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_code_create_query)); + } else { + $httpBody = $coupon_code_create_query; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1054,7 +1254,7 @@ public function deleteCouponRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1078,7 +1278,7 @@ public function deleteCouponRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1088,7 +1288,7 @@ public function deleteCouponRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1096,35 +1296,35 @@ public function deleteCouponRequest($id, $apiKey = null) } /** - * Operation deleteCouponCode + * Operation deleteCoupon * - * Delete Coupon Code + * Delete Coupon * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteCouponCode($id, $apiKey = null) + public function deleteCoupon($id, $apiKey = null) { - $this->deleteCouponCodeWithHttpInfo($id, $apiKey); + $this->deleteCouponWithHttpInfo($id, $apiKey); } /** - * Operation deleteCouponCodeWithHttpInfo + * Operation deleteCouponWithHttpInfo * - * Delete Coupon Code + * Delete Coupon * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCouponCodeWithHttpInfo($id, $apiKey = null) + public function deleteCouponWithHttpInfo($id, $apiKey = null) { - $request = $this->deleteCouponCodeRequest($id, $apiKey); + $request = $this->deleteCouponRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1187,18 +1387,18 @@ public function deleteCouponCodeWithHttpInfo($id, $apiKey = null) } /** - * Operation deleteCouponCodeAsync + * Operation deleteCouponAsync * - * Delete Coupon Code + * Delete Coupon * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCouponCodeAsync($id, $apiKey = null) + public function deleteCouponAsync($id, $apiKey = null) { - return $this->deleteCouponCodeAsyncWithHttpInfo($id, $apiKey) + return $this->deleteCouponAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -1207,19 +1407,19 @@ function ($response) { } /** - * Operation deleteCouponCodeAsyncWithHttpInfo + * Operation deleteCouponAsyncWithHttpInfo * - * Delete Coupon Code + * Delete Coupon * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCouponCodeAsyncWithHttpInfo($id, $apiKey = null) + public function deleteCouponAsyncWithHttpInfo($id, $apiKey = null) { $returnType = ''; - $request = $this->deleteCouponCodeRequest($id, $apiKey); + $request = $this->deleteCouponRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1245,23 +1445,23 @@ function ($exception) { } /** - * Create request for operation 'deleteCouponCode' + * Create request for operation 'deleteCoupon' * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCouponCodeRequest($id, $apiKey = null) + public function deleteCouponRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteCouponCode' + 'Missing the required parameter $id when calling deleteCoupon' ); } - $resourcePath = '/api/coupon-codes/{id}/'; + $resourcePath = '/api/coupons/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1282,11 +1482,11 @@ public function deleteCouponCodeRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1307,7 +1507,7 @@ public function deleteCouponCodeRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1331,7 +1531,7 @@ public function deleteCouponCodeRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1349,38 +1549,35 @@ public function deleteCouponCodeRequest($id, $apiKey = null) } /** - * Operation getCoupon + * Operation deleteCouponCode * - * Get Coupon + * Delete Coupon Code * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getCoupon($id, $fields_coupon = null, $apiKey = null) + public function deleteCouponCode($id, $apiKey = null) { - list($response) = $this->getCouponWithHttpInfo($id, $fields_coupon, $apiKey); - return $response; + $this->deleteCouponCodeWithHttpInfo($id, $apiKey); } /** - * Operation getCouponWithHttpInfo + * Operation deleteCouponCodeWithHttpInfo * - * Get Coupon + * Delete Coupon Code * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponWithHttpInfo($id, $fields_coupon = null, $apiKey = null) + public function deleteCouponCodeWithHttpInfo($id, $apiKey = null) { - $request = $this->getCouponRequest($id, $fields_coupon, $apiKey); + $request = $this->deleteCouponCodeRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1417,103 +1614,10 @@ public function getCouponWithHttpInfo($id, $fields_coupon = null, $apiKey = null ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1536,19 +1640,18 @@ public function getCouponWithHttpInfo($id, $fields_coupon = null, $apiKey = null } /** - * Operation getCouponAsync + * Operation deleteCouponCodeAsync * - * Get Coupon + * Delete Coupon Code * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponAsync($id, $fields_coupon = null, $apiKey = null) + public function deleteCouponCodeAsync($id, $apiKey = null) { - return $this->getCouponAsyncWithHttpInfo($id, $fields_coupon, $apiKey) + return $this->deleteCouponCodeAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -1557,44 +1660,25 @@ function ($response) { } /** - * Operation getCouponAsyncWithHttpInfo + * Operation deleteCouponCodeAsyncWithHttpInfo * - * Get Coupon + * Delete Coupon Code * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponAsyncWithHttpInfo($id, $fields_coupon = null, $apiKey = null) - { - $returnType = 'array'; - $request = $this->getCouponRequest($id, $fields_coupon, $apiKey); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } + public function deleteCouponCodeAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = ''; + $request = $this->deleteCouponCodeRequest($id, $apiKey); - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1614,39 +1698,29 @@ function ($exception) { } /** - * Create request for operation 'getCoupon' + * Create request for operation 'deleteCouponCode' * - * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponRequest($id, $fields_coupon = null, $apiKey = null) + public function deleteCouponCodeRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCoupon' + 'Missing the required parameter $id when calling deleteCouponCode' ); } - $resourcePath = '/api/coupons/{id}/'; + $resourcePath = '/api/coupon-codes/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_coupon, - 'fields[coupon]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -1661,11 +1735,11 @@ public function getCouponRequest($id, $fields_coupon = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1686,7 +1760,7 @@ public function getCouponRequest($id, $fields_coupon = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1710,7 +1784,7 @@ public function getCouponRequest($id, $fields_coupon = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1720,7 +1794,7 @@ public function getCouponRequest($id, $fields_coupon = null, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1728,42 +1802,49 @@ public function getCouponRequest($id, $fields_coupon = null, $apiKey = null) } /** - * Operation getCouponCode + * Operation getBulkCreateCouponCodeJobs * - * Get Coupon Code + * Get Bulk Create Coupon Code Jobs * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponCode($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodeJobs($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getCouponCodeWithHttpInfo($id, $fields_coupon_code, $fields_coupon, $include, $apiKey); + list($response) = $this->getBulkCreateCouponCodeJobsWithHttpInfo($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey); return $response; } /** - * Operation getCouponCodeWithHttpInfo + * Alias of `getBulkCreateCouponCodeJobs` * - * Get Coupon Code + * @deprecated use `getBulkCreateCouponCodeJobs` instead + */ + public function getCouponCodeBulkCreateJobs(...$args) { + return $this->getBulkCreateCouponCodeJobs(...$args); + } + + /** + * Operation getBulkCreateCouponCodeJobsWithHttpInfo * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Bulk Create Coupon Code Jobs + * + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponCodeWithHttpInfo($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodeJobsWithHttpInfo($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getCouponCodeRequest($id, $fields_coupon_code, $fields_coupon, $include, $apiKey); + $request = $this->getBulkCreateCouponCodeJobsRequest($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1919,21 +2000,29 @@ public function getCouponCodeWithHttpInfo($id, $fields_coupon_code = null, $fiel } /** - * Operation getCouponCodeAsync + * Alias of `getBulkCreateCouponCodeJobsWithHttpInfo` * - * Get Coupon Code + * @deprecated use `getBulkCreateCouponCodeJobsWithHttpInfo` instead + */ + public function getCouponCodeBulkCreateJobsWithHttpInfo(...$args) { + return $this->getBulkCreateCouponCodeJobsWithHttpInfo(...$args); + } + + /** + * Operation getBulkCreateCouponCodeJobsAsync * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Bulk Create Coupon Code Jobs + * + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeAsync($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodeJobsAsync($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getCouponCodeAsyncWithHttpInfo($id, $fields_coupon_code, $fields_coupon, $include, $apiKey) + return $this->getBulkCreateCouponCodeJobsAsyncWithHttpInfo($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -1942,22 +2031,30 @@ function ($response) { } /** - * Operation getCouponCodeAsyncWithHttpInfo + * Alias of `getBulkCreateCouponCodeJobsAsync` * - * Get Coupon Code + * @deprecated use `getBulkCreateCouponCodeJobsAsync` instead + */ + public function getCouponCodeBulkCreateJobsAsync(...$args) { + return $this->getBulkCreateCouponCodeJobsAsync(...$args); + } + + /** + * Operation getBulkCreateCouponCodeJobsAsyncWithHttpInfo * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Bulk Create Coupon Code Jobs + * + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeAsyncWithHttpInfo($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodeJobsAsyncWithHttpInfo($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponCodeRequest($id, $fields_coupon_code, $fields_coupon, $include, $apiKey); + $request = $this->getBulkCreateCouponCodeJobsRequest($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2001,26 +2098,28 @@ function ($exception) { } /** - * Create request for operation 'getCouponCode' + * Alias of `getBulkCreateCouponCodeJobsAsyncWithHttpInfo` * - * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @deprecated use `getBulkCreateCouponCodeJobsAsyncWithHttpInfo` instead + */ + public function getCouponCodeBulkCreateJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkCreateCouponCodeJobsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkCreateCouponCodeJobs' + * + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponCodeRequest($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodeJobsRequest($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCouponCode' - ); - } - $resourcePath = '/api/coupon-codes/{id}/'; + $resourcePath = '/api/coupon-code-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2029,8 +2128,8 @@ public function getCouponCodeRequest($id, $fields_coupon_code = null, $fields_co // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_coupon_code, - 'fields[coupon-code]', // param base name + $fields_coupon_code_bulk_create_job, + 'fields[coupon-code-bulk-create-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -2038,41 +2137,33 @@ public function getCouponCodeRequest($id, $fields_coupon_code = null, $fields_co ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_coupon, - 'fields[coupon]', // param base name - 'array', // openApiType + $filter, + 'filter', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2093,7 +2184,7 @@ public function getCouponCodeRequest($id, $fields_coupon_code = null, $fields_co // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2117,7 +2208,7 @@ public function getCouponCodeRequest($id, $fields_coupon_code = null, $fields_co $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2135,42 +2226,60 @@ public function getCouponCodeRequest($id, $fields_coupon_code = null, $fields_co } /** - * Operation getCouponCodeBulkCreateJob + * Alias of `getBulkCreateCouponCodeJobsRequest` + * + * @deprecated use `getBulkCreateCouponCodeJobsRequest` instead + */ + public function getCouponCodeBulkCreateJobsRequest(...$args) { + return $this->getBulkCreateCouponCodeJobsRequest(...$args); + } + + /** + * Operation getBulkCreateCouponCodesJob * - * Get Coupon Code Bulk Create Job + * Get Bulk Create Coupon Codes Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponCodeBulkCreateJob($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodesJob($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) { - list($response) = $this->getCouponCodeBulkCreateJobWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey); + list($response) = $this->getBulkCreateCouponCodesJobWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey); return $response; } /** - * Operation getCouponCodeBulkCreateJobWithHttpInfo + * Alias of `getBulkCreateCouponCodesJob` + * + * @deprecated use `getBulkCreateCouponCodesJob` instead + */ + public function getCouponCodeBulkCreateJob(...$args) { + return $this->getBulkCreateCouponCodesJob(...$args); + } + + /** + * Operation getBulkCreateCouponCodesJobWithHttpInfo * - * Get Coupon Code Bulk Create Job + * Get Bulk Create Coupon Codes Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponCodeBulkCreateJobWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodesJobWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) { - $request = $this->getCouponCodeBulkCreateJobRequest($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey); + $request = $this->getBulkCreateCouponCodesJobRequest($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2326,21 +2435,30 @@ public function getCouponCodeBulkCreateJobWithHttpInfo($job_id, $fields_coupon_c } /** - * Operation getCouponCodeBulkCreateJobAsync + * Alias of `getBulkCreateCouponCodesJobWithHttpInfo` * - * Get Coupon Code Bulk Create Job + * @deprecated use `getBulkCreateCouponCodesJobWithHttpInfo` instead + */ + public function getCouponCodeBulkCreateJobWithHttpInfo(...$args) { + return $this->getBulkCreateCouponCodesJobWithHttpInfo(...$args); + } + + /** + * Operation getBulkCreateCouponCodesJobAsync + * + * Get Bulk Create Coupon Codes Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeBulkCreateJobAsync($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodesJobAsync($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) { - return $this->getCouponCodeBulkCreateJobAsyncWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey) + return $this->getBulkCreateCouponCodesJobAsyncWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -2349,22 +2467,31 @@ function ($response) { } /** - * Operation getCouponCodeBulkCreateJobAsyncWithHttpInfo + * Alias of `getBulkCreateCouponCodesJobAsync` + * + * @deprecated use `getBulkCreateCouponCodesJobAsync` instead + */ + public function getCouponCodeBulkCreateJobAsync(...$args) { + return $this->getBulkCreateCouponCodesJobAsync(...$args); + } + + /** + * Operation getBulkCreateCouponCodesJobAsyncWithHttpInfo * - * Get Coupon Code Bulk Create Job + * Get Bulk Create Coupon Codes Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeBulkCreateJobAsyncWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodesJobAsyncWithHttpInfo($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponCodeBulkCreateJobRequest($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey); + $request = $this->getBulkCreateCouponCodesJobRequest($job_id, $fields_coupon_code_bulk_create_job, $fields_coupon_code, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2408,26 +2535,35 @@ function ($exception) { } /** - * Create request for operation 'getCouponCodeBulkCreateJob' + * Alias of `getBulkCreateCouponCodesJobAsyncWithHttpInfo` + * + * @deprecated use `getBulkCreateCouponCodesJobAsyncWithHttpInfo` instead + */ + public function getCouponCodeBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->getBulkCreateCouponCodesJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkCreateCouponCodesJob' * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponCodeBulkCreateJobRequest($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) + public function getBulkCreateCouponCodesJobRequest($job_id, $fields_coupon_code_bulk_create_job = null, $fields_coupon_code = null, $include = null, $apiKey = null) { // verify the required parameter 'job_id' is set if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getCouponCodeBulkCreateJob' + 'Missing the required parameter $job_id when calling getBulkCreateCouponCodesJob' ); } - $resourcePath = '/api/coupon-code-bulk-create-jobs/{job_id}/'; + $resourcePath = '/api/coupon-code-bulk-create-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2475,11 +2611,11 @@ public function getCouponCodeBulkCreateJobRequest($job_id, $fields_coupon_code_b if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2500,7 +2636,7 @@ public function getCouponCodeBulkCreateJobRequest($job_id, $fields_coupon_code_b // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2524,7 +2660,7 @@ public function getCouponCodeBulkCreateJobRequest($job_id, $fields_coupon_code_b $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2542,40 +2678,56 @@ public function getCouponCodeBulkCreateJobRequest($job_id, $fields_coupon_code_b } /** - * Operation getCouponCodeBulkCreateJobs + * Alias of `getBulkCreateCouponCodesJobRequest` + * + * @deprecated use `getBulkCreateCouponCodesJobRequest` instead + */ + public function getCouponCodeBulkCreateJobRequest(...$args) { + return $this->getBulkCreateCouponCodesJobRequest(...$args); + } + + /** + * Operation getCodeIdsForCoupon * - * Get Coupon Code Bulk Create Jobs + * Get Code IDs for Coupon * - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponCodeBulkCreateJobs($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCodeIdsForCoupon($id, $page_cursor = null, $apiKey = null) { - list($response) = $this->getCouponCodeBulkCreateJobsWithHttpInfo($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey); + list($response) = $this->getCodeIdsForCouponWithHttpInfo($id, $page_cursor, $apiKey); return $response; } /** - * Operation getCouponCodeBulkCreateJobsWithHttpInfo + * Alias of `getCodeIdsForCoupon` + * + * @deprecated use `getCodeIdsForCoupon` instead + */ + public function getCouponCodeRelationshipsCoupon(...$args) { + return $this->getCodeIdsForCoupon(...$args); + } + + /** + * Operation getCodeIdsForCouponWithHttpInfo * - * Get Coupon Code Bulk Create Jobs + * Get Code IDs for Coupon * - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponCodeBulkCreateJobsWithHttpInfo($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCodeIdsForCouponWithHttpInfo($id, $page_cursor = null, $apiKey = null) { - $request = $this->getCouponCodeBulkCreateJobsRequest($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getCodeIdsForCouponRequest($id, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2731,20 +2883,28 @@ public function getCouponCodeBulkCreateJobsWithHttpInfo($fields_coupon_code_bulk } /** - * Operation getCouponCodeBulkCreateJobsAsync + * Alias of `getCodeIdsForCouponWithHttpInfo` + * + * @deprecated use `getCodeIdsForCouponWithHttpInfo` instead + */ + public function getCouponCodeRelationshipsCouponWithHttpInfo(...$args) { + return $this->getCodeIdsForCouponWithHttpInfo(...$args); + } + + /** + * Operation getCodeIdsForCouponAsync * - * Get Coupon Code Bulk Create Jobs + * Get Code IDs for Coupon * - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeBulkCreateJobsAsync($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCodeIdsForCouponAsync($id, $page_cursor = null, $apiKey = null) { - return $this->getCouponCodeBulkCreateJobsAsyncWithHttpInfo($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey) + return $this->getCodeIdsForCouponAsyncWithHttpInfo($id, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -2753,21 +2913,29 @@ function ($response) { } /** - * Operation getCouponCodeBulkCreateJobsAsyncWithHttpInfo + * Alias of `getCodeIdsForCouponAsync` + * + * @deprecated use `getCodeIdsForCouponAsync` instead + */ + public function getCouponCodeRelationshipsCouponAsync(...$args) { + return $this->getCodeIdsForCouponAsync(...$args); + } + + /** + * Operation getCodeIdsForCouponAsyncWithHttpInfo * - * Get Coupon Code Bulk Create Jobs + * Get Code IDs for Coupon * - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeBulkCreateJobsAsyncWithHttpInfo($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCodeIdsForCouponAsyncWithHttpInfo($id, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponCodeBulkCreateJobsRequest($fields_coupon_code_bulk_create_job, $filter, $page_cursor, $apiKey); + $request = $this->getCodeIdsForCouponRequest($id, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2811,43 +2979,39 @@ function ($exception) { } /** - * Create request for operation 'getCouponCodeBulkCreateJobs' + * Alias of `getCodeIdsForCouponAsyncWithHttpInfo` + * + * @deprecated use `getCodeIdsForCouponAsyncWithHttpInfo` instead + */ + public function getCouponCodeRelationshipsCouponAsyncWithHttpInfo(...$args) { + return $this->getCodeIdsForCouponAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getCodeIdsForCoupon' * - * @param string[] $fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponCodeBulkCreateJobsRequest($fields_coupon_code_bulk_create_job = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCodeIdsForCouponRequest($id, $page_cursor = null, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getCodeIdsForCoupon' + ); + } - $resourcePath = '/api/coupon-code-bulk-create-jobs/'; + $resourcePath = '/api/coupons/{id}/relationships/coupon-codes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_coupon_code_bulk_create_job, - 'fields[coupon-code-bulk-create-job]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, @@ -2859,15 +3023,23 @@ public function getCouponCodeBulkCreateJobsRequest($fields_coupon_code_bulk_crea ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2888,7 +3060,7 @@ public function getCouponCodeBulkCreateJobsRequest($fields_coupon_code_bulk_crea // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2912,7 +3084,7 @@ public function getCouponCodeBulkCreateJobsRequest($fields_coupon_code_bulk_crea $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2930,38 +3102,47 @@ public function getCouponCodeBulkCreateJobsRequest($fields_coupon_code_bulk_crea } /** - * Operation getCouponCodeRelationshipsCoupon + * Alias of `getCodeIdsForCouponRequest` + * + * @deprecated use `getCodeIdsForCouponRequest` instead + */ + public function getCouponCodeRelationshipsCouponRequest(...$args) { + return $this->getCodeIdsForCouponRequest(...$args); + } + + /** + * Operation getCoupon * - * Get Coupon Code Relationships Coupon + * Get Coupon * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponCodeRelationshipsCoupon($id, $page_cursor = null, $apiKey = null) + public function getCoupon($id, $fields_coupon = null, $apiKey = null) { - list($response) = $this->getCouponCodeRelationshipsCouponWithHttpInfo($id, $page_cursor, $apiKey); + list($response) = $this->getCouponWithHttpInfo($id, $fields_coupon, $apiKey); return $response; } /** - * Operation getCouponCodeRelationshipsCouponWithHttpInfo + * Operation getCouponWithHttpInfo * - * Get Coupon Code Relationships Coupon + * Get Coupon * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponCodeRelationshipsCouponWithHttpInfo($id, $page_cursor = null, $apiKey = null) + public function getCouponWithHttpInfo($id, $fields_coupon = null, $apiKey = null) { - $request = $this->getCouponCodeRelationshipsCouponRequest($id, $page_cursor, $apiKey); + $request = $this->getCouponRequest($id, $fields_coupon, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3117,19 +3298,19 @@ public function getCouponCodeRelationshipsCouponWithHttpInfo($id, $page_cursor = } /** - * Operation getCouponCodeRelationshipsCouponAsync + * Operation getCouponAsync * - * Get Coupon Code Relationships Coupon + * Get Coupon * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeRelationshipsCouponAsync($id, $page_cursor = null, $apiKey = null) + public function getCouponAsync($id, $fields_coupon = null, $apiKey = null) { - return $this->getCouponCodeRelationshipsCouponAsyncWithHttpInfo($id, $page_cursor, $apiKey) + return $this->getCouponAsyncWithHttpInfo($id, $fields_coupon, $apiKey) ->then( function ($response) { return $response[0]; @@ -3138,20 +3319,20 @@ function ($response) { } /** - * Operation getCouponCodeRelationshipsCouponAsyncWithHttpInfo + * Operation getCouponAsyncWithHttpInfo * - * Get Coupon Code Relationships Coupon + * Get Coupon * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodeRelationshipsCouponAsyncWithHttpInfo($id, $page_cursor = null, $apiKey = null) + public function getCouponAsyncWithHttpInfo($id, $fields_coupon = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponCodeRelationshipsCouponRequest($id, $page_cursor, $apiKey); + $request = $this->getCouponRequest($id, $fields_coupon, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3195,24 +3376,24 @@ function ($exception) { } /** - * Create request for operation 'getCouponCodeRelationshipsCoupon' + * Create request for operation 'getCoupon' * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The internal id of a Coupon is equivalent to its external id stored within an integration. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponCodeRelationshipsCouponRequest($id, $page_cursor = null, $apiKey = null) + public function getCouponRequest($id, $fields_coupon = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCouponCodeRelationshipsCoupon' + 'Missing the required parameter $id when calling getCoupon' ); } - $resourcePath = '/api/coupons/{id}/relationships/coupon-codes/'; + $resourcePath = '/api/coupons/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3221,11 +3402,11 @@ public function getCouponCodeRelationshipsCouponRequest($id, $page_cursor = null // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType + $fields_coupon, + 'fields[coupon]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); @@ -3242,11 +3423,11 @@ public function getCouponCodeRelationshipsCouponRequest($id, $page_cursor = null if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3267,7 +3448,7 @@ public function getCouponCodeRelationshipsCouponRequest($id, $page_cursor = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3291,7 +3472,7 @@ public function getCouponCodeRelationshipsCouponRequest($id, $page_cursor = null $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3309,44 +3490,42 @@ public function getCouponCodeRelationshipsCouponRequest($id, $page_cursor = null } /** - * Operation getCouponCodes + * Operation getCouponCode * - * Get Coupon Codes + * Get Coupon Code * - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponCodes($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + public function getCouponCode($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) { - list($response) = $this->getCouponCodesWithHttpInfo($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey); + list($response) = $this->getCouponCodeWithHttpInfo($id, $fields_coupon_code, $fields_coupon, $include, $apiKey); return $response; } /** - * Operation getCouponCodesWithHttpInfo + * Operation getCouponCodeWithHttpInfo * - * Get Coupon Codes + * Get Coupon Code * - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponCodesWithHttpInfo($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + public function getCouponCodeWithHttpInfo($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) { - $request = $this->getCouponCodesRequest($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey); + $request = $this->getCouponCodeRequest($id, $fields_coupon_code, $fields_coupon, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3502,22 +3681,21 @@ public function getCouponCodesWithHttpInfo($fields_coupon_code = null, $fields_c } /** - * Operation getCouponCodesAsync + * Operation getCouponCodeAsync * - * Get Coupon Codes + * Get Coupon Code * - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodesAsync($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + public function getCouponCodeAsync($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) { - return $this->getCouponCodesAsyncWithHttpInfo($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey) + return $this->getCouponCodeAsyncWithHttpInfo($id, $fields_coupon_code, $fields_coupon, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -3526,23 +3704,22 @@ function ($response) { } /** - * Operation getCouponCodesAsyncWithHttpInfo + * Operation getCouponCodeAsyncWithHttpInfo * - * Get Coupon Codes + * Get Coupon Code * - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodesAsyncWithHttpInfo($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + public function getCouponCodeAsyncWithHttpInfo($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponCodesRequest($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey); + $request = $this->getCouponCodeRequest($id, $fields_coupon_code, $fields_coupon, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3586,21 +3763,26 @@ function ($exception) { } /** - * Create request for operation 'getCouponCodes' + * Create request for operation 'getCouponCode' * - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. (required) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponCodesRequest($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + public function getCouponCodeRequest($id, $fields_coupon_code = null, $fields_coupon = null, $include = null, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getCouponCode' + ); + } - $resourcePath = '/api/coupon-codes/'; + $resourcePath = '/api/coupon-codes/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3626,15 +3808,6 @@ public function getCouponCodesRequest($fields_coupon_code = null, $fields_coupon false // required ) ?? []); // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $include, 'include', // param base name @@ -3643,26 +3816,25 @@ public function getCouponCodesRequest($fields_coupon_code = null, $fields_coupon false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3683,7 +3855,7 @@ public function getCouponCodesRequest($fields_coupon_code = null, $fields_coupon // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3707,7 +3879,7 @@ public function getCouponCodesRequest($fields_coupon_code = null, $fields_coupon $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3725,51 +3897,44 @@ public function getCouponCodesRequest($fields_coupon_code = null, $fields_coupon } /** - * Operation getCouponCodesForCoupon + * Operation getCouponCodes * - * Get Coupon Codes For Coupon + * Get Coupon Codes * - * @param string $id (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponCodesForCoupon($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCouponCodes($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getCouponCodesForCouponWithHttpInfo($id, $fields_coupon_code, $filter, $page_cursor, $apiKey); + list($response) = $this->getCouponCodesWithHttpInfo($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey); return $response; } /** - * Alias of `getCouponCodesForCoupon` - * - * @deprecated use `getCouponCodesForCoupon` instead - */ - public function getCouponCouponCodes(...$args) { - return $this->getCouponCodesForCoupon(...$args); - } - - /** - * Operation getCouponCodesForCouponWithHttpInfo + * Operation getCouponCodesWithHttpInfo * - * Get Coupon Codes For Coupon + * Get Coupon Codes * - * @param string $id (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponCodesForCouponWithHttpInfo($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCouponCodesWithHttpInfo($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) { - $request = $this->getCouponCodesForCouponRequest($id, $fields_coupon_code, $filter, $page_cursor, $apiKey); + $request = $this->getCouponCodesRequest($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3925,30 +4090,22 @@ public function getCouponCodesForCouponWithHttpInfo($id, $fields_coupon_code = n } /** - * Alias of `getCouponCodesForCouponWithHttpInfo` - * - * @deprecated use `getCouponCodesForCouponWithHttpInfo` instead - */ - public function getCouponCouponCodesWithHttpInfo(...$args) { - return $this->getCouponCodesForCouponWithHttpInfo(...$args); - } - - /** - * Operation getCouponCodesForCouponAsync + * Operation getCouponCodesAsync * - * Get Coupon Codes For Coupon + * Get Coupon Codes * - * @param string $id (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodesForCouponAsync($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCouponCodesAsync($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) { - return $this->getCouponCodesForCouponAsyncWithHttpInfo($id, $fields_coupon_code, $filter, $page_cursor, $apiKey) + return $this->getCouponCodesAsyncWithHttpInfo($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -3957,31 +4114,23 @@ function ($response) { } /** - * Alias of `getCouponCodesForCouponAsync` - * - * @deprecated use `getCouponCodesForCouponAsync` instead - */ - public function getCouponCouponCodesAsync(...$args) { - return $this->getCouponCodesForCouponAsync(...$args); - } - - /** - * Operation getCouponCodesForCouponAsyncWithHttpInfo + * Operation getCouponCodesAsyncWithHttpInfo * - * Get Coupon Codes For Coupon + * Get Coupon Codes * - * @param string $id (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponCodesForCouponAsyncWithHttpInfo($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCouponCodesAsyncWithHttpInfo($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponCodesForCouponRequest($id, $fields_coupon_code, $filter, $page_cursor, $apiKey); + $request = $this->getCouponCodesRequest($fields_coupon_code, $fields_coupon, $filter, $include, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4025,35 +4174,21 @@ function ($exception) { } /** - * Alias of `getCouponCodesForCouponAsyncWithHttpInfo` - * - * @deprecated use `getCouponCodesForCouponAsyncWithHttpInfo` instead - */ - public function getCouponCouponCodesAsyncWithHttpInfo(...$args) { - return $this->getCouponCodesForCouponAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'getCouponCodesForCoupon' + * Create request for operation 'getCouponCodes' * - * @param string $id (required) - * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getCouponCodesRequest($fields_coupon_code = null, $fields_coupon = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCouponCodesForCoupon' - ); - } - $resourcePath = '/api/coupons/{id}/coupon-codes/'; + $resourcePath = '/api/coupon-codes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4070,6 +4205,15 @@ public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_coupon, + 'fields[coupon]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $filter, 'filter', // param base name @@ -4079,6 +4223,15 @@ public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, 'page[cursor]', // param base name @@ -4089,23 +4242,15 @@ public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4126,7 +4271,7 @@ public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4150,7 +4295,7 @@ public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4168,56 +4313,51 @@ public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, } /** - * Alias of `getCouponCodesForCouponRequest` - * - * @deprecated use `getCouponCodesForCouponRequest` instead - */ - public function getCouponCouponCodesRequest(...$args) { - return $this->getCouponCodesForCouponRequest(...$args); - } - - /** - * Operation getCouponForCouponCode + * Operation getCouponCodesForCoupon * - * Get Coupon For Coupon Code + * Get Coupon Codes For Coupon * * @param string $id (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponForCouponCode($id, $fields_coupon = null, $apiKey = null) + public function getCouponCodesForCoupon($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->getCouponForCouponCodeWithHttpInfo($id, $fields_coupon, $apiKey); + list($response) = $this->getCouponCodesForCouponWithHttpInfo($id, $fields_coupon_code, $filter, $page_cursor, $apiKey); return $response; } /** - * Alias of `getCouponForCouponCode` + * Alias of `getCouponCodesForCoupon` * - * @deprecated use `getCouponForCouponCode` instead + * @deprecated use `getCouponCodesForCoupon` instead */ - public function getCouponCodeCoupon(...$args) { - return $this->getCouponForCouponCode(...$args); + public function getCouponCouponCodes(...$args) { + return $this->getCouponCodesForCoupon(...$args); } /** - * Operation getCouponForCouponCodeWithHttpInfo + * Operation getCouponCodesForCouponWithHttpInfo * - * Get Coupon For Coupon Code + * Get Coupon Codes For Coupon * * @param string $id (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponForCouponCodeWithHttpInfo($id, $fields_coupon = null, $apiKey = null) + public function getCouponCodesForCouponWithHttpInfo($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) { - $request = $this->getCouponForCouponCodeRequest($id, $fields_coupon, $apiKey); + $request = $this->getCouponCodesForCouponRequest($id, $fields_coupon_code, $filter, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4373,28 +4513,30 @@ public function getCouponForCouponCodeWithHttpInfo($id, $fields_coupon = null, $ } /** - * Alias of `getCouponForCouponCodeWithHttpInfo` + * Alias of `getCouponCodesForCouponWithHttpInfo` * - * @deprecated use `getCouponForCouponCodeWithHttpInfo` instead + * @deprecated use `getCouponCodesForCouponWithHttpInfo` instead */ - public function getCouponCodeCouponWithHttpInfo(...$args) { - return $this->getCouponForCouponCodeWithHttpInfo(...$args); + public function getCouponCouponCodesWithHttpInfo(...$args) { + return $this->getCouponCodesForCouponWithHttpInfo(...$args); } /** - * Operation getCouponForCouponCodeAsync + * Operation getCouponCodesForCouponAsync * - * Get Coupon For Coupon Code + * Get Coupon Codes For Coupon * * @param string $id (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponForCouponCodeAsync($id, $fields_coupon = null, $apiKey = null) + public function getCouponCodesForCouponAsync($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) { - return $this->getCouponForCouponCodeAsyncWithHttpInfo($id, $fields_coupon, $apiKey) + return $this->getCouponCodesForCouponAsyncWithHttpInfo($id, $fields_coupon_code, $filter, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -4403,29 +4545,31 @@ function ($response) { } /** - * Alias of `getCouponForCouponCodeAsync` + * Alias of `getCouponCodesForCouponAsync` * - * @deprecated use `getCouponForCouponCodeAsync` instead + * @deprecated use `getCouponCodesForCouponAsync` instead */ - public function getCouponCodeCouponAsync(...$args) { - return $this->getCouponForCouponCodeAsync(...$args); + public function getCouponCouponCodesAsync(...$args) { + return $this->getCouponCodesForCouponAsync(...$args); } /** - * Operation getCouponForCouponCodeAsyncWithHttpInfo + * Operation getCouponCodesForCouponAsyncWithHttpInfo * - * Get Coupon For Coupon Code + * Get Coupon Codes For Coupon * * @param string $id (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponForCouponCodeAsyncWithHttpInfo($id, $fields_coupon = null, $apiKey = null) + public function getCouponCodesForCouponAsyncWithHttpInfo($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponForCouponCodeRequest($id, $fields_coupon, $apiKey); + $request = $this->getCouponCodesForCouponRequest($id, $fields_coupon_code, $filter, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4469,33 +4613,35 @@ function ($exception) { } /** - * Alias of `getCouponForCouponCodeAsyncWithHttpInfo` + * Alias of `getCouponCodesForCouponAsyncWithHttpInfo` * - * @deprecated use `getCouponForCouponCodeAsyncWithHttpInfo` instead + * @deprecated use `getCouponCodesForCouponAsyncWithHttpInfo` instead */ - public function getCouponCodeCouponAsyncWithHttpInfo(...$args) { - return $this->getCouponForCouponCodeAsyncWithHttpInfo(...$args); + public function getCouponCouponCodesAsyncWithHttpInfo(...$args) { + return $this->getCouponCodesForCouponAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getCouponForCouponCode' + * Create request for operation 'getCouponCodesForCoupon' * * @param string $id (required) - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponForCouponCodeRequest($id, $fields_coupon = null, $apiKey = null) + public function getCouponCodesForCouponRequest($id, $fields_coupon_code = null, $filter = null, $page_cursor = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCouponForCouponCode' + 'Missing the required parameter $id when calling getCouponCodesForCoupon' ); } - $resourcePath = '/api/coupon-codes/{id}/coupon/'; + $resourcePath = '/api/coupons/{id}/coupon-codes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4504,11 +4650,29 @@ public function getCouponForCouponCodeRequest($id, $fields_coupon = null, $apiKe // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_coupon, - 'fields[coupon]', // param base name + $fields_coupon_code, + 'fields[coupon-code]', // param base name 'array', // openApiType 'form', // style - false, // explode + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode false // required ) ?? []); @@ -4525,11 +4689,11 @@ public function getCouponForCouponCodeRequest($id, $fields_coupon = null, $apiKe if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4550,7 +4714,7 @@ public function getCouponForCouponCodeRequest($id, $fields_coupon = null, $apiKe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4574,7 +4738,7 @@ public function getCouponForCouponCodeRequest($id, $fields_coupon = null, $apiKe $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4592,45 +4756,56 @@ public function getCouponForCouponCodeRequest($id, $fields_coupon = null, $apiKe } /** - * Alias of `getCouponForCouponCodeRequest` + * Alias of `getCouponCodesForCouponRequest` * - * @deprecated use `getCouponForCouponCodeRequest` instead + * @deprecated use `getCouponCodesForCouponRequest` instead */ - public function getCouponCodeCouponRequest(...$args) { - return $this->getCouponForCouponCodeRequest(...$args); + public function getCouponCouponCodesRequest(...$args) { + return $this->getCouponCodesForCouponRequest(...$args); } /** - * Operation getCouponRelationshipsCouponCodes + * Operation getCouponForCouponCode * - * Get Coupon Relationships Coupon Codes + * Get Coupon For Coupon Code * - * @param string $id (required) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCouponRelationshipsCouponCodes($id, $apiKey = null) + public function getCouponForCouponCode($id, $fields_coupon = null, $apiKey = null) { - list($response) = $this->getCouponRelationshipsCouponCodesWithHttpInfo($id, $apiKey); + list($response) = $this->getCouponForCouponCodeWithHttpInfo($id, $fields_coupon, $apiKey); return $response; } /** - * Operation getCouponRelationshipsCouponCodesWithHttpInfo + * Alias of `getCouponForCouponCode` + * + * @deprecated use `getCouponForCouponCode` instead + */ + public function getCouponCodeCoupon(...$args) { + return $this->getCouponForCouponCode(...$args); + } + + /** + * Operation getCouponForCouponCodeWithHttpInfo * - * Get Coupon Relationships Coupon Codes + * Get Coupon For Coupon Code * - * @param string $id (required) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponRelationshipsCouponCodesWithHttpInfo($id, $apiKey = null) + public function getCouponForCouponCodeWithHttpInfo($id, $fields_coupon = null, $apiKey = null) { - $request = $this->getCouponRelationshipsCouponCodesRequest($id, $apiKey); + $request = $this->getCouponForCouponCodeRequest($id, $fields_coupon, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4786,18 +4961,28 @@ public function getCouponRelationshipsCouponCodesWithHttpInfo($id, $apiKey = nul } /** - * Operation getCouponRelationshipsCouponCodesAsync + * Alias of `getCouponForCouponCodeWithHttpInfo` + * + * @deprecated use `getCouponForCouponCodeWithHttpInfo` instead + */ + public function getCouponCodeCouponWithHttpInfo(...$args) { + return $this->getCouponForCouponCodeWithHttpInfo(...$args); + } + + /** + * Operation getCouponForCouponCodeAsync * - * Get Coupon Relationships Coupon Codes + * Get Coupon For Coupon Code * - * @param string $id (required) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponRelationshipsCouponCodesAsync($id, $apiKey = null) + public function getCouponForCouponCodeAsync($id, $fields_coupon = null, $apiKey = null) { - return $this->getCouponRelationshipsCouponCodesAsyncWithHttpInfo($id, $apiKey) + return $this->getCouponForCouponCodeAsyncWithHttpInfo($id, $fields_coupon, $apiKey) ->then( function ($response) { return $response[0]; @@ -4806,19 +4991,29 @@ function ($response) { } /** - * Operation getCouponRelationshipsCouponCodesAsyncWithHttpInfo + * Alias of `getCouponForCouponCodeAsync` + * + * @deprecated use `getCouponForCouponCodeAsync` instead + */ + public function getCouponCodeCouponAsync(...$args) { + return $this->getCouponForCouponCodeAsync(...$args); + } + + /** + * Operation getCouponForCouponCodeAsyncWithHttpInfo * - * Get Coupon Relationships Coupon Codes + * Get Coupon For Coupon Code * - * @param string $id (required) + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponRelationshipsCouponCodesAsyncWithHttpInfo($id, $apiKey = null) + public function getCouponForCouponCodeAsyncWithHttpInfo($id, $fields_coupon = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponRelationshipsCouponCodesRequest($id, $apiKey); + $request = $this->getCouponForCouponCodeRequest($id, $fields_coupon, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4862,29 +5057,48 @@ function ($exception) { } /** - * Create request for operation 'getCouponRelationshipsCouponCodes' + * Alias of `getCouponForCouponCodeAsyncWithHttpInfo` * - * @param string $id (required) + * @deprecated use `getCouponForCouponCodeAsyncWithHttpInfo` instead + */ + public function getCouponCodeCouponAsyncWithHttpInfo(...$args) { + return $this->getCouponForCouponCodeAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getCouponForCouponCode' + * + * @param string $id The ID of the coupon to look up the relationship of. (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponRelationshipsCouponCodesRequest($id, $apiKey = null) + public function getCouponForCouponCodeRequest($id, $fields_coupon = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getCouponRelationshipsCouponCodes' + 'Missing the required parameter $id when calling getCouponForCouponCode' ); } - $resourcePath = '/api/coupon-codes/{id}/relationships/coupon/'; + $resourcePath = '/api/coupon-codes/{id}/coupon'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_coupon, + 'fields[coupon]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -4899,11 +5113,11 @@ public function getCouponRelationshipsCouponCodesRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4924,7 +5138,7 @@ public function getCouponRelationshipsCouponCodesRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4948,7 +5162,7 @@ public function getCouponRelationshipsCouponCodesRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4966,38 +5180,54 @@ public function getCouponRelationshipsCouponCodesRequest($id, $apiKey = null) } /** - * Operation getCoupons + * Alias of `getCouponForCouponCodeRequest` * - * Get Coupons + * @deprecated use `getCouponForCouponCodeRequest` instead + */ + public function getCouponCodeCouponRequest(...$args) { + return $this->getCouponForCouponCodeRequest(...$args); + } + + /** + * Operation getCouponIdForCouponCode + * + * Get Coupon ID for Coupon Code * - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon code to look up the relationship of. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getCoupons($fields_coupon = null, $page_cursor = null, $apiKey = null) + public function getCouponIdForCouponCode($id, $apiKey = null) { - list($response) = $this->getCouponsWithHttpInfo($fields_coupon, $page_cursor, $apiKey); + list($response) = $this->getCouponIdForCouponCodeWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getCouponsWithHttpInfo + * Alias of `getCouponIdForCouponCode` * - * Get Coupons + * @deprecated use `getCouponIdForCouponCode` instead + */ + public function getCouponRelationshipsCouponCodes(...$args) { + return $this->getCouponIdForCouponCode(...$args); + } + + /** + * Operation getCouponIdForCouponCodeWithHttpInfo * - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * Get Coupon ID for Coupon Code + * + * @param string $id The ID of the coupon code to look up the relationship of. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponsWithHttpInfo($fields_coupon = null, $page_cursor = null, $apiKey = null) + public function getCouponIdForCouponCodeWithHttpInfo($id, $apiKey = null) { - $request = $this->getCouponsRequest($fields_coupon, $page_cursor, $apiKey); + $request = $this->getCouponIdForCouponCodeRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5153,19 +5383,27 @@ public function getCouponsWithHttpInfo($fields_coupon = null, $page_cursor = nul } /** - * Operation getCouponsAsync + * Alias of `getCouponIdForCouponCodeWithHttpInfo` * - * Get Coupons + * @deprecated use `getCouponIdForCouponCodeWithHttpInfo` instead + */ + public function getCouponRelationshipsCouponCodesWithHttpInfo(...$args) { + return $this->getCouponIdForCouponCodeWithHttpInfo(...$args); + } + + /** + * Operation getCouponIdForCouponCodeAsync + * + * Get Coupon ID for Coupon Code * - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon code to look up the relationship of. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponsAsync($fields_coupon = null, $page_cursor = null, $apiKey = null) + public function getCouponIdForCouponCodeAsync($id, $apiKey = null) { - return $this->getCouponsAsyncWithHttpInfo($fields_coupon, $page_cursor, $apiKey) + return $this->getCouponIdForCouponCodeAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -5174,20 +5412,28 @@ function ($response) { } /** - * Operation getCouponsAsyncWithHttpInfo + * Alias of `getCouponIdForCouponCodeAsync` * - * Get Coupons + * @deprecated use `getCouponIdForCouponCodeAsync` instead + */ + public function getCouponRelationshipsCouponCodesAsync(...$args) { + return $this->getCouponIdForCouponCodeAsync(...$args); + } + + /** + * Operation getCouponIdForCouponCodeAsyncWithHttpInfo * - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * Get Coupon ID for Coupon Code + * + * @param string $id The ID of the coupon code to look up the relationship of. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponsAsyncWithHttpInfo($fields_coupon = null, $page_cursor = null, $apiKey = null) + public function getCouponIdForCouponCodeAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getCouponsRequest($fields_coupon, $page_cursor, $apiKey); + $request = $this->getCouponIdForCouponCodeRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5231,53 +5477,57 @@ function ($exception) { } /** - * Create request for operation 'getCoupons' + * Alias of `getCouponIdForCouponCodeAsyncWithHttpInfo` + * + * @deprecated use `getCouponIdForCouponCodeAsyncWithHttpInfo` instead + */ + public function getCouponRelationshipsCouponCodesAsyncWithHttpInfo(...$args) { + return $this->getCouponIdForCouponCodeAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getCouponIdForCouponCode' * - * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the coupon code to look up the relationship of. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCouponsRequest($fields_coupon = null, $page_cursor = null, $apiKey = null) + public function getCouponIdForCouponCodeRequest($id, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getCouponIdForCouponCode' + ); + } - $resourcePath = '/api/coupons/'; + $resourcePath = '/api/coupon-codes/{id}/relationships/coupon'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_coupon, - 'fields[coupon]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5298,7 +5548,7 @@ public function getCouponsRequest($fields_coupon = null, $page_cursor = null, $a // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5322,7 +5572,7 @@ public function getCouponsRequest($fields_coupon = null, $page_cursor = null, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5340,45 +5590,47 @@ public function getCouponsRequest($fields_coupon = null, $page_cursor = null, $a } /** - * Operation spawnCouponCodeBulkCreateJob + * Alias of `getCouponIdForCouponCodeRequest` * - * Spawn Coupon Code Bulk Create Job + * @deprecated use `getCouponIdForCouponCodeRequest` instead + */ + public function getCouponRelationshipsCouponCodesRequest(...$args) { + return $this->getCouponIdForCouponCodeRequest(...$args); + } + + /** + * Operation getCoupons * - * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query coupon_code_create_job_create_query (required) + * Get Coupons + * + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnCouponCodeBulkCreateJob($coupon_code_create_job_create_query, $apiKey = null) + public function getCoupons($fields_coupon = null, $page_cursor = null, $apiKey = null) { - list($response) = $this->spawnCouponCodeBulkCreateJobWithHttpInfo($coupon_code_create_job_create_query, $apiKey); + list($response) = $this->getCouponsWithHttpInfo($fields_coupon, $page_cursor, $apiKey); return $response; } /** - * Alias of `spawnCouponCodeBulkCreateJob` - * - * @deprecated use `spawnCouponCodeBulkCreateJob` instead - */ - public function createCouponCodeBulkCreateJob(...$args) { - return $this->spawnCouponCodeBulkCreateJob(...$args); - } - - /** - * Operation spawnCouponCodeBulkCreateJobWithHttpInfo + * Operation getCouponsWithHttpInfo * - * Spawn Coupon Code Bulk Create Job + * Get Coupons * - * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnCouponCodeBulkCreateJobWithHttpInfo($coupon_code_create_job_create_query, $apiKey = null) + public function getCouponsWithHttpInfo($fields_coupon = null, $page_cursor = null, $apiKey = null) { - $request = $this->spawnCouponCodeBulkCreateJobRequest($coupon_code_create_job_create_query, $apiKey); + $request = $this->getCouponsRequest($fields_coupon, $page_cursor, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5416,7 +5668,7 @@ public function spawnCouponCodeBulkCreateJobWithHttpInfo($coupon_code_create_job } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5504,7 +5756,7 @@ public function spawnCouponCodeBulkCreateJobWithHttpInfo($coupon_code_create_job } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -5534,27 +5786,19 @@ public function spawnCouponCodeBulkCreateJobWithHttpInfo($coupon_code_create_job } /** - * Alias of `spawnCouponCodeBulkCreateJobWithHttpInfo` - * - * @deprecated use `spawnCouponCodeBulkCreateJobWithHttpInfo` instead - */ - public function createCouponCodeBulkCreateJobWithHttpInfo(...$args) { - return $this->spawnCouponCodeBulkCreateJobWithHttpInfo(...$args); - } - - /** - * Operation spawnCouponCodeBulkCreateJobAsync + * Operation getCouponsAsync * - * Spawn Coupon Code Bulk Create Job + * Get Coupons * - * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCouponCodeBulkCreateJobAsync($coupon_code_create_job_create_query, $apiKey = null) + public function getCouponsAsync($fields_coupon = null, $page_cursor = null, $apiKey = null) { - return $this->spawnCouponCodeBulkCreateJobAsyncWithHttpInfo($coupon_code_create_job_create_query, $apiKey) + return $this->getCouponsAsyncWithHttpInfo($fields_coupon, $page_cursor, $apiKey) ->then( function ($response) { return $response[0]; @@ -5563,28 +5807,20 @@ function ($response) { } /** - * Alias of `spawnCouponCodeBulkCreateJobAsync` - * - * @deprecated use `spawnCouponCodeBulkCreateJobAsync` instead - */ - public function createCouponCodeBulkCreateJobAsync(...$args) { - return $this->spawnCouponCodeBulkCreateJobAsync(...$args); - } - - /** - * Operation spawnCouponCodeBulkCreateJobAsyncWithHttpInfo + * Operation getCouponsAsyncWithHttpInfo * - * Spawn Coupon Code Bulk Create Job + * Get Coupons * - * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnCouponCodeBulkCreateJobAsyncWithHttpInfo($coupon_code_create_job_create_query, $apiKey = null) + public function getCouponsAsyncWithHttpInfo($fields_coupon = null, $page_cursor = null, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnCouponCodeBulkCreateJobRequest($coupon_code_create_job_create_query, $apiKey); + $request = $this->getCouponsRequest($fields_coupon, $page_cursor, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5628,61 +5864,59 @@ function ($exception) { } /** - * Alias of `spawnCouponCodeBulkCreateJobAsyncWithHttpInfo` - * - * @deprecated use `spawnCouponCodeBulkCreateJobAsyncWithHttpInfo` instead - */ - public function createCouponCodeBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->spawnCouponCodeBulkCreateJobAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'spawnCouponCodeBulkCreateJob' + * Create request for operation 'getCoupons' * - * @param \KlaviyoAPI\Model\CouponCodeCreateJobCreateQuery $coupon_code_create_job_create_query (required) + * @param string[] $fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnCouponCodeBulkCreateJobRequest($coupon_code_create_job_create_query, $apiKey = null) + public function getCouponsRequest($fields_coupon = null, $page_cursor = null, $apiKey = null) { - // verify the required parameter 'coupon_code_create_job_create_query' is set - if ($coupon_code_create_job_create_query === null || (is_array($coupon_code_create_job_create_query) && count($coupon_code_create_job_create_query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $coupon_code_create_job_create_query when calling spawnCouponCodeBulkCreateJob' - ); - } - $resourcePath = '/api/coupon-code-bulk-create-jobs/'; + $resourcePath = '/api/coupons'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_coupon, + 'fields[coupon]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($coupon_code_create_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_code_create_job_create_query)); - } else { - $httpBody = $coupon_code_create_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -5697,7 +5931,7 @@ public function spawnCouponCodeBulkCreateJobRequest($coupon_code_create_job_crea // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5721,7 +5955,7 @@ public function spawnCouponCodeBulkCreateJobRequest($coupon_code_create_job_crea $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5731,22 +5965,13 @@ public function spawnCouponCodeBulkCreateJobRequest($coupon_code_create_job_crea $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } - /** - * Alias of `spawnCouponCodeBulkCreateJobRequest` - * - * @deprecated use `spawnCouponCodeBulkCreateJobRequest` instead - */ - public function createCouponCodeBulkCreateJobRequest(...$args) { - return $this->spawnCouponCodeBulkCreateJobRequest(...$args); - } - /** * Operation updateCoupon * @@ -6036,7 +6261,7 @@ public function updateCouponRequest($id, $coupon_update_query, $apiKey = null) ); } - $resourcePath = '/api/coupons/{id}/'; + $resourcePath = '/api/coupons/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6057,18 +6282,18 @@ public function updateCouponRequest($id, $coupon_update_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($coupon_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_update_query)); } else { $httpBody = $coupon_update_query; @@ -6088,7 +6313,7 @@ public function updateCouponRequest($id, $coupon_update_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6112,7 +6337,7 @@ public function updateCouponRequest($id, $coupon_update_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6418,7 +6643,7 @@ public function updateCouponCodeRequest($id, $coupon_code_update_query, $apiKey ); } - $resourcePath = '/api/coupon-codes/{id}/'; + $resourcePath = '/api/coupon-codes/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6439,18 +6664,18 @@ public function updateCouponCodeRequest($id, $coupon_code_update_query, $apiKey if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($coupon_code_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($coupon_code_update_query)); } else { $httpBody = $coupon_code_update_query; @@ -6470,7 +6695,7 @@ public function updateCouponCodeRequest($id, $coupon_code_update_query, $apiKey // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6494,7 +6719,7 @@ public function updateCouponCodeRequest($id, $coupon_code_update_query, $apiKey $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/DataPrivacyApi.php b/lib/API/DataPrivacyApi.php index 24ad628..b50790c 100644 --- a/lib/API/DataPrivacyApi.php +++ b/lib/API/DataPrivacyApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -318,7 +318,7 @@ public function requestProfileDeletionRequest($data_privacy_create_deletion_job_ ); } - $resourcePath = '/api/data-privacy-deletion-jobs/'; + $resourcePath = '/api/data-privacy-deletion-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -331,18 +331,18 @@ public function requestProfileDeletionRequest($data_privacy_create_deletion_job_ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($data_privacy_create_deletion_job_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($data_privacy_create_deletion_job_query)); } else { $httpBody = $data_privacy_create_deletion_job_query; @@ -362,7 +362,7 @@ public function requestProfileDeletionRequest($data_privacy_create_deletion_job_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -386,7 +386,7 @@ public function requestProfileDeletionRequest($data_privacy_create_deletion_job_ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/EventsApi.php b/lib/API/EventsApi.php index 19c4e4e..07429e0 100644 --- a/lib/API/EventsApi.php +++ b/lib/API/EventsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -318,7 +318,7 @@ public function bulkCreateEventsRequest($events_bulk_create_job, $apiKey = null) ); } - $resourcePath = '/api/event-bulk-create-jobs/'; + $resourcePath = '/api/event-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -331,18 +331,18 @@ public function bulkCreateEventsRequest($events_bulk_create_job, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($events_bulk_create_job)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($events_bulk_create_job)); } else { $httpBody = $events_bulk_create_job; @@ -362,7 +362,7 @@ public function bulkCreateEventsRequest($events_bulk_create_job, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -386,7 +386,7 @@ public function bulkCreateEventsRequest($events_bulk_create_job, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -578,7 +578,7 @@ public function createEventRequest($event_create_query_v2, $apiKey = null) ); } - $resourcePath = '/api/events/'; + $resourcePath = '/api/events'; $formParams = []; $queryParams = []; $headerParams = []; @@ -591,18 +591,18 @@ public function createEventRequest($event_create_query_v2, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($event_create_query_v2)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($event_create_query_v2)); } else { $httpBody = $event_create_query_v2; @@ -622,7 +622,7 @@ public function createEventRequest($event_create_query_v2, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -646,7 +646,7 @@ public function createEventRequest($event_create_query_v2, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -669,10 +669,10 @@ public function createEventRequest($event_create_query_v2, $apiKey = null) * Get Event * * @param string $id ID of the event (required) - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -690,10 +690,10 @@ public function getEvent($id, $fields_event = null, $fields_metric = null, $fiel * Get Event * * @param string $id ID of the event (required) - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -862,10 +862,10 @@ public function getEventWithHttpInfo($id, $fields_event = null, $fields_metric = * Get Event * * @param string $id ID of the event (required) - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -886,10 +886,10 @@ function ($response) { * Get Event * * @param string $id ID of the event (required) - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -944,10 +944,10 @@ function ($exception) { * Create request for operation 'getEvent' * * @param string $id ID of the event (required) - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -961,7 +961,7 @@ public function getEventRequest($id, $fields_event = null, $fields_metric = null ); } - $resourcePath = '/api/events/{id}/'; + $resourcePath = '/api/events/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1018,11 +1018,11 @@ public function getEventRequest($id, $fields_event = null, $fields_metric = null if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1043,7 +1043,7 @@ public function getEventRequest($id, $fields_event = null, $fields_metric = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1067,7 +1067,7 @@ public function getEventRequest($id, $fields_event = null, $fields_metric = null $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1089,8 +1089,8 @@ public function getEventRequest($id, $fields_event = null, $fields_metric = null * * Get Event Metric * - * @param string $id (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id ID of the event (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1107,8 +1107,8 @@ public function getEventMetric($id, $fields_metric = null, $apiKey = null) * * Get Event Metric * - * @param string $id (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id ID of the event (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1276,8 +1276,8 @@ public function getEventMetricWithHttpInfo($id, $fields_metric = null, $apiKey = * * Get Event Metric * - * @param string $id (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id ID of the event (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1297,8 +1297,8 @@ function ($response) { * * Get Event Metric * - * @param string $id (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id ID of the event (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1352,8 +1352,8 @@ function ($exception) { /** * Create request for operation 'getEventMetric' * - * @param string $id (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id ID of the event (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1367,7 +1367,7 @@ public function getEventMetricRequest($id, $fields_metric = null, $apiKey = null ); } - $resourcePath = '/api/events/{id}/metric/'; + $resourcePath = '/api/events/{id}/metric'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1397,11 +1397,11 @@ public function getEventMetricRequest($id, $fields_metric = null, $apiKey = null if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1422,7 +1422,7 @@ public function getEventMetricRequest($id, $fields_metric = null, $apiKey = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1446,7 +1446,7 @@ public function getEventMetricRequest($id, $fields_metric = null, $apiKey = null $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1468,9 +1468,9 @@ public function getEventMetricRequest($id, $fields_metric = null, $apiKey = null * * Get Event Profile * - * @param string $id (required) + * @param string $id ID of the event (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1487,9 +1487,9 @@ public function getEventProfile($id, $additional_fields_profile = null, $fields_ * * Get Event Profile * - * @param string $id (required) + * @param string $id ID of the event (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1657,9 +1657,9 @@ public function getEventProfileWithHttpInfo($id, $additional_fields_profile = nu * * Get Event Profile * - * @param string $id (required) + * @param string $id ID of the event (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1679,9 +1679,9 @@ function ($response) { * * Get Event Profile * - * @param string $id (required) + * @param string $id ID of the event (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1735,9 +1735,9 @@ function ($exception) { /** * Create request for operation 'getEventProfile' * - * @param string $id (required) + * @param string $id ID of the event (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1751,7 +1751,7 @@ public function getEventProfileRequest($id, $additional_fields_profile = null, $ ); } - $resourcePath = '/api/events/{id}/profile/'; + $resourcePath = '/api/events/{id}/profile'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1790,11 +1790,11 @@ public function getEventProfileRequest($id, $additional_fields_profile = null, $ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1815,7 +1815,7 @@ public function getEventProfileRequest($id, $additional_fields_profile = null, $ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1839,7 +1839,7 @@ public function getEventProfileRequest($id, $additional_fields_profile = null, $ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1857,36 +1857,48 @@ public function getEventProfileRequest($id, $additional_fields_profile = null, $ } /** - * Operation getEventRelationshipsMetric + * Operation getEvents * - * Get Event Relationships Metric + * Get Events * - * @param string $id (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getEventRelationshipsMetric($id, $apiKey = null) + public function getEvents($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getEventRelationshipsMetricWithHttpInfo($id, $apiKey); + list($response) = $this->getEventsWithHttpInfo($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey); return $response; } /** - * Operation getEventRelationshipsMetricWithHttpInfo + * Operation getEventsWithHttpInfo * - * Get Event Relationships Metric + * Get Events * - * @param string $id (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getEventRelationshipsMetricWithHttpInfo($id, $apiKey = null) + public function getEventsWithHttpInfo($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getEventRelationshipsMetricRequest($id, $apiKey); + $request = $this->getEventsRequest($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2042,18 +2054,24 @@ public function getEventRelationshipsMetricWithHttpInfo($id, $apiKey = null) } /** - * Operation getEventRelationshipsMetricAsync + * Operation getEventsAsync * - * Get Event Relationships Metric + * Get Events * - * @param string $id (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventRelationshipsMetricAsync($id, $apiKey = null) + public function getEventsAsync($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getEventRelationshipsMetricAsyncWithHttpInfo($id, $apiKey) + return $this->getEventsAsyncWithHttpInfo($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -2062,19 +2080,25 @@ function ($response) { } /** - * Operation getEventRelationshipsMetricAsyncWithHttpInfo + * Operation getEventsAsyncWithHttpInfo * - * Get Event Relationships Metric + * Get Events * - * @param string $id (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventRelationshipsMetricAsyncWithHttpInfo($id, $apiKey = null) + public function getEventsAsyncWithHttpInfo($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getEventRelationshipsMetricRequest($id, $apiKey); + $request = $this->getEventsRequest($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2118,48 +2142,103 @@ function ($exception) { } /** - * Create request for operation 'getEventRelationshipsMetric' + * Create request for operation 'getEvents' * - * @param string $id (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getEventRelationshipsMetricRequest($id, $apiKey = null) + public function getEventsRequest($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getEventRelationshipsMetric' - ); - } - $resourcePath = '/api/events/{id}/relationships/metric/'; + $resourcePath = '/api/events'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_event, + 'fields[event]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_metric, + 'fields[metric]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_profile, + 'fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2180,7 +2259,7 @@ public function getEventRelationshipsMetricRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2204,7 +2283,7 @@ public function getEventRelationshipsMetricRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2222,36 +2301,45 @@ public function getEventRelationshipsMetricRequest($id, $apiKey = null) } /** - * Operation getEventRelationshipsProfile + * Operation getMetricIdForEvent * - * Get Event Relationships Profile + * Get Metric ID for Event * - * @param string $id (required) + * @param string $id ID of the event (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getEventRelationshipsProfile($id, $apiKey = null) + public function getMetricIdForEvent($id, $apiKey = null) { - list($response) = $this->getEventRelationshipsProfileWithHttpInfo($id, $apiKey); + list($response) = $this->getMetricIdForEventWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getEventRelationshipsProfileWithHttpInfo + * Alias of `getMetricIdForEvent` * - * Get Event Relationships Profile + * @deprecated use `getMetricIdForEvent` instead + */ + public function getEventRelationshipsMetric(...$args) { + return $this->getMetricIdForEvent(...$args); + } + + /** + * Operation getMetricIdForEventWithHttpInfo * - * @param string $id (required) + * Get Metric ID for Event + * + * @param string $id ID of the event (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getEventRelationshipsProfileWithHttpInfo($id, $apiKey = null) + public function getMetricIdForEventWithHttpInfo($id, $apiKey = null) { - $request = $this->getEventRelationshipsProfileRequest($id, $apiKey); + $request = $this->getMetricIdForEventRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2407,18 +2495,27 @@ public function getEventRelationshipsProfileWithHttpInfo($id, $apiKey = null) } /** - * Operation getEventRelationshipsProfileAsync + * Alias of `getMetricIdForEventWithHttpInfo` + * + * @deprecated use `getMetricIdForEventWithHttpInfo` instead + */ + public function getEventRelationshipsMetricWithHttpInfo(...$args) { + return $this->getMetricIdForEventWithHttpInfo(...$args); + } + + /** + * Operation getMetricIdForEventAsync * - * Get Event Relationships Profile + * Get Metric ID for Event * - * @param string $id (required) + * @param string $id ID of the event (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventRelationshipsProfileAsync($id, $apiKey = null) + public function getMetricIdForEventAsync($id, $apiKey = null) { - return $this->getEventRelationshipsProfileAsyncWithHttpInfo($id, $apiKey) + return $this->getMetricIdForEventAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -2427,19 +2524,28 @@ function ($response) { } /** - * Operation getEventRelationshipsProfileAsyncWithHttpInfo + * Alias of `getMetricIdForEventAsync` + * + * @deprecated use `getMetricIdForEventAsync` instead + */ + public function getEventRelationshipsMetricAsync(...$args) { + return $this->getMetricIdForEventAsync(...$args); + } + + /** + * Operation getMetricIdForEventAsyncWithHttpInfo * - * Get Event Relationships Profile + * Get Metric ID for Event * - * @param string $id (required) + * @param string $id ID of the event (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventRelationshipsProfileAsyncWithHttpInfo($id, $apiKey = null) + public function getMetricIdForEventAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getEventRelationshipsProfileRequest($id, $apiKey); + $request = $this->getMetricIdForEventRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2483,23 +2589,32 @@ function ($exception) { } /** - * Create request for operation 'getEventRelationshipsProfile' + * Alias of `getMetricIdForEventAsyncWithHttpInfo` + * + * @deprecated use `getMetricIdForEventAsyncWithHttpInfo` instead + */ + public function getEventRelationshipsMetricAsyncWithHttpInfo(...$args) { + return $this->getMetricIdForEventAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getMetricIdForEvent' * - * @param string $id (required) + * @param string $id ID of the event (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getEventRelationshipsProfileRequest($id, $apiKey = null) + public function getMetricIdForEventRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getEventRelationshipsProfile' + 'Missing the required parameter $id when calling getMetricIdForEvent' ); } - $resourcePath = '/api/events/{id}/relationships/profile/'; + $resourcePath = '/api/events/{id}/relationships/metric'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2520,11 +2635,11 @@ public function getEventRelationshipsProfileRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2545,7 +2660,7 @@ public function getEventRelationshipsProfileRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2569,7 +2684,7 @@ public function getEventRelationshipsProfileRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2587,48 +2702,54 @@ public function getEventRelationshipsProfileRequest($id, $apiKey = null) } /** - * Operation getEvents + * Alias of `getMetricIdForEventRequest` * - * Get Events + * @deprecated use `getMetricIdForEventRequest` instead + */ + public function getEventRelationshipsMetricRequest(...$args) { + return $this->getMetricIdForEventRequest(...$args); + } + + /** + * Operation getProfileIdForEvent + * + * Get Profile ID for Event * - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id ID of the event (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getEvents($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getProfileIdForEvent($id, $apiKey = null) { - list($response) = $this->getEventsWithHttpInfo($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey); + list($response) = $this->getProfileIdForEventWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getEventsWithHttpInfo + * Alias of `getProfileIdForEvent` * - * Get Events + * @deprecated use `getProfileIdForEvent` instead + */ + public function getEventRelationshipsProfile(...$args) { + return $this->getProfileIdForEvent(...$args); + } + + /** + * Operation getProfileIdForEventWithHttpInfo * - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get Profile ID for Event + * + * @param string $id ID of the event (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getEventsWithHttpInfo($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getProfileIdForEventWithHttpInfo($id, $apiKey = null) { - $request = $this->getEventsRequest($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getProfileIdForEventRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2784,24 +2905,27 @@ public function getEventsWithHttpInfo($fields_event = null, $fields_metric = nul } /** - * Operation getEventsAsync + * Alias of `getProfileIdForEventWithHttpInfo` * - * Get Events + * @deprecated use `getProfileIdForEventWithHttpInfo` instead + */ + public function getEventRelationshipsProfileWithHttpInfo(...$args) { + return $this->getProfileIdForEventWithHttpInfo(...$args); + } + + /** + * Operation getProfileIdForEventAsync + * + * Get Profile ID for Event * - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id ID of the event (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventsAsync($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getProfileIdForEventAsync($id, $apiKey = null) { - return $this->getEventsAsyncWithHttpInfo($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey) + return $this->getProfileIdForEventAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -2810,25 +2934,28 @@ function ($response) { } /** - * Operation getEventsAsyncWithHttpInfo + * Alias of `getProfileIdForEventAsync` * - * Get Events + * @deprecated use `getProfileIdForEventAsync` instead + */ + public function getEventRelationshipsProfileAsync(...$args) { + return $this->getProfileIdForEventAsync(...$args); + } + + /** + * Operation getProfileIdForEventAsyncWithHttpInfo + * + * Get Profile ID for Event * - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id ID of the event (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventsAsyncWithHttpInfo($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getProfileIdForEventAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getEventsRequest($fields_event, $fields_metric, $fields_profile, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getProfileIdForEventRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2872,103 +2999,57 @@ function ($exception) { } /** - * Create request for operation 'getEvents' + * Alias of `getProfileIdForEventAsyncWithHttpInfo` * - * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @deprecated use `getProfileIdForEventAsyncWithHttpInfo` instead + */ + public function getEventRelationshipsProfileAsyncWithHttpInfo(...$args) { + return $this->getProfileIdForEventAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getProfileIdForEvent' + * + * @param string $id ID of the event (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getEventsRequest($fields_event = null, $fields_metric = null, $fields_profile = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getProfileIdForEventRequest($id, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProfileIdForEvent' + ); + } - $resourcePath = '/api/events/'; + $resourcePath = '/api/events/{id}/relationships/profile'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_event, - 'fields[event]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_metric, - 'fields[metric]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_profile, - 'fields[profile]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2989,7 +3070,7 @@ public function getEventsRequest($fields_event = null, $fields_metric = null, $f // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3013,7 +3094,7 @@ public function getEventsRequest($fields_event = null, $fields_metric = null, $f $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3030,6 +3111,15 @@ public function getEventsRequest($fields_event = null, $fields_metric = null, $f ); } + /** + * Alias of `getProfileIdForEventRequest` + * + * @deprecated use `getProfileIdForEventRequest` instead + */ + public function getEventRelationshipsProfileRequest(...$args) { + return $this->getProfileIdForEventRequest(...$args); + } + /** * Create http client option * diff --git a/lib/API/FlowsApi.php b/lib/API/FlowsApi.php index 03b2fe5..d0fed49 100644 --- a/lib/API/FlowsApi.php +++ b/lib/API/FlowsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -282,7 +282,7 @@ public function deleteFlowRequest($id, $apiKey = null) ); } - $resourcePath = '/api/flows/{id}/'; + $resourcePath = '/api/flows/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -303,11 +303,11 @@ public function deleteFlowRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -328,7 +328,7 @@ public function deleteFlowRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -352,7 +352,7 @@ public function deleteFlowRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -370,44 +370,45 @@ public function deleteFlowRequest($id, $apiKey = null) } /** - * Operation getFlow + * Operation getActionIdForFlowMessage * - * Get Flow + * Get Action ID for Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlow($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) + public function getActionIdForFlowMessage($id, $apiKey = null) { - list($response) = $this->getFlowWithHttpInfo($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey); + list($response) = $this->getActionIdForFlowMessageWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getFlowWithHttpInfo + * Alias of `getActionIdForFlowMessage` * - * Get Flow + * @deprecated use `getActionIdForFlowMessage` instead + */ + public function getFlowMessageRelationshipsAction(...$args) { + return $this->getActionIdForFlowMessage(...$args); + } + + /** + * Operation getActionIdForFlowMessageWithHttpInfo + * + * Get Action ID for Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowWithHttpInfo($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) + public function getActionIdForFlowMessageWithHttpInfo($id, $apiKey = null) { - $request = $this->getFlowRequest($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey); + $request = $this->getActionIdForFlowMessageRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -563,22 +564,27 @@ public function getFlowWithHttpInfo($id, $fields_flow_action = null, $fields_flo } /** - * Operation getFlowAsync + * Alias of `getActionIdForFlowMessageWithHttpInfo` * - * Get Flow + * @deprecated use `getActionIdForFlowMessageWithHttpInfo` instead + */ + public function getFlowMessageRelationshipsActionWithHttpInfo(...$args) { + return $this->getActionIdForFlowMessageWithHttpInfo(...$args); + } + + /** + * Operation getActionIdForFlowMessageAsync + * + * Get Action ID for Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowAsync($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) + public function getActionIdForFlowMessageAsync($id, $apiKey = null) { - return $this->getFlowAsyncWithHttpInfo($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey) + return $this->getActionIdForFlowMessageAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -587,23 +593,28 @@ function ($response) { } /** - * Operation getFlowAsyncWithHttpInfo + * Alias of `getActionIdForFlowMessageAsync` * - * Get Flow + * @deprecated use `getActionIdForFlowMessageAsync` instead + */ + public function getFlowMessageRelationshipsActionAsync(...$args) { + return $this->getActionIdForFlowMessageAsync(...$args); + } + + /** + * Operation getActionIdForFlowMessageAsyncWithHttpInfo + * + * Get Action ID for Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowAsyncWithHttpInfo($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) + public function getActionIdForFlowMessageAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowRequest($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey); + $request = $this->getActionIdForFlowMessageRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -647,69 +658,38 @@ function ($exception) { } /** - * Create request for operation 'getFlow' + * Alias of `getActionIdForFlowMessageAsyncWithHttpInfo` + * + * @deprecated use `getActionIdForFlowMessageAsyncWithHttpInfo` instead + */ + public function getFlowMessageRelationshipsActionAsyncWithHttpInfo(...$args) { + return $this->getActionIdForFlowMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getActionIdForFlowMessage' * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowRequest($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) + public function getActionIdForFlowMessageRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlow' + 'Missing the required parameter $id when calling getActionIdForFlowMessage' ); } - $resourcePath = '/api/flows/{id}/'; + $resourcePath = '/api/flow-messages/{id}/relationships/flow-action'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow_action, - 'fields[flow-action]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow, - 'fields[flow]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -724,11 +704,11 @@ public function getFlowRequest($id, $fields_flow_action = null, $fields_flow = n if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -749,7 +729,7 @@ public function getFlowRequest($id, $fields_flow_action = null, $fields_flow = n // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -773,7 +753,7 @@ public function getFlowRequest($id, $fields_flow_action = null, $fields_flow = n $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -791,44 +771,60 @@ public function getFlowRequest($id, $fields_flow_action = null, $fields_flow = n } /** - * Operation getFlowAction + * Alias of `getActionIdForFlowMessageRequest` * - * Get Flow Action + * @deprecated use `getActionIdForFlowMessageRequest` instead + */ + public function getFlowMessageRelationshipsActionRequest(...$args) { + return $this->getActionIdForFlowMessageRequest(...$args); + } + + /** + * Operation getActionIdsForFlow * - * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Action IDs for Flow + * + * @param string $id ID of the Flow to update. Ex: XVTP5Q (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowAction($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) + public function getActionIdsForFlow($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { - list($response) = $this->getFlowActionWithHttpInfo($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey); + list($response) = $this->getActionIdsForFlowWithHttpInfo($id, $filter, $page_size, $sort, $apiKey); return $response; } /** - * Operation getFlowActionWithHttpInfo + * Alias of `getActionIdsForFlow` * - * Get Flow Action + * @deprecated use `getActionIdsForFlow` instead + */ + public function getFlowRelationshipsFlowActions(...$args) { + return $this->getActionIdsForFlow(...$args); + } + + /** + * Operation getActionIdsForFlowWithHttpInfo * - * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Action IDs for Flow + * + * @param string $id ID of the Flow to update. Ex: XVTP5Q (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowActionWithHttpInfo($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) + public function getActionIdsForFlowWithHttpInfo($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { - $request = $this->getFlowActionRequest($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey); + $request = $this->getActionIdsForFlowRequest($id, $filter, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -984,22 +980,30 @@ public function getFlowActionWithHttpInfo($id, $fields_flow_action = null, $fiel } /** - * Operation getFlowActionAsync + * Alias of `getActionIdsForFlowWithHttpInfo` * - * Get Flow Action + * @deprecated use `getActionIdsForFlowWithHttpInfo` instead + */ + public function getFlowRelationshipsFlowActionsWithHttpInfo(...$args) { + return $this->getActionIdsForFlowWithHttpInfo(...$args); + } + + /** + * Operation getActionIdsForFlowAsync * - * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Action IDs for Flow + * + * @param string $id ID of the Flow to update. Ex: XVTP5Q (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionAsync($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) + public function getActionIdsForFlowAsync($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { - return $this->getFlowActionAsyncWithHttpInfo($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey) + return $this->getActionIdsForFlowAsyncWithHttpInfo($id, $filter, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -1008,23 +1012,31 @@ function ($response) { } /** - * Operation getFlowActionAsyncWithHttpInfo + * Alias of `getActionIdsForFlowAsync` * - * Get Flow Action + * @deprecated use `getActionIdsForFlowAsync` instead + */ + public function getFlowRelationshipsFlowActionsAsync(...$args) { + return $this->getActionIdsForFlowAsync(...$args); + } + + /** + * Operation getActionIdsForFlowAsyncWithHttpInfo * - * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Action IDs for Flow + * + * @param string $id ID of the Flow to update. Ex: XVTP5Q (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionAsyncWithHttpInfo($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) + public function getActionIdsForFlowAsyncWithHttpInfo($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowActionRequest($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey); + $request = $this->getActionIdsForFlowRequest($id, $filter, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1068,27 +1080,42 @@ function ($exception) { } /** - * Create request for operation 'getFlowAction' + * Alias of `getActionIdsForFlowAsyncWithHttpInfo` * - * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @deprecated use `getActionIdsForFlowAsyncWithHttpInfo` instead + */ + public function getFlowRelationshipsFlowActionsAsyncWithHttpInfo(...$args) { + return $this->getActionIdsForFlowAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getActionIdsForFlow' + * + * @param string $id ID of the Flow to update. Ex: XVTP5Q (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowActionRequest($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) + public function getActionIdsForFlowRequest($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowAction' + 'Missing the required parameter $id when calling getActionIdsForFlow' ); } + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getActionIdsForFlow, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getActionIdsForFlow, must be bigger than or equal to 1.'); + } + - $resourcePath = '/api/flow-actions/{id}/'; + $resourcePath = '/api/flows/{id}/relationships/flow-actions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1097,38 +1124,29 @@ public function getFlowActionRequest($id, $fields_flow_action = null, $fields_fl // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow_action, - 'fields[flow-action]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow_message, - 'fields[flow-message]', // param base name - 'array', // openApiType + $filter, + 'filter', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow, - 'fields[flow]', // param base name - 'array', // openApiType + $page_size, + 'page[size]', // param base name + 'integer', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType + $sort, + 'sort', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); @@ -1145,11 +1163,11 @@ public function getFlowActionRequest($id, $fields_flow_action = null, $fields_fl if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1170,7 +1188,7 @@ public function getFlowActionRequest($id, $fields_flow_action = null, $fields_fl // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1194,7 +1212,7 @@ public function getFlowActionRequest($id, $fields_flow_action = null, $fields_fl $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1212,38 +1230,64 @@ public function getFlowActionRequest($id, $fields_flow_action = null, $fields_fl } /** - * Operation getFlowActionFlow + * Alias of `getActionIdsForFlowRequest` * - * Get Flow For Flow Action + * @deprecated use `getActionIdsForFlowRequest` instead + */ + public function getFlowRelationshipsFlowActionsRequest(...$args) { + return $this->getActionIdsForFlowRequest(...$args); + } + + /** + * Operation getActionsForFlow + * + * Get Actions for Flow * * @param string $id (required) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowActionFlow($id, $fields_flow = null, $apiKey = null) + public function getActionsForFlow($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - list($response) = $this->getFlowActionFlowWithHttpInfo($id, $fields_flow, $apiKey); + list($response) = $this->getActionsForFlowWithHttpInfo($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Operation getFlowActionFlowWithHttpInfo + * Alias of `getActionsForFlow` * - * Get Flow For Flow Action + * @deprecated use `getActionsForFlow` instead + */ + public function getFlowFlowActions(...$args) { + return $this->getActionsForFlow(...$args); + } + + /** + * Operation getActionsForFlowWithHttpInfo + * + * Get Actions for Flow * * @param string $id (required) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowActionFlowWithHttpInfo($id, $fields_flow = null, $apiKey = null) + public function getActionsForFlowWithHttpInfo($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - $request = $this->getFlowActionFlowRequest($id, $fields_flow, $apiKey); + $request = $this->getActionsForFlowRequest($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1399,19 +1443,32 @@ public function getFlowActionFlowWithHttpInfo($id, $fields_flow = null, $apiKey } /** - * Operation getFlowActionFlowAsync + * Alias of `getActionsForFlowWithHttpInfo` * - * Get Flow For Flow Action + * @deprecated use `getActionsForFlowWithHttpInfo` instead + */ + public function getFlowFlowActionsWithHttpInfo(...$args) { + return $this->getActionsForFlowWithHttpInfo(...$args); + } + + /** + * Operation getActionsForFlowAsync + * + * Get Actions for Flow * * @param string $id (required) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionFlowAsync($id, $fields_flow = null, $apiKey = null) + public function getActionsForFlowAsync($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - return $this->getFlowActionFlowAsyncWithHttpInfo($id, $fields_flow, $apiKey) + return $this->getActionsForFlowAsyncWithHttpInfo($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -1420,20 +1477,33 @@ function ($response) { } /** - * Operation getFlowActionFlowAsyncWithHttpInfo + * Alias of `getActionsForFlowAsync` * - * Get Flow For Flow Action + * @deprecated use `getActionsForFlowAsync` instead + */ + public function getFlowFlowActionsAsync(...$args) { + return $this->getActionsForFlowAsync(...$args); + } + + /** + * Operation getActionsForFlowAsyncWithHttpInfo + * + * Get Actions for Flow * * @param string $id (required) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionFlowAsyncWithHttpInfo($id, $fields_flow = null, $apiKey = null) + public function getActionsForFlowAsyncWithHttpInfo($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowActionFlowRequest($id, $fields_flow, $apiKey); + $request = $this->getActionsForFlowRequest($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1477,24 +1547,44 @@ function ($exception) { } /** - * Create request for operation 'getFlowActionFlow' + * Alias of `getActionsForFlowAsyncWithHttpInfo` + * + * @deprecated use `getActionsForFlowAsyncWithHttpInfo` instead + */ + public function getFlowFlowActionsAsyncWithHttpInfo(...$args) { + return $this->getActionsForFlowAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getActionsForFlow' * * @param string $id (required) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowActionFlowRequest($id, $fields_flow = null, $apiKey = null) + public function getActionsForFlowRequest($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowActionFlow' + 'Missing the required parameter $id when calling getActionsForFlow' ); } + if ($page_size !== null && $page_size > 50) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getActionsForFlow, must be smaller than or equal to 50.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getActionsForFlow, must be bigger than or equal to 1.'); + } - $resourcePath = '/api/flow-actions/{id}/flow/'; + + $resourcePath = '/api/flows/{id}/flow-actions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1503,13 +1593,49 @@ public function getFlowActionFlowRequest($id, $fields_flow = null, $apiKey = nul // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow, - 'fields[flow]', // param base name + $fields_flow_action, + 'fields[flow-action]', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1524,11 +1650,11 @@ public function getFlowActionFlowRequest($id, $fields_flow = null, $apiKey = nul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1549,7 +1675,7 @@ public function getFlowActionFlowRequest($id, $fields_flow = null, $apiKey = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1573,7 +1699,7 @@ public function getFlowActionFlowRequest($id, $fields_flow = null, $apiKey = nul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1591,44 +1717,53 @@ public function getFlowActionFlowRequest($id, $fields_flow = null, $apiKey = nul } /** - * Operation getFlowActionMessages + * Alias of `getActionsForFlowRequest` * - * Get Flow Action Messages + * @deprecated use `getActionsForFlowRequest` instead + */ + public function getFlowFlowActionsRequest(...$args) { + return $this->getActionsForFlowRequest(...$args); + } + + /** + * Operation getFlow + * + * Get Flow * * @param string $id (required) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowActionMessages($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlow($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) { - list($response) = $this->getFlowActionMessagesWithHttpInfo($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey); + list($response) = $this->getFlowWithHttpInfo($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey); return $response; } /** - * Operation getFlowActionMessagesWithHttpInfo + * Operation getFlowWithHttpInfo * - * Get Flow Action Messages + * Get Flow * * @param string $id (required) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowActionMessagesWithHttpInfo($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowWithHttpInfo($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) { - $request = $this->getFlowActionMessagesRequest($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey); + $request = $this->getFlowRequest($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1784,22 +1919,22 @@ public function getFlowActionMessagesWithHttpInfo($id, $fields_flow_message = nu } /** - * Operation getFlowActionMessagesAsync + * Operation getFlowAsync * - * Get Flow Action Messages + * Get Flow * * @param string $id (required) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionMessagesAsync($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowAsync($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) { - return $this->getFlowActionMessagesAsyncWithHttpInfo($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey) + return $this->getFlowAsyncWithHttpInfo($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -1808,23 +1943,23 @@ function ($response) { } /** - * Operation getFlowActionMessagesAsyncWithHttpInfo + * Operation getFlowAsyncWithHttpInfo * - * Get Flow Action Messages + * Get Flow * * @param string $id (required) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionMessagesAsyncWithHttpInfo($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowAsyncWithHttpInfo($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowActionMessagesRequest($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey); + $request = $this->getFlowRequest($id, $fields_flow_action, $fields_flow, $fields_tag, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1868,34 +2003,27 @@ function ($exception) { } /** - * Create request for operation 'getFlowActionMessages' + * Create request for operation 'getFlow' * * @param string $id (required) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowActionMessagesRequest($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowRequest($id, $fields_flow_action = null, $fields_flow = null, $fields_tag = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowActionMessages' - ); - } - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowActionMessages, must be smaller than or equal to 100.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowActionMessages, must be bigger than or equal to 1.'); + 'Missing the required parameter $id when calling getFlow' + ); } - - $resourcePath = '/api/flow-actions/{id}/flow-messages/'; + $resourcePath = '/api/flows/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1904,8 +2032,8 @@ public function getFlowActionMessagesRequest($id, $fields_flow_message = null, $ // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow_message, - 'fields[flow-message]', // param base name + $fields_flow_action, + 'fields[flow-action]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -1913,29 +2041,29 @@ public function getFlowActionMessagesRequest($id, $fields_flow_message = null, $ ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType + $include, + 'include', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); @@ -1952,11 +2080,11 @@ public function getFlowActionMessagesRequest($id, $fields_flow_message = null, $ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1977,7 +2105,7 @@ public function getFlowActionMessagesRequest($id, $fields_flow_message = null, $ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2001,7 +2129,7 @@ public function getFlowActionMessagesRequest($id, $fields_flow_message = null, $ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2019,36 +2147,44 @@ public function getFlowActionMessagesRequest($id, $fields_flow_message = null, $ } /** - * Operation getFlowActionRelationshipsFlow + * Operation getFlowAction * - * Get Flow Action Relationships Flow + * Get Flow Action * * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowActionRelationshipsFlow($id, $apiKey = null) + public function getFlowAction($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) { - list($response) = $this->getFlowActionRelationshipsFlowWithHttpInfo($id, $apiKey); + list($response) = $this->getFlowActionWithHttpInfo($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey); return $response; } /** - * Operation getFlowActionRelationshipsFlowWithHttpInfo + * Operation getFlowActionWithHttpInfo * - * Get Flow Action Relationships Flow + * Get Flow Action * * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowActionRelationshipsFlowWithHttpInfo($id, $apiKey = null) + public function getFlowActionWithHttpInfo($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) { - $request = $this->getFlowActionRelationshipsFlowRequest($id, $apiKey); + $request = $this->getFlowActionRequest($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2204,18 +2340,22 @@ public function getFlowActionRelationshipsFlowWithHttpInfo($id, $apiKey = null) } /** - * Operation getFlowActionRelationshipsFlowAsync + * Operation getFlowActionAsync * - * Get Flow Action Relationships Flow + * Get Flow Action * * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionRelationshipsFlowAsync($id, $apiKey = null) + public function getFlowActionAsync($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) { - return $this->getFlowActionRelationshipsFlowAsyncWithHttpInfo($id, $apiKey) + return $this->getFlowActionAsyncWithHttpInfo($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -2224,19 +2364,23 @@ function ($response) { } /** - * Operation getFlowActionRelationshipsFlowAsyncWithHttpInfo + * Operation getFlowActionAsyncWithHttpInfo * - * Get Flow Action Relationships Flow + * Get Flow Action * * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionRelationshipsFlowAsyncWithHttpInfo($id, $apiKey = null) + public function getFlowActionAsyncWithHttpInfo($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowActionRelationshipsFlowRequest($id, $apiKey); + $request = $this->getFlowActionRequest($id, $fields_flow_action, $fields_flow_message, $fields_flow, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2280,29 +2424,69 @@ function ($exception) { } /** - * Create request for operation 'getFlowActionRelationshipsFlow' + * Create request for operation 'getFlowAction' * * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowActionRelationshipsFlowRequest($id, $apiKey = null) + public function getFlowActionRequest($id, $fields_flow_action = null, $fields_flow_message = null, $fields_flow = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowActionRelationshipsFlow' + 'Missing the required parameter $id when calling getFlowAction' ); } - $resourcePath = '/api/flow-actions/{id}/relationships/flow/'; + $resourcePath = '/api/flow-actions/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow_action, + 'fields[flow-action]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow_message, + 'fields[flow-message]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -2317,11 +2501,11 @@ public function getFlowActionRelationshipsFlowRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2342,7 +2526,7 @@ public function getFlowActionRelationshipsFlowRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2366,7 +2550,7 @@ public function getFlowActionRelationshipsFlowRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2384,44 +2568,38 @@ public function getFlowActionRelationshipsFlowRequest($id, $apiKey = null) } /** - * Operation getFlowActionRelationshipsMessages + * Operation getFlowActionFlow * - * Get Flow Action Relationships Messages + * Get Flow For Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowActionRelationshipsMessages($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowActionFlow($id, $fields_flow = null, $apiKey = null) { - list($response) = $this->getFlowActionRelationshipsMessagesWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getFlowActionFlowWithHttpInfo($id, $fields_flow, $apiKey); return $response; } /** - * Operation getFlowActionRelationshipsMessagesWithHttpInfo + * Operation getFlowActionFlowWithHttpInfo * - * Get Flow Action Relationships Messages + * Get Flow For Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowActionRelationshipsMessagesWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowActionFlowWithHttpInfo($id, $fields_flow = null, $apiKey = null) { - $request = $this->getFlowActionRelationshipsMessagesRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getFlowActionFlowRequest($id, $fields_flow, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2577,22 +2755,19 @@ public function getFlowActionRelationshipsMessagesWithHttpInfo($id, $filter = nu } /** - * Operation getFlowActionRelationshipsMessagesAsync + * Operation getFlowActionFlowAsync * - * Get Flow Action Relationships Messages + * Get Flow For Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionRelationshipsMessagesAsync($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowActionFlowAsync($id, $fields_flow = null, $apiKey = null) { - return $this->getFlowActionRelationshipsMessagesAsyncWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getFlowActionFlowAsyncWithHttpInfo($id, $fields_flow, $apiKey) ->then( function ($response) { return $response[0]; @@ -2601,23 +2776,20 @@ function ($response) { } /** - * Operation getFlowActionRelationshipsMessagesAsyncWithHttpInfo + * Operation getFlowActionFlowAsyncWithHttpInfo * - * Get Flow Action Relationships Messages + * Get Flow For Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowActionRelationshipsMessagesAsyncWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowActionFlowAsyncWithHttpInfo($id, $fields_flow = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowActionRelationshipsMessagesRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getFlowActionFlowRequest($id, $fields_flow, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2661,34 +2833,24 @@ function ($exception) { } /** - * Create request for operation 'getFlowActionRelationshipsMessages' + * Create request for operation 'getFlowActionFlow' * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowActionRelationshipsMessagesRequest($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowActionFlowRequest($id, $fields_flow = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowActionRelationshipsMessages' + 'Missing the required parameter $id when calling getFlowActionFlow' ); } - if ($page_size !== null && $page_size > 50) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowActionRelationshipsMessages, must be smaller than or equal to 50.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowActionRelationshipsMessages, must be bigger than or equal to 1.'); - } - - $resourcePath = '/api/flow-actions/{id}/relationships/flow-messages/'; + $resourcePath = '/api/flow-actions/{id}/flow'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2697,38 +2859,11 @@ public function getFlowActionRelationshipsMessagesRequest($id, $filter = null, $ // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); @@ -2745,11 +2880,11 @@ public function getFlowActionRelationshipsMessagesRequest($id, $filter = null, $ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2770,7 +2905,7 @@ public function getFlowActionRelationshipsMessagesRequest($id, $filter = null, $ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2794,7 +2929,7 @@ public function getFlowActionRelationshipsMessagesRequest($id, $filter = null, $ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2812,46 +2947,45 @@ public function getFlowActionRelationshipsMessagesRequest($id, $filter = null, $ } /** - * Operation getFlowFlowActions + * Operation getFlowIdForFlowAction * - * Get Flow Flow Actions + * Get Flow ID for Flow Action * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowFlowActions($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowIdForFlowAction($id, $apiKey = null) { - list($response) = $this->getFlowFlowActionsWithHttpInfo($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getFlowIdForFlowActionWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getFlowFlowActionsWithHttpInfo + * Alias of `getFlowIdForFlowAction` + * + * @deprecated use `getFlowIdForFlowAction` instead + */ + public function getFlowActionRelationshipsFlow(...$args) { + return $this->getFlowIdForFlowAction(...$args); + } + + /** + * Operation getFlowIdForFlowActionWithHttpInfo * - * Get Flow Flow Actions + * Get Flow ID for Flow Action * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowFlowActionsWithHttpInfo($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowIdForFlowActionWithHttpInfo($id, $apiKey = null) { - $request = $this->getFlowFlowActionsRequest($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getFlowIdForFlowActionRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3007,23 +3141,27 @@ public function getFlowFlowActionsWithHttpInfo($id, $fields_flow_action = null, } /** - * Operation getFlowFlowActionsAsync + * Alias of `getFlowIdForFlowActionWithHttpInfo` + * + * @deprecated use `getFlowIdForFlowActionWithHttpInfo` instead + */ + public function getFlowActionRelationshipsFlowWithHttpInfo(...$args) { + return $this->getFlowIdForFlowActionWithHttpInfo(...$args); + } + + /** + * Operation getFlowIdForFlowActionAsync * - * Get Flow Flow Actions + * Get Flow ID for Flow Action * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowFlowActionsAsync($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowIdForFlowActionAsync($id, $apiKey = null) { - return $this->getFlowFlowActionsAsyncWithHttpInfo($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getFlowIdForFlowActionAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -3032,24 +3170,28 @@ function ($response) { } /** - * Operation getFlowFlowActionsAsyncWithHttpInfo + * Alias of `getFlowIdForFlowActionAsync` + * + * @deprecated use `getFlowIdForFlowActionAsync` instead + */ + public function getFlowActionRelationshipsFlowAsync(...$args) { + return $this->getFlowIdForFlowActionAsync(...$args); + } + + /** + * Operation getFlowIdForFlowActionAsyncWithHttpInfo * - * Get Flow Flow Actions + * Get Flow ID for Flow Action * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowFlowActionsAsyncWithHttpInfo($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getFlowIdForFlowActionAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowFlowActionsRequest($id, $fields_flow_action, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getFlowIdForFlowActionRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3076,103 +3218,55 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getFlowFlowActions' - * - * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getFlowFlowActionsRequest($id, $fields_flow_action = null, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) - { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowFlowActions' - ); - } - if ($page_size !== null && $page_size > 50) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowFlowActions, must be smaller than or equal to 50.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowFlowActions, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/api/flows/{id}/flow-actions/'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow_action, - 'fields[flow-action]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getFlowIdForFlowActionAsyncWithHttpInfo` + * + * @deprecated use `getFlowIdForFlowActionAsyncWithHttpInfo` instead + */ + public function getFlowActionRelationshipsFlowAsyncWithHttpInfo(...$args) { + return $this->getFlowIdForFlowActionAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getFlowIdForFlowAction' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFlowIdForFlowActionRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getFlowIdForFlowAction' + ); + } + + $resourcePath = '/api/flow-actions/{id}/relationships/flow'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // path params @@ -3187,11 +3281,11 @@ public function getFlowFlowActionsRequest($id, $fields_flow_action = null, $filt if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3212,7 +3306,7 @@ public function getFlowFlowActionsRequest($id, $fields_flow_action = null, $filt // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3236,7 +3330,7 @@ public function getFlowFlowActionsRequest($id, $fields_flow_action = null, $filt $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3253,16 +3347,25 @@ public function getFlowFlowActionsRequest($id, $fields_flow_action = null, $filt ); } + /** + * Alias of `getFlowIdForFlowActionRequest` + * + * @deprecated use `getFlowIdForFlowActionRequest` instead + */ + public function getFlowActionRelationshipsFlowRequest(...$args) { + return $this->getFlowIdForFlowActionRequest(...$args); + } + /** * Operation getFlowMessage * * Get Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3280,10 +3383,10 @@ public function getFlowMessage($id, $fields_flow_action = null, $fields_flow_mes * Get Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3452,10 +3555,10 @@ public function getFlowMessageWithHttpInfo($id, $fields_flow_action = null, $fie * Get Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3476,10 +3579,10 @@ function ($response) { * Get Flow Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3534,10 +3637,10 @@ function ($exception) { * Create request for operation 'getFlowMessage' * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3551,7 +3654,7 @@ public function getFlowMessageRequest($id, $fields_flow_action = null, $fields_f ); } - $resourcePath = '/api/flow-messages/{id}/'; + $resourcePath = '/api/flow-messages/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3608,11 +3711,11 @@ public function getFlowMessageRequest($id, $fields_flow_action = null, $fields_f if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3633,7 +3736,7 @@ public function getFlowMessageRequest($id, $fields_flow_action = null, $fields_f // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3657,7 +3760,7 @@ public function getFlowMessageRequest($id, $fields_flow_action = null, $fields_f $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3680,7 +3783,7 @@ public function getFlowMessageRequest($id, $fields_flow_action = null, $fields_f * Get Flow Action For Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3698,7 +3801,7 @@ public function getFlowMessageAction($id, $fields_flow_action = null, $apiKey = * Get Flow Action For Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3867,7 +3970,7 @@ public function getFlowMessageActionWithHttpInfo($id, $fields_flow_action = null * Get Flow Action For Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3888,7 +3991,7 @@ function ($response) { * Get Flow Action For Message * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3943,7 +4046,7 @@ function ($exception) { * Create request for operation 'getFlowMessageAction' * * @param string $id (required) - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3957,7 +4060,7 @@ public function getFlowMessageActionRequest($id, $fields_flow_action = null, $ap ); } - $resourcePath = '/api/flow-messages/{id}/flow-action/'; + $resourcePath = '/api/flow-messages/{id}/flow-action'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3987,11 +4090,11 @@ public function getFlowMessageActionRequest($id, $fields_flow_action = null, $ap if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4012,7 +4115,7 @@ public function getFlowMessageActionRequest($id, $fields_flow_action = null, $ap // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4036,7 +4139,7 @@ public function getFlowMessageActionRequest($id, $fields_flow_action = null, $ap $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4054,36 +4157,38 @@ public function getFlowMessageActionRequest($id, $fields_flow_action = null, $ap } /** - * Operation getFlowMessageRelationshipsAction + * Operation getFlowTags * - * Get Flow Message Relationships Action + * Get Flow Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowMessageRelationshipsAction($id, $apiKey = null) + public function getFlowTags($id, $fields_tag = null, $apiKey = null) { - list($response) = $this->getFlowMessageRelationshipsActionWithHttpInfo($id, $apiKey); + list($response) = $this->getFlowTagsWithHttpInfo($id, $fields_tag, $apiKey); return $response; } /** - * Operation getFlowMessageRelationshipsActionWithHttpInfo + * Operation getFlowTagsWithHttpInfo * - * Get Flow Message Relationships Action + * Get Flow Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowMessageRelationshipsActionWithHttpInfo($id, $apiKey = null) + public function getFlowTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) { - $request = $this->getFlowMessageRelationshipsActionRequest($id, $apiKey); + $request = $this->getFlowTagsRequest($id, $fields_tag, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4239,18 +4344,19 @@ public function getFlowMessageRelationshipsActionWithHttpInfo($id, $apiKey = nul } /** - * Operation getFlowMessageRelationshipsActionAsync + * Operation getFlowTagsAsync * - * Get Flow Message Relationships Action + * Get Flow Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowMessageRelationshipsActionAsync($id, $apiKey = null) + public function getFlowTagsAsync($id, $fields_tag = null, $apiKey = null) { - return $this->getFlowMessageRelationshipsActionAsyncWithHttpInfo($id, $apiKey) + return $this->getFlowTagsAsyncWithHttpInfo($id, $fields_tag, $apiKey) ->then( function ($response) { return $response[0]; @@ -4259,19 +4365,20 @@ function ($response) { } /** - * Operation getFlowMessageRelationshipsActionAsyncWithHttpInfo + * Operation getFlowTagsAsyncWithHttpInfo * - * Get Flow Message Relationships Action + * Get Flow Tags * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowMessageRelationshipsActionAsyncWithHttpInfo($id, $apiKey = null) + public function getFlowTagsAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowMessageRelationshipsActionRequest($id, $apiKey); + $request = $this->getFlowTagsRequest($id, $fields_tag, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4315,29 +4422,39 @@ function ($exception) { } /** - * Create request for operation 'getFlowMessageRelationshipsAction' + * Create request for operation 'getFlowTags' * * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowMessageRelationshipsActionRequest($id, $apiKey = null) + public function getFlowTagsRequest($id, $fields_tag = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowMessageRelationshipsAction' + 'Missing the required parameter $id when calling getFlowTags' ); } - $resourcePath = '/api/flow-messages/{id}/relationships/flow-action/'; + $resourcePath = '/api/flows/{id}/tags'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -4352,11 +4469,11 @@ public function getFlowMessageRelationshipsActionRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4377,7 +4494,7 @@ public function getFlowMessageRelationshipsActionRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4401,7 +4518,7 @@ public function getFlowMessageRelationshipsActionRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4419,36 +4536,50 @@ public function getFlowMessageRelationshipsActionRequest($id, $apiKey = null) } /** - * Operation getFlowMessageRelationshipsTemplate + * Operation getFlows * - * Get Flow Message Relationships Template + * Get Flows * - * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowMessageRelationshipsTemplate($id, $apiKey = null) + public function getFlows($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - list($response) = $this->getFlowMessageRelationshipsTemplateWithHttpInfo($id, $apiKey); + list($response) = $this->getFlowsWithHttpInfo($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Operation getFlowMessageRelationshipsTemplateWithHttpInfo + * Operation getFlowsWithHttpInfo * - * Get Flow Message Relationships Template + * Get Flows * - * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowMessageRelationshipsTemplateWithHttpInfo($id, $apiKey = null) + public function getFlowsWithHttpInfo($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - $request = $this->getFlowMessageRelationshipsTemplateRequest($id, $apiKey); + $request = $this->getFlowsRequest($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4604,18 +4735,25 @@ public function getFlowMessageRelationshipsTemplateWithHttpInfo($id, $apiKey = n } /** - * Operation getFlowMessageRelationshipsTemplateAsync + * Operation getFlowsAsync * - * Get Flow Message Relationships Template + * Get Flows * - * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowMessageRelationshipsTemplateAsync($id, $apiKey = null) + public function getFlowsAsync($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - return $this->getFlowMessageRelationshipsTemplateAsyncWithHttpInfo($id, $apiKey) + return $this->getFlowsAsyncWithHttpInfo($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -4624,19 +4762,26 @@ function ($response) { } /** - * Operation getFlowMessageRelationshipsTemplateAsyncWithHttpInfo + * Operation getFlowsAsyncWithHttpInfo * - * Get Flow Message Relationships Template + * Get Flows * - * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowMessageRelationshipsTemplateAsyncWithHttpInfo($id, $apiKey = null) + public function getFlowsAsyncWithHttpInfo($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowMessageRelationshipsTemplateRequest($id, $apiKey); + $request = $this->getFlowsRequest($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4680,48 +4825,120 @@ function ($exception) { } /** - * Create request for operation 'getFlowMessageRelationshipsTemplate' + * Create request for operation 'getFlows' * - * @param string $id (required) + * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowMessageRelationshipsTemplateRequest($id, $apiKey = null) + public function getFlowsRequest($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowMessageRelationshipsTemplate' - ); + if ($page_size !== null && $page_size > 50) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlows, must be smaller than or equal to 50.'); } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlows, must be bigger than or equal to 1.'); + } + - $resourcePath = '/api/flow-messages/{id}/relationships/template/'; + $resourcePath = '/api/flows'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow_action, + 'fields[flow-action]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4742,7 +4959,7 @@ public function getFlowMessageRelationshipsTemplateRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4766,7 +4983,7 @@ public function getFlowMessageRelationshipsTemplateRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4784,38 +5001,53 @@ public function getFlowMessageRelationshipsTemplateRequest($id, $apiKey = null) } /** - * Operation getFlowMessageTemplate + * Operation getMessageIdsForFlowAction * - * Get Flow Message Template + * Get Message IDs for Flow Action * * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowMessageTemplate($id, $fields_template = null, $apiKey = null) + public function getMessageIdsForFlowAction($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - list($response) = $this->getFlowMessageTemplateWithHttpInfo($id, $fields_template, $apiKey); + list($response) = $this->getMessageIdsForFlowActionWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Operation getFlowMessageTemplateWithHttpInfo + * Alias of `getMessageIdsForFlowAction` + * + * @deprecated use `getMessageIdsForFlowAction` instead + */ + public function getFlowActionRelationshipsMessages(...$args) { + return $this->getMessageIdsForFlowAction(...$args); + } + + /** + * Operation getMessageIdsForFlowActionWithHttpInfo * - * Get Flow Message Template + * Get Message IDs for Flow Action * * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowMessageTemplateWithHttpInfo($id, $fields_template = null, $apiKey = null) + public function getMessageIdsForFlowActionWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - $request = $this->getFlowMessageTemplateRequest($id, $fields_template, $apiKey); + $request = $this->getMessageIdsForFlowActionRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4971,19 +5203,31 @@ public function getFlowMessageTemplateWithHttpInfo($id, $fields_template = null, } /** - * Operation getFlowMessageTemplateAsync + * Alias of `getMessageIdsForFlowActionWithHttpInfo` + * + * @deprecated use `getMessageIdsForFlowActionWithHttpInfo` instead + */ + public function getFlowActionRelationshipsMessagesWithHttpInfo(...$args) { + return $this->getMessageIdsForFlowActionWithHttpInfo(...$args); + } + + /** + * Operation getMessageIdsForFlowActionAsync * - * Get Flow Message Template + * Get Message IDs for Flow Action * * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowMessageTemplateAsync($id, $fields_template = null, $apiKey = null) + public function getMessageIdsForFlowActionAsync($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { - return $this->getFlowMessageTemplateAsyncWithHttpInfo($id, $fields_template, $apiKey) + return $this->getMessageIdsForFlowActionAsyncWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -4992,20 +5236,32 @@ function ($response) { } /** - * Operation getFlowMessageTemplateAsyncWithHttpInfo + * Alias of `getMessageIdsForFlowActionAsync` + * + * @deprecated use `getMessageIdsForFlowActionAsync` instead + */ + public function getFlowActionRelationshipsMessagesAsync(...$args) { + return $this->getMessageIdsForFlowActionAsync(...$args); + } + + /** + * Operation getMessageIdsForFlowActionAsyncWithHttpInfo * - * Get Flow Message Template + * Get Message IDs for Flow Action * * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowMessageTemplateAsyncWithHttpInfo($id, $fields_template = null, $apiKey = null) + public function getMessageIdsForFlowActionAsyncWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowMessageTemplateRequest($id, $fields_template, $apiKey); + $request = $this->getMessageIdsForFlowActionRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5049,24 +5305,43 @@ function ($exception) { } /** - * Create request for operation 'getFlowMessageTemplate' + * Alias of `getMessageIdsForFlowActionAsyncWithHttpInfo` + * + * @deprecated use `getMessageIdsForFlowActionAsyncWithHttpInfo` instead + */ + public function getFlowActionRelationshipsMessagesAsyncWithHttpInfo(...$args) { + return $this->getMessageIdsForFlowActionAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getMessageIdsForFlowAction' * * @param string $id (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowMessageTemplateRequest($id, $fields_template = null, $apiKey = null) + public function getMessageIdsForFlowActionRequest($id, $filter = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowMessageTemplate' + 'Missing the required parameter $id when calling getMessageIdsForFlowAction' ); } + if ($page_size !== null && $page_size > 50) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getMessageIdsForFlowAction, must be smaller than or equal to 50.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getMessageIdsForFlowAction, must be bigger than or equal to 1.'); + } + - $resourcePath = '/api/flow-messages/{id}/template/'; + $resourcePath = '/api/flow-actions/{id}/relationships/flow-messages'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5075,11 +5350,38 @@ public function getFlowMessageTemplateRequest($id, $fields_template = null, $api // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_template, - 'fields[template]', // param base name - 'array', // openApiType + $filter, + 'filter', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode false // required ) ?? []); @@ -5096,11 +5398,11 @@ public function getFlowMessageTemplateRequest($id, $fields_template = null, $api if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5121,7 +5423,7 @@ public function getFlowMessageTemplateRequest($id, $fields_template = null, $api // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5145,7 +5447,7 @@ public function getFlowMessageTemplateRequest($id, $fields_template = null, $api $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5163,42 +5465,62 @@ public function getFlowMessageTemplateRequest($id, $fields_template = null, $api } /** - * Operation getFlowRelationshipsFlowActions + * Alias of `getMessageIdsForFlowActionRequest` + * + * @deprecated use `getMessageIdsForFlowActionRequest` instead + */ + public function getFlowActionRelationshipsMessagesRequest(...$args) { + return $this->getMessageIdsForFlowActionRequest(...$args); + } + + /** + * Operation getMessagesForFlowAction * - * Get Flow Relationships Flow Actions + * Get Messages for Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowRelationshipsFlowActions($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getMessagesForFlowAction($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { - list($response) = $this->getFlowRelationshipsFlowActionsWithHttpInfo($id, $filter, $page_size, $sort, $apiKey); + list($response) = $this->getMessagesForFlowActionWithHttpInfo($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey); return $response; } /** - * Operation getFlowRelationshipsFlowActionsWithHttpInfo + * Alias of `getMessagesForFlowAction` + * + * @deprecated use `getMessagesForFlowAction` instead + */ + public function getFlowActionMessages(...$args) { + return $this->getMessagesForFlowAction(...$args); + } + + /** + * Operation getMessagesForFlowActionWithHttpInfo * - * Get Flow Relationships Flow Actions + * Get Messages for Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowRelationshipsFlowActionsWithHttpInfo($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getMessagesForFlowActionWithHttpInfo($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { - $request = $this->getFlowRelationshipsFlowActionsRequest($id, $filter, $page_size, $sort, $apiKey); + $request = $this->getMessagesForFlowActionRequest($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5354,21 +5676,31 @@ public function getFlowRelationshipsFlowActionsWithHttpInfo($id, $filter = null, } /** - * Operation getFlowRelationshipsFlowActionsAsync + * Alias of `getMessagesForFlowActionWithHttpInfo` + * + * @deprecated use `getMessagesForFlowActionWithHttpInfo` instead + */ + public function getFlowActionMessagesWithHttpInfo(...$args) { + return $this->getMessagesForFlowActionWithHttpInfo(...$args); + } + + /** + * Operation getMessagesForFlowActionAsync * - * Get Flow Relationships Flow Actions + * Get Messages for Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowRelationshipsFlowActionsAsync($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getMessagesForFlowActionAsync($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { - return $this->getFlowRelationshipsFlowActionsAsyncWithHttpInfo($id, $filter, $page_size, $sort, $apiKey) + return $this->getMessagesForFlowActionAsyncWithHttpInfo($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -5377,22 +5709,32 @@ function ($response) { } /** - * Operation getFlowRelationshipsFlowActionsAsyncWithHttpInfo + * Alias of `getMessagesForFlowActionAsync` * - * Get Flow Relationships Flow Actions + * @deprecated use `getMessagesForFlowActionAsync` instead + */ + public function getFlowActionMessagesAsync(...$args) { + return $this->getMessagesForFlowActionAsync(...$args); + } + + /** + * Operation getMessagesForFlowActionAsyncWithHttpInfo + * + * Get Messages for Flow Action * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowRelationshipsFlowActionsAsyncWithHttpInfo($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getMessagesForFlowActionAsyncWithHttpInfo($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowRelationshipsFlowActionsRequest($id, $filter, $page_size, $sort, $apiKey); + $request = $this->getMessagesForFlowActionRequest($id, $fields_flow_message, $filter, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5436,39 +5778,58 @@ function ($exception) { } /** - * Create request for operation 'getFlowRelationshipsFlowActions' + * Alias of `getMessagesForFlowActionAsyncWithHttpInfo` + * + * @deprecated use `getMessagesForFlowActionAsyncWithHttpInfo` instead + */ + public function getFlowActionMessagesAsyncWithHttpInfo(...$args) { + return $this->getMessagesForFlowActionAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getMessagesForFlowAction' * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string[] $fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) * @param int $page_size Default: 50. Min: 1. Max: 100. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowRelationshipsFlowActionsRequest($id, $filter = null, $page_size = 50, $sort = null, $apiKey = null) + public function getMessagesForFlowActionRequest($id, $fields_flow_message = null, $filter = null, $page_size = 50, $sort = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowRelationshipsFlowActions' + 'Missing the required parameter $id when calling getMessagesForFlowAction' ); } if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowRelationshipsFlowActions, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getMessagesForFlowAction, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlowRelationshipsFlowActions, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getMessagesForFlowAction, must be bigger than or equal to 1.'); } - $resourcePath = '/api/flows/{id}/relationships/flow-actions/'; + $resourcePath = '/api/flow-actions/{id}/flow-messages'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow_message, + 'fields[flow-message]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $filter, @@ -5510,11 +5871,11 @@ public function getFlowRelationshipsFlowActionsRequest($id, $filter = null, $pag if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5535,7 +5896,7 @@ public function getFlowRelationshipsFlowActionsRequest($id, $filter = null, $pag // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5559,7 +5920,7 @@ public function getFlowRelationshipsFlowActionsRequest($id, $filter = null, $pag $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5577,9 +5938,18 @@ public function getFlowRelationshipsFlowActionsRequest($id, $filter = null, $pag } /** - * Operation getFlowRelationshipsTags + * Alias of `getMessagesForFlowActionRequest` + * + * @deprecated use `getMessagesForFlowActionRequest` instead + */ + public function getFlowActionMessagesRequest(...$args) { + return $this->getMessagesForFlowActionRequest(...$args); + } + + /** + * Operation getTagIdsForFlow * - * Get Flow Relationships Tags + * Get Tag IDs for Flow * * @param string $id (required) * @@ -5587,16 +5957,25 @@ public function getFlowRelationshipsFlowActionsRequest($id, $filter = null, $pag * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowRelationshipsTags($id, $apiKey = null) + public function getTagIdsForFlow($id, $apiKey = null) { - list($response) = $this->getFlowRelationshipsTagsWithHttpInfo($id, $apiKey); + list($response) = $this->getTagIdsForFlowWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getFlowRelationshipsTagsWithHttpInfo + * Alias of `getTagIdsForFlow` * - * Get Flow Relationships Tags + * @deprecated use `getTagIdsForFlow` instead + */ + public function getFlowRelationshipsTags(...$args) { + return $this->getTagIdsForFlow(...$args); + } + + /** + * Operation getTagIdsForFlowWithHttpInfo + * + * Get Tag IDs for Flow * * @param string $id (required) * @@ -5604,9 +5983,9 @@ public function getFlowRelationshipsTags($id, $apiKey = null) * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowRelationshipsTagsWithHttpInfo($id, $apiKey = null) + public function getTagIdsForFlowWithHttpInfo($id, $apiKey = null) { - $request = $this->getFlowRelationshipsTagsRequest($id, $apiKey); + $request = $this->getTagIdsForFlowRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5762,18 +6141,27 @@ public function getFlowRelationshipsTagsWithHttpInfo($id, $apiKey = null) } /** - * Operation getFlowRelationshipsTagsAsync + * Alias of `getTagIdsForFlowWithHttpInfo` + * + * @deprecated use `getTagIdsForFlowWithHttpInfo` instead + */ + public function getFlowRelationshipsTagsWithHttpInfo(...$args) { + return $this->getTagIdsForFlowWithHttpInfo(...$args); + } + + /** + * Operation getTagIdsForFlowAsync * - * Get Flow Relationships Tags + * Get Tag IDs for Flow * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowRelationshipsTagsAsync($id, $apiKey = null) + public function getTagIdsForFlowAsync($id, $apiKey = null) { - return $this->getFlowRelationshipsTagsAsyncWithHttpInfo($id, $apiKey) + return $this->getTagIdsForFlowAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -5782,19 +6170,28 @@ function ($response) { } /** - * Operation getFlowRelationshipsTagsAsyncWithHttpInfo + * Alias of `getTagIdsForFlowAsync` + * + * @deprecated use `getTagIdsForFlowAsync` instead + */ + public function getFlowRelationshipsTagsAsync(...$args) { + return $this->getTagIdsForFlowAsync(...$args); + } + + /** + * Operation getTagIdsForFlowAsyncWithHttpInfo * - * Get Flow Relationships Tags + * Get Tag IDs for Flow * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowRelationshipsTagsAsyncWithHttpInfo($id, $apiKey = null) + public function getTagIdsForFlowAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowRelationshipsTagsRequest($id, $apiKey); + $request = $this->getTagIdsForFlowRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5838,23 +6235,32 @@ function ($exception) { } /** - * Create request for operation 'getFlowRelationshipsTags' + * Alias of `getTagIdsForFlowAsyncWithHttpInfo` + * + * @deprecated use `getTagIdsForFlowAsyncWithHttpInfo` instead + */ + public function getFlowRelationshipsTagsAsyncWithHttpInfo(...$args) { + return $this->getTagIdsForFlowAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagIdsForFlow' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowRelationshipsTagsRequest($id, $apiKey = null) + public function getTagIdsForFlowRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowRelationshipsTags' + 'Missing the required parameter $id when calling getTagIdsForFlow' ); } - $resourcePath = '/api/flows/{id}/relationships/tags/'; + $resourcePath = '/api/flows/{id}/relationships/tags'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5875,11 +6281,11 @@ public function getFlowRelationshipsTagsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5900,7 +6306,7 @@ public function getFlowRelationshipsTagsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5924,7 +6330,7 @@ public function getFlowRelationshipsTagsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5942,38 +6348,56 @@ public function getFlowRelationshipsTagsRequest($id, $apiKey = null) } /** - * Operation getFlowTags + * Alias of `getTagIdsForFlowRequest` * - * Get Flow Tags + * @deprecated use `getTagIdsForFlowRequest` instead + */ + public function getFlowRelationshipsTagsRequest(...$args) { + return $this->getTagIdsForFlowRequest(...$args); + } + + /** + * Operation getTemplateForFlowMessage + * + * Get Template for Flow Message * * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlowTags($id, $fields_tag = null, $apiKey = null) + public function getTemplateForFlowMessage($id, $fields_template = null, $apiKey = null) { - list($response) = $this->getFlowTagsWithHttpInfo($id, $fields_tag, $apiKey); + list($response) = $this->getTemplateForFlowMessageWithHttpInfo($id, $fields_template, $apiKey); return $response; } /** - * Operation getFlowTagsWithHttpInfo + * Alias of `getTemplateForFlowMessage` * - * Get Flow Tags + * @deprecated use `getTemplateForFlowMessage` instead + */ + public function getFlowMessageTemplate(...$args) { + return $this->getTemplateForFlowMessage(...$args); + } + + /** + * Operation getTemplateForFlowMessageWithHttpInfo + * + * Get Template for Flow Message * * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function getTemplateForFlowMessageWithHttpInfo($id, $fields_template = null, $apiKey = null) { - $request = $this->getFlowTagsRequest($id, $fields_tag, $apiKey); + $request = $this->getTemplateForFlowMessageRequest($id, $fields_template, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6129,19 +6553,28 @@ public function getFlowTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) } /** - * Operation getFlowTagsAsync + * Alias of `getTemplateForFlowMessageWithHttpInfo` * - * Get Flow Tags + * @deprecated use `getTemplateForFlowMessageWithHttpInfo` instead + */ + public function getFlowMessageTemplateWithHttpInfo(...$args) { + return $this->getTemplateForFlowMessageWithHttpInfo(...$args); + } + + /** + * Operation getTemplateForFlowMessageAsync + * + * Get Template for Flow Message * * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowTagsAsync($id, $fields_tag = null, $apiKey = null) + public function getTemplateForFlowMessageAsync($id, $fields_template = null, $apiKey = null) { - return $this->getFlowTagsAsyncWithHttpInfo($id, $fields_tag, $apiKey) + return $this->getTemplateForFlowMessageAsyncWithHttpInfo($id, $fields_template, $apiKey) ->then( function ($response) { return $response[0]; @@ -6150,20 +6583,29 @@ function ($response) { } /** - * Operation getFlowTagsAsyncWithHttpInfo + * Alias of `getTemplateForFlowMessageAsync` * - * Get Flow Tags + * @deprecated use `getTemplateForFlowMessageAsync` instead + */ + public function getFlowMessageTemplateAsync(...$args) { + return $this->getTemplateForFlowMessageAsync(...$args); + } + + /** + * Operation getTemplateForFlowMessageAsyncWithHttpInfo + * + * Get Template for Flow Message * * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowTagsAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function getTemplateForFlowMessageAsyncWithHttpInfo($id, $fields_template = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowTagsRequest($id, $fields_tag, $apiKey); + $request = $this->getTemplateForFlowMessageRequest($id, $fields_template, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6207,24 +6649,33 @@ function ($exception) { } /** - * Create request for operation 'getFlowTags' + * Alias of `getTemplateForFlowMessageAsyncWithHttpInfo` + * + * @deprecated use `getTemplateForFlowMessageAsyncWithHttpInfo` instead + */ + public function getFlowMessageTemplateAsyncWithHttpInfo(...$args) { + return $this->getTemplateForFlowMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTemplateForFlowMessage' * * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowTagsRequest($id, $fields_tag = null, $apiKey = null) + public function getTemplateForFlowMessageRequest($id, $fields_template = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getFlowTags' + 'Missing the required parameter $id when calling getTemplateForFlowMessage' ); } - $resourcePath = '/api/flows/{id}/tags/'; + $resourcePath = '/api/flow-messages/{id}/template'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6233,8 +6684,8 @@ public function getFlowTagsRequest($id, $fields_tag = null, $apiKey = null) // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name + $fields_template, + 'fields[template]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -6254,11 +6705,11 @@ public function getFlowTagsRequest($id, $fields_tag = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6279,7 +6730,7 @@ public function getFlowTagsRequest($id, $fields_tag = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6303,7 +6754,7 @@ public function getFlowTagsRequest($id, $fields_tag = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6321,50 +6772,54 @@ public function getFlowTagsRequest($id, $fields_tag = null, $apiKey = null) } /** - * Operation getFlows + * Alias of `getTemplateForFlowMessageRequest` * - * Get Flows + * @deprecated use `getTemplateForFlowMessageRequest` instead + */ + public function getFlowMessageTemplateRequest(...$args) { + return $this->getTemplateForFlowMessageRequest(...$args); + } + + /** + * Operation getTemplateIdForFlowMessage * - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get Template ID for Flow Message + * + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getFlows($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getTemplateIdForFlowMessage($id, $apiKey = null) { - list($response) = $this->getFlowsWithHttpInfo($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getTemplateIdForFlowMessageWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getFlowsWithHttpInfo + * Alias of `getTemplateIdForFlowMessage` * - * Get Flows + * @deprecated use `getTemplateIdForFlowMessage` instead + */ + public function getFlowMessageRelationshipsTemplate(...$args) { + return $this->getTemplateIdForFlowMessage(...$args); + } + + /** + * Operation getTemplateIdForFlowMessageWithHttpInfo * - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get Template ID for Flow Message + * + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getFlowsWithHttpInfo($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getTemplateIdForFlowMessageWithHttpInfo($id, $apiKey = null) { - $request = $this->getFlowsRequest($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getTemplateIdForFlowMessageRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6520,25 +6975,27 @@ public function getFlowsWithHttpInfo($fields_flow_action = null, $fields_flow = } /** - * Operation getFlowsAsync + * Alias of `getTemplateIdForFlowMessageWithHttpInfo` * - * Get Flows + * @deprecated use `getTemplateIdForFlowMessageWithHttpInfo` instead + */ + public function getFlowMessageRelationshipsTemplateWithHttpInfo(...$args) { + return $this->getTemplateIdForFlowMessageWithHttpInfo(...$args); + } + + /** + * Operation getTemplateIdForFlowMessageAsync * - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get Template ID for Flow Message + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowsAsync($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getTemplateIdForFlowMessageAsync($id, $apiKey = null) { - return $this->getFlowsAsyncWithHttpInfo($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey) + return $this->getTemplateIdForFlowMessageAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -6547,26 +7004,28 @@ function ($response) { } /** - * Operation getFlowsAsyncWithHttpInfo + * Alias of `getTemplateIdForFlowMessageAsync` * - * Get Flows + * @deprecated use `getTemplateIdForFlowMessageAsync` instead + */ + public function getFlowMessageRelationshipsTemplateAsync(...$args) { + return $this->getTemplateIdForFlowMessageAsync(...$args); + } + + /** + * Operation getTemplateIdForFlowMessageAsyncWithHttpInfo * - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get Template ID for Flow Message + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFlowsAsyncWithHttpInfo($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getTemplateIdForFlowMessageAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getFlowsRequest($fields_flow_action, $fields_flow, $fields_tag, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getTemplateIdForFlowMessageRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6610,120 +7069,57 @@ function ($exception) { } /** - * Create request for operation 'getFlows' + * Alias of `getTemplateIdForFlowMessageAsyncWithHttpInfo` * - * @param string[] $fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 50. Min: 1. Max: 50. (optional, default to 50) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @deprecated use `getTemplateIdForFlowMessageAsyncWithHttpInfo` instead + */ + public function getFlowMessageRelationshipsTemplateAsyncWithHttpInfo(...$args) { + return $this->getTemplateIdForFlowMessageAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTemplateIdForFlowMessage' + * + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFlowsRequest($fields_flow_action = null, $fields_flow = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $page_size = 50, $sort = null, $apiKey = null) + public function getTemplateIdForFlowMessageRequest($id, $apiKey = null) { - if ($page_size !== null && $page_size > 50) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlows, must be smaller than or equal to 50.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling FlowsApi.getFlows, must be bigger than or equal to 1.'); + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTemplateIdForFlowMessage' + ); } - - $resourcePath = '/api/flows/'; + $resourcePath = '/api/flow-messages/{id}/relationships/template'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow_action, - 'fields[flow-action]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_flow, - 'fields[flow]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6744,7 +7140,7 @@ public function getFlowsRequest($fields_flow_action = null, $fields_flow = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6768,7 +7164,7 @@ public function getFlowsRequest($fields_flow_action = null, $fields_flow = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6785,6 +7181,15 @@ public function getFlowsRequest($fields_flow_action = null, $fields_flow = null, ); } + /** + * Alias of `getTemplateIdForFlowMessageRequest` + * + * @deprecated use `getTemplateIdForFlowMessageRequest` instead + */ + public function getFlowMessageRelationshipsTemplateRequest(...$args) { + return $this->getTemplateIdForFlowMessageRequest(...$args); + } + /** * Operation updateFlow * @@ -7074,7 +7479,7 @@ public function updateFlowRequest($id, $flow_update_query, $apiKey = null) ); } - $resourcePath = '/api/flows/{id}/'; + $resourcePath = '/api/flows/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7095,18 +7500,18 @@ public function updateFlowRequest($id, $flow_update_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($flow_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($flow_update_query)); } else { $httpBody = $flow_update_query; @@ -7126,7 +7531,7 @@ public function updateFlowRequest($id, $flow_update_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7150,7 +7555,7 @@ public function updateFlowRequest($id, $flow_update_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/FormsApi.php b/lib/API/FormsApi.php index e54e15f..879bc03 100644 --- a/lib/API/FormsApi.php +++ b/lib/API/FormsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -122,9 +122,9 @@ public function getConfig() * Get Form * * @param string $id The ID of the form (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -142,9 +142,9 @@ public function getForm($id, $fields_form_version = null, $fields_form = null, $ * Get Form * * @param string $id The ID of the form (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -313,9 +313,9 @@ public function getFormWithHttpInfo($id, $fields_form_version = null, $fields_fo * Get Form * * @param string $id The ID of the form (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -336,9 +336,9 @@ function ($response) { * Get Form * * @param string $id The ID of the form (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -393,9 +393,9 @@ function ($exception) { * Create request for operation 'getForm' * * @param string $id The ID of the form (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -409,7 +409,7 @@ public function getFormRequest($id, $fields_form_version = null, $fields_form = ); } - $resourcePath = '/api/forms/{id}/'; + $resourcePath = '/api/forms/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -457,11 +457,11 @@ public function getFormRequest($id, $fields_form_version = null, $fields_form = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -482,7 +482,7 @@ public function getFormRequest($id, $fields_form_version = null, $fields_form = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -506,7 +506,7 @@ public function getFormRequest($id, $fields_form_version = null, $fields_form = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -528,8 +528,8 @@ public function getFormRequest($id, $fields_form_version = null, $fields_form = * * Get Form for Form Version * - * @param string $id (required) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the form version (required) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -555,8 +555,8 @@ public function getFormVersionForm(...$args) { * * Get Form for Form Version * - * @param string $id (required) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the form version (required) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -733,8 +733,8 @@ public function getFormVersionFormWithHttpInfo(...$args) { * * Get Form for Form Version * - * @param string $id (required) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the form version (required) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -763,8 +763,8 @@ public function getFormVersionFormAsync(...$args) { * * Get Form for Form Version * - * @param string $id (required) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the form version (required) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -827,8 +827,8 @@ public function getFormVersionFormAsyncWithHttpInfo(...$args) { /** * Create request for operation 'getFormForFormVersion' * - * @param string $id (required) - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the form version (required) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -842,7 +842,7 @@ public function getFormForFormVersionRequest($id, $fields_form = null, $apiKey = ); } - $resourcePath = '/api/form-versions/{id}/form/'; + $resourcePath = '/api/form-versions/{id}/form'; $formParams = []; $queryParams = []; $headerParams = []; @@ -872,11 +872,11 @@ public function getFormForFormVersionRequest($id, $fields_form = null, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -897,7 +897,7 @@ public function getFormForFormVersionRequest($id, $fields_form = null, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -921,7 +921,7 @@ public function getFormForFormVersionRequest($id, $fields_form = null, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -952,7 +952,7 @@ public function getFormVersionFormRequest(...$args) { * * Get Form ID for Form Version * - * @param string $id (required) + * @param string $id The ID of the form version (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -978,7 +978,7 @@ public function getFormVersionRelationshipsForm(...$args) { * * Get Form ID for Form Version * - * @param string $id (required) + * @param string $id The ID of the form version (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1155,7 +1155,7 @@ public function getFormVersionRelationshipsFormWithHttpInfo(...$args) { * * Get Form ID for Form Version * - * @param string $id (required) + * @param string $id The ID of the form version (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1184,7 +1184,7 @@ public function getFormVersionRelationshipsFormAsync(...$args) { * * Get Form ID for Form Version * - * @param string $id (required) + * @param string $id The ID of the form version (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1247,7 +1247,7 @@ public function getFormVersionRelationshipsFormAsyncWithHttpInfo(...$args) { /** * Create request for operation 'getFormIdForFormVersion' * - * @param string $id (required) + * @param string $id The ID of the form version (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1261,7 +1261,7 @@ public function getFormIdForFormVersionRequest($id, $apiKey = null) ); } - $resourcePath = '/api/form-versions/{id}/relationships/form/'; + $resourcePath = '/api/form-versions/{id}/relationships/form'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1282,11 +1282,11 @@ public function getFormIdForFormVersionRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1307,7 +1307,7 @@ public function getFormIdForFormVersionRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1331,7 +1331,7 @@ public function getFormIdForFormVersionRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1363,7 +1363,7 @@ public function getFormVersionRelationshipsFormRequest(...$args) { * Get Form Version * * @param string $id The ID of the form version (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1381,7 +1381,7 @@ public function getFormVersion($id, $fields_form_version = null, $apiKey = null) * Get Form Version * * @param string $id The ID of the form version (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1550,7 +1550,7 @@ public function getFormVersionWithHttpInfo($id, $fields_form_version = null, $ap * Get Form Version * * @param string $id The ID of the form version (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1571,7 +1571,7 @@ function ($response) { * Get Form Version * * @param string $id The ID of the form version (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1626,7 +1626,7 @@ function ($exception) { * Create request for operation 'getFormVersion' * * @param string $id The ID of the form version (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1640,7 +1640,7 @@ public function getFormVersionRequest($id, $fields_form_version = null, $apiKey ); } - $resourcePath = '/api/form-versions/{id}/'; + $resourcePath = '/api/form-versions/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1670,11 +1670,11 @@ public function getFormVersionRequest($id, $fields_form_version = null, $apiKey if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1695,7 +1695,7 @@ public function getFormVersionRequest($id, $fields_form_version = null, $apiKey // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1719,7 +1719,7 @@ public function getFormVersionRequest($id, $fields_form_version = null, $apiKey $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1741,11 +1741,11 @@ public function getFormVersionRequest($id, $fields_form_version = null, $apiKey * * Get Forms * - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1762,11 +1762,11 @@ public function getForms($fields_form = null, $filter = null, $page_cursor = nul * * Get Forms * - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1934,11 +1934,11 @@ public function getFormsWithHttpInfo($fields_form = null, $filter = null, $page_ * * Get Forms * - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1958,11 +1958,11 @@ function ($response) { * * Get Forms * - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2016,11 +2016,11 @@ function ($exception) { /** * Create request for operation 'getForms' * - * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2035,7 +2035,7 @@ public function getFormsRequest($fields_form = null, $filter = null, $page_curso } - $resourcePath = '/api/forms/'; + $resourcePath = '/api/forms'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2093,11 +2093,11 @@ public function getFormsRequest($fields_form = null, $filter = null, $page_curso if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2118,7 +2118,7 @@ public function getFormsRequest($fields_form = null, $filter = null, $page_curso // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2142,7 +2142,7 @@ public function getFormsRequest($fields_form = null, $filter = null, $page_curso $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2164,7 +2164,7 @@ public function getFormsRequest($fields_form = null, $filter = null, $page_curso * * Get Version IDs for Form * - * @param string $id (required) + * @param string $id The ID of the form (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2190,7 +2190,7 @@ public function getFormRelationshipsFormVersions(...$args) { * * Get Version IDs for Form * - * @param string $id (required) + * @param string $id The ID of the form (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2367,7 +2367,7 @@ public function getFormRelationshipsFormVersionsWithHttpInfo(...$args) { * * Get Version IDs for Form * - * @param string $id (required) + * @param string $id The ID of the form (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2396,7 +2396,7 @@ public function getFormRelationshipsFormVersionsAsync(...$args) { * * Get Version IDs for Form * - * @param string $id (required) + * @param string $id The ID of the form (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2459,7 +2459,7 @@ public function getFormRelationshipsFormVersionsAsyncWithHttpInfo(...$args) { /** * Create request for operation 'getVersionIdsForForm' * - * @param string $id (required) + * @param string $id The ID of the form (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2473,7 +2473,7 @@ public function getVersionIdsForFormRequest($id, $apiKey = null) ); } - $resourcePath = '/api/forms/{id}/relationships/form-versions/'; + $resourcePath = '/api/forms/{id}/relationships/form-versions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2494,11 +2494,11 @@ public function getVersionIdsForFormRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2519,7 +2519,7 @@ public function getVersionIdsForFormRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2543,7 +2543,7 @@ public function getVersionIdsForFormRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2574,12 +2574,12 @@ public function getFormRelationshipsFormVersionsRequest(...$args) { * * Get Versions for Form * - * @param string $id (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the form (required) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2605,12 +2605,12 @@ public function getFormFormVersions(...$args) { * * Get Versions for Form * - * @param string $id (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the form (required) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2787,12 +2787,12 @@ public function getFormFormVersionsWithHttpInfo(...$args) { * * Get Versions for Form * - * @param string $id (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the form (required) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2821,12 +2821,12 @@ public function getFormFormVersionsAsync(...$args) { * * Get Versions for Form * - * @param string $id (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the form (required) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2889,12 +2889,12 @@ public function getFormFormVersionsAsyncWithHttpInfo(...$args) { /** * Create request for operation 'getVersionsForForm' * - * @param string $id (required) - * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id The ID of the form (required) + * @param string[] $fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2915,7 +2915,7 @@ public function getVersionsForFormRequest($id, $fields_form_version = null, $fil } - $resourcePath = '/api/forms/{id}/form-versions/'; + $resourcePath = '/api/forms/{id}/form-versions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2981,11 +2981,11 @@ public function getVersionsForFormRequest($id, $fields_form_version = null, $fil if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3006,7 +3006,7 @@ public function getVersionsForFormRequest($id, $fields_form_version = null, $fil // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3030,7 +3030,7 @@ public function getVersionsForFormRequest($id, $fields_form_version = null, $fil $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/ImagesApi.php b/lib/API/ImagesApi.php index 49a2838..9d80288 100644 --- a/lib/API/ImagesApi.php +++ b/lib/API/ImagesApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -122,7 +122,7 @@ public function getConfig() * Get Image * * @param string $id The ID of the image (required) - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -140,7 +140,7 @@ public function getImage($id, $fields_image = null, $apiKey = null) * Get Image * * @param string $id The ID of the image (required) - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -309,7 +309,7 @@ public function getImageWithHttpInfo($id, $fields_image = null, $apiKey = null) * Get Image * * @param string $id The ID of the image (required) - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -330,7 +330,7 @@ function ($response) { * Get Image * * @param string $id The ID of the image (required) - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -385,7 +385,7 @@ function ($exception) { * Create request for operation 'getImage' * * @param string $id The ID of the image (required) - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -399,7 +399,7 @@ public function getImageRequest($id, $fields_image = null, $apiKey = null) ); } - $resourcePath = '/api/images/{id}/'; + $resourcePath = '/api/images/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -429,11 +429,11 @@ public function getImageRequest($id, $fields_image = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -454,7 +454,7 @@ public function getImageRequest($id, $fields_image = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -478,7 +478,7 @@ public function getImageRequest($id, $fields_image = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -500,11 +500,11 @@ public function getImageRequest($id, $fields_image = null, $apiKey = null) * * Get Images * - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -521,11 +521,11 @@ public function getImages($fields_image = null, $filter = null, $page_cursor = n * * Get Images * - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -693,11 +693,11 @@ public function getImagesWithHttpInfo($fields_image = null, $filter = null, $pag * * Get Images * - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -717,11 +717,11 @@ function ($response) { * * Get Images * - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -775,11 +775,11 @@ function ($exception) { /** * Create request for operation 'getImages' * - * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -794,7 +794,7 @@ public function getImagesRequest($fields_image = null, $filter = null, $page_cur } - $resourcePath = '/api/images/'; + $resourcePath = '/api/images'; $formParams = []; $queryParams = []; $headerParams = []; @@ -852,11 +852,11 @@ public function getImagesRequest($fields_image = null, $filter = null, $page_cur if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -877,7 +877,7 @@ public function getImagesRequest($fields_image = null, $filter = null, $page_cur // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -901,7 +901,7 @@ public function getImagesRequest($fields_image = null, $filter = null, $page_cur $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1207,7 +1207,7 @@ public function updateImageRequest($id, $image_partial_update_query, $apiKey = n ); } - $resourcePath = '/api/images/{id}/'; + $resourcePath = '/api/images/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1228,18 +1228,18 @@ public function updateImageRequest($id, $image_partial_update_query, $apiKey = n if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($image_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($image_partial_update_query)); } else { $httpBody = $image_partial_update_query; @@ -1259,7 +1259,7 @@ public function updateImageRequest($id, $image_partial_update_query, $apiKey = n // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1283,7 +1283,7 @@ public function updateImageRequest($id, $image_partial_update_query, $apiKey = n $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1624,7 +1624,7 @@ public function uploadImageFromFileRequest($file, $name = null, $hidden = false, ); } - $resourcePath = '/api/image-upload/'; + $resourcePath = '/api/image-upload'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1657,11 +1657,11 @@ public function uploadImageFromFileRequest($file, $name = null, $hidden = false, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], ['multipart/form-data'] ); } @@ -1682,7 +1682,7 @@ public function uploadImageFromFileRequest($file, $name = null, $hidden = false, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1706,7 +1706,7 @@ public function uploadImageFromFileRequest($file, $name = null, $hidden = false, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2046,7 +2046,7 @@ public function uploadImageFromUrlRequest($image_create_query, $apiKey = null) ); } - $resourcePath = '/api/images/'; + $resourcePath = '/api/images'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2059,18 +2059,18 @@ public function uploadImageFromUrlRequest($image_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($image_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($image_create_query)); } else { $httpBody = $image_create_query; @@ -2090,7 +2090,7 @@ public function uploadImageFromUrlRequest($image_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2114,7 +2114,7 @@ public function uploadImageFromUrlRequest($image_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/ListsApi.php b/lib/API/ListsApi.php index 427de0a..c800d9f 100644 --- a/lib/API/ListsApi.php +++ b/lib/API/ListsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -394,7 +394,7 @@ public function createListRequest($list_create_query, $apiKey = null) ); } - $resourcePath = '/api/lists/'; + $resourcePath = '/api/lists'; $formParams = []; $queryParams = []; $headerParams = []; @@ -407,18 +407,18 @@ public function createListRequest($list_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($list_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($list_create_query)); } else { $httpBody = $list_create_query; @@ -438,7 +438,7 @@ public function createListRequest($list_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -462,7 +462,7 @@ public function createListRequest($list_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -692,7 +692,7 @@ public function createListRelationshipsRequest($id, $list_members_add_query, $ap ); } - $resourcePath = '/api/lists/{id}/relationships/profiles/'; + $resourcePath = '/api/lists/{id}/relationships/profiles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -713,18 +713,18 @@ public function createListRelationshipsRequest($id, $list_members_add_query, $ap if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($list_members_add_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($list_members_add_query)); } else { $httpBody = $list_members_add_query; @@ -744,7 +744,7 @@ public function createListRelationshipsRequest($id, $list_members_add_query, $ap // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -768,7 +768,7 @@ public function createListRelationshipsRequest($id, $list_members_add_query, $ap $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -960,7 +960,7 @@ public function deleteListRequest($id, $apiKey = null) ); } - $resourcePath = '/api/lists/{id}/'; + $resourcePath = '/api/lists/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -981,11 +981,11 @@ public function deleteListRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1006,7 +1006,7 @@ public function deleteListRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1030,7 +1030,7 @@ public function deleteListRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1260,7 +1260,7 @@ public function deleteListRelationshipsRequest($id, $list_members_delete_query, ); } - $resourcePath = '/api/lists/{id}/relationships/profiles/'; + $resourcePath = '/api/lists/{id}/relationships/profiles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1281,18 +1281,18 @@ public function deleteListRelationshipsRequest($id, $list_members_delete_query, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($list_members_delete_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($list_members_delete_query)); } else { $httpBody = $list_members_delete_query; @@ -1312,7 +1312,7 @@ public function deleteListRelationshipsRequest($id, $list_members_delete_query, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1336,7 +1336,7 @@ public function deleteListRelationshipsRequest($id, $list_members_delete_query, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1369,17 +1369,18 @@ public function deleteListRelationshipsProfilesRequest(...$args) { * * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * @param string[] $additional_fields_list Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getList($id, $additional_fields_list = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) + public function getList($id, $additional_fields_list = null, $fields_flow = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) { - list($response) = $this->getListWithHttpInfo($id, $additional_fields_list, $fields_list, $fields_tag, $include, $apiKey); + list($response) = $this->getListWithHttpInfo($id, $additional_fields_list, $fields_flow, $fields_list, $fields_tag, $include, $apiKey); return $response; } @@ -1390,17 +1391,18 @@ public function getList($id, $additional_fields_list = null, $fields_list = null * * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * @param string[] $additional_fields_list Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getListWithHttpInfo($id, $additional_fields_list = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) + public function getListWithHttpInfo($id, $additional_fields_list = null, $fields_flow = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) { - $request = $this->getListRequest($id, $additional_fields_list, $fields_list, $fields_tag, $include, $apiKey); + $request = $this->getListRequest($id, $additional_fields_list, $fields_flow, $fields_list, $fields_tag, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1562,16 +1564,17 @@ public function getListWithHttpInfo($id, $additional_fields_list = null, $fields * * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * @param string[] $additional_fields_list Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListAsync($id, $additional_fields_list = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) + public function getListAsync($id, $additional_fields_list = null, $fields_flow = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) { - return $this->getListAsyncWithHttpInfo($id, $additional_fields_list, $fields_list, $fields_tag, $include, $apiKey) + return $this->getListAsyncWithHttpInfo($id, $additional_fields_list, $fields_flow, $fields_list, $fields_tag, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -1586,17 +1589,18 @@ function ($response) { * * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * @param string[] $additional_fields_list Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListAsyncWithHttpInfo($id, $additional_fields_list = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) + public function getListAsyncWithHttpInfo($id, $additional_fields_list = null, $fields_flow = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getListRequest($id, $additional_fields_list, $fields_list, $fields_tag, $include, $apiKey); + $request = $this->getListRequest($id, $additional_fields_list, $fields_flow, $fields_list, $fields_tag, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1644,14 +1648,15 @@ function ($exception) { * * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * @param string[] $additional_fields_list Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getListRequest($id, $additional_fields_list = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) + public function getListRequest($id, $additional_fields_list = null, $fields_flow = null, $fields_list = null, $fields_tag = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -1660,7 +1665,7 @@ public function getListRequest($id, $additional_fields_list = null, $fields_list ); } - $resourcePath = '/api/lists/{id}/'; + $resourcePath = '/api/lists/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1677,6 +1682,15 @@ public function getListRequest($id, $additional_fields_list = null, $fields_list false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $fields_list, 'fields[list]', // param base name @@ -1717,11 +1731,11 @@ public function getListRequest($id, $additional_fields_list = null, $fields_list if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1742,7 +1756,7 @@ public function getListRequest($id, $additional_fields_list = null, $fields_list // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1766,7 +1780,7 @@ public function getListRequest($id, $additional_fields_list = null, $fields_list $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1784,48 +1798,38 @@ public function getListRequest($id, $additional_fields_list = null, $fields_list } /** - * Operation getListProfiles + * Operation getListFlowTriggers * - * Get List Profiles + * Get List Flow Triggers * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getListProfiles($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListFlowTriggers($id, $fields_flow = null, $apiKey = null) { - list($response) = $this->getListProfilesWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getListFlowTriggersWithHttpInfo($id, $fields_flow, $apiKey); return $response; } /** - * Operation getListProfilesWithHttpInfo + * Operation getListFlowTriggersWithHttpInfo * - * Get List Profiles + * Get List Flow Triggers * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getListProfilesWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListFlowTriggersWithHttpInfo($id, $fields_flow = null, $apiKey = null) { - $request = $this->getListProfilesRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getListFlowTriggersRequest($id, $fields_flow, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1981,24 +1985,19 @@ public function getListProfilesWithHttpInfo($id, $additional_fields_profile = nu } /** - * Operation getListProfilesAsync + * Operation getListFlowTriggersAsync * - * Get List Profiles + * Get List Flow Triggers * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListProfilesAsync($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListFlowTriggersAsync($id, $fields_flow = null, $apiKey = null) { - return $this->getListProfilesAsyncWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getListFlowTriggersAsyncWithHttpInfo($id, $fields_flow, $apiKey) ->then( function ($response) { return $response[0]; @@ -2007,25 +2006,20 @@ function ($response) { } /** - * Operation getListProfilesAsyncWithHttpInfo + * Operation getListFlowTriggersAsyncWithHttpInfo * - * Get List Profiles + * Get List Flow Triggers * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListProfilesAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListFlowTriggersAsyncWithHttpInfo($id, $fields_flow = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getListProfilesRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getListFlowTriggersRequest($id, $fields_flow, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2069,36 +2063,24 @@ function ($exception) { } /** - * Create request for operation 'getListProfiles' + * Create request for operation 'getListFlowTriggers' * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getListProfilesRequest($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListFlowTriggersRequest($id, $fields_flow = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getListProfiles' + 'Missing the required parameter $id when calling getListFlowTriggers' ); } - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getListProfiles, must be smaller than or equal to 100.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getListProfiles, must be bigger than or equal to 1.'); - } - - $resourcePath = '/api/lists/{id}/profiles/'; + $resourcePath = '/api/lists/{id}/flow-triggers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2107,58 +2089,13 @@ public function getListProfilesRequest($id, $additional_fields_profile = null, $ // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $additional_fields_profile, - 'additional-fields[profile]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_profile, - 'fields[profile]', // param base name + $fields_flow, + 'fields[flow]', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params @@ -2173,11 +2110,11 @@ public function getListProfilesRequest($id, $additional_fields_profile = null, $ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2198,7 +2135,7 @@ public function getListProfilesRequest($id, $additional_fields_profile = null, $ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2222,7 +2159,7 @@ public function getListProfilesRequest($id, $additional_fields_profile = null, $ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2240,44 +2177,48 @@ public function getListProfilesRequest($id, $additional_fields_profile = null, $ } /** - * Operation getListRelationshipsProfiles + * Operation getListProfiles * - * Get List Relationships Profiles + * Get List Profiles * - * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getListRelationshipsProfiles($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListProfiles($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - list($response) = $this->getListRelationshipsProfilesWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getListProfilesWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Operation getListRelationshipsProfilesWithHttpInfo + * Operation getListProfilesWithHttpInfo * - * Get List Relationships Profiles + * Get List Profiles * - * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getListRelationshipsProfilesWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListProfilesWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - $request = $this->getListRelationshipsProfilesRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getListProfilesRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2433,22 +2374,24 @@ public function getListRelationshipsProfilesWithHttpInfo($id, $filter = null, $p } /** - * Operation getListRelationshipsProfilesAsync + * Operation getListProfilesAsync * - * Get List Relationships Profiles + * Get List Profiles * - * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListRelationshipsProfilesAsync($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListProfilesAsync($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - return $this->getListRelationshipsProfilesAsyncWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getListProfilesAsyncWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -2457,23 +2400,25 @@ function ($response) { } /** - * Operation getListRelationshipsProfilesAsyncWithHttpInfo + * Operation getListProfilesAsyncWithHttpInfo * - * Get List Relationships Profiles + * Get List Profiles * - * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListRelationshipsProfilesAsyncWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListProfilesAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getListRelationshipsProfilesRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getListProfilesRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2517,40 +2462,60 @@ function ($exception) { } /** - * Create request for operation 'getListRelationshipsProfiles' + * Create request for operation 'getListProfiles' * - * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getListRelationshipsProfilesRequest($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getListProfilesRequest($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getListRelationshipsProfiles' + 'Missing the required parameter $id when calling getListProfiles' ); } - if ($page_size !== null && $page_size > 1000) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getListRelationshipsProfiles, must be smaller than or equal to 1000.'); + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getListProfiles, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getListRelationshipsProfiles, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getListProfiles, must be bigger than or equal to 1.'); } - $resourcePath = '/api/lists/{id}/relationships/profiles/'; + $resourcePath = '/api/lists/{id}/profiles'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $additional_fields_profile, + 'additional-fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_profile, + 'fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $filter, @@ -2601,11 +2566,11 @@ public function getListRelationshipsProfilesRequest($id, $filter = null, $page_c if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2626,7 +2591,7 @@ public function getListRelationshipsProfilesRequest($id, $filter = null, $page_c // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2650,7 +2615,7 @@ public function getListRelationshipsProfilesRequest($id, $filter = null, $page_c $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2668,36 +2633,36 @@ public function getListRelationshipsProfilesRequest($id, $filter = null, $page_c } /** - * Operation getListRelationshipsTags + * Operation getListRelationshipsFlowTriggers * - * Get List Relationships Tags + * Get List Relationships Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getListRelationshipsTags($id, $apiKey = null) + public function getListRelationshipsFlowTriggers($id, $apiKey = null) { - list($response) = $this->getListRelationshipsTagsWithHttpInfo($id, $apiKey); + list($response) = $this->getListRelationshipsFlowTriggersWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getListRelationshipsTagsWithHttpInfo + * Operation getListRelationshipsFlowTriggersWithHttpInfo * - * Get List Relationships Tags + * Get List Relationships Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getListRelationshipsTagsWithHttpInfo($id, $apiKey = null) + public function getListRelationshipsFlowTriggersWithHttpInfo($id, $apiKey = null) { - $request = $this->getListRelationshipsTagsRequest($id, $apiKey); + $request = $this->getListRelationshipsFlowTriggersRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2853,18 +2818,18 @@ public function getListRelationshipsTagsWithHttpInfo($id, $apiKey = null) } /** - * Operation getListRelationshipsTagsAsync + * Operation getListRelationshipsFlowTriggersAsync * - * Get List Relationships Tags + * Get List Relationships Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListRelationshipsTagsAsync($id, $apiKey = null) + public function getListRelationshipsFlowTriggersAsync($id, $apiKey = null) { - return $this->getListRelationshipsTagsAsyncWithHttpInfo($id, $apiKey) + return $this->getListRelationshipsFlowTriggersAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -2873,19 +2838,19 @@ function ($response) { } /** - * Operation getListRelationshipsTagsAsyncWithHttpInfo + * Operation getListRelationshipsFlowTriggersAsyncWithHttpInfo * - * Get List Relationships Tags + * Get List Relationships Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListRelationshipsTagsAsyncWithHttpInfo($id, $apiKey = null) + public function getListRelationshipsFlowTriggersAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getListRelationshipsTagsRequest($id, $apiKey); + $request = $this->getListRelationshipsFlowTriggersRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2929,23 +2894,23 @@ function ($exception) { } /** - * Create request for operation 'getListRelationshipsTags' + * Create request for operation 'getListRelationshipsFlowTriggers' * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getListRelationshipsTagsRequest($id, $apiKey = null) + public function getListRelationshipsFlowTriggersRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getListRelationshipsTags' + 'Missing the required parameter $id when calling getListRelationshipsFlowTriggers' ); } - $resourcePath = '/api/lists/{id}/relationships/tags/'; + $resourcePath = '/api/lists/{id}/relationships/flow-triggers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2966,11 +2931,11 @@ public function getListRelationshipsTagsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2991,7 +2956,7 @@ public function getListRelationshipsTagsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3015,7 +2980,7 @@ public function getListRelationshipsTagsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3037,8 +3002,8 @@ public function getListRelationshipsTagsRequest($id, $apiKey = null) * * Get List Tags * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3055,8 +3020,8 @@ public function getListTags($id, $fields_tag = null, $apiKey = null) * * Get List Tags * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3224,8 +3189,8 @@ public function getListTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) * * Get List Tags * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3245,8 +3210,8 @@ function ($response) { * * Get List Tags * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3300,8 +3265,8 @@ function ($exception) { /** * Create request for operation 'getListTags' * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3315,7 +3280,7 @@ public function getListTagsRequest($id, $fields_tag = null, $apiKey = null) ); } - $resourcePath = '/api/lists/{id}/tags/'; + $resourcePath = '/api/lists/{id}/tags'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3345,11 +3310,11 @@ public function getListTagsRequest($id, $fields_tag = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3370,7 +3335,7 @@ public function getListTagsRequest($id, $fields_tag = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3394,7 +3359,7 @@ public function getListTagsRequest($id, $fields_tag = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3416,20 +3381,21 @@ public function getListTagsRequest($id, $fields_tag = null, $apiKey = null) * * Get Lists * - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getLists($fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getLists($fields_flow = null, $fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getListsWithHttpInfo($fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + list($response) = $this->getListsWithHttpInfo($fields_flow, $fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); return $response; } @@ -3438,20 +3404,21 @@ public function getLists($fields_list = null, $fields_tag = null, $filter = null * * Get Lists * - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getListsWithHttpInfo($fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getListsWithHttpInfo($fields_flow = null, $fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getListsRequest($fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getListsRequest($fields_flow, $fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3611,19 +3578,20 @@ public function getListsWithHttpInfo($fields_list = null, $fields_tag = null, $f * * Get Lists * - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListsAsync($fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getListsAsync($fields_flow = null, $fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getListsAsyncWithHttpInfo($fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey) + return $this->getListsAsyncWithHttpInfo($fields_flow, $fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -3636,20 +3604,21 @@ function ($response) { * * Get Lists * - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getListsAsyncWithHttpInfo($fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getListsAsyncWithHttpInfo($fields_flow = null, $fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getListsRequest($fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getListsRequest($fields_flow, $fields_list, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3695,26 +3664,36 @@ function ($exception) { /** * Create request for operation 'getLists' * - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getListsRequest($fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getListsRequest($fields_flow = null, $fields_list = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $resourcePath = '/api/lists/'; + $resourcePath = '/api/lists'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $fields_list, @@ -3775,11 +3754,11 @@ public function getListsRequest($fields_list = null, $fields_tag = null, $filter if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3800,7 +3779,7 @@ public function getListsRequest($fields_list = null, $fields_tag = null, $filter // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3824,7 +3803,7 @@ public function getListsRequest($fields_list = null, $fields_tag = null, $filter $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3841,6 +3820,889 @@ public function getListsRequest($fields_list = null, $fields_tag = null, $filter ); } + /** + * Operation getProfileIdsForList + * + * Get Profile IDs for List + * + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getProfileIdsForList($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + list($response) = $this->getProfileIdsForListWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + return $response; + } + + /** + * Alias of `getProfileIdsForList` + * + * @deprecated use `getProfileIdsForList` instead + */ + public function getListRelationshipsProfiles(...$args) { + return $this->getProfileIdsForList(...$args); + } + + /** + * Operation getProfileIdsForListWithHttpInfo + * + * Get Profile IDs for List + * + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getProfileIdsForListWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + $request = $this->getProfileIdsForListRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getProfileIdsForListWithHttpInfo` + * + * @deprecated use `getProfileIdsForListWithHttpInfo` instead + */ + public function getListRelationshipsProfilesWithHttpInfo(...$args) { + return $this->getProfileIdsForListWithHttpInfo(...$args); + } + + /** + * Operation getProfileIdsForListAsync + * + * Get Profile IDs for List + * + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProfileIdsForListAsync($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + return $this->getProfileIdsForListAsyncWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getProfileIdsForListAsync` + * + * @deprecated use `getProfileIdsForListAsync` instead + */ + public function getListRelationshipsProfilesAsync(...$args) { + return $this->getProfileIdsForListAsync(...$args); + } + + /** + * Operation getProfileIdsForListAsyncWithHttpInfo + * + * Get Profile IDs for List + * + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProfileIdsForListAsyncWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getProfileIdsForListRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getProfileIdsForListAsyncWithHttpInfo` + * + * @deprecated use `getProfileIdsForListAsyncWithHttpInfo` instead + */ + public function getListRelationshipsProfilesAsyncWithHttpInfo(...$args) { + return $this->getProfileIdsForListAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getProfileIdsForList' + * + * @param string $id Primary key that uniquely identifies this list. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProfileIdsForListRequest($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProfileIdsForList' + ); + } + if ($page_size !== null && $page_size > 1000) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getProfileIdsForList, must be smaller than or equal to 1000.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ListsApi.getProfileIdsForList, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/api/lists/{id}/relationships/profiles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getProfileIdsForListRequest` + * + * @deprecated use `getProfileIdsForListRequest` instead + */ + public function getListRelationshipsProfilesRequest(...$args) { + return $this->getProfileIdsForListRequest(...$args); + } + + /** + * Operation getTagIdsForList + * + * Get Tag IDs for List + * + * @param string $id (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getTagIdsForList($id, $apiKey = null) + { + list($response) = $this->getTagIdsForListWithHttpInfo($id, $apiKey); + return $response; + } + + /** + * Alias of `getTagIdsForList` + * + * @deprecated use `getTagIdsForList` instead + */ + public function getListRelationshipsTags(...$args) { + return $this->getTagIdsForList(...$args); + } + + /** + * Operation getTagIdsForListWithHttpInfo + * + * Get Tag IDs for List + * + * @param string $id (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getTagIdsForListWithHttpInfo($id, $apiKey = null) + { + $request = $this->getTagIdsForListRequest($id, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getTagIdsForListWithHttpInfo` + * + * @deprecated use `getTagIdsForListWithHttpInfo` instead + */ + public function getListRelationshipsTagsWithHttpInfo(...$args) { + return $this->getTagIdsForListWithHttpInfo(...$args); + } + + /** + * Operation getTagIdsForListAsync + * + * Get Tag IDs for List + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagIdsForListAsync($id, $apiKey = null) + { + return $this->getTagIdsForListAsyncWithHttpInfo($id, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getTagIdsForListAsync` + * + * @deprecated use `getTagIdsForListAsync` instead + */ + public function getListRelationshipsTagsAsync(...$args) { + return $this->getTagIdsForListAsync(...$args); + } + + /** + * Operation getTagIdsForListAsyncWithHttpInfo + * + * Get Tag IDs for List + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagIdsForListAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTagIdsForListRequest($id, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getTagIdsForListAsyncWithHttpInfo` + * + * @deprecated use `getTagIdsForListAsyncWithHttpInfo` instead + */ + public function getListRelationshipsTagsAsyncWithHttpInfo(...$args) { + return $this->getTagIdsForListAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagIdsForList' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTagIdsForListRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTagIdsForList' + ); + } + + $resourcePath = '/api/lists/{id}/relationships/tags'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getTagIdsForListRequest` + * + * @deprecated use `getTagIdsForListRequest` instead + */ + public function getListRelationshipsTagsRequest(...$args) { + return $this->getTagIdsForListRequest(...$args); + } + /** * Operation updateList * @@ -4130,7 +4992,7 @@ public function updateListRequest($id, $list_partial_update_query, $apiKey = nul ); } - $resourcePath = '/api/lists/{id}/'; + $resourcePath = '/api/lists/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4151,18 +5013,18 @@ public function updateListRequest($id, $list_partial_update_query, $apiKey = nul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($list_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($list_partial_update_query)); } else { $httpBody = $list_partial_update_query; @@ -4182,7 +5044,7 @@ public function updateListRequest($id, $list_partial_update_query, $apiKey = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4206,7 +5068,7 @@ public function updateListRequest($id, $list_partial_update_query, $apiKey = nul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/MetricsApi.php b/lib/API/MetricsApi.php index 0ecaf16..5473900 100644 --- a/lib/API/MetricsApi.php +++ b/lib/API/MetricsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -122,15 +122,17 @@ public function getConfig() * Get Metric * * @param string $id Metric ID (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getMetric($id, $fields_metric = null, $apiKey = null) + public function getMetric($id, $fields_flow = null, $fields_metric = null, $include = null, $apiKey = null) { - list($response) = $this->getMetricWithHttpInfo($id, $fields_metric, $apiKey); + list($response) = $this->getMetricWithHttpInfo($id, $fields_flow, $fields_metric, $include, $apiKey); return $response; } @@ -140,15 +142,17 @@ public function getMetric($id, $fields_metric = null, $apiKey = null) * Get Metric * * @param string $id Metric ID (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getMetricWithHttpInfo($id, $fields_metric = null, $apiKey = null) + public function getMetricWithHttpInfo($id, $fields_flow = null, $fields_metric = null, $include = null, $apiKey = null) { - $request = $this->getMetricRequest($id, $fields_metric, $apiKey); + $request = $this->getMetricRequest($id, $fields_flow, $fields_metric, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -309,14 +313,16 @@ public function getMetricWithHttpInfo($id, $fields_metric = null, $apiKey = null * Get Metric * * @param string $id Metric ID (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMetricAsync($id, $fields_metric = null, $apiKey = null) + public function getMetricAsync($id, $fields_flow = null, $fields_metric = null, $include = null, $apiKey = null) { - return $this->getMetricAsyncWithHttpInfo($id, $fields_metric, $apiKey) + return $this->getMetricAsyncWithHttpInfo($id, $fields_flow, $fields_metric, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -330,15 +336,17 @@ function ($response) { * Get Metric * * @param string $id Metric ID (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMetricAsyncWithHttpInfo($id, $fields_metric = null, $apiKey = null) + public function getMetricAsyncWithHttpInfo($id, $fields_flow = null, $fields_metric = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getMetricRequest($id, $fields_metric, $apiKey); + $request = $this->getMetricRequest($id, $fields_flow, $fields_metric, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -385,12 +393,14 @@ function ($exception) { * Create request for operation 'getMetric' * * @param string $id Metric ID (required) - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getMetricRequest($id, $fields_metric = null, $apiKey = null) + public function getMetricRequest($id, $fields_flow = null, $fields_metric = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -399,13 +409,22 @@ public function getMetricRequest($id, $fields_metric = null, $apiKey = null) ); } - $resourcePath = '/api/metrics/{id}/'; + $resourcePath = '/api/metrics/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $fields_metric, @@ -415,6 +434,15 @@ public function getMetricRequest($id, $fields_metric = null, $apiKey = null) false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -429,11 +457,11 @@ public function getMetricRequest($id, $fields_metric = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -454,7 +482,7 @@ public function getMetricRequest($id, $fields_metric = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -478,7 +506,7 @@ public function getMetricRequest($id, $fields_metric = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -496,40 +524,38 @@ public function getMetricRequest($id, $fields_metric = null, $apiKey = null) } /** - * Operation getMetrics + * Operation getMetricFlowTriggers * - * Get Metrics + * Get Metric Flow Triggers * - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getMetrics($fields_metric = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getMetricFlowTriggers($id, $fields_flow = null, $apiKey = null) { - list($response) = $this->getMetricsWithHttpInfo($fields_metric, $filter, $page_cursor, $apiKey); + list($response) = $this->getMetricFlowTriggersWithHttpInfo($id, $fields_flow, $apiKey); return $response; } /** - * Operation getMetricsWithHttpInfo + * Operation getMetricFlowTriggersWithHttpInfo * - * Get Metrics + * Get Metric Flow Triggers * - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getMetricsWithHttpInfo($fields_metric = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getMetricFlowTriggersWithHttpInfo($id, $fields_flow = null, $apiKey = null) { - $request = $this->getMetricsRequest($fields_metric, $filter, $page_cursor, $apiKey); + $request = $this->getMetricFlowTriggersRequest($id, $fields_flow, $apiKey); try { $options = $this->createHttpClientOption(); @@ -685,20 +711,19 @@ public function getMetricsWithHttpInfo($fields_metric = null, $filter = null, $p } /** - * Operation getMetricsAsync + * Operation getMetricFlowTriggersAsync * - * Get Metrics + * Get Metric Flow Triggers * - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMetricsAsync($fields_metric = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getMetricFlowTriggersAsync($id, $fields_flow = null, $apiKey = null) { - return $this->getMetricsAsyncWithHttpInfo($fields_metric, $filter, $page_cursor, $apiKey) + return $this->getMetricFlowTriggersAsyncWithHttpInfo($id, $fields_flow, $apiKey) ->then( function ($response) { return $response[0]; @@ -707,21 +732,20 @@ function ($response) { } /** - * Operation getMetricsAsyncWithHttpInfo + * Operation getMetricFlowTriggersAsyncWithHttpInfo * - * Get Metrics + * Get Metric Flow Triggers * - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMetricsAsyncWithHttpInfo($fields_metric = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getMetricFlowTriggersAsyncWithHttpInfo($id, $fields_flow = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getMetricsRequest($fields_metric, $filter, $page_cursor, $apiKey); + $request = $this->getMetricFlowTriggersRequest($id, $fields_flow, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -765,19 +789,24 @@ function ($exception) { } /** - * Create request for operation 'getMetrics' + * Create request for operation 'getMetricFlowTriggers' * - * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getMetricsRequest($fields_metric = null, $filter = null, $page_cursor = null, $apiKey = null) + public function getMetricFlowTriggersRequest($id, $fields_flow = null, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMetricFlowTriggers' + ); + } - $resourcePath = '/api/metrics/'; + $resourcePath = '/api/metrics/{id}/flow-triggers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -786,42 +815,32 @@ public function getMetricsRequest($fields_metric = null, $filter = null, $page_c // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_metric, - 'fields[metric]', // param base name + $fields_flow, + 'fields[flow]', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -842,7 +861,7 @@ public function getMetricsRequest($fields_metric = null, $filter = null, $page_c // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -866,7 +885,7 @@ public function getMetricsRequest($fields_metric = null, $filter = null, $page_c $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -883,6 +902,2890 @@ public function getMetricsRequest($fields_metric = null, $filter = null, $page_c ); } + /** + * Operation getMetricForMetricProperty + * + * Get Metric for Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getMetricForMetricProperty($id, $fields_metric = null, $apiKey = null) + { + list($response) = $this->getMetricForMetricPropertyWithHttpInfo($id, $fields_metric, $apiKey); + return $response; + } + + /** + * Alias of `getMetricForMetricProperty` + * + * @deprecated use `getMetricForMetricProperty` instead + */ + public function getMetricPropertyMetric(...$args) { + return $this->getMetricForMetricProperty(...$args); + } + + /** + * Operation getMetricForMetricPropertyWithHttpInfo + * + * Get Metric for Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getMetricForMetricPropertyWithHttpInfo($id, $fields_metric = null, $apiKey = null) + { + $request = $this->getMetricForMetricPropertyRequest($id, $fields_metric, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getMetricForMetricPropertyWithHttpInfo` + * + * @deprecated use `getMetricForMetricPropertyWithHttpInfo` instead + */ + public function getMetricPropertyMetricWithHttpInfo(...$args) { + return $this->getMetricForMetricPropertyWithHttpInfo(...$args); + } + + /** + * Operation getMetricForMetricPropertyAsync + * + * Get Metric for Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricForMetricPropertyAsync($id, $fields_metric = null, $apiKey = null) + { + return $this->getMetricForMetricPropertyAsyncWithHttpInfo($id, $fields_metric, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getMetricForMetricPropertyAsync` + * + * @deprecated use `getMetricForMetricPropertyAsync` instead + */ + public function getMetricPropertyMetricAsync(...$args) { + return $this->getMetricForMetricPropertyAsync(...$args); + } + + /** + * Operation getMetricForMetricPropertyAsyncWithHttpInfo + * + * Get Metric for Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricForMetricPropertyAsyncWithHttpInfo($id, $fields_metric = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getMetricForMetricPropertyRequest($id, $fields_metric, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getMetricForMetricPropertyAsyncWithHttpInfo` + * + * @deprecated use `getMetricForMetricPropertyAsyncWithHttpInfo` instead + */ + public function getMetricPropertyMetricAsyncWithHttpInfo(...$args) { + return $this->getMetricForMetricPropertyAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getMetricForMetricProperty' + * + * @param string $id The ID of the metric property (required) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMetricForMetricPropertyRequest($id, $fields_metric = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMetricForMetricProperty' + ); + } + + $resourcePath = '/api/metric-properties/{id}/metric'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_metric, + 'fields[metric]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getMetricForMetricPropertyRequest` + * + * @deprecated use `getMetricForMetricPropertyRequest` instead + */ + public function getMetricPropertyMetricRequest(...$args) { + return $this->getMetricForMetricPropertyRequest(...$args); + } + + /** + * Operation getMetricIdForMetricProperty + * + * Get Metric ID for Metric Property + * + * @param string $id The ID of the metric property (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getMetricIdForMetricProperty($id, $apiKey = null) + { + list($response) = $this->getMetricIdForMetricPropertyWithHttpInfo($id, $apiKey); + return $response; + } + + /** + * Alias of `getMetricIdForMetricProperty` + * + * @deprecated use `getMetricIdForMetricProperty` instead + */ + public function getMetricPropertyRelationshipsMetric(...$args) { + return $this->getMetricIdForMetricProperty(...$args); + } + + /** + * Operation getMetricIdForMetricPropertyWithHttpInfo + * + * Get Metric ID for Metric Property + * + * @param string $id The ID of the metric property (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getMetricIdForMetricPropertyWithHttpInfo($id, $apiKey = null) + { + $request = $this->getMetricIdForMetricPropertyRequest($id, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getMetricIdForMetricPropertyWithHttpInfo` + * + * @deprecated use `getMetricIdForMetricPropertyWithHttpInfo` instead + */ + public function getMetricPropertyRelationshipsMetricWithHttpInfo(...$args) { + return $this->getMetricIdForMetricPropertyWithHttpInfo(...$args); + } + + /** + * Operation getMetricIdForMetricPropertyAsync + * + * Get Metric ID for Metric Property + * + * @param string $id The ID of the metric property (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricIdForMetricPropertyAsync($id, $apiKey = null) + { + return $this->getMetricIdForMetricPropertyAsyncWithHttpInfo($id, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getMetricIdForMetricPropertyAsync` + * + * @deprecated use `getMetricIdForMetricPropertyAsync` instead + */ + public function getMetricPropertyRelationshipsMetricAsync(...$args) { + return $this->getMetricIdForMetricPropertyAsync(...$args); + } + + /** + * Operation getMetricIdForMetricPropertyAsyncWithHttpInfo + * + * Get Metric ID for Metric Property + * + * @param string $id The ID of the metric property (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricIdForMetricPropertyAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getMetricIdForMetricPropertyRequest($id, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getMetricIdForMetricPropertyAsyncWithHttpInfo` + * + * @deprecated use `getMetricIdForMetricPropertyAsyncWithHttpInfo` instead + */ + public function getMetricPropertyRelationshipsMetricAsyncWithHttpInfo(...$args) { + return $this->getMetricIdForMetricPropertyAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getMetricIdForMetricProperty' + * + * @param string $id The ID of the metric property (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMetricIdForMetricPropertyRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMetricIdForMetricProperty' + ); + } + + $resourcePath = '/api/metric-properties/{id}/relationships/metric'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getMetricIdForMetricPropertyRequest` + * + * @deprecated use `getMetricIdForMetricPropertyRequest` instead + */ + public function getMetricPropertyRelationshipsMetricRequest(...$args) { + return $this->getMetricIdForMetricPropertyRequest(...$args); + } + + /** + * Operation getMetricProperty + * + * Get Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getMetricProperty($id, $additional_fields_metric_property = null, $fields_metric_property = null, $fields_metric = null, $include = null, $apiKey = null) + { + list($response) = $this->getMetricPropertyWithHttpInfo($id, $additional_fields_metric_property, $fields_metric_property, $fields_metric, $include, $apiKey); + return $response; + } + + /** + * Operation getMetricPropertyWithHttpInfo + * + * Get Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getMetricPropertyWithHttpInfo($id, $additional_fields_metric_property = null, $fields_metric_property = null, $fields_metric = null, $include = null, $apiKey = null) + { + $request = $this->getMetricPropertyRequest($id, $additional_fields_metric_property, $fields_metric_property, $fields_metric, $include, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMetricPropertyAsync + * + * Get Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricPropertyAsync($id, $additional_fields_metric_property = null, $fields_metric_property = null, $fields_metric = null, $include = null, $apiKey = null) + { + return $this->getMetricPropertyAsyncWithHttpInfo($id, $additional_fields_metric_property, $fields_metric_property, $fields_metric, $include, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMetricPropertyAsyncWithHttpInfo + * + * Get Metric Property + * + * @param string $id The ID of the metric property (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricPropertyAsyncWithHttpInfo($id, $additional_fields_metric_property = null, $fields_metric_property = null, $fields_metric = null, $include = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getMetricPropertyRequest($id, $additional_fields_metric_property, $fields_metric_property, $fields_metric, $include, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMetricProperty' + * + * @param string $id The ID of the metric property (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMetricPropertyRequest($id, $additional_fields_metric_property = null, $fields_metric_property = null, $fields_metric = null, $include = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMetricProperty' + ); + } + + $resourcePath = '/api/metric-properties/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $additional_fields_metric_property, + 'additional-fields[metric-property]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_metric_property, + 'fields[metric-property]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_metric, + 'fields[metric]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMetricRelationshipsFlowTriggers + * + * Get Metric Relationships Flow Triggers + * + * @param string $id (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getMetricRelationshipsFlowTriggers($id, $apiKey = null) + { + list($response) = $this->getMetricRelationshipsFlowTriggersWithHttpInfo($id, $apiKey); + return $response; + } + + /** + * Operation getMetricRelationshipsFlowTriggersWithHttpInfo + * + * Get Metric Relationships Flow Triggers + * + * @param string $id (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getMetricRelationshipsFlowTriggersWithHttpInfo($id, $apiKey = null) + { + $request = $this->getMetricRelationshipsFlowTriggersRequest($id, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMetricRelationshipsFlowTriggersAsync + * + * Get Metric Relationships Flow Triggers + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricRelationshipsFlowTriggersAsync($id, $apiKey = null) + { + return $this->getMetricRelationshipsFlowTriggersAsyncWithHttpInfo($id, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMetricRelationshipsFlowTriggersAsyncWithHttpInfo + * + * Get Metric Relationships Flow Triggers + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricRelationshipsFlowTriggersAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getMetricRelationshipsFlowTriggersRequest($id, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMetricRelationshipsFlowTriggers' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMetricRelationshipsFlowTriggersRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMetricRelationshipsFlowTriggers' + ); + } + + $resourcePath = '/api/metrics/{id}/relationships/flow-triggers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMetrics + * + * Get Metrics + * + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getMetrics($fields_flow = null, $fields_metric = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + { + list($response) = $this->getMetricsWithHttpInfo($fields_flow, $fields_metric, $filter, $include, $page_cursor, $apiKey); + return $response; + } + + /** + * Operation getMetricsWithHttpInfo + * + * Get Metrics + * + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getMetricsWithHttpInfo($fields_flow = null, $fields_metric = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + { + $request = $this->getMetricsRequest($fields_flow, $fields_metric, $filter, $include, $page_cursor, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMetricsAsync + * + * Get Metrics + * + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricsAsync($fields_flow = null, $fields_metric = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + { + return $this->getMetricsAsyncWithHttpInfo($fields_flow, $fields_metric, $filter, $include, $page_cursor, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMetricsAsyncWithHttpInfo + * + * Get Metrics + * + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetricsAsyncWithHttpInfo($fields_flow = null, $fields_metric = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getMetricsRequest($fields_flow, $fields_metric, $filter, $include, $page_cursor, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMetrics' + * + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMetricsRequest($fields_flow = null, $fields_metric = null, $filter = null, $include = null, $page_cursor = null, $apiKey = null) + { + + $resourcePath = '/api/metrics'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_metric, + 'fields[metric]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPropertiesForMetric + * + * Get Properties for Metric + * + * @param string $id The ID of the metric (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getPropertiesForMetric($id, $additional_fields_metric_property = null, $fields_metric_property = null, $apiKey = null) + { + list($response) = $this->getPropertiesForMetricWithHttpInfo($id, $additional_fields_metric_property, $fields_metric_property, $apiKey); + return $response; + } + + /** + * Alias of `getPropertiesForMetric` + * + * @deprecated use `getPropertiesForMetric` instead + */ + public function getMetricMetricProperties(...$args) { + return $this->getPropertiesForMetric(...$args); + } + + /** + * Operation getPropertiesForMetricWithHttpInfo + * + * Get Properties for Metric + * + * @param string $id The ID of the metric (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getPropertiesForMetricWithHttpInfo($id, $additional_fields_metric_property = null, $fields_metric_property = null, $apiKey = null) + { + $request = $this->getPropertiesForMetricRequest($id, $additional_fields_metric_property, $fields_metric_property, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getPropertiesForMetricWithHttpInfo` + * + * @deprecated use `getPropertiesForMetricWithHttpInfo` instead + */ + public function getMetricMetricPropertiesWithHttpInfo(...$args) { + return $this->getPropertiesForMetricWithHttpInfo(...$args); + } + + /** + * Operation getPropertiesForMetricAsync + * + * Get Properties for Metric + * + * @param string $id The ID of the metric (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPropertiesForMetricAsync($id, $additional_fields_metric_property = null, $fields_metric_property = null, $apiKey = null) + { + return $this->getPropertiesForMetricAsyncWithHttpInfo($id, $additional_fields_metric_property, $fields_metric_property, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getPropertiesForMetricAsync` + * + * @deprecated use `getPropertiesForMetricAsync` instead + */ + public function getMetricMetricPropertiesAsync(...$args) { + return $this->getPropertiesForMetricAsync(...$args); + } + + /** + * Operation getPropertiesForMetricAsyncWithHttpInfo + * + * Get Properties for Metric + * + * @param string $id The ID of the metric (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPropertiesForMetricAsyncWithHttpInfo($id, $additional_fields_metric_property = null, $fields_metric_property = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getPropertiesForMetricRequest($id, $additional_fields_metric_property, $fields_metric_property, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getPropertiesForMetricAsyncWithHttpInfo` + * + * @deprecated use `getPropertiesForMetricAsyncWithHttpInfo` instead + */ + public function getMetricMetricPropertiesAsyncWithHttpInfo(...$args) { + return $this->getPropertiesForMetricAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getPropertiesForMetric' + * + * @param string $id The ID of the metric (required) + * @param string[] $additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' (optional) + * @param string[] $fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPropertiesForMetricRequest($id, $additional_fields_metric_property = null, $fields_metric_property = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPropertiesForMetric' + ); + } + + $resourcePath = '/api/metrics/{id}/metric-properties'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $additional_fields_metric_property, + 'additional-fields[metric-property]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_metric_property, + 'fields[metric-property]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getPropertiesForMetricRequest` + * + * @deprecated use `getPropertiesForMetricRequest` instead + */ + public function getMetricMetricPropertiesRequest(...$args) { + return $this->getPropertiesForMetricRequest(...$args); + } + + /** + * Operation getPropertyIdsForMetric + * + * Get Property IDs for Metric + * + * @param string $id The ID of the metric (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getPropertyIdsForMetric($id, $apiKey = null) + { + list($response) = $this->getPropertyIdsForMetricWithHttpInfo($id, $apiKey); + return $response; + } + + /** + * Alias of `getPropertyIdsForMetric` + * + * @deprecated use `getPropertyIdsForMetric` instead + */ + public function getMetricRelationshipsMetricProperties(...$args) { + return $this->getPropertyIdsForMetric(...$args); + } + + /** + * Operation getPropertyIdsForMetricWithHttpInfo + * + * Get Property IDs for Metric + * + * @param string $id The ID of the metric (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getPropertyIdsForMetricWithHttpInfo($id, $apiKey = null) + { + $request = $this->getPropertyIdsForMetricRequest($id, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getPropertyIdsForMetricWithHttpInfo` + * + * @deprecated use `getPropertyIdsForMetricWithHttpInfo` instead + */ + public function getMetricRelationshipsMetricPropertiesWithHttpInfo(...$args) { + return $this->getPropertyIdsForMetricWithHttpInfo(...$args); + } + + /** + * Operation getPropertyIdsForMetricAsync + * + * Get Property IDs for Metric + * + * @param string $id The ID of the metric (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPropertyIdsForMetricAsync($id, $apiKey = null) + { + return $this->getPropertyIdsForMetricAsyncWithHttpInfo($id, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getPropertyIdsForMetricAsync` + * + * @deprecated use `getPropertyIdsForMetricAsync` instead + */ + public function getMetricRelationshipsMetricPropertiesAsync(...$args) { + return $this->getPropertyIdsForMetricAsync(...$args); + } + + /** + * Operation getPropertyIdsForMetricAsyncWithHttpInfo + * + * Get Property IDs for Metric + * + * @param string $id The ID of the metric (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPropertyIdsForMetricAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getPropertyIdsForMetricRequest($id, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getPropertyIdsForMetricAsyncWithHttpInfo` + * + * @deprecated use `getPropertyIdsForMetricAsyncWithHttpInfo` instead + */ + public function getMetricRelationshipsMetricPropertiesAsyncWithHttpInfo(...$args) { + return $this->getPropertyIdsForMetricAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getPropertyIdsForMetric' + * + * @param string $id The ID of the metric (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPropertyIdsForMetricRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPropertyIdsForMetric' + ); + } + + $resourcePath = '/api/metrics/{id}/relationships/metric-properties'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getPropertyIdsForMetricRequest` + * + * @deprecated use `getPropertyIdsForMetricRequest` instead + */ + public function getMetricRelationshipsMetricPropertiesRequest(...$args) { + return $this->getPropertyIdsForMetricRequest(...$args); + } + /** * Operation queryMetricAggregates * @@ -1197,7 +4100,7 @@ public function queryMetricAggregatesRequest($metric_aggregate_query, $apiKey = ); } - $resourcePath = '/api/metric-aggregates/'; + $resourcePath = '/api/metric-aggregates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1210,18 +4113,18 @@ public function queryMetricAggregatesRequest($metric_aggregate_query, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($metric_aggregate_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($metric_aggregate_query)); } else { $httpBody = $metric_aggregate_query; @@ -1241,7 +4144,7 @@ public function queryMetricAggregatesRequest($metric_aggregate_query, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1265,7 +4168,7 @@ public function queryMetricAggregatesRequest($metric_aggregate_query, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/ProfilesApi.php b/lib/API/ProfilesApi.php index ec2203d..fa2fd81 100644 --- a/lib/API/ProfilesApi.php +++ b/lib/API/ProfilesApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -116,6 +116,1594 @@ public function getConfig() return $this->config; } + /** + * Operation bulkSubscribeProfiles + * + * Bulk Subscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function bulkSubscribeProfiles($subscription_create_job_create_query, $apiKey = null) + { + $this->bulkSubscribeProfilesWithHttpInfo($subscription_create_job_create_query, $apiKey); + } + + /** + * Alias of `bulkSubscribeProfiles` + * + * @deprecated use `bulkSubscribeProfiles` instead + */ + public function subscribeProfiles(...$args) { + return $this->bulkSubscribeProfiles(...$args); + } + + /** + * Alias of `bulkSubscribeProfiles` + * + * @deprecated use `bulkSubscribeProfiles` instead + */ + public function createProfileSubscriptionBulkCreateJob(...$args) { + return $this->bulkSubscribeProfiles(...$args); + } + + /** + * Operation bulkSubscribeProfilesWithHttpInfo + * + * Bulk Subscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function bulkSubscribeProfilesWithHttpInfo($subscription_create_job_create_query, $apiKey = null) + { + $request = $this->bulkSubscribeProfilesRequest($subscription_create_job_create_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `bulkSubscribeProfilesWithHttpInfo` + * + * @deprecated use `bulkSubscribeProfilesWithHttpInfo` instead + */ + public function subscribeProfilesWithHttpInfo(...$args) { + return $this->bulkSubscribeProfilesWithHttpInfo(...$args); + } + + /** + * Alias of `bulkSubscribeProfilesWithHttpInfo` + * + * @deprecated use `bulkSubscribeProfilesWithHttpInfo` instead + */ + public function createProfileSubscriptionBulkCreateJobWithHttpInfo(...$args) { + return $this->bulkSubscribeProfilesWithHttpInfo(...$args); + } + + /** + * Operation bulkSubscribeProfilesAsync + * + * Bulk Subscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkSubscribeProfilesAsync($subscription_create_job_create_query, $apiKey = null) + { + return $this->bulkSubscribeProfilesAsyncWithHttpInfo($subscription_create_job_create_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `bulkSubscribeProfilesAsync` + * + * @deprecated use `bulkSubscribeProfilesAsync` instead + */ + public function subscribeProfilesAsync(...$args) { + return $this->bulkSubscribeProfilesAsync(...$args); + } + + /** + * Alias of `bulkSubscribeProfilesAsync` + * + * @deprecated use `bulkSubscribeProfilesAsync` instead + */ + public function createProfileSubscriptionBulkCreateJobAsync(...$args) { + return $this->bulkSubscribeProfilesAsync(...$args); + } + + /** + * Operation bulkSubscribeProfilesAsyncWithHttpInfo + * + * Bulk Subscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkSubscribeProfilesAsyncWithHttpInfo($subscription_create_job_create_query, $apiKey = null) + { + $returnType = ''; + $request = $this->bulkSubscribeProfilesRequest($subscription_create_job_create_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `bulkSubscribeProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkSubscribeProfilesAsyncWithHttpInfo` instead + */ + public function subscribeProfilesAsyncWithHttpInfo(...$args) { + return $this->bulkSubscribeProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkSubscribeProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkSubscribeProfilesAsyncWithHttpInfo` instead + */ + public function createProfileSubscriptionBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->bulkSubscribeProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkSubscribeProfiles' + * + * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function bulkSubscribeProfilesRequest($subscription_create_job_create_query, $apiKey = null) + { + // verify the required parameter 'subscription_create_job_create_query' is set + if ($subscription_create_job_create_query === null || (is_array($subscription_create_job_create_query) && count($subscription_create_job_create_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscription_create_job_create_query when calling bulkSubscribeProfiles' + ); + } + + $resourcePath = '/api/profile-subscription-bulk-create-jobs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($subscription_create_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($subscription_create_job_create_query)); + } else { + $httpBody = $subscription_create_job_create_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `bulkSubscribeProfilesRequest` + * + * @deprecated use `bulkSubscribeProfilesRequest` instead + */ + public function subscribeProfilesRequest(...$args) { + return $this->bulkSubscribeProfilesRequest(...$args); + } + + /** + * Alias of `bulkSubscribeProfilesRequest` + * + * @deprecated use `bulkSubscribeProfilesRequest` instead + */ + public function createProfileSubscriptionBulkCreateJobRequest(...$args) { + return $this->bulkSubscribeProfilesRequest(...$args); + } + + /** + * Operation bulkSuppressProfiles + * + * Bulk Suppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function bulkSuppressProfiles($suppression_create_job_create_query, $apiKey = null) + { + list($response) = $this->bulkSuppressProfilesWithHttpInfo($suppression_create_job_create_query, $apiKey); + return $response; + } + + /** + * Alias of `bulkSuppressProfiles` + * + * @deprecated use `bulkSuppressProfiles` instead + */ + public function suppressProfiles(...$args) { + return $this->bulkSuppressProfiles(...$args); + } + + /** + * Alias of `bulkSuppressProfiles` + * + * @deprecated use `bulkSuppressProfiles` instead + */ + public function createProfileSuppressionBulkCreateJob(...$args) { + return $this->bulkSuppressProfiles(...$args); + } + + /** + * Operation bulkSuppressProfilesWithHttpInfo + * + * Bulk Suppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function bulkSuppressProfilesWithHttpInfo($suppression_create_job_create_query, $apiKey = null) + { + $request = $this->bulkSuppressProfilesRequest($suppression_create_job_create_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `bulkSuppressProfilesWithHttpInfo` + * + * @deprecated use `bulkSuppressProfilesWithHttpInfo` instead + */ + public function suppressProfilesWithHttpInfo(...$args) { + return $this->bulkSuppressProfilesWithHttpInfo(...$args); + } + + /** + * Alias of `bulkSuppressProfilesWithHttpInfo` + * + * @deprecated use `bulkSuppressProfilesWithHttpInfo` instead + */ + public function createProfileSuppressionBulkCreateJobWithHttpInfo(...$args) { + return $this->bulkSuppressProfilesWithHttpInfo(...$args); + } + + /** + * Operation bulkSuppressProfilesAsync + * + * Bulk Suppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkSuppressProfilesAsync($suppression_create_job_create_query, $apiKey = null) + { + return $this->bulkSuppressProfilesAsyncWithHttpInfo($suppression_create_job_create_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `bulkSuppressProfilesAsync` + * + * @deprecated use `bulkSuppressProfilesAsync` instead + */ + public function suppressProfilesAsync(...$args) { + return $this->bulkSuppressProfilesAsync(...$args); + } + + /** + * Alias of `bulkSuppressProfilesAsync` + * + * @deprecated use `bulkSuppressProfilesAsync` instead + */ + public function createProfileSuppressionBulkCreateJobAsync(...$args) { + return $this->bulkSuppressProfilesAsync(...$args); + } + + /** + * Operation bulkSuppressProfilesAsyncWithHttpInfo + * + * Bulk Suppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkSuppressProfilesAsyncWithHttpInfo($suppression_create_job_create_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->bulkSuppressProfilesRequest($suppression_create_job_create_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `bulkSuppressProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkSuppressProfilesAsyncWithHttpInfo` instead + */ + public function suppressProfilesAsyncWithHttpInfo(...$args) { + return $this->bulkSuppressProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkSuppressProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkSuppressProfilesAsyncWithHttpInfo` instead + */ + public function createProfileSuppressionBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->bulkSuppressProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkSuppressProfiles' + * + * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function bulkSuppressProfilesRequest($suppression_create_job_create_query, $apiKey = null) + { + // verify the required parameter 'suppression_create_job_create_query' is set + if ($suppression_create_job_create_query === null || (is_array($suppression_create_job_create_query) && count($suppression_create_job_create_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $suppression_create_job_create_query when calling bulkSuppressProfiles' + ); + } + + $resourcePath = '/api/profile-suppression-bulk-create-jobs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($suppression_create_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($suppression_create_job_create_query)); + } else { + $httpBody = $suppression_create_job_create_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `bulkSuppressProfilesRequest` + * + * @deprecated use `bulkSuppressProfilesRequest` instead + */ + public function suppressProfilesRequest(...$args) { + return $this->bulkSuppressProfilesRequest(...$args); + } + + /** + * Alias of `bulkSuppressProfilesRequest` + * + * @deprecated use `bulkSuppressProfilesRequest` instead + */ + public function createProfileSuppressionBulkCreateJobRequest(...$args) { + return $this->bulkSuppressProfilesRequest(...$args); + } + + /** + * Operation bulkUnsubscribeProfiles + * + * Bulk Unsubscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function bulkUnsubscribeProfiles($subscription_delete_job_create_query, $apiKey = null) + { + $this->bulkUnsubscribeProfilesWithHttpInfo($subscription_delete_job_create_query, $apiKey); + } + + /** + * Alias of `bulkUnsubscribeProfiles` + * + * @deprecated use `bulkUnsubscribeProfiles` instead + */ + public function unsubscribeProfiles(...$args) { + return $this->bulkUnsubscribeProfiles(...$args); + } + + /** + * Alias of `bulkUnsubscribeProfiles` + * + * @deprecated use `bulkUnsubscribeProfiles` instead + */ + public function createProfileSubscriptionBulkDeleteJob(...$args) { + return $this->bulkUnsubscribeProfiles(...$args); + } + + /** + * Operation bulkUnsubscribeProfilesWithHttpInfo + * + * Bulk Unsubscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function bulkUnsubscribeProfilesWithHttpInfo($subscription_delete_job_create_query, $apiKey = null) + { + $request = $this->bulkUnsubscribeProfilesRequest($subscription_delete_job_create_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `bulkUnsubscribeProfilesWithHttpInfo` + * + * @deprecated use `bulkUnsubscribeProfilesWithHttpInfo` instead + */ + public function unsubscribeProfilesWithHttpInfo(...$args) { + return $this->bulkUnsubscribeProfilesWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUnsubscribeProfilesWithHttpInfo` + * + * @deprecated use `bulkUnsubscribeProfilesWithHttpInfo` instead + */ + public function createProfileSubscriptionBulkDeleteJobWithHttpInfo(...$args) { + return $this->bulkUnsubscribeProfilesWithHttpInfo(...$args); + } + + /** + * Operation bulkUnsubscribeProfilesAsync + * + * Bulk Unsubscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkUnsubscribeProfilesAsync($subscription_delete_job_create_query, $apiKey = null) + { + return $this->bulkUnsubscribeProfilesAsyncWithHttpInfo($subscription_delete_job_create_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `bulkUnsubscribeProfilesAsync` + * + * @deprecated use `bulkUnsubscribeProfilesAsync` instead + */ + public function unsubscribeProfilesAsync(...$args) { + return $this->bulkUnsubscribeProfilesAsync(...$args); + } + + /** + * Alias of `bulkUnsubscribeProfilesAsync` + * + * @deprecated use `bulkUnsubscribeProfilesAsync` instead + */ + public function createProfileSubscriptionBulkDeleteJobAsync(...$args) { + return $this->bulkUnsubscribeProfilesAsync(...$args); + } + + /** + * Operation bulkUnsubscribeProfilesAsyncWithHttpInfo + * + * Bulk Unsubscribe Profiles + * + * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkUnsubscribeProfilesAsyncWithHttpInfo($subscription_delete_job_create_query, $apiKey = null) + { + $returnType = ''; + $request = $this->bulkUnsubscribeProfilesRequest($subscription_delete_job_create_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `bulkUnsubscribeProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkUnsubscribeProfilesAsyncWithHttpInfo` instead + */ + public function unsubscribeProfilesAsyncWithHttpInfo(...$args) { + return $this->bulkUnsubscribeProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUnsubscribeProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkUnsubscribeProfilesAsyncWithHttpInfo` instead + */ + public function createProfileSubscriptionBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->bulkUnsubscribeProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkUnsubscribeProfiles' + * + * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function bulkUnsubscribeProfilesRequest($subscription_delete_job_create_query, $apiKey = null) + { + // verify the required parameter 'subscription_delete_job_create_query' is set + if ($subscription_delete_job_create_query === null || (is_array($subscription_delete_job_create_query) && count($subscription_delete_job_create_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscription_delete_job_create_query when calling bulkUnsubscribeProfiles' + ); + } + + $resourcePath = '/api/profile-subscription-bulk-delete-jobs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($subscription_delete_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($subscription_delete_job_create_query)); + } else { + $httpBody = $subscription_delete_job_create_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `bulkUnsubscribeProfilesRequest` + * + * @deprecated use `bulkUnsubscribeProfilesRequest` instead + */ + public function unsubscribeProfilesRequest(...$args) { + return $this->bulkUnsubscribeProfilesRequest(...$args); + } + + /** + * Alias of `bulkUnsubscribeProfilesRequest` + * + * @deprecated use `bulkUnsubscribeProfilesRequest` instead + */ + public function createProfileSubscriptionBulkDeleteJobRequest(...$args) { + return $this->bulkUnsubscribeProfilesRequest(...$args); + } + + /** + * Operation bulkUnsuppressProfiles + * + * Bulk Unsuppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function bulkUnsuppressProfiles($suppression_delete_job_create_query, $apiKey = null) + { + list($response) = $this->bulkUnsuppressProfilesWithHttpInfo($suppression_delete_job_create_query, $apiKey); + return $response; + } + + /** + * Alias of `bulkUnsuppressProfiles` + * + * @deprecated use `bulkUnsuppressProfiles` instead + */ + public function unsuppressProfiles(...$args) { + return $this->bulkUnsuppressProfiles(...$args); + } + + /** + * Alias of `bulkUnsuppressProfiles` + * + * @deprecated use `bulkUnsuppressProfiles` instead + */ + public function createProfileSuppressionBulkDeleteJob(...$args) { + return $this->bulkUnsuppressProfiles(...$args); + } + + /** + * Operation bulkUnsuppressProfilesWithHttpInfo + * + * Bulk Unsuppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function bulkUnsuppressProfilesWithHttpInfo($suppression_delete_job_create_query, $apiKey = null) + { + $request = $this->bulkUnsuppressProfilesRequest($suppression_delete_job_create_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `bulkUnsuppressProfilesWithHttpInfo` + * + * @deprecated use `bulkUnsuppressProfilesWithHttpInfo` instead + */ + public function unsuppressProfilesWithHttpInfo(...$args) { + return $this->bulkUnsuppressProfilesWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUnsuppressProfilesWithHttpInfo` + * + * @deprecated use `bulkUnsuppressProfilesWithHttpInfo` instead + */ + public function createProfileSuppressionBulkDeleteJobWithHttpInfo(...$args) { + return $this->bulkUnsuppressProfilesWithHttpInfo(...$args); + } + + /** + * Operation bulkUnsuppressProfilesAsync + * + * Bulk Unsuppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkUnsuppressProfilesAsync($suppression_delete_job_create_query, $apiKey = null) + { + return $this->bulkUnsuppressProfilesAsyncWithHttpInfo($suppression_delete_job_create_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `bulkUnsuppressProfilesAsync` + * + * @deprecated use `bulkUnsuppressProfilesAsync` instead + */ + public function unsuppressProfilesAsync(...$args) { + return $this->bulkUnsuppressProfilesAsync(...$args); + } + + /** + * Alias of `bulkUnsuppressProfilesAsync` + * + * @deprecated use `bulkUnsuppressProfilesAsync` instead + */ + public function createProfileSuppressionBulkDeleteJobAsync(...$args) { + return $this->bulkUnsuppressProfilesAsync(...$args); + } + + /** + * Operation bulkUnsuppressProfilesAsyncWithHttpInfo + * + * Bulk Unsuppress Profiles + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkUnsuppressProfilesAsyncWithHttpInfo($suppression_delete_job_create_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->bulkUnsuppressProfilesRequest($suppression_delete_job_create_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `bulkUnsuppressProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkUnsuppressProfilesAsyncWithHttpInfo` instead + */ + public function unsuppressProfilesAsyncWithHttpInfo(...$args) { + return $this->bulkUnsuppressProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `bulkUnsuppressProfilesAsyncWithHttpInfo` + * + * @deprecated use `bulkUnsuppressProfilesAsyncWithHttpInfo` instead + */ + public function createProfileSuppressionBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->bulkUnsuppressProfilesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'bulkUnsuppressProfiles' + * + * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function bulkUnsuppressProfilesRequest($suppression_delete_job_create_query, $apiKey = null) + { + // verify the required parameter 'suppression_delete_job_create_query' is set + if ($suppression_delete_job_create_query === null || (is_array($suppression_delete_job_create_query) && count($suppression_delete_job_create_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $suppression_delete_job_create_query when calling bulkUnsuppressProfiles' + ); + } + + $resourcePath = '/api/profile-suppression-bulk-delete-jobs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($suppression_delete_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($suppression_delete_job_create_query)); + } else { + $httpBody = $suppression_delete_job_create_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `bulkUnsuppressProfilesRequest` + * + * @deprecated use `bulkUnsuppressProfilesRequest` instead + */ + public function unsuppressProfilesRequest(...$args) { + return $this->bulkUnsuppressProfilesRequest(...$args); + } + + /** + * Alias of `bulkUnsuppressProfilesRequest` + * + * @deprecated use `bulkUnsuppressProfilesRequest` instead + */ + public function createProfileSuppressionBulkDeleteJobRequest(...$args) { + return $this->bulkUnsuppressProfilesRequest(...$args); + } + /** * Operation createOrUpdateProfile * @@ -459,7 +2047,7 @@ public function createOrUpdateProfileRequest($profile_upsert_query, $apiKey = nu ); } - $resourcePath = '/api/profile-import/'; + $resourcePath = '/api/profile-import'; $formParams = []; $queryParams = []; $headerParams = []; @@ -472,18 +2060,18 @@ public function createOrUpdateProfileRequest($profile_upsert_query, $apiKey = nu if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($profile_upsert_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($profile_upsert_query)); } else { $httpBody = $profile_upsert_query; @@ -503,7 +2091,7 @@ public function createOrUpdateProfileRequest($profile_upsert_query, $apiKey = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -527,7 +2115,7 @@ public function createOrUpdateProfileRequest($profile_upsert_query, $apiKey = nu $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -831,7 +2419,7 @@ public function createProfileRequest($profile_create_query, $apiKey = null) ); } - $resourcePath = '/api/profiles/'; + $resourcePath = '/api/profiles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -844,18 +2432,18 @@ public function createProfileRequest($profile_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($profile_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($profile_create_query)); } else { $httpBody = $profile_create_query; @@ -875,7 +2463,7 @@ public function createProfileRequest($profile_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -899,7 +2487,7 @@ public function createProfileRequest($profile_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1082,7 +2670,7 @@ public function createPushTokenRequest($push_token_create_query, $apiKey = null) ); } - $resourcePath = '/api/push-tokens/'; + $resourcePath = '/api/push-tokens'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1095,18 +2683,18 @@ public function createPushTokenRequest($push_token_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($push_token_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($push_token_create_query)); } else { $httpBody = $push_token_create_query; @@ -1126,7 +2714,7 @@ public function createPushTokenRequest($push_token_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1150,7 +2738,7 @@ public function createPushTokenRequest($push_token_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1168,51 +2756,60 @@ public function createPushTokenRequest($push_token_create_query, $apiKey = null) } /** - * Operation getBulkProfileImportJob + * Operation getBulkImportProfilesJob * - * Get Bulk Profile Import Job + * Get Bulk Import Profiles Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getBulkProfileImportJob($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) + public function getBulkImportProfilesJob($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) { - list($response) = $this->getBulkProfileImportJobWithHttpInfo($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey); + list($response) = $this->getBulkImportProfilesJobWithHttpInfo($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey); return $response; } /** - * Alias of `getBulkProfileImportJob` + * Alias of `getBulkImportProfilesJob` + * + * @deprecated use `getBulkImportProfilesJob` instead + */ + public function getBulkProfileImportJob(...$args) { + return $this->getBulkImportProfilesJob(...$args); + } + + /** + * Alias of `getBulkImportProfilesJob` * - * @deprecated use `getBulkProfileImportJob` instead + * @deprecated use `getBulkImportProfilesJob` instead */ public function getProfileBulkImportJob(...$args) { - return $this->getBulkProfileImportJob(...$args); + return $this->getBulkImportProfilesJob(...$args); } /** - * Operation getBulkProfileImportJobWithHttpInfo + * Operation getBulkImportProfilesJobWithHttpInfo * - * Get Bulk Profile Import Job + * Get Bulk Import Profiles Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getBulkProfileImportJobWithHttpInfo($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) + public function getBulkImportProfilesJobWithHttpInfo($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) { - $request = $this->getBulkProfileImportJobRequest($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey); + $request = $this->getBulkImportProfilesJobRequest($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1368,30 +2965,39 @@ public function getBulkProfileImportJobWithHttpInfo($job_id, $fields_list = null } /** - * Alias of `getBulkProfileImportJobWithHttpInfo` + * Alias of `getBulkImportProfilesJobWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobWithHttpInfo` instead + * @deprecated use `getBulkImportProfilesJobWithHttpInfo` instead + */ + public function getBulkProfileImportJobWithHttpInfo(...$args) { + return $this->getBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobWithHttpInfo` + * + * @deprecated use `getBulkImportProfilesJobWithHttpInfo` instead */ public function getProfileBulkImportJobWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobWithHttpInfo(...$args); + return $this->getBulkImportProfilesJobWithHttpInfo(...$args); } /** - * Operation getBulkProfileImportJobAsync + * Operation getBulkImportProfilesJobAsync * - * Get Bulk Profile Import Job + * Get Bulk Import Profiles Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobAsync($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) + public function getBulkImportProfilesJobAsync($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) { - return $this->getBulkProfileImportJobAsyncWithHttpInfo($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey) + return $this->getBulkImportProfilesJobAsyncWithHttpInfo($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -1400,31 +3006,40 @@ function ($response) { } /** - * Alias of `getBulkProfileImportJobAsync` + * Alias of `getBulkImportProfilesJobAsync` + * + * @deprecated use `getBulkImportProfilesJobAsync` instead + */ + public function getBulkProfileImportJobAsync(...$args) { + return $this->getBulkImportProfilesJobAsync(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobAsync` * - * @deprecated use `getBulkProfileImportJobAsync` instead + * @deprecated use `getBulkImportProfilesJobAsync` instead */ public function getProfileBulkImportJobAsync(...$args) { - return $this->getBulkProfileImportJobAsync(...$args); + return $this->getBulkImportProfilesJobAsync(...$args); } /** - * Operation getBulkProfileImportJobAsyncWithHttpInfo + * Operation getBulkImportProfilesJobAsyncWithHttpInfo * - * Get Bulk Profile Import Job + * Get Bulk Import Profiles Job * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobAsyncWithHttpInfo($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) + public function getBulkImportProfilesJobAsyncWithHttpInfo($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getBulkProfileImportJobRequest($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey); + $request = $this->getBulkImportProfilesJobRequest($job_id, $fields_list, $fields_profile_bulk_import_job, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1468,35 +3083,44 @@ function ($exception) { } /** - * Alias of `getBulkProfileImportJobAsyncWithHttpInfo` + * Alias of `getBulkImportProfilesJobAsyncWithHttpInfo` + * + * @deprecated use `getBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getBulkProfileImportJobAsyncWithHttpInfo(...$args) { + return $this->getBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobAsyncWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobAsyncWithHttpInfo` instead + * @deprecated use `getBulkImportProfilesJobAsyncWithHttpInfo` instead */ public function getProfileBulkImportJobAsyncWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobAsyncWithHttpInfo(...$args); + return $this->getBulkImportProfilesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getBulkProfileImportJob' + * Create request for operation 'getBulkImportProfilesJob' * * @param string $job_id ID of the job to retrieve. (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBulkProfileImportJobRequest($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) + public function getBulkImportProfilesJobRequest($job_id, $fields_list = null, $fields_profile_bulk_import_job = null, $include = null, $apiKey = null) { // verify the required parameter 'job_id' is set if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $job_id when calling getBulkProfileImportJob' + 'Missing the required parameter $job_id when calling getBulkImportProfilesJob' ); } - $resourcePath = '/api/profile-bulk-import-jobs/{job_id}/'; + $resourcePath = '/api/profile-bulk-import-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1544,11 +3168,11 @@ public function getBulkProfileImportJobRequest($job_id, $fields_list = null, $fi if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1569,7 +3193,7 @@ public function getBulkProfileImportJobRequest($job_id, $fields_list = null, $fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1593,7 +3217,7 @@ public function getBulkProfileImportJobRequest($job_id, $fields_list = null, $fi $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1611,60 +3235,80 @@ public function getBulkProfileImportJobRequest($job_id, $fields_list = null, $fi } /** - * Alias of `getBulkProfileImportJobRequest` + * Alias of `getBulkImportProfilesJobRequest` + * + * @deprecated use `getBulkImportProfilesJobRequest` instead + */ + public function getBulkProfileImportJobRequest(...$args) { + return $this->getBulkImportProfilesJobRequest(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobRequest` * - * @deprecated use `getBulkProfileImportJobRequest` instead + * @deprecated use `getBulkImportProfilesJobRequest` instead */ public function getProfileBulkImportJobRequest(...$args) { - return $this->getBulkProfileImportJobRequest(...$args); + return $this->getBulkImportProfilesJobRequest(...$args); } /** - * Operation getBulkProfileImportJobImportErrors + * Operation getBulkImportProfilesJobs * - * Get Bulk Profile Import Job Errors + * Get Bulk Import Profiles Jobs * - * @param string $id (required) - * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getBulkProfileImportJobImportErrors($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkImportProfilesJobs($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - list($response) = $this->getBulkProfileImportJobImportErrorsWithHttpInfo($id, $fields_import_error, $page_cursor, $page_size, $apiKey); + list($response) = $this->getBulkImportProfilesJobsWithHttpInfo($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Alias of `getBulkProfileImportJobImportErrors` + * Alias of `getBulkImportProfilesJobs` * - * @deprecated use `getBulkProfileImportJobImportErrors` instead + * @deprecated use `getBulkImportProfilesJobs` instead */ - public function getProfileBulkImportJobImportErrors(...$args) { - return $this->getBulkProfileImportJobImportErrors(...$args); + public function getBulkProfileImportJobs(...$args) { + return $this->getBulkImportProfilesJobs(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobs` + * + * @deprecated use `getBulkImportProfilesJobs` instead + */ + public function getProfileBulkImportJobs(...$args) { + return $this->getBulkImportProfilesJobs(...$args); } /** - * Operation getBulkProfileImportJobImportErrorsWithHttpInfo + * Operation getBulkImportProfilesJobsWithHttpInfo * - * Get Bulk Profile Import Job Errors + * Get Bulk Import Profiles Jobs * - * @param string $id (required) - * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getBulkProfileImportJobImportErrorsWithHttpInfo($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkImportProfilesJobsWithHttpInfo($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - $request = $this->getBulkProfileImportJobImportErrorsRequest($id, $fields_import_error, $page_cursor, $page_size, $apiKey); + $request = $this->getBulkImportProfilesJobsRequest($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1820,30 +3464,40 @@ public function getBulkProfileImportJobImportErrorsWithHttpInfo($id, $fields_imp } /** - * Alias of `getBulkProfileImportJobImportErrorsWithHttpInfo` + * Alias of `getBulkImportProfilesJobsWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobImportErrorsWithHttpInfo` instead + * @deprecated use `getBulkImportProfilesJobsWithHttpInfo` instead */ - public function getProfileBulkImportJobImportErrorsWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobImportErrorsWithHttpInfo(...$args); + public function getBulkProfileImportJobsWithHttpInfo(...$args) { + return $this->getBulkImportProfilesJobsWithHttpInfo(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobsWithHttpInfo` + * + * @deprecated use `getBulkImportProfilesJobsWithHttpInfo` instead + */ + public function getProfileBulkImportJobsWithHttpInfo(...$args) { + return $this->getBulkImportProfilesJobsWithHttpInfo(...$args); } /** - * Operation getBulkProfileImportJobImportErrorsAsync + * Operation getBulkImportProfilesJobsAsync * - * Get Bulk Profile Import Job Errors + * Get Bulk Import Profiles Jobs * - * @param string $id (required) - * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobImportErrorsAsync($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkImportProfilesJobsAsync($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - return $this->getBulkProfileImportJobImportErrorsAsyncWithHttpInfo($id, $fields_import_error, $page_cursor, $page_size, $apiKey) + return $this->getBulkImportProfilesJobsAsyncWithHttpInfo($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -1852,31 +3506,41 @@ function ($response) { } /** - * Alias of `getBulkProfileImportJobImportErrorsAsync` + * Alias of `getBulkImportProfilesJobsAsync` * - * @deprecated use `getBulkProfileImportJobImportErrorsAsync` instead + * @deprecated use `getBulkImportProfilesJobsAsync` instead */ - public function getProfileBulkImportJobImportErrorsAsync(...$args) { - return $this->getBulkProfileImportJobImportErrorsAsync(...$args); + public function getBulkProfileImportJobsAsync(...$args) { + return $this->getBulkImportProfilesJobsAsync(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobsAsync` + * + * @deprecated use `getBulkImportProfilesJobsAsync` instead + */ + public function getProfileBulkImportJobsAsync(...$args) { + return $this->getBulkImportProfilesJobsAsync(...$args); } /** - * Operation getBulkProfileImportJobImportErrorsAsyncWithHttpInfo + * Operation getBulkImportProfilesJobsAsyncWithHttpInfo * - * Get Bulk Profile Import Job Errors + * Get Bulk Import Profiles Jobs * - * @param string $id (required) - * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobImportErrorsAsyncWithHttpInfo($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkImportProfilesJobsAsyncWithHttpInfo($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getBulkProfileImportJobImportErrorsRequest($id, $fields_import_error, $page_cursor, $page_size, $apiKey); + $request = $this->getBulkImportProfilesJobsRequest($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1920,42 +3584,46 @@ function ($exception) { } /** - * Alias of `getBulkProfileImportJobImportErrorsAsyncWithHttpInfo` + * Alias of `getBulkImportProfilesJobsAsyncWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobImportErrorsAsyncWithHttpInfo` instead + * @deprecated use `getBulkImportProfilesJobsAsyncWithHttpInfo` instead */ - public function getProfileBulkImportJobImportErrorsAsyncWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobImportErrorsAsyncWithHttpInfo(...$args); + public function getBulkProfileImportJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkImportProfilesJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getBulkProfileImportJobImportErrors' + * Alias of `getBulkImportProfilesJobsAsyncWithHttpInfo` * - * @param string $id (required) - * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @deprecated use `getBulkImportProfilesJobsAsyncWithHttpInfo` instead + */ + public function getProfileBulkImportJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkImportProfilesJobsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getBulkImportProfilesJobs' + * + * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBulkProfileImportJobImportErrorsRequest($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkImportProfilesJobsRequest($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getBulkProfileImportJobImportErrors' - ); - } if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobImportErrors, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkImportProfilesJobs, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobImportErrors, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkImportProfilesJobs, must be bigger than or equal to 1.'); } - $resourcePath = '/api/profile-bulk-import-jobs/{id}/import-errors/'; + $resourcePath = '/api/profile-bulk-import-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1964,14 +3632,23 @@ public function getBulkProfileImportJobImportErrorsRequest($id, $fields_import_e // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_import_error, - 'fields[import-error]', // param base name + $fields_profile_bulk_import_job, + 'fields[profile-bulk-import-job]', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, 'page[cursor]', // param base name @@ -1982,32 +3659,33 @@ public function getBulkProfileImportJobImportErrorsRequest($id, $fields_import_e ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType 'form', // style true, // explode false // required ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2028,7 +3706,7 @@ public function getBulkProfileImportJobImportErrorsRequest($id, $fields_import_e // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2052,7 +3730,7 @@ public function getBulkProfileImportJobImportErrorsRequest($id, $fields_import_e $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2070,56 +3748,65 @@ public function getBulkProfileImportJobImportErrorsRequest($id, $fields_import_e } /** - * Alias of `getBulkProfileImportJobImportErrorsRequest` + * Alias of `getBulkImportProfilesJobsRequest` * - * @deprecated use `getBulkProfileImportJobImportErrorsRequest` instead + * @deprecated use `getBulkImportProfilesJobsRequest` instead */ - public function getProfileBulkImportJobImportErrorsRequest(...$args) { - return $this->getBulkProfileImportJobImportErrorsRequest(...$args); + public function getBulkProfileImportJobsRequest(...$args) { + return $this->getBulkImportProfilesJobsRequest(...$args); + } + + /** + * Alias of `getBulkImportProfilesJobsRequest` + * + * @deprecated use `getBulkImportProfilesJobsRequest` instead + */ + public function getProfileBulkImportJobsRequest(...$args) { + return $this->getBulkImportProfilesJobsRequest(...$args); } /** - * Operation getBulkProfileImportJobLists + * Operation getBulkSuppressProfilesJob * - * Get Bulk Profile Import Job Lists + * Get Bulk Suppress Profiles Job * - * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getBulkProfileImportJobLists($id, $fields_list = null, $apiKey = null) + public function getBulkSuppressProfilesJob($job_id, $fields_profile_suppression_bulk_create_job = null, $apiKey = null) { - list($response) = $this->getBulkProfileImportJobListsWithHttpInfo($id, $fields_list, $apiKey); + list($response) = $this->getBulkSuppressProfilesJobWithHttpInfo($job_id, $fields_profile_suppression_bulk_create_job, $apiKey); return $response; } /** - * Alias of `getBulkProfileImportJobLists` + * Alias of `getBulkSuppressProfilesJob` * - * @deprecated use `getBulkProfileImportJobLists` instead + * @deprecated use `getBulkSuppressProfilesJob` instead */ - public function getProfileBulkImportJobLists(...$args) { - return $this->getBulkProfileImportJobLists(...$args); + public function getProfileSuppressionBulkCreateJob(...$args) { + return $this->getBulkSuppressProfilesJob(...$args); } /** - * Operation getBulkProfileImportJobListsWithHttpInfo + * Operation getBulkSuppressProfilesJobWithHttpInfo * - * Get Bulk Profile Import Job Lists + * Get Bulk Suppress Profiles Job * - * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getBulkProfileImportJobListsWithHttpInfo($id, $fields_list = null, $apiKey = null) + public function getBulkSuppressProfilesJobWithHttpInfo($job_id, $fields_profile_suppression_bulk_create_job = null, $apiKey = null) { - $request = $this->getBulkProfileImportJobListsRequest($id, $fields_list, $apiKey); + $request = $this->getBulkSuppressProfilesJobRequest($job_id, $fields_profile_suppression_bulk_create_job, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2275,28 +3962,28 @@ public function getBulkProfileImportJobListsWithHttpInfo($id, $fields_list = nul } /** - * Alias of `getBulkProfileImportJobListsWithHttpInfo` + * Alias of `getBulkSuppressProfilesJobWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobListsWithHttpInfo` instead + * @deprecated use `getBulkSuppressProfilesJobWithHttpInfo` instead */ - public function getProfileBulkImportJobListsWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobListsWithHttpInfo(...$args); + public function getProfileSuppressionBulkCreateJobWithHttpInfo(...$args) { + return $this->getBulkSuppressProfilesJobWithHttpInfo(...$args); } /** - * Operation getBulkProfileImportJobListsAsync + * Operation getBulkSuppressProfilesJobAsync * - * Get Bulk Profile Import Job Lists + * Get Bulk Suppress Profiles Job * - * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobListsAsync($id, $fields_list = null, $apiKey = null) + public function getBulkSuppressProfilesJobAsync($job_id, $fields_profile_suppression_bulk_create_job = null, $apiKey = null) { - return $this->getBulkProfileImportJobListsAsyncWithHttpInfo($id, $fields_list, $apiKey) + return $this->getBulkSuppressProfilesJobAsyncWithHttpInfo($job_id, $fields_profile_suppression_bulk_create_job, $apiKey) ->then( function ($response) { return $response[0]; @@ -2305,29 +3992,29 @@ function ($response) { } /** - * Alias of `getBulkProfileImportJobListsAsync` + * Alias of `getBulkSuppressProfilesJobAsync` * - * @deprecated use `getBulkProfileImportJobListsAsync` instead + * @deprecated use `getBulkSuppressProfilesJobAsync` instead */ - public function getProfileBulkImportJobListsAsync(...$args) { - return $this->getBulkProfileImportJobListsAsync(...$args); + public function getProfileSuppressionBulkCreateJobAsync(...$args) { + return $this->getBulkSuppressProfilesJobAsync(...$args); } /** - * Operation getBulkProfileImportJobListsAsyncWithHttpInfo + * Operation getBulkSuppressProfilesJobAsyncWithHttpInfo * - * Get Bulk Profile Import Job Lists + * Get Bulk Suppress Profiles Job * - * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobListsAsyncWithHttpInfo($id, $fields_list = null, $apiKey = null) + public function getBulkSuppressProfilesJobAsyncWithHttpInfo($job_id, $fields_profile_suppression_bulk_create_job = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getBulkProfileImportJobListsRequest($id, $fields_list, $apiKey); + $request = $this->getBulkSuppressProfilesJobRequest($job_id, $fields_profile_suppression_bulk_create_job, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2371,33 +4058,33 @@ function ($exception) { } /** - * Alias of `getBulkProfileImportJobListsAsyncWithHttpInfo` + * Alias of `getBulkSuppressProfilesJobAsyncWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobListsAsyncWithHttpInfo` instead + * @deprecated use `getBulkSuppressProfilesJobAsyncWithHttpInfo` instead */ - public function getProfileBulkImportJobListsAsyncWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobListsAsyncWithHttpInfo(...$args); + public function getProfileSuppressionBulkCreateJobAsyncWithHttpInfo(...$args) { + return $this->getBulkSuppressProfilesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getBulkProfileImportJobLists' + * Create request for operation 'getBulkSuppressProfilesJob' * - * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBulkProfileImportJobListsRequest($id, $fields_list = null, $apiKey = null) + public function getBulkSuppressProfilesJobRequest($job_id, $fields_profile_suppression_bulk_create_job = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getBulkProfileImportJobLists' + 'Missing the required parameter $job_id when calling getBulkSuppressProfilesJob' ); } - $resourcePath = '/api/profile-bulk-import-jobs/{id}/lists/'; + $resourcePath = '/api/profile-suppression-bulk-create-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2406,8 +4093,8 @@ public function getBulkProfileImportJobListsRequest($id, $fields_list = null, $a // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_list, - 'fields[list]', // param base name + $fields_profile_suppression_bulk_create_job, + 'fields[profile-suppression-bulk-create-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -2416,10 +4103,10 @@ public function getBulkProfileImportJobListsRequest($id, $fields_list = null, $a // path params - if ($id !== null) { + if ($job_id !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'job_id' . '}', + ObjectSerializer::toPathValue($job_id), $resourcePath ); } @@ -2427,11 +4114,11 @@ public function getBulkProfileImportJobListsRequest($id, $fields_list = null, $a if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2452,7 +4139,7 @@ public function getBulkProfileImportJobListsRequest($id, $fields_list = null, $a // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2476,7 +4163,7 @@ public function getBulkProfileImportJobListsRequest($id, $fields_list = null, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2494,62 +4181,60 @@ public function getBulkProfileImportJobListsRequest($id, $fields_list = null, $a } /** - * Alias of `getBulkProfileImportJobListsRequest` + * Alias of `getBulkSuppressProfilesJobRequest` * - * @deprecated use `getBulkProfileImportJobListsRequest` instead + * @deprecated use `getBulkSuppressProfilesJobRequest` instead */ - public function getProfileBulkImportJobListsRequest(...$args) { - return $this->getBulkProfileImportJobListsRequest(...$args); + public function getProfileSuppressionBulkCreateJobRequest(...$args) { + return $this->getBulkSuppressProfilesJobRequest(...$args); } /** - * Operation getBulkProfileImportJobProfiles + * Operation getBulkSuppressProfilesJobs * - * Get Bulk Profile Import Job Profiles + * Get Bulk Suppress Profiles Jobs * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getBulkProfileImportJobProfiles($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkSuppressProfilesJobs($fields_profile_suppression_bulk_create_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getBulkProfileImportJobProfilesWithHttpInfo($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey); + list($response) = $this->getBulkSuppressProfilesJobsWithHttpInfo($fields_profile_suppression_bulk_create_job, $filter, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `getBulkProfileImportJobProfiles` + * Alias of `getBulkSuppressProfilesJobs` * - * @deprecated use `getBulkProfileImportJobProfiles` instead + * @deprecated use `getBulkSuppressProfilesJobs` instead */ - public function getProfileBulkImportJobProfiles(...$args) { - return $this->getBulkProfileImportJobProfiles(...$args); + public function getProfileSuppressionBulkCreateJobs(...$args) { + return $this->getBulkSuppressProfilesJobs(...$args); } /** - * Operation getBulkProfileImportJobProfilesWithHttpInfo + * Operation getBulkSuppressProfilesJobsWithHttpInfo * - * Get Bulk Profile Import Job Profiles + * Get Bulk Suppress Profiles Jobs * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getBulkProfileImportJobProfilesWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkSuppressProfilesJobsWithHttpInfo($fields_profile_suppression_bulk_create_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getBulkProfileImportJobProfilesRequest($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey); + $request = $this->getBulkSuppressProfilesJobsRequest($fields_profile_suppression_bulk_create_job, $filter, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2705,31 +4390,30 @@ public function getBulkProfileImportJobProfilesWithHttpInfo($id, $additional_fie } /** - * Alias of `getBulkProfileImportJobProfilesWithHttpInfo` + * Alias of `getBulkSuppressProfilesJobsWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobProfilesWithHttpInfo` instead + * @deprecated use `getBulkSuppressProfilesJobsWithHttpInfo` instead */ - public function getProfileBulkImportJobProfilesWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobProfilesWithHttpInfo(...$args); + public function getProfileSuppressionBulkCreateJobsWithHttpInfo(...$args) { + return $this->getBulkSuppressProfilesJobsWithHttpInfo(...$args); } /** - * Operation getBulkProfileImportJobProfilesAsync + * Operation getBulkSuppressProfilesJobsAsync * - * Get Bulk Profile Import Job Profiles + * Get Bulk Suppress Profiles Jobs * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobProfilesAsync($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkSuppressProfilesJobsAsync($fields_profile_suppression_bulk_create_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getBulkProfileImportJobProfilesAsyncWithHttpInfo($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey) + return $this->getBulkSuppressProfilesJobsAsyncWithHttpInfo($fields_profile_suppression_bulk_create_job, $filter, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -2738,32 +4422,31 @@ function ($response) { } /** - * Alias of `getBulkProfileImportJobProfilesAsync` + * Alias of `getBulkSuppressProfilesJobsAsync` * - * @deprecated use `getBulkProfileImportJobProfilesAsync` instead + * @deprecated use `getBulkSuppressProfilesJobsAsync` instead */ - public function getProfileBulkImportJobProfilesAsync(...$args) { - return $this->getBulkProfileImportJobProfilesAsync(...$args); + public function getProfileSuppressionBulkCreateJobsAsync(...$args) { + return $this->getBulkSuppressProfilesJobsAsync(...$args); } /** - * Operation getBulkProfileImportJobProfilesAsyncWithHttpInfo + * Operation getBulkSuppressProfilesJobsAsyncWithHttpInfo * - * Get Bulk Profile Import Job Profiles + * Get Bulk Suppress Profiles Jobs * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobProfilesAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkSuppressProfilesJobsAsyncWithHttpInfo($fields_profile_suppression_bulk_create_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getBulkProfileImportJobProfilesRequest($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey); + $request = $this->getBulkSuppressProfilesJobsRequest($fields_profile_suppression_bulk_create_job, $filter, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2807,43 +4490,29 @@ function ($exception) { } /** - * Alias of `getBulkProfileImportJobProfilesAsyncWithHttpInfo` + * Alias of `getBulkSuppressProfilesJobsAsyncWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobProfilesAsyncWithHttpInfo` instead + * @deprecated use `getBulkSuppressProfilesJobsAsyncWithHttpInfo` instead */ - public function getProfileBulkImportJobProfilesAsyncWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobProfilesAsyncWithHttpInfo(...$args); + public function getProfileSuppressionBulkCreateJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkSuppressProfilesJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getBulkProfileImportJobProfiles' + * Create request for operation 'getBulkSuppressProfilesJobs' * - * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBulkProfileImportJobProfilesRequest($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkSuppressProfilesJobsRequest($fields_profile_suppression_bulk_create_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getBulkProfileImportJobProfiles' - ); - } - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobProfiles, must be smaller than or equal to 100.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobProfiles, must be bigger than or equal to 1.'); - } - - $resourcePath = '/api/profile-bulk-import-jobs/{id}/profiles/'; + $resourcePath = '/api/profile-suppression-bulk-create-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2852,8 +4521,8 @@ public function getBulkProfileImportJobProfilesRequest($id, $additional_fields_p // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $additional_fields_profile, - 'additional-fields[profile]', // param base name + $fields_profile_suppression_bulk_create_job, + 'fields[profile-suppression-bulk-create-job]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -2861,11 +4530,11 @@ public function getBulkProfileImportJobProfilesRequest($id, $additional_fields_p ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_profile, - 'fields[profile]', // param base name - 'array', // openApiType + $filter, + 'filter', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params @@ -2879,32 +4548,24 @@ public function getBulkProfileImportJobProfilesRequest($id, $additional_fields_p ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType + $sort, + 'sort', // param base name + 'string', // openApiType 'form', // style true, // explode false // required ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2925,7 +4586,7 @@ public function getBulkProfileImportJobProfilesRequest($id, $additional_fields_p // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2949,7 +4610,7 @@ public function getBulkProfileImportJobProfilesRequest($id, $additional_fields_p $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2967,54 +4628,56 @@ public function getBulkProfileImportJobProfilesRequest($id, $additional_fields_p } /** - * Alias of `getBulkProfileImportJobProfilesRequest` + * Alias of `getBulkSuppressProfilesJobsRequest` * - * @deprecated use `getBulkProfileImportJobProfilesRequest` instead + * @deprecated use `getBulkSuppressProfilesJobsRequest` instead */ - public function getProfileBulkImportJobProfilesRequest(...$args) { - return $this->getBulkProfileImportJobProfilesRequest(...$args); + public function getProfileSuppressionBulkCreateJobsRequest(...$args) { + return $this->getBulkSuppressProfilesJobsRequest(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsLists + * Operation getBulkUnsuppressProfilesJob * - * Get Bulk Profile Import Job Relationships Lists + * Get Bulk Unsuppress Profiles Job * - * @param string $id (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getBulkProfileImportJobRelationshipsLists($id, $apiKey = null) + public function getBulkUnsuppressProfilesJob($job_id, $fields_profile_suppression_bulk_delete_job = null, $apiKey = null) { - list($response) = $this->getBulkProfileImportJobRelationshipsListsWithHttpInfo($id, $apiKey); + list($response) = $this->getBulkUnsuppressProfilesJobWithHttpInfo($job_id, $fields_profile_suppression_bulk_delete_job, $apiKey); return $response; } /** - * Alias of `getBulkProfileImportJobRelationshipsLists` + * Alias of `getBulkUnsuppressProfilesJob` * - * @deprecated use `getBulkProfileImportJobRelationshipsLists` instead + * @deprecated use `getBulkUnsuppressProfilesJob` instead */ - public function getProfileBulkImportJobRelationshipsLists(...$args) { - return $this->getBulkProfileImportJobRelationshipsLists(...$args); + public function getProfileSuppressionBulkDeleteJob(...$args) { + return $this->getBulkUnsuppressProfilesJob(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsListsWithHttpInfo + * Operation getBulkUnsuppressProfilesJobWithHttpInfo * - * Get Bulk Profile Import Job Relationships Lists + * Get Bulk Unsuppress Profiles Job * - * @param string $id (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getBulkProfileImportJobRelationshipsListsWithHttpInfo($id, $apiKey = null) + public function getBulkUnsuppressProfilesJobWithHttpInfo($job_id, $fields_profile_suppression_bulk_delete_job = null, $apiKey = null) { - $request = $this->getBulkProfileImportJobRelationshipsListsRequest($id, $apiKey); + $request = $this->getBulkUnsuppressProfilesJobRequest($job_id, $fields_profile_suppression_bulk_delete_job, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3170,27 +4833,28 @@ public function getBulkProfileImportJobRelationshipsListsWithHttpInfo($id, $apiK } /** - * Alias of `getBulkProfileImportJobRelationshipsListsWithHttpInfo` + * Alias of `getBulkUnsuppressProfilesJobWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobRelationshipsListsWithHttpInfo` instead + * @deprecated use `getBulkUnsuppressProfilesJobWithHttpInfo` instead */ - public function getProfileBulkImportJobRelationshipsListsWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobRelationshipsListsWithHttpInfo(...$args); + public function getProfileSuppressionBulkDeleteJobWithHttpInfo(...$args) { + return $this->getBulkUnsuppressProfilesJobWithHttpInfo(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsListsAsync + * Operation getBulkUnsuppressProfilesJobAsync * - * Get Bulk Profile Import Job Relationships Lists + * Get Bulk Unsuppress Profiles Job * - * @param string $id (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobRelationshipsListsAsync($id, $apiKey = null) + public function getBulkUnsuppressProfilesJobAsync($job_id, $fields_profile_suppression_bulk_delete_job = null, $apiKey = null) { - return $this->getBulkProfileImportJobRelationshipsListsAsyncWithHttpInfo($id, $apiKey) + return $this->getBulkUnsuppressProfilesJobAsyncWithHttpInfo($job_id, $fields_profile_suppression_bulk_delete_job, $apiKey) ->then( function ($response) { return $response[0]; @@ -3199,28 +4863,29 @@ function ($response) { } /** - * Alias of `getBulkProfileImportJobRelationshipsListsAsync` + * Alias of `getBulkUnsuppressProfilesJobAsync` * - * @deprecated use `getBulkProfileImportJobRelationshipsListsAsync` instead + * @deprecated use `getBulkUnsuppressProfilesJobAsync` instead */ - public function getProfileBulkImportJobRelationshipsListsAsync(...$args) { - return $this->getBulkProfileImportJobRelationshipsListsAsync(...$args); + public function getProfileSuppressionBulkDeleteJobAsync(...$args) { + return $this->getBulkUnsuppressProfilesJobAsync(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsListsAsyncWithHttpInfo + * Operation getBulkUnsuppressProfilesJobAsyncWithHttpInfo * - * Get Bulk Profile Import Job Relationships Lists + * Get Bulk Unsuppress Profiles Job * - * @param string $id (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobRelationshipsListsAsyncWithHttpInfo($id, $apiKey = null) + public function getBulkUnsuppressProfilesJobAsyncWithHttpInfo($job_id, $fields_profile_suppression_bulk_delete_job = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getBulkProfileImportJobRelationshipsListsRequest($id, $apiKey); + $request = $this->getBulkUnsuppressProfilesJobRequest($job_id, $fields_profile_suppression_bulk_delete_job, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3264,45 +4929,55 @@ function ($exception) { } /** - * Alias of `getBulkProfileImportJobRelationshipsListsAsyncWithHttpInfo` + * Alias of `getBulkUnsuppressProfilesJobAsyncWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobRelationshipsListsAsyncWithHttpInfo` instead + * @deprecated use `getBulkUnsuppressProfilesJobAsyncWithHttpInfo` instead */ - public function getProfileBulkImportJobRelationshipsListsAsyncWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobRelationshipsListsAsyncWithHttpInfo(...$args); + public function getProfileSuppressionBulkDeleteJobAsyncWithHttpInfo(...$args) { + return $this->getBulkUnsuppressProfilesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getBulkProfileImportJobRelationshipsLists' + * Create request for operation 'getBulkUnsuppressProfilesJob' * - * @param string $id (required) + * @param string $job_id ID of the job to retrieve. (required) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBulkProfileImportJobRelationshipsListsRequest($id, $apiKey = null) + public function getBulkUnsuppressProfilesJobRequest($job_id, $fields_profile_suppression_bulk_delete_job = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getBulkProfileImportJobRelationshipsLists' + 'Missing the required parameter $job_id when calling getBulkUnsuppressProfilesJob' ); } - $resourcePath = '/api/profile-bulk-import-jobs/{id}/relationships/lists/'; + $resourcePath = '/api/profile-suppression-bulk-delete-jobs/{job_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_profile_suppression_bulk_delete_job, + 'fields[profile-suppression-bulk-delete-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params - if ($id !== null) { + if ($job_id !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'job_id' . '}', + ObjectSerializer::toPathValue($job_id), $resourcePath ); } @@ -3310,11 +4985,11 @@ public function getBulkProfileImportJobRelationshipsListsRequest($id, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3335,7 +5010,7 @@ public function getBulkProfileImportJobRelationshipsListsRequest($id, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3359,7 +5034,7 @@ public function getBulkProfileImportJobRelationshipsListsRequest($id, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3377,58 +5052,60 @@ public function getBulkProfileImportJobRelationshipsListsRequest($id, $apiKey = } /** - * Alias of `getBulkProfileImportJobRelationshipsListsRequest` + * Alias of `getBulkUnsuppressProfilesJobRequest` * - * @deprecated use `getBulkProfileImportJobRelationshipsListsRequest` instead + * @deprecated use `getBulkUnsuppressProfilesJobRequest` instead */ - public function getProfileBulkImportJobRelationshipsListsRequest(...$args) { - return $this->getBulkProfileImportJobRelationshipsListsRequest(...$args); + public function getProfileSuppressionBulkDeleteJobRequest(...$args) { + return $this->getBulkUnsuppressProfilesJobRequest(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsProfiles + * Operation getBulkUnsuppressProfilesJobs * - * Get Bulk Profile Import Job Relationships Profiles + * Get Bulk Unsuppress Profiles Jobs * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getBulkProfileImportJobRelationshipsProfiles($id, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkUnsuppressProfilesJobs($fields_profile_suppression_bulk_delete_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getBulkProfileImportJobRelationshipsProfilesWithHttpInfo($id, $page_cursor, $page_size, $apiKey); + list($response) = $this->getBulkUnsuppressProfilesJobsWithHttpInfo($fields_profile_suppression_bulk_delete_job, $filter, $page_cursor, $sort, $apiKey); return $response; } /** - * Alias of `getBulkProfileImportJobRelationshipsProfiles` + * Alias of `getBulkUnsuppressProfilesJobs` * - * @deprecated use `getBulkProfileImportJobRelationshipsProfiles` instead + * @deprecated use `getBulkUnsuppressProfilesJobs` instead */ - public function getProfileBulkImportJobRelationshipsProfiles(...$args) { - return $this->getBulkProfileImportJobRelationshipsProfiles(...$args); + public function getProfileSuppressionBulkDeleteJobs(...$args) { + return $this->getBulkUnsuppressProfilesJobs(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsProfilesWithHttpInfo + * Operation getBulkUnsuppressProfilesJobsWithHttpInfo * - * Get Bulk Profile Import Job Relationships Profiles + * Get Bulk Unsuppress Profiles Jobs * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getBulkProfileImportJobRelationshipsProfilesWithHttpInfo($id, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkUnsuppressProfilesJobsWithHttpInfo($fields_profile_suppression_bulk_delete_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getBulkProfileImportJobRelationshipsProfilesRequest($id, $page_cursor, $page_size, $apiKey); + $request = $this->getBulkUnsuppressProfilesJobsRequest($fields_profile_suppression_bulk_delete_job, $filter, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3584,29 +5261,30 @@ public function getBulkProfileImportJobRelationshipsProfilesWithHttpInfo($id, $p } /** - * Alias of `getBulkProfileImportJobRelationshipsProfilesWithHttpInfo` + * Alias of `getBulkUnsuppressProfilesJobsWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobRelationshipsProfilesWithHttpInfo` instead + * @deprecated use `getBulkUnsuppressProfilesJobsWithHttpInfo` instead */ - public function getProfileBulkImportJobRelationshipsProfilesWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobRelationshipsProfilesWithHttpInfo(...$args); + public function getProfileSuppressionBulkDeleteJobsWithHttpInfo(...$args) { + return $this->getBulkUnsuppressProfilesJobsWithHttpInfo(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsProfilesAsync + * Operation getBulkUnsuppressProfilesJobsAsync * - * Get Bulk Profile Import Job Relationships Profiles + * Get Bulk Unsuppress Profiles Jobs * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobRelationshipsProfilesAsync($id, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkUnsuppressProfilesJobsAsync($fields_profile_suppression_bulk_delete_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getBulkProfileImportJobRelationshipsProfilesAsyncWithHttpInfo($id, $page_cursor, $page_size, $apiKey) + return $this->getBulkUnsuppressProfilesJobsAsyncWithHttpInfo($fields_profile_suppression_bulk_delete_job, $filter, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -3615,30 +5293,31 @@ function ($response) { } /** - * Alias of `getBulkProfileImportJobRelationshipsProfilesAsync` + * Alias of `getBulkUnsuppressProfilesJobsAsync` * - * @deprecated use `getBulkProfileImportJobRelationshipsProfilesAsync` instead + * @deprecated use `getBulkUnsuppressProfilesJobsAsync` instead */ - public function getProfileBulkImportJobRelationshipsProfilesAsync(...$args) { - return $this->getBulkProfileImportJobRelationshipsProfilesAsync(...$args); + public function getProfileSuppressionBulkDeleteJobsAsync(...$args) { + return $this->getBulkUnsuppressProfilesJobsAsync(...$args); } /** - * Operation getBulkProfileImportJobRelationshipsProfilesAsyncWithHttpInfo + * Operation getBulkUnsuppressProfilesJobsAsyncWithHttpInfo * - * Get Bulk Profile Import Job Relationships Profiles + * Get Bulk Unsuppress Profiles Jobs * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobRelationshipsProfilesAsyncWithHttpInfo($id, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkUnsuppressProfilesJobsAsyncWithHttpInfo($fields_profile_suppression_bulk_delete_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getBulkProfileImportJobRelationshipsProfilesRequest($id, $page_cursor, $page_size, $apiKey); + $request = $this->getBulkUnsuppressProfilesJobsRequest($fields_profile_suppression_bulk_delete_job, $filter, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3682,47 +5361,53 @@ function ($exception) { } /** - * Alias of `getBulkProfileImportJobRelationshipsProfilesAsyncWithHttpInfo` + * Alias of `getBulkUnsuppressProfilesJobsAsyncWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobRelationshipsProfilesAsyncWithHttpInfo` instead + * @deprecated use `getBulkUnsuppressProfilesJobsAsyncWithHttpInfo` instead */ - public function getProfileBulkImportJobRelationshipsProfilesAsyncWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobRelationshipsProfilesAsyncWithHttpInfo(...$args); + public function getProfileSuppressionBulkDeleteJobsAsyncWithHttpInfo(...$args) { + return $this->getBulkUnsuppressProfilesJobsAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getBulkProfileImportJobRelationshipsProfiles' + * Create request for operation 'getBulkUnsuppressProfilesJobs' * - * @param string $id (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string[] $fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBulkProfileImportJobRelationshipsProfilesRequest($id, $page_cursor = null, $page_size = 20, $apiKey = null) + public function getBulkUnsuppressProfilesJobsRequest($fields_profile_suppression_bulk_delete_job = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getBulkProfileImportJobRelationshipsProfiles' - ); - } - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobRelationshipsProfiles, must be smaller than or equal to 100.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobRelationshipsProfiles, must be bigger than or equal to 1.'); - } - - $resourcePath = '/api/profile-bulk-import-jobs/{id}/relationships/profiles/'; + $resourcePath = '/api/profile-suppression-bulk-delete-jobs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_profile_suppression_bulk_delete_job, + 'fields[profile-suppression-bulk-delete-job]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, @@ -3734,32 +5419,24 @@ public function getBulkProfileImportJobRelationshipsProfilesRequest($id, $page_c ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType + $sort, + 'sort', // param base name + 'string', // openApiType 'form', // style true, // explode false // required ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3780,7 +5457,7 @@ public function getBulkProfileImportJobRelationshipsProfilesRequest($id, $page_c // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3804,7 +5481,7 @@ public function getBulkProfileImportJobRelationshipsProfilesRequest($id, $page_c $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3822,62 +5499,69 @@ public function getBulkProfileImportJobRelationshipsProfilesRequest($id, $page_c } /** - * Alias of `getBulkProfileImportJobRelationshipsProfilesRequest` + * Alias of `getBulkUnsuppressProfilesJobsRequest` * - * @deprecated use `getBulkProfileImportJobRelationshipsProfilesRequest` instead + * @deprecated use `getBulkUnsuppressProfilesJobsRequest` instead */ - public function getProfileBulkImportJobRelationshipsProfilesRequest(...$args) { - return $this->getBulkProfileImportJobRelationshipsProfilesRequest(...$args); + public function getProfileSuppressionBulkDeleteJobsRequest(...$args) { + return $this->getBulkUnsuppressProfilesJobsRequest(...$args); } /** - * Operation getBulkProfileImportJobs + * Operation getErrorsForBulkImportProfilesJob * - * Get Bulk Profile Import Jobs + * Get Errors for Bulk Import Profiles Job * - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getBulkProfileImportJobs($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getErrorsForBulkImportProfilesJob($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) { - list($response) = $this->getBulkProfileImportJobsWithHttpInfo($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getErrorsForBulkImportProfilesJobWithHttpInfo($id, $fields_import_error, $page_cursor, $page_size, $apiKey); return $response; } /** - * Alias of `getBulkProfileImportJobs` + * Alias of `getErrorsForBulkImportProfilesJob` * - * @deprecated use `getBulkProfileImportJobs` instead + * @deprecated use `getErrorsForBulkImportProfilesJob` instead */ - public function getProfileBulkImportJobs(...$args) { - return $this->getBulkProfileImportJobs(...$args); + public function getBulkProfileImportJobImportErrors(...$args) { + return $this->getErrorsForBulkImportProfilesJob(...$args); + } + + /** + * Alias of `getErrorsForBulkImportProfilesJob` + * + * @deprecated use `getErrorsForBulkImportProfilesJob` instead + */ + public function getProfileBulkImportJobImportErrors(...$args) { + return $this->getErrorsForBulkImportProfilesJob(...$args); } /** - * Operation getBulkProfileImportJobsWithHttpInfo + * Operation getErrorsForBulkImportProfilesJobWithHttpInfo * - * Get Bulk Profile Import Jobs + * Get Errors for Bulk Import Profiles Job * - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getBulkProfileImportJobsWithHttpInfo($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getErrorsForBulkImportProfilesJobWithHttpInfo($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) { - $request = $this->getBulkProfileImportJobsRequest($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getErrorsForBulkImportProfilesJobRequest($id, $fields_import_error, $page_cursor, $page_size, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4033,31 +5717,39 @@ public function getBulkProfileImportJobsWithHttpInfo($fields_profile_bulk_import } /** - * Alias of `getBulkProfileImportJobsWithHttpInfo` + * Alias of `getErrorsForBulkImportProfilesJobWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobsWithHttpInfo` instead + * @deprecated use `getErrorsForBulkImportProfilesJobWithHttpInfo` instead */ - public function getProfileBulkImportJobsWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobsWithHttpInfo(...$args); + public function getBulkProfileImportJobImportErrorsWithHttpInfo(...$args) { + return $this->getErrorsForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Alias of `getErrorsForBulkImportProfilesJobWithHttpInfo` + * + * @deprecated use `getErrorsForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getProfileBulkImportJobImportErrorsWithHttpInfo(...$args) { + return $this->getErrorsForBulkImportProfilesJobWithHttpInfo(...$args); } /** - * Operation getBulkProfileImportJobsAsync + * Operation getErrorsForBulkImportProfilesJobAsync * - * Get Bulk Profile Import Jobs + * Get Errors for Bulk Import Profiles Job * - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobsAsync($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getErrorsForBulkImportProfilesJobAsync($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) { - return $this->getBulkProfileImportJobsAsyncWithHttpInfo($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getErrorsForBulkImportProfilesJobAsyncWithHttpInfo($id, $fields_import_error, $page_cursor, $page_size, $apiKey) ->then( function ($response) { return $response[0]; @@ -4066,32 +5758,40 @@ function ($response) { } /** - * Alias of `getBulkProfileImportJobsAsync` + * Alias of `getErrorsForBulkImportProfilesJobAsync` * - * @deprecated use `getBulkProfileImportJobsAsync` instead + * @deprecated use `getErrorsForBulkImportProfilesJobAsync` instead */ - public function getProfileBulkImportJobsAsync(...$args) { - return $this->getBulkProfileImportJobsAsync(...$args); + public function getBulkProfileImportJobImportErrorsAsync(...$args) { + return $this->getErrorsForBulkImportProfilesJobAsync(...$args); + } + + /** + * Alias of `getErrorsForBulkImportProfilesJobAsync` + * + * @deprecated use `getErrorsForBulkImportProfilesJobAsync` instead + */ + public function getProfileBulkImportJobImportErrorsAsync(...$args) { + return $this->getErrorsForBulkImportProfilesJobAsync(...$args); } /** - * Operation getBulkProfileImportJobsAsyncWithHttpInfo + * Operation getErrorsForBulkImportProfilesJobAsyncWithHttpInfo * - * Get Bulk Profile Import Jobs + * Get Errors for Bulk Import Profiles Job * - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBulkProfileImportJobsAsyncWithHttpInfo($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getErrorsForBulkImportProfilesJobAsyncWithHttpInfo($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) { $returnType = 'array'; - $request = $this->getBulkProfileImportJobsRequest($fields_profile_bulk_import_job, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getErrorsForBulkImportProfilesJobRequest($id, $fields_import_error, $page_cursor, $page_size, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4135,37 +5835,51 @@ function ($exception) { } /** - * Alias of `getBulkProfileImportJobsAsyncWithHttpInfo` + * Alias of `getErrorsForBulkImportProfilesJobAsyncWithHttpInfo` * - * @deprecated use `getBulkProfileImportJobsAsyncWithHttpInfo` instead + * @deprecated use `getErrorsForBulkImportProfilesJobAsyncWithHttpInfo` instead */ - public function getProfileBulkImportJobsAsyncWithHttpInfo(...$args) { - return $this->getBulkProfileImportJobsAsyncWithHttpInfo(...$args); + public function getBulkProfileImportJobImportErrorsAsyncWithHttpInfo(...$args) { + return $this->getErrorsForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getErrorsForBulkImportProfilesJobAsyncWithHttpInfo` + * + * @deprecated use `getErrorsForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getProfileBulkImportJobImportErrorsAsyncWithHttpInfo(...$args) { + return $this->getErrorsForBulkImportProfilesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'getBulkProfileImportJobs' + * Create request for operation 'getErrorsForBulkImportProfilesJob' * - * @param string[] $fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string[] $fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBulkProfileImportJobsRequest($fields_profile_bulk_import_job = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getErrorsForBulkImportProfilesJobRequest($id, $fields_import_error = null, $page_cursor = null, $page_size = 20, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getErrorsForBulkImportProfilesJob' + ); + } if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobs, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getErrorsForBulkImportProfilesJob, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getBulkProfileImportJobs, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getErrorsForBulkImportProfilesJob, must be bigger than or equal to 1.'); } - $resourcePath = '/api/profile-bulk-import-jobs/'; + $resourcePath = '/api/profile-bulk-import-jobs/{id}/import-errors'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4174,23 +5888,14 @@ public function getBulkProfileImportJobsRequest($fields_profile_bulk_import_job // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_profile_bulk_import_job, - 'fields[profile-bulk-import-job]', // param base name + $fields_import_error, + 'fields[import-error]', // param base name 'array', // openApiType 'form', // style false, // explode false // required ) ?? []); // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, 'page[cursor]', // param base name @@ -4208,26 +5913,25 @@ public function getBulkProfileImportJobsRequest($fields_profile_bulk_import_job true, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4248,7 +5952,7 @@ public function getBulkProfileImportJobsRequest($fields_profile_bulk_import_job // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4272,7 +5976,7 @@ public function getBulkProfileImportJobsRequest($fields_profile_bulk_import_job $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4290,55 +5994,74 @@ public function getBulkProfileImportJobsRequest($fields_profile_bulk_import_job } /** - * Alias of `getBulkProfileImportJobsRequest` + * Alias of `getErrorsForBulkImportProfilesJobRequest` * - * @deprecated use `getBulkProfileImportJobsRequest` instead + * @deprecated use `getErrorsForBulkImportProfilesJobRequest` instead */ - public function getProfileBulkImportJobsRequest(...$args) { - return $this->getBulkProfileImportJobsRequest(...$args); + public function getBulkProfileImportJobImportErrorsRequest(...$args) { + return $this->getErrorsForBulkImportProfilesJobRequest(...$args); } /** - * Operation getProfile + * Alias of `getErrorsForBulkImportProfilesJobRequest` * - * Get Profile + * @deprecated use `getErrorsForBulkImportProfilesJobRequest` instead + */ + public function getProfileBulkImportJobImportErrorsRequest(...$args) { + return $this->getErrorsForBulkImportProfilesJobRequest(...$args); + } + + /** + * Operation getListForBulkImportProfilesJob + * + * Get List for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getProfile($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) + public function getListForBulkImportProfilesJob($id, $fields_list = null, $apiKey = null) { - list($response) = $this->getProfileWithHttpInfo($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey); + list($response) = $this->getListForBulkImportProfilesJobWithHttpInfo($id, $fields_list, $apiKey); return $response; } /** - * Operation getProfileWithHttpInfo + * Alias of `getListForBulkImportProfilesJob` * - * Get Profile + * @deprecated use `getListForBulkImportProfilesJob` instead + */ + public function getBulkProfileImportJobLists(...$args) { + return $this->getListForBulkImportProfilesJob(...$args); + } + + /** + * Alias of `getListForBulkImportProfilesJob` + * + * @deprecated use `getListForBulkImportProfilesJob` instead + */ + public function getProfileBulkImportJobLists(...$args) { + return $this->getListForBulkImportProfilesJob(...$args); + } + + /** + * Operation getListForBulkImportProfilesJobWithHttpInfo + * + * Get List for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getProfileWithHttpInfo($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) + public function getListForBulkImportProfilesJobWithHttpInfo($id, $fields_list = null, $apiKey = null) { - $request = $this->getProfileRequest($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey); + $request = $this->getListForBulkImportProfilesJobRequest($id, $fields_list, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4494,23 +6217,37 @@ public function getProfileWithHttpInfo($id, $additional_fields_profile = null, $ } /** - * Operation getProfileAsync + * Alias of `getListForBulkImportProfilesJobWithHttpInfo` * - * Get Profile + * @deprecated use `getListForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getBulkProfileImportJobListsWithHttpInfo(...$args) { + return $this->getListForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Alias of `getListForBulkImportProfilesJobWithHttpInfo` + * + * @deprecated use `getListForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getProfileBulkImportJobListsWithHttpInfo(...$args) { + return $this->getListForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Operation getListForBulkImportProfilesJobAsync + * + * Get List for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileAsync($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) + public function getListForBulkImportProfilesJobAsync($id, $fields_list = null, $apiKey = null) { - return $this->getProfileAsyncWithHttpInfo($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey) + return $this->getListForBulkImportProfilesJobAsyncWithHttpInfo($id, $fields_list, $apiKey) ->then( function ($response) { return $response[0]; @@ -4519,24 +6256,38 @@ function ($response) { } /** - * Operation getProfileAsyncWithHttpInfo + * Alias of `getListForBulkImportProfilesJobAsync` * - * Get Profile + * @deprecated use `getListForBulkImportProfilesJobAsync` instead + */ + public function getBulkProfileImportJobListsAsync(...$args) { + return $this->getListForBulkImportProfilesJobAsync(...$args); + } + + /** + * Alias of `getListForBulkImportProfilesJobAsync` + * + * @deprecated use `getListForBulkImportProfilesJobAsync` instead + */ + public function getProfileBulkImportJobListsAsync(...$args) { + return $this->getListForBulkImportProfilesJobAsync(...$args); + } + + /** + * Operation getListForBulkImportProfilesJobAsyncWithHttpInfo + * + * Get List for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) + public function getListForBulkImportProfilesJobAsyncWithHttpInfo($id, $fields_list = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getProfileRequest($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey); + $request = $this->getListForBulkImportProfilesJobRequest($id, $fields_list, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4580,43 +6331,48 @@ function ($exception) { } /** - * Create request for operation 'getProfile' + * Alias of `getListForBulkImportProfilesJobAsyncWithHttpInfo` + * + * @deprecated use `getListForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getBulkProfileImportJobListsAsyncWithHttpInfo(...$args) { + return $this->getListForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getListForBulkImportProfilesJobAsyncWithHttpInfo` + * + * @deprecated use `getListForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getProfileBulkImportJobListsAsyncWithHttpInfo(...$args) { + return $this->getListForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getListForBulkImportProfilesJob' * * @param string $id (required) - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProfileRequest($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) + public function getListForBulkImportProfilesJobRequest($id, $fields_list = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getProfile' + 'Missing the required parameter $id when calling getListForBulkImportProfilesJob' ); } - $resourcePath = '/api/profiles/{id}/'; + $resourcePath = '/api/profile-bulk-import-jobs/{id}/lists'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $additional_fields_profile, - 'additional-fields[profile]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $fields_list, @@ -4626,33 +6382,6 @@ public function getProfileRequest($id, $additional_fields_profile = null, $field false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_profile, - 'fields[profile]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_segment, - 'fields[segment]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -4667,11 +6396,11 @@ public function getProfileRequest($id, $additional_fields_profile = null, $field if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4692,7 +6421,7 @@ public function getProfileRequest($id, $additional_fields_profile = null, $field // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4716,7 +6445,7 @@ public function getProfileRequest($id, $additional_fields_profile = null, $field $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4734,38 +6463,72 @@ public function getProfileRequest($id, $additional_fields_profile = null, $field } /** - * Operation getProfileLists + * Alias of `getListForBulkImportProfilesJobRequest` * - * Get Profile Lists + * @deprecated use `getListForBulkImportProfilesJobRequest` instead + */ + public function getBulkProfileImportJobListsRequest(...$args) { + return $this->getListForBulkImportProfilesJobRequest(...$args); + } + + /** + * Alias of `getListForBulkImportProfilesJobRequest` + * + * @deprecated use `getListForBulkImportProfilesJobRequest` instead + */ + public function getProfileBulkImportJobListsRequest(...$args) { + return $this->getListForBulkImportProfilesJobRequest(...$args); + } + + /** + * Operation getListIdsForBulkImportProfilesJob + * + * Get List IDs for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getProfileLists($id, $fields_list = null, $apiKey = null) + public function getListIdsForBulkImportProfilesJob($id, $apiKey = null) { - list($response) = $this->getProfileListsWithHttpInfo($id, $fields_list, $apiKey); + list($response) = $this->getListIdsForBulkImportProfilesJobWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getProfileListsWithHttpInfo + * Alias of `getListIdsForBulkImportProfilesJob` + * + * @deprecated use `getListIdsForBulkImportProfilesJob` instead + */ + public function getBulkProfileImportJobRelationshipsLists(...$args) { + return $this->getListIdsForBulkImportProfilesJob(...$args); + } + + /** + * Alias of `getListIdsForBulkImportProfilesJob` * - * Get Profile Lists + * @deprecated use `getListIdsForBulkImportProfilesJob` instead + */ + public function getProfileBulkImportJobRelationshipsLists(...$args) { + return $this->getListIdsForBulkImportProfilesJob(...$args); + } + + /** + * Operation getListIdsForBulkImportProfilesJobWithHttpInfo + * + * Get List IDs for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getProfileListsWithHttpInfo($id, $fields_list = null, $apiKey = null) + public function getListIdsForBulkImportProfilesJobWithHttpInfo($id, $apiKey = null) { - $request = $this->getProfileListsRequest($id, $fields_list, $apiKey); + $request = $this->getListIdsForBulkImportProfilesJobRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4921,19 +6684,36 @@ public function getProfileListsWithHttpInfo($id, $fields_list = null, $apiKey = } /** - * Operation getProfileListsAsync + * Alias of `getListIdsForBulkImportProfilesJobWithHttpInfo` + * + * @deprecated use `getListIdsForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getBulkProfileImportJobRelationshipsListsWithHttpInfo(...$args) { + return $this->getListIdsForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Alias of `getListIdsForBulkImportProfilesJobWithHttpInfo` + * + * @deprecated use `getListIdsForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getProfileBulkImportJobRelationshipsListsWithHttpInfo(...$args) { + return $this->getListIdsForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Operation getListIdsForBulkImportProfilesJobAsync * - * Get Profile Lists + * Get List IDs for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileListsAsync($id, $fields_list = null, $apiKey = null) + public function getListIdsForBulkImportProfilesJobAsync($id, $apiKey = null) { - return $this->getProfileListsAsyncWithHttpInfo($id, $fields_list, $apiKey) + return $this->getListIdsForBulkImportProfilesJobAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -4942,20 +6722,37 @@ function ($response) { } /** - * Operation getProfileListsAsyncWithHttpInfo + * Alias of `getListIdsForBulkImportProfilesJobAsync` + * + * @deprecated use `getListIdsForBulkImportProfilesJobAsync` instead + */ + public function getBulkProfileImportJobRelationshipsListsAsync(...$args) { + return $this->getListIdsForBulkImportProfilesJobAsync(...$args); + } + + /** + * Alias of `getListIdsForBulkImportProfilesJobAsync` + * + * @deprecated use `getListIdsForBulkImportProfilesJobAsync` instead + */ + public function getProfileBulkImportJobRelationshipsListsAsync(...$args) { + return $this->getListIdsForBulkImportProfilesJobAsync(...$args); + } + + /** + * Operation getListIdsForBulkImportProfilesJobAsyncWithHttpInfo * - * Get Profile Lists + * Get List IDs for Bulk Import Profiles Job * * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileListsAsyncWithHttpInfo($id, $fields_list = null, $apiKey = null) + public function getListIdsForBulkImportProfilesJobAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getProfileListsRequest($id, $fields_list, $apiKey); + $request = $this->getListIdsForBulkImportProfilesJobRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4999,39 +6796,47 @@ function ($exception) { } /** - * Create request for operation 'getProfileLists' + * Alias of `getListIdsForBulkImportProfilesJobAsyncWithHttpInfo` + * + * @deprecated use `getListIdsForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getBulkProfileImportJobRelationshipsListsAsyncWithHttpInfo(...$args) { + return $this->getListIdsForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getListIdsForBulkImportProfilesJobAsyncWithHttpInfo` + * + * @deprecated use `getListIdsForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getProfileBulkImportJobRelationshipsListsAsyncWithHttpInfo(...$args) { + return $this->getListIdsForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getListIdsForBulkImportProfilesJob' * * @param string $id (required) - * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProfileListsRequest($id, $fields_list = null, $apiKey = null) + public function getListIdsForBulkImportProfilesJobRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getProfileLists' + 'Missing the required parameter $id when calling getListIdsForBulkImportProfilesJob' ); } - $resourcePath = '/api/profiles/{id}/lists/'; + $resourcePath = '/api/profile-bulk-import-jobs/{id}/relationships/lists'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_list, - 'fields[list]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -5046,11 +6851,11 @@ public function getProfileListsRequest($id, $fields_list = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5071,7 +6876,7 @@ public function getProfileListsRequest($id, $fields_list = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5095,7 +6900,7 @@ public function getProfileListsRequest($id, $fields_list = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5113,9 +6918,27 @@ public function getProfileListsRequest($id, $fields_list = null, $apiKey = null) } /** - * Operation getProfileRelationshipsLists + * Alias of `getListIdsForBulkImportProfilesJobRequest` * - * Get Profile Relationships Lists + * @deprecated use `getListIdsForBulkImportProfilesJobRequest` instead + */ + public function getBulkProfileImportJobRelationshipsListsRequest(...$args) { + return $this->getListIdsForBulkImportProfilesJobRequest(...$args); + } + + /** + * Alias of `getListIdsForBulkImportProfilesJobRequest` + * + * @deprecated use `getListIdsForBulkImportProfilesJobRequest` instead + */ + public function getProfileBulkImportJobRelationshipsListsRequest(...$args) { + return $this->getListIdsForBulkImportProfilesJobRequest(...$args); + } + + /** + * Operation getListIdsForProfile + * + * Get List IDs for Profile * * @param string $id (required) * @@ -5123,16 +6946,25 @@ public function getProfileListsRequest($id, $fields_list = null, $apiKey = null) * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getProfileRelationshipsLists($id, $apiKey = null) + public function getListIdsForProfile($id, $apiKey = null) { - list($response) = $this->getProfileRelationshipsListsWithHttpInfo($id, $apiKey); + list($response) = $this->getListIdsForProfileWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getProfileRelationshipsListsWithHttpInfo + * Alias of `getListIdsForProfile` + * + * @deprecated use `getListIdsForProfile` instead + */ + public function getProfileRelationshipsLists(...$args) { + return $this->getListIdsForProfile(...$args); + } + + /** + * Operation getListIdsForProfileWithHttpInfo * - * Get Profile Relationships Lists + * Get List IDs for Profile * * @param string $id (required) * @@ -5140,9 +6972,9 @@ public function getProfileRelationshipsLists($id, $apiKey = null) * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getProfileRelationshipsListsWithHttpInfo($id, $apiKey = null) + public function getListIdsForProfileWithHttpInfo($id, $apiKey = null) { - $request = $this->getProfileRelationshipsListsRequest($id, $apiKey); + $request = $this->getListIdsForProfileRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5298,18 +7130,27 @@ public function getProfileRelationshipsListsWithHttpInfo($id, $apiKey = null) } /** - * Operation getProfileRelationshipsListsAsync + * Alias of `getListIdsForProfileWithHttpInfo` * - * Get Profile Relationships Lists + * @deprecated use `getListIdsForProfileWithHttpInfo` instead + */ + public function getProfileRelationshipsListsWithHttpInfo(...$args) { + return $this->getListIdsForProfileWithHttpInfo(...$args); + } + + /** + * Operation getListIdsForProfileAsync + * + * Get List IDs for Profile * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileRelationshipsListsAsync($id, $apiKey = null) + public function getListIdsForProfileAsync($id, $apiKey = null) { - return $this->getProfileRelationshipsListsAsyncWithHttpInfo($id, $apiKey) + return $this->getListIdsForProfileAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -5318,19 +7159,28 @@ function ($response) { } /** - * Operation getProfileRelationshipsListsAsyncWithHttpInfo + * Alias of `getListIdsForProfileAsync` + * + * @deprecated use `getListIdsForProfileAsync` instead + */ + public function getProfileRelationshipsListsAsync(...$args) { + return $this->getListIdsForProfileAsync(...$args); + } + + /** + * Operation getListIdsForProfileAsyncWithHttpInfo * - * Get Profile Relationships Lists + * Get List IDs for Profile * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileRelationshipsListsAsyncWithHttpInfo($id, $apiKey = null) + public function getListIdsForProfileAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getProfileRelationshipsListsRequest($id, $apiKey); + $request = $this->getListIdsForProfileRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5374,23 +7224,32 @@ function ($exception) { } /** - * Create request for operation 'getProfileRelationshipsLists' + * Alias of `getListIdsForProfileAsyncWithHttpInfo` + * + * @deprecated use `getListIdsForProfileAsyncWithHttpInfo` instead + */ + public function getProfileRelationshipsListsAsyncWithHttpInfo(...$args) { + return $this->getListIdsForProfileAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getListIdsForProfile' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProfileRelationshipsListsRequest($id, $apiKey = null) + public function getListIdsForProfileRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getProfileRelationshipsLists' + 'Missing the required parameter $id when calling getListIdsForProfile' ); } - $resourcePath = '/api/profiles/{id}/relationships/lists/'; + $resourcePath = '/api/profiles/{id}/relationships/lists'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5411,11 +7270,11 @@ public function getProfileRelationshipsListsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5436,7 +7295,7 @@ public function getProfileRelationshipsListsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5460,7 +7319,7 @@ public function getProfileRelationshipsListsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5478,36 +7337,56 @@ public function getProfileRelationshipsListsRequest($id, $apiKey = null) } /** - * Operation getProfileRelationshipsSegments + * Alias of `getListIdsForProfileRequest` + * + * @deprecated use `getListIdsForProfileRequest` instead + */ + public function getProfileRelationshipsListsRequest(...$args) { + return $this->getListIdsForProfileRequest(...$args); + } + + /** + * Operation getListsForProfile * - * Get Profile Relationships Segments + * Get Lists for Profile * * @param string $id (required) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getProfileRelationshipsSegments($id, $apiKey = null) + public function getListsForProfile($id, $fields_list = null, $apiKey = null) { - list($response) = $this->getProfileRelationshipsSegmentsWithHttpInfo($id, $apiKey); + list($response) = $this->getListsForProfileWithHttpInfo($id, $fields_list, $apiKey); return $response; } /** - * Operation getProfileRelationshipsSegmentsWithHttpInfo + * Alias of `getListsForProfile` + * + * @deprecated use `getListsForProfile` instead + */ + public function getProfileLists(...$args) { + return $this->getListsForProfile(...$args); + } + + /** + * Operation getListsForProfileWithHttpInfo * - * Get Profile Relationships Segments + * Get Lists for Profile * * @param string $id (required) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getProfileRelationshipsSegmentsWithHttpInfo($id, $apiKey = null) + public function getListsForProfileWithHttpInfo($id, $fields_list = null, $apiKey = null) { - $request = $this->getProfileRelationshipsSegmentsRequest($id, $apiKey); + $request = $this->getListsForProfileRequest($id, $fields_list, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5663,18 +7542,28 @@ public function getProfileRelationshipsSegmentsWithHttpInfo($id, $apiKey = null) } /** - * Operation getProfileRelationshipsSegmentsAsync + * Alias of `getListsForProfileWithHttpInfo` + * + * @deprecated use `getListsForProfileWithHttpInfo` instead + */ + public function getProfileListsWithHttpInfo(...$args) { + return $this->getListsForProfileWithHttpInfo(...$args); + } + + /** + * Operation getListsForProfileAsync * - * Get Profile Relationships Segments + * Get Lists for Profile * * @param string $id (required) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileRelationshipsSegmentsAsync($id, $apiKey = null) + public function getListsForProfileAsync($id, $fields_list = null, $apiKey = null) { - return $this->getProfileRelationshipsSegmentsAsyncWithHttpInfo($id, $apiKey) + return $this->getListsForProfileAsyncWithHttpInfo($id, $fields_list, $apiKey) ->then( function ($response) { return $response[0]; @@ -5683,19 +7572,29 @@ function ($response) { } /** - * Operation getProfileRelationshipsSegmentsAsyncWithHttpInfo + * Alias of `getListsForProfileAsync` + * + * @deprecated use `getListsForProfileAsync` instead + */ + public function getProfileListsAsync(...$args) { + return $this->getListsForProfileAsync(...$args); + } + + /** + * Operation getListsForProfileAsyncWithHttpInfo * - * Get Profile Relationships Segments + * Get Lists for Profile * * @param string $id (required) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileRelationshipsSegmentsAsyncWithHttpInfo($id, $apiKey = null) + public function getListsForProfileAsyncWithHttpInfo($id, $fields_list = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getProfileRelationshipsSegmentsRequest($id, $apiKey); + $request = $this->getListsForProfileRequest($id, $fields_list, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5739,29 +7638,48 @@ function ($exception) { } /** - * Create request for operation 'getProfileRelationshipsSegments' + * Alias of `getListsForProfileAsyncWithHttpInfo` + * + * @deprecated use `getListsForProfileAsyncWithHttpInfo` instead + */ + public function getProfileListsAsyncWithHttpInfo(...$args) { + return $this->getListsForProfileAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getListsForProfile' * * @param string $id (required) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProfileRelationshipsSegmentsRequest($id, $apiKey = null) + public function getListsForProfileRequest($id, $fields_list = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getProfileRelationshipsSegments' + 'Missing the required parameter $id when calling getListsForProfile' ); } - $resourcePath = '/api/profiles/{id}/relationships/segments/'; + $resourcePath = '/api/profiles/{id}/lists'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_list, + 'fields[list]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -5776,11 +7694,11 @@ public function getProfileRelationshipsSegmentsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5801,7 +7719,7 @@ public function getProfileRelationshipsSegmentsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5825,7 +7743,7 @@ public function getProfileRelationshipsSegmentsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5843,38 +7761,55 @@ public function getProfileRelationshipsSegmentsRequest($id, $apiKey = null) } /** - * Operation getProfileSegments + * Alias of `getListsForProfileRequest` + * + * @deprecated use `getListsForProfileRequest` instead + */ + public function getProfileListsRequest(...$args) { + return $this->getListsForProfileRequest(...$args); + } + + /** + * Operation getProfile * - * Get Profile Segments + * Get Profile * * @param string $id (required) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getProfileSegments($id, $fields_segment = null, $apiKey = null) + public function getProfile($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) { - list($response) = $this->getProfileSegmentsWithHttpInfo($id, $fields_segment, $apiKey); + list($response) = $this->getProfileWithHttpInfo($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey); return $response; } /** - * Operation getProfileSegmentsWithHttpInfo + * Operation getProfileWithHttpInfo * - * Get Profile Segments + * Get Profile * * @param string $id (required) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getProfileSegmentsWithHttpInfo($id, $fields_segment = null, $apiKey = null) + public function getProfileWithHttpInfo($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) { - $request = $this->getProfileSegmentsRequest($id, $fields_segment, $apiKey); + $request = $this->getProfileRequest($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6030,19 +7965,23 @@ public function getProfileSegmentsWithHttpInfo($id, $fields_segment = null, $api } /** - * Operation getProfileSegmentsAsync + * Operation getProfileAsync * - * Get Profile Segments + * Get Profile * * @param string $id (required) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileSegmentsAsync($id, $fields_segment = null, $apiKey = null) + public function getProfileAsync($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) { - return $this->getProfileSegmentsAsyncWithHttpInfo($id, $fields_segment, $apiKey) + return $this->getProfileAsyncWithHttpInfo($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -6051,20 +7990,24 @@ function ($response) { } /** - * Operation getProfileSegmentsAsyncWithHttpInfo + * Operation getProfileAsyncWithHttpInfo * - * Get Profile Segments + * Get Profile * * @param string $id (required) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfileSegmentsAsyncWithHttpInfo($id, $fields_segment = null, $apiKey = null) + public function getProfileAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getProfileSegmentsRequest($id, $fields_segment, $apiKey); + $request = $this->getProfileRequest($id, $additional_fields_profile, $fields_list, $fields_profile, $fields_segment, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6108,30 +8051,61 @@ function ($exception) { } /** - * Create request for operation 'getProfileSegments' + * Create request for operation 'getProfile' * * @param string $id (required) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProfileSegmentsRequest($id, $fields_segment = null, $apiKey = null) + public function getProfileRequest($id, $additional_fields_profile = null, $fields_list = null, $fields_profile = null, $fields_segment = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getProfileSegments' + 'Missing the required parameter $id when calling getProfile' ); } - $resourcePath = '/api/profiles/{id}/segments/'; + $resourcePath = '/api/profiles/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $additional_fields_profile, + 'additional-fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_list, + 'fields[list]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_profile, + 'fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $fields_segment, @@ -6141,6 +8115,15 @@ public function getProfileSegmentsRequest($id, $fields_segment = null, $apiKey = false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -6155,11 +8138,11 @@ public function getProfileSegmentsRequest($id, $fields_segment = null, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6180,7 +8163,7 @@ public function getProfileSegmentsRequest($id, $fields_segment = null, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6204,7 +8187,7 @@ public function getProfileSegmentsRequest($id, $fields_segment = null, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6222,46 +8205,58 @@ public function getProfileSegmentsRequest($id, $fields_segment = null, $apiKey = } /** - * Operation getProfiles + * Operation getProfileIdsForBulkImportProfilesJob * - * Get Profiles + * Get Profile IDs for Bulk Import Profiles Job * - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.suppression.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal`<br>`subscriptions.email.marketing.suppression.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.list_id` : `equals`<br>`subscriptions.email.marketing.list_suppressions.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $id (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getProfiles($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfileIdsForBulkImportProfilesJob($id, $page_cursor = null, $page_size = 20, $apiKey = null) { - list($response) = $this->getProfilesWithHttpInfo($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getProfileIdsForBulkImportProfilesJobWithHttpInfo($id, $page_cursor, $page_size, $apiKey); return $response; } /** - * Operation getProfilesWithHttpInfo + * Alias of `getProfileIdsForBulkImportProfilesJob` * - * Get Profiles + * @deprecated use `getProfileIdsForBulkImportProfilesJob` instead + */ + public function getBulkProfileImportJobRelationshipsProfiles(...$args) { + return $this->getProfileIdsForBulkImportProfilesJob(...$args); + } + + /** + * Alias of `getProfileIdsForBulkImportProfilesJob` * - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.suppression.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal`<br>`subscriptions.email.marketing.suppression.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.list_id` : `equals`<br>`subscriptions.email.marketing.list_suppressions.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @deprecated use `getProfileIdsForBulkImportProfilesJob` instead + */ + public function getProfileBulkImportJobRelationshipsProfiles(...$args) { + return $this->getProfileIdsForBulkImportProfilesJob(...$args); + } + + /** + * Operation getProfileIdsForBulkImportProfilesJobWithHttpInfo + * + * Get Profile IDs for Bulk Import Profiles Job + * + * @param string $id (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getProfilesWithHttpInfo($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfileIdsForBulkImportProfilesJobWithHttpInfo($id, $page_cursor = null, $page_size = 20, $apiKey = null) { - $request = $this->getProfilesRequest($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getProfileIdsForBulkImportProfilesJobRequest($id, $page_cursor, $page_size, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6417,23 +8412,38 @@ public function getProfilesWithHttpInfo($additional_fields_profile = null, $fiel } /** - * Operation getProfilesAsync + * Alias of `getProfileIdsForBulkImportProfilesJobWithHttpInfo` * - * Get Profiles + * @deprecated use `getProfileIdsForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getBulkProfileImportJobRelationshipsProfilesWithHttpInfo(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Alias of `getProfileIdsForBulkImportProfilesJobWithHttpInfo` * - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.suppression.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal`<br>`subscriptions.email.marketing.suppression.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.list_id` : `equals`<br>`subscriptions.email.marketing.list_suppressions.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @deprecated use `getProfileIdsForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getProfileBulkImportJobRelationshipsProfilesWithHttpInfo(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Operation getProfileIdsForBulkImportProfilesJobAsync + * + * Get Profile IDs for Bulk Import Profiles Job + * + * @param string $id (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfilesAsync($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfileIdsForBulkImportProfilesJobAsync($id, $page_cursor = null, $page_size = 20, $apiKey = null) { - return $this->getProfilesAsyncWithHttpInfo($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo($id, $page_cursor, $page_size, $apiKey) ->then( function ($response) { return $response[0]; @@ -6442,24 +8452,39 @@ function ($response) { } /** - * Operation getProfilesAsyncWithHttpInfo + * Alias of `getProfileIdsForBulkImportProfilesJobAsync` * - * Get Profiles + * @deprecated use `getProfileIdsForBulkImportProfilesJobAsync` instead + */ + public function getBulkProfileImportJobRelationshipsProfilesAsync(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobAsync(...$args); + } + + /** + * Alias of `getProfileIdsForBulkImportProfilesJobAsync` * - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.suppression.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal`<br>`subscriptions.email.marketing.suppression.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.list_id` : `equals`<br>`subscriptions.email.marketing.list_suppressions.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @deprecated use `getProfileIdsForBulkImportProfilesJobAsync` instead + */ + public function getProfileBulkImportJobRelationshipsProfilesAsync(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobAsync(...$args); + } + + /** + * Operation getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo + * + * Get Profile IDs for Bulk Import Profiles Job + * + * @param string $id (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProfilesAsyncWithHttpInfo($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo($id, $page_cursor = null, $page_size = 20, $apiKey = null) { $returnType = 'array'; - $request = $this->getProfilesRequest($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getProfileIdsForBulkImportProfilesJobRequest($id, $page_cursor, $page_size, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6503,62 +8528,56 @@ function ($exception) { } /** - * Create request for operation 'getProfiles' + * Alias of `getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo` * - * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.suppression.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal`<br>`subscriptions.email.marketing.suppression.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.list_id` : `equals`<br>`subscriptions.email.marketing.list_suppressions.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @deprecated use `getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getBulkProfileImportJobRelationshipsProfilesAsyncWithHttpInfo(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo` + * + * @deprecated use `getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getProfileBulkImportJobRelationshipsProfilesAsyncWithHttpInfo(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getProfileIdsForBulkImportProfilesJob' + * + * @param string $id (required) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProfilesRequest($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfileIdsForBulkImportProfilesJobRequest($id, $page_cursor = null, $page_size = 20, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProfileIdsForBulkImportProfilesJob' + ); + } if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfiles, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfileIdsForBulkImportProfilesJob, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfiles, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfileIdsForBulkImportProfilesJob, must be bigger than or equal to 1.'); } - $resourcePath = '/api/profiles/'; + $resourcePath = '/api/profile-bulk-import-jobs/{id}/relationships/profiles'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $additional_fields_profile, - 'additional-fields[profile]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_profile, - 'fields[profile]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_cursor, @@ -6577,26 +8596,25 @@ public function getProfilesRequest($additional_fields_profile = null, $fields_pr true, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -6617,7 +8635,7 @@ public function getProfilesRequest($additional_fields_profile = null, $fields_pr // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6641,7 +8659,7 @@ public function getProfilesRequest($additional_fields_profile = null, $fields_pr $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6659,45 +8677,64 @@ public function getProfilesRequest($additional_fields_profile = null, $fields_pr } /** - * Operation mergeProfiles + * Alias of `getProfileIdsForBulkImportProfilesJobRequest` * - * Merge Profiles + * @deprecated use `getProfileIdsForBulkImportProfilesJobRequest` instead + */ + public function getBulkProfileImportJobRelationshipsProfilesRequest(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobRequest(...$args); + } + + /** + * Alias of `getProfileIdsForBulkImportProfilesJobRequest` * - * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query profile_merge_query (required) + * @deprecated use `getProfileIdsForBulkImportProfilesJobRequest` instead + */ + public function getProfileBulkImportJobRelationshipsProfilesRequest(...$args) { + return $this->getProfileIdsForBulkImportProfilesJobRequest(...$args); + } + + /** + * Operation getProfiles + * + * Get Profiles + * + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.reason`: `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.list_id`: `equals`<br>`subscriptions.email.marketing.suppression.reason`: `equals`<br>`subscriptions.email.marketing.suppression.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function mergeProfiles($profile_merge_query, $apiKey = null) + public function getProfiles($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - list($response) = $this->mergeProfilesWithHttpInfo($profile_merge_query, $apiKey); + list($response) = $this->getProfilesWithHttpInfo($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Alias of `mergeProfiles` - * - * @deprecated use `mergeProfiles` instead - */ - public function createProfileMerge(...$args) { - return $this->mergeProfiles(...$args); - } - - /** - * Operation mergeProfilesWithHttpInfo + * Operation getProfilesWithHttpInfo * - * Merge Profiles + * Get Profiles * - * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.reason`: `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.list_id`: `equals`<br>`subscriptions.email.marketing.suppression.reason`: `equals`<br>`subscriptions.email.marketing.suppression.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function mergeProfilesWithHttpInfo($profile_merge_query, $apiKey = null) + public function getProfilesWithHttpInfo($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - $request = $this->mergeProfilesRequest($profile_merge_query, $apiKey); + $request = $this->getProfilesRequest($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6735,7 +8772,7 @@ public function mergeProfilesWithHttpInfo($profile_merge_query, $apiKey = null) } switch($statusCode) { - case 201: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -6823,7 +8860,7 @@ public function mergeProfilesWithHttpInfo($profile_merge_query, $apiKey = null) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -6853,27 +8890,23 @@ public function mergeProfilesWithHttpInfo($profile_merge_query, $apiKey = null) } /** - * Alias of `mergeProfilesWithHttpInfo` - * - * @deprecated use `mergeProfilesWithHttpInfo` instead - */ - public function createProfileMergeWithHttpInfo(...$args) { - return $this->mergeProfilesWithHttpInfo(...$args); - } - - /** - * Operation mergeProfilesAsync + * Operation getProfilesAsync * - * Merge Profiles + * Get Profiles * - * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.reason`: `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.list_id`: `equals`<br>`subscriptions.email.marketing.suppression.reason`: `equals`<br>`subscriptions.email.marketing.suppression.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function mergeProfilesAsync($profile_merge_query, $apiKey = null) + public function getProfilesAsync($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - return $this->mergeProfilesAsyncWithHttpInfo($profile_merge_query, $apiKey) + return $this->getProfilesAsyncWithHttpInfo($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -6882,28 +8915,24 @@ function ($response) { } /** - * Alias of `mergeProfilesAsync` - * - * @deprecated use `mergeProfilesAsync` instead - */ - public function createProfileMergeAsync(...$args) { - return $this->mergeProfilesAsync(...$args); - } - - /** - * Operation mergeProfilesAsyncWithHttpInfo + * Operation getProfilesAsyncWithHttpInfo * - * Merge Profiles + * Get Profiles * - * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.reason`: `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.list_id`: `equals`<br>`subscriptions.email.marketing.suppression.reason`: `equals`<br>`subscriptions.email.marketing.suppression.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function mergeProfilesAsyncWithHttpInfo($profile_merge_query, $apiKey = null) + public function getProfilesAsyncWithHttpInfo($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->mergeProfilesRequest($profile_merge_query, $apiKey); + $request = $this->getProfilesRequest($additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6947,61 +8976,106 @@ function ($exception) { } /** - * Alias of `mergeProfilesAsyncWithHttpInfo` - * - * @deprecated use `mergeProfilesAsyncWithHttpInfo` instead - */ - public function createProfileMergeAsyncWithHttpInfo(...$args) { - return $this->mergeProfilesAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'mergeProfiles' + * Create request for operation 'getProfiles' * - * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.reason`: `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.list_id`: `equals`<br>`subscriptions.email.marketing.suppression.reason`: `equals`<br>`subscriptions.email.marketing.suppression.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function mergeProfilesRequest($profile_merge_query, $apiKey = null) + public function getProfilesRequest($additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - // verify the required parameter 'profile_merge_query' is set - if ($profile_merge_query === null || (is_array($profile_merge_query) && count($profile_merge_query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $profile_merge_query when calling mergeProfiles' - ); + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfiles, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfiles, must be bigger than or equal to 1.'); } - $resourcePath = '/api/profile-merge/'; + + $resourcePath = '/api/profiles'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $additional_fields_profile, + 'additional-fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_profile, + 'fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($profile_merge_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($profile_merge_query)); - } else { - $httpBody = $profile_merge_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7016,7 +9090,7 @@ public function mergeProfilesRequest($profile_merge_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7040,7 +9114,7 @@ public function mergeProfilesRequest($profile_merge_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7050,7 +9124,7 @@ public function mergeProfilesRequest($profile_merge_query, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7058,54 +9132,62 @@ public function mergeProfilesRequest($profile_merge_query, $apiKey = null) } /** - * Alias of `mergeProfilesRequest` - * - * @deprecated use `mergeProfilesRequest` instead - */ - public function createProfileMergeRequest(...$args) { - return $this->mergeProfilesRequest(...$args); - } - - /** - * Operation spawnBulkProfileImportJob + * Operation getProfilesForBulkImportProfilesJob * - * Spawn Bulk Profile Import Job + * Get Profiles for Bulk Import Profiles Job * - * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query profile_import_job_create_query (required) + * @param string $id (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function spawnBulkProfileImportJob($profile_import_job_create_query, $apiKey = null) + public function getProfilesForBulkImportProfilesJob($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) { - list($response) = $this->spawnBulkProfileImportJobWithHttpInfo($profile_import_job_create_query, $apiKey); + list($response) = $this->getProfilesForBulkImportProfilesJobWithHttpInfo($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey); return $response; } /** - * Alias of `spawnBulkProfileImportJob` + * Alias of `getProfilesForBulkImportProfilesJob` * - * @deprecated use `spawnBulkProfileImportJob` instead + * @deprecated use `getProfilesForBulkImportProfilesJob` instead */ - public function createProfileBulkImportJob(...$args) { - return $this->spawnBulkProfileImportJob(...$args); + public function getBulkProfileImportJobProfiles(...$args) { + return $this->getProfilesForBulkImportProfilesJob(...$args); } /** - * Operation spawnBulkProfileImportJobWithHttpInfo + * Alias of `getProfilesForBulkImportProfilesJob` * - * Spawn Bulk Profile Import Job + * @deprecated use `getProfilesForBulkImportProfilesJob` instead + */ + public function getProfileBulkImportJobProfiles(...$args) { + return $this->getProfilesForBulkImportProfilesJob(...$args); + } + + /** + * Operation getProfilesForBulkImportProfilesJobWithHttpInfo * - * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) + * Get Profiles for Bulk Import Profiles Job + * + * @param string $id (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function spawnBulkProfileImportJobWithHttpInfo($profile_import_job_create_query, $apiKey = null) + public function getProfilesForBulkImportProfilesJobWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) { - $request = $this->spawnBulkProfileImportJobRequest($profile_import_job_create_query, $apiKey); + $request = $this->getProfilesForBulkImportProfilesJobRequest($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7143,7 +9225,7 @@ public function spawnBulkProfileImportJobWithHttpInfo($profile_import_job_create } switch($statusCode) { - case 202: + case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7231,7 +9313,7 @@ public function spawnBulkProfileImportJobWithHttpInfo($profile_import_job_create } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -7261,27 +9343,40 @@ public function spawnBulkProfileImportJobWithHttpInfo($profile_import_job_create } /** - * Alias of `spawnBulkProfileImportJobWithHttpInfo` + * Alias of `getProfilesForBulkImportProfilesJobWithHttpInfo` * - * @deprecated use `spawnBulkProfileImportJobWithHttpInfo` instead + * @deprecated use `getProfilesForBulkImportProfilesJobWithHttpInfo` instead */ - public function createProfileBulkImportJobWithHttpInfo(...$args) { - return $this->spawnBulkProfileImportJobWithHttpInfo(...$args); + public function getBulkProfileImportJobProfilesWithHttpInfo(...$args) { + return $this->getProfilesForBulkImportProfilesJobWithHttpInfo(...$args); } /** - * Operation spawnBulkProfileImportJobAsync + * Alias of `getProfilesForBulkImportProfilesJobWithHttpInfo` * - * Spawn Bulk Profile Import Job + * @deprecated use `getProfilesForBulkImportProfilesJobWithHttpInfo` instead + */ + public function getProfileBulkImportJobProfilesWithHttpInfo(...$args) { + return $this->getProfilesForBulkImportProfilesJobWithHttpInfo(...$args); + } + + /** + * Operation getProfilesForBulkImportProfilesJobAsync * - * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) + * Get Profiles for Bulk Import Profiles Job + * + * @param string $id (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnBulkProfileImportJobAsync($profile_import_job_create_query, $apiKey = null) + public function getProfilesForBulkImportProfilesJobAsync($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) { - return $this->spawnBulkProfileImportJobAsyncWithHttpInfo($profile_import_job_create_query, $apiKey) + return $this->getProfilesForBulkImportProfilesJobAsyncWithHttpInfo($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey) ->then( function ($response) { return $response[0]; @@ -7290,28 +9385,41 @@ function ($response) { } /** - * Alias of `spawnBulkProfileImportJobAsync` + * Alias of `getProfilesForBulkImportProfilesJobAsync` * - * @deprecated use `spawnBulkProfileImportJobAsync` instead + * @deprecated use `getProfilesForBulkImportProfilesJobAsync` instead */ - public function createProfileBulkImportJobAsync(...$args) { - return $this->spawnBulkProfileImportJobAsync(...$args); + public function getBulkProfileImportJobProfilesAsync(...$args) { + return $this->getProfilesForBulkImportProfilesJobAsync(...$args); } /** - * Operation spawnBulkProfileImportJobAsyncWithHttpInfo + * Alias of `getProfilesForBulkImportProfilesJobAsync` * - * Spawn Bulk Profile Import Job + * @deprecated use `getProfilesForBulkImportProfilesJobAsync` instead + */ + public function getProfileBulkImportJobProfilesAsync(...$args) { + return $this->getProfilesForBulkImportProfilesJobAsync(...$args); + } + + /** + * Operation getProfilesForBulkImportProfilesJobAsyncWithHttpInfo * - * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) + * Get Profiles for Bulk Import Profiles Job + * + * @param string $id (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function spawnBulkProfileImportJobAsyncWithHttpInfo($profile_import_job_create_query, $apiKey = null) + public function getProfilesForBulkImportProfilesJobAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) { $returnType = 'array'; - $request = $this->spawnBulkProfileImportJobRequest($profile_import_job_create_query, $apiKey); + $request = $this->getProfilesForBulkImportProfilesJobRequest($id, $additional_fields_profile, $fields_profile, $page_cursor, $page_size, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7355,61 +9463,119 @@ function ($exception) { } /** - * Alias of `spawnBulkProfileImportJobAsyncWithHttpInfo` + * Alias of `getProfilesForBulkImportProfilesJobAsyncWithHttpInfo` * - * @deprecated use `spawnBulkProfileImportJobAsyncWithHttpInfo` instead + * @deprecated use `getProfilesForBulkImportProfilesJobAsyncWithHttpInfo` instead */ - public function createProfileBulkImportJobAsyncWithHttpInfo(...$args) { - return $this->spawnBulkProfileImportJobAsyncWithHttpInfo(...$args); + public function getBulkProfileImportJobProfilesAsyncWithHttpInfo(...$args) { + return $this->getProfilesForBulkImportProfilesJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'spawnBulkProfileImportJob' + * Alias of `getProfilesForBulkImportProfilesJobAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) + * @deprecated use `getProfilesForBulkImportProfilesJobAsyncWithHttpInfo` instead + */ + public function getProfileBulkImportJobProfilesAsyncWithHttpInfo(...$args) { + return $this->getProfilesForBulkImportProfilesJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getProfilesForBulkImportProfilesJob' + * + * @param string $id (required) + * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function spawnBulkProfileImportJobRequest($profile_import_job_create_query, $apiKey = null) + public function getProfilesForBulkImportProfilesJobRequest($id, $additional_fields_profile = null, $fields_profile = null, $page_cursor = null, $page_size = 20, $apiKey = null) { - // verify the required parameter 'profile_import_job_create_query' is set - if ($profile_import_job_create_query === null || (is_array($profile_import_job_create_query) && count($profile_import_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $profile_import_job_create_query when calling spawnBulkProfileImportJob' + 'Missing the required parameter $id when calling getProfilesForBulkImportProfilesJob' ); } + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfilesForBulkImportProfilesJob, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ProfilesApi.getProfilesForBulkImportProfilesJob, must be bigger than or equal to 1.'); + } - $resourcePath = '/api/profile-bulk-import-jobs/'; + + $resourcePath = '/api/profile-bulk-import-jobs/{id}/profiles'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $additional_fields_profile, + 'additional-fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_profile, + 'fields[profile]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($profile_import_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($profile_import_job_create_query)); - } else { - $httpBody = $profile_import_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7424,7 +9590,7 @@ public function spawnBulkProfileImportJobRequest($profile_import_job_create_quer // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7448,7 +9614,7 @@ public function spawnBulkProfileImportJobRequest($profile_import_job_create_quer $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7458,7 +9624,7 @@ public function spawnBulkProfileImportJobRequest($profile_import_job_create_quer $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7466,53 +9632,63 @@ public function spawnBulkProfileImportJobRequest($profile_import_job_create_quer } /** - * Alias of `spawnBulkProfileImportJobRequest` + * Alias of `getProfilesForBulkImportProfilesJobRequest` * - * @deprecated use `spawnBulkProfileImportJobRequest` instead + * @deprecated use `getProfilesForBulkImportProfilesJobRequest` instead + */ + public function getBulkProfileImportJobProfilesRequest(...$args) { + return $this->getProfilesForBulkImportProfilesJobRequest(...$args); + } + + /** + * Alias of `getProfilesForBulkImportProfilesJobRequest` + * + * @deprecated use `getProfilesForBulkImportProfilesJobRequest` instead */ - public function createProfileBulkImportJobRequest(...$args) { - return $this->spawnBulkProfileImportJobRequest(...$args); + public function getProfileBulkImportJobProfilesRequest(...$args) { + return $this->getProfilesForBulkImportProfilesJobRequest(...$args); } /** - * Operation subscribeProfiles + * Operation getSegmentIdsForProfile * - * Subscribe Profiles + * Get Segment IDs for Profile * - * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function subscribeProfiles($subscription_create_job_create_query, $apiKey = null) + public function getSegmentIdsForProfile($id, $apiKey = null) { - $this->subscribeProfilesWithHttpInfo($subscription_create_job_create_query, $apiKey); + list($response) = $this->getSegmentIdsForProfileWithHttpInfo($id, $apiKey); + return $response; } /** - * Alias of `subscribeProfiles` + * Alias of `getSegmentIdsForProfile` * - * @deprecated use `subscribeProfiles` instead + * @deprecated use `getSegmentIdsForProfile` instead */ - public function createProfileSubscriptionBulkCreateJob(...$args) { - return $this->subscribeProfiles(...$args); + public function getProfileRelationshipsSegments(...$args) { + return $this->getSegmentIdsForProfile(...$args); } /** - * Operation subscribeProfilesWithHttpInfo + * Operation getSegmentIdsForProfileWithHttpInfo * - * Subscribe Profiles + * Get Segment IDs for Profile * - * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * @param string $id (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function subscribeProfilesWithHttpInfo($subscription_create_job_create_query, $apiKey = null) + public function getSegmentIdsForProfileWithHttpInfo($id, $apiKey = null) { - $request = $this->subscribeProfilesRequest($subscription_create_job_create_query, $apiKey); + $request = $this->getSegmentIdsForProfileRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7549,10 +9725,103 @@ public function subscribeProfilesWithHttpInfo($subscription_create_job_create_qu ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7575,27 +9844,27 @@ public function subscribeProfilesWithHttpInfo($subscription_create_job_create_qu } /** - * Alias of `subscribeProfilesWithHttpInfo` + * Alias of `getSegmentIdsForProfileWithHttpInfo` * - * @deprecated use `subscribeProfilesWithHttpInfo` instead + * @deprecated use `getSegmentIdsForProfileWithHttpInfo` instead */ - public function createProfileSubscriptionBulkCreateJobWithHttpInfo(...$args) { - return $this->subscribeProfilesWithHttpInfo(...$args); + public function getProfileRelationshipsSegmentsWithHttpInfo(...$args) { + return $this->getSegmentIdsForProfileWithHttpInfo(...$args); } /** - * Operation subscribeProfilesAsync + * Operation getSegmentIdsForProfileAsync * - * Subscribe Profiles + * Get Segment IDs for Profile * - * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function subscribeProfilesAsync($subscription_create_job_create_query, $apiKey = null) + public function getSegmentIdsForProfileAsync($id, $apiKey = null) { - return $this->subscribeProfilesAsyncWithHttpInfo($subscription_create_job_create_query, $apiKey) + return $this->getSegmentIdsForProfileAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -7604,34 +9873,52 @@ function ($response) { } /** - * Alias of `subscribeProfilesAsync` + * Alias of `getSegmentIdsForProfileAsync` * - * @deprecated use `subscribeProfilesAsync` instead + * @deprecated use `getSegmentIdsForProfileAsync` instead */ - public function createProfileSubscriptionBulkCreateJobAsync(...$args) { - return $this->subscribeProfilesAsync(...$args); + public function getProfileRelationshipsSegmentsAsync(...$args) { + return $this->getSegmentIdsForProfileAsync(...$args); } /** - * Operation subscribeProfilesAsyncWithHttpInfo + * Operation getSegmentIdsForProfileAsyncWithHttpInfo * - * Subscribe Profiles + * Get Segment IDs for Profile * - * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function subscribeProfilesAsyncWithHttpInfo($subscription_create_job_create_query, $apiKey = null) + public function getSegmentIdsForProfileAsyncWithHttpInfo($id, $apiKey = null) { - $returnType = ''; - $request = $this->subscribeProfilesRequest($subscription_create_job_create_query, $apiKey); + $returnType = 'array'; + $request = $this->getSegmentIdsForProfileRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -7651,32 +9938,32 @@ function ($exception) { } /** - * Alias of `subscribeProfilesAsyncWithHttpInfo` + * Alias of `getSegmentIdsForProfileAsyncWithHttpInfo` * - * @deprecated use `subscribeProfilesAsyncWithHttpInfo` instead + * @deprecated use `getSegmentIdsForProfileAsyncWithHttpInfo` instead */ - public function createProfileSubscriptionBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->subscribeProfilesAsyncWithHttpInfo(...$args); + public function getProfileRelationshipsSegmentsAsyncWithHttpInfo(...$args) { + return $this->getSegmentIdsForProfileAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'subscribeProfiles' + * Create request for operation 'getSegmentIdsForProfile' * - * @param \KlaviyoAPI\Model\SubscriptionCreateJobCreateQuery $subscription_create_job_create_query Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed. (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function subscribeProfilesRequest($subscription_create_job_create_query, $apiKey = null) + public function getSegmentIdsForProfileRequest($id, $apiKey = null) { - // verify the required parameter 'subscription_create_job_create_query' is set - if ($subscription_create_job_create_query === null || (is_array($subscription_create_job_create_query) && count($subscription_create_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_create_job_create_query when calling subscribeProfiles' + 'Missing the required parameter $id when calling getSegmentIdsForProfile' ); } - $resourcePath = '/api/profile-subscription-bulk-create-jobs/'; + $resourcePath = '/api/profiles/{id}/relationships/segments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7685,27 +9972,29 @@ public function subscribeProfilesRequest($subscription_create_job_create_query, + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($subscription_create_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($subscription_create_job_create_query)); - } else { - $httpBody = $subscription_create_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7720,7 +10009,7 @@ public function subscribeProfilesRequest($subscription_create_job_create_query, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7744,7 +10033,7 @@ public function subscribeProfilesRequest($subscription_create_job_create_query, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7754,7 +10043,7 @@ public function subscribeProfilesRequest($subscription_create_job_create_query, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7762,53 +10051,56 @@ public function subscribeProfilesRequest($subscription_create_job_create_query, } /** - * Alias of `subscribeProfilesRequest` + * Alias of `getSegmentIdsForProfileRequest` * - * @deprecated use `subscribeProfilesRequest` instead + * @deprecated use `getSegmentIdsForProfileRequest` instead */ - public function createProfileSubscriptionBulkCreateJobRequest(...$args) { - return $this->subscribeProfilesRequest(...$args); + public function getProfileRelationshipsSegmentsRequest(...$args) { + return $this->getSegmentIdsForProfileRequest(...$args); } /** - * Operation suppressProfiles + * Operation getSegmentsForProfile * - * Suppress Profiles + * Get Segments for Profile * - * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * @param string $id (required) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function suppressProfiles($suppression_create_job_create_query, $apiKey = null) + public function getSegmentsForProfile($id, $fields_segment = null, $apiKey = null) { - $this->suppressProfilesWithHttpInfo($suppression_create_job_create_query, $apiKey); + list($response) = $this->getSegmentsForProfileWithHttpInfo($id, $fields_segment, $apiKey); + return $response; } /** - * Alias of `suppressProfiles` + * Alias of `getSegmentsForProfile` * - * @deprecated use `suppressProfiles` instead + * @deprecated use `getSegmentsForProfile` instead */ - public function createProfileSuppressionBulkCreateJob(...$args) { - return $this->suppressProfiles(...$args); + public function getProfileSegments(...$args) { + return $this->getSegmentsForProfile(...$args); } /** - * Operation suppressProfilesWithHttpInfo + * Operation getSegmentsForProfileWithHttpInfo * - * Suppress Profiles + * Get Segments for Profile * - * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * @param string $id (required) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function suppressProfilesWithHttpInfo($suppression_create_job_create_query, $apiKey = null) + public function getSegmentsForProfileWithHttpInfo($id, $fields_segment = null, $apiKey = null) { - $request = $this->suppressProfilesRequest($suppression_create_job_create_query, $apiKey); + $request = $this->getSegmentsForProfileRequest($id, $fields_segment, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7830,25 +10122,118 @@ public function suppressProfilesWithHttpInfo($suppression_create_job_create_quer ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; } - return [null, $statusCode, $response->getHeaders()]; + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7871,27 +10256,28 @@ public function suppressProfilesWithHttpInfo($suppression_create_job_create_quer } /** - * Alias of `suppressProfilesWithHttpInfo` + * Alias of `getSegmentsForProfileWithHttpInfo` * - * @deprecated use `suppressProfilesWithHttpInfo` instead + * @deprecated use `getSegmentsForProfileWithHttpInfo` instead */ - public function createProfileSuppressionBulkCreateJobWithHttpInfo(...$args) { - return $this->suppressProfilesWithHttpInfo(...$args); + public function getProfileSegmentsWithHttpInfo(...$args) { + return $this->getSegmentsForProfileWithHttpInfo(...$args); } /** - * Operation suppressProfilesAsync + * Operation getSegmentsForProfileAsync * - * Suppress Profiles + * Get Segments for Profile * - * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * @param string $id (required) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function suppressProfilesAsync($suppression_create_job_create_query, $apiKey = null) + public function getSegmentsForProfileAsync($id, $fields_segment = null, $apiKey = null) { - return $this->suppressProfilesAsyncWithHttpInfo($suppression_create_job_create_query, $apiKey) + return $this->getSegmentsForProfileAsyncWithHttpInfo($id, $fields_segment, $apiKey) ->then( function ($response) { return $response[0]; @@ -7900,34 +10286,53 @@ function ($response) { } /** - * Alias of `suppressProfilesAsync` + * Alias of `getSegmentsForProfileAsync` * - * @deprecated use `suppressProfilesAsync` instead + * @deprecated use `getSegmentsForProfileAsync` instead */ - public function createProfileSuppressionBulkCreateJobAsync(...$args) { - return $this->suppressProfilesAsync(...$args); + public function getProfileSegmentsAsync(...$args) { + return $this->getSegmentsForProfileAsync(...$args); } /** - * Operation suppressProfilesAsyncWithHttpInfo + * Operation getSegmentsForProfileAsyncWithHttpInfo * - * Suppress Profiles + * Get Segments for Profile * - * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * @param string $id (required) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function suppressProfilesAsyncWithHttpInfo($suppression_create_job_create_query, $apiKey = null) + public function getSegmentsForProfileAsyncWithHttpInfo($id, $fields_segment = null, $apiKey = null) { - $returnType = ''; - $request = $this->suppressProfilesRequest($suppression_create_job_create_query, $apiKey); + $returnType = 'array'; + $request = $this->getSegmentsForProfileRequest($id, $fields_segment, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -7947,61 +10352,73 @@ function ($exception) { } /** - * Alias of `suppressProfilesAsyncWithHttpInfo` + * Alias of `getSegmentsForProfileAsyncWithHttpInfo` * - * @deprecated use `suppressProfilesAsyncWithHttpInfo` instead + * @deprecated use `getSegmentsForProfileAsyncWithHttpInfo` instead */ - public function createProfileSuppressionBulkCreateJobAsyncWithHttpInfo(...$args) { - return $this->suppressProfilesAsyncWithHttpInfo(...$args); + public function getProfileSegmentsAsyncWithHttpInfo(...$args) { + return $this->getSegmentsForProfileAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'suppressProfiles' + * Create request for operation 'getSegmentsForProfile' * - * @param \KlaviyoAPI\Model\SuppressionCreateJobCreateQuery $suppression_create_job_create_query Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed. (required) + * @param string $id (required) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function suppressProfilesRequest($suppression_create_job_create_query, $apiKey = null) + public function getSegmentsForProfileRequest($id, $fields_segment = null, $apiKey = null) { - // verify the required parameter 'suppression_create_job_create_query' is set - if ($suppression_create_job_create_query === null || (is_array($suppression_create_job_create_query) && count($suppression_create_job_create_query) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $suppression_create_job_create_query when calling suppressProfiles' + 'Missing the required parameter $id when calling getSegmentsForProfile' ); } - $resourcePath = '/api/profile-suppression-bulk-create-jobs/'; + $resourcePath = '/api/profiles/{id}/segments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_segment, + 'fields[segment]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($suppression_create_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($suppression_create_job_create_query)); - } else { - $httpBody = $suppression_create_job_create_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -8016,7 +10433,7 @@ public function suppressProfilesRequest($suppression_create_job_create_query, $a // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8040,7 +10457,7 @@ public function suppressProfilesRequest($suppression_create_job_create_query, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8050,7 +10467,7 @@ public function suppressProfilesRequest($suppression_create_job_create_query, $a $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -8058,53 +10475,54 @@ public function suppressProfilesRequest($suppression_create_job_create_query, $a } /** - * Alias of `suppressProfilesRequest` + * Alias of `getSegmentsForProfileRequest` * - * @deprecated use `suppressProfilesRequest` instead + * @deprecated use `getSegmentsForProfileRequest` instead */ - public function createProfileSuppressionBulkCreateJobRequest(...$args) { - return $this->suppressProfilesRequest(...$args); + public function getProfileSegmentsRequest(...$args) { + return $this->getSegmentsForProfileRequest(...$args); } /** - * Operation unsubscribeProfiles + * Operation mergeProfiles * - * Unsubscribe Profiles + * Merge Profiles * - * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query profile_merge_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function unsubscribeProfiles($subscription_delete_job_create_query, $apiKey = null) + public function mergeProfiles($profile_merge_query, $apiKey = null) { - $this->unsubscribeProfilesWithHttpInfo($subscription_delete_job_create_query, $apiKey); + list($response) = $this->mergeProfilesWithHttpInfo($profile_merge_query, $apiKey); + return $response; } /** - * Alias of `unsubscribeProfiles` + * Alias of `mergeProfiles` * - * @deprecated use `unsubscribeProfiles` instead + * @deprecated use `mergeProfiles` instead */ - public function createProfileSubscriptionBulkDeleteJob(...$args) { - return $this->unsubscribeProfiles(...$args); + public function createProfileMerge(...$args) { + return $this->mergeProfiles(...$args); } /** - * Operation unsubscribeProfilesWithHttpInfo + * Operation mergeProfilesWithHttpInfo * - * Unsubscribe Profiles + * Merge Profiles * - * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function unsubscribeProfilesWithHttpInfo($subscription_delete_job_create_query, $apiKey = null) + public function mergeProfilesWithHttpInfo($profile_merge_query, $apiKey = null) { - $request = $this->unsubscribeProfilesRequest($subscription_delete_job_create_query, $apiKey); + $request = $this->mergeProfilesRequest($profile_merge_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -8141,10 +10559,103 @@ public function unsubscribeProfilesWithHttpInfo($subscription_delete_job_create_ ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 201: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8167,27 +10678,27 @@ public function unsubscribeProfilesWithHttpInfo($subscription_delete_job_create_ } /** - * Alias of `unsubscribeProfilesWithHttpInfo` + * Alias of `mergeProfilesWithHttpInfo` * - * @deprecated use `unsubscribeProfilesWithHttpInfo` instead + * @deprecated use `mergeProfilesWithHttpInfo` instead */ - public function createProfileSubscriptionBulkDeleteJobWithHttpInfo(...$args) { - return $this->unsubscribeProfilesWithHttpInfo(...$args); + public function createProfileMergeWithHttpInfo(...$args) { + return $this->mergeProfilesWithHttpInfo(...$args); } /** - * Operation unsubscribeProfilesAsync + * Operation mergeProfilesAsync * - * Unsubscribe Profiles + * Merge Profiles * - * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unsubscribeProfilesAsync($subscription_delete_job_create_query, $apiKey = null) + public function mergeProfilesAsync($profile_merge_query, $apiKey = null) { - return $this->unsubscribeProfilesAsyncWithHttpInfo($subscription_delete_job_create_query, $apiKey) + return $this->mergeProfilesAsyncWithHttpInfo($profile_merge_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -8196,34 +10707,52 @@ function ($response) { } /** - * Alias of `unsubscribeProfilesAsync` + * Alias of `mergeProfilesAsync` * - * @deprecated use `unsubscribeProfilesAsync` instead + * @deprecated use `mergeProfilesAsync` instead */ - public function createProfileSubscriptionBulkDeleteJobAsync(...$args) { - return $this->unsubscribeProfilesAsync(...$args); + public function createProfileMergeAsync(...$args) { + return $this->mergeProfilesAsync(...$args); } /** - * Operation unsubscribeProfilesAsyncWithHttpInfo + * Operation mergeProfilesAsyncWithHttpInfo * - * Unsubscribe Profiles + * Merge Profiles * - * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unsubscribeProfilesAsyncWithHttpInfo($subscription_delete_job_create_query, $apiKey = null) + public function mergeProfilesAsyncWithHttpInfo($profile_merge_query, $apiKey = null) { - $returnType = ''; - $request = $this->unsubscribeProfilesRequest($subscription_delete_job_create_query, $apiKey); + $returnType = 'array'; + $request = $this->mergeProfilesRequest($profile_merge_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -8243,32 +10772,32 @@ function ($exception) { } /** - * Alias of `unsubscribeProfilesAsyncWithHttpInfo` + * Alias of `mergeProfilesAsyncWithHttpInfo` * - * @deprecated use `unsubscribeProfilesAsyncWithHttpInfo` instead + * @deprecated use `mergeProfilesAsyncWithHttpInfo` instead */ - public function createProfileSubscriptionBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->unsubscribeProfilesAsyncWithHttpInfo(...$args); + public function createProfileMergeAsyncWithHttpInfo(...$args) { + return $this->mergeProfilesAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'unsubscribeProfiles' + * Create request for operation 'mergeProfiles' * - * @param \KlaviyoAPI\Model\SubscriptionDeleteJobCreateQuery $subscription_delete_job_create_query Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed. (required) + * @param \KlaviyoAPI\Model\ProfileMergeQuery $profile_merge_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function unsubscribeProfilesRequest($subscription_delete_job_create_query, $apiKey = null) + public function mergeProfilesRequest($profile_merge_query, $apiKey = null) { - // verify the required parameter 'subscription_delete_job_create_query' is set - if ($subscription_delete_job_create_query === null || (is_array($subscription_delete_job_create_query) && count($subscription_delete_job_create_query) === 0)) { + // verify the required parameter 'profile_merge_query' is set + if ($profile_merge_query === null || (is_array($profile_merge_query) && count($profile_merge_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_delete_job_create_query when calling unsubscribeProfiles' + 'Missing the required parameter $profile_merge_query when calling mergeProfiles' ); } - $resourcePath = '/api/profile-subscription-bulk-delete-jobs/'; + $resourcePath = '/api/profile-merge'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8281,21 +10810,21 @@ public function unsubscribeProfilesRequest($subscription_delete_job_create_query if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($subscription_delete_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($subscription_delete_job_create_query)); + if (isset($profile_merge_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($profile_merge_query)); } else { - $httpBody = $subscription_delete_job_create_query; + $httpBody = $profile_merge_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8312,7 +10841,7 @@ public function unsubscribeProfilesRequest($subscription_delete_job_create_query // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8336,7 +10865,7 @@ public function unsubscribeProfilesRequest($subscription_delete_job_create_query $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8354,53 +10883,63 @@ public function unsubscribeProfilesRequest($subscription_delete_job_create_query } /** - * Alias of `unsubscribeProfilesRequest` + * Alias of `mergeProfilesRequest` * - * @deprecated use `unsubscribeProfilesRequest` instead + * @deprecated use `mergeProfilesRequest` instead */ - public function createProfileSubscriptionBulkDeleteJobRequest(...$args) { - return $this->unsubscribeProfilesRequest(...$args); + public function createProfileMergeRequest(...$args) { + return $this->mergeProfilesRequest(...$args); } /** - * Operation unsuppressProfiles + * Operation spawnBulkProfileImportJob * - * Unsuppress Profiles + * Spawn Bulk Profile Import Job * - * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query profile_import_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function unsuppressProfiles($suppression_delete_job_create_query, $apiKey = null) + public function spawnBulkProfileImportJob($profile_import_job_create_query, $apiKey = null) { - $this->unsuppressProfilesWithHttpInfo($suppression_delete_job_create_query, $apiKey); + list($response) = $this->spawnBulkProfileImportJobWithHttpInfo($profile_import_job_create_query, $apiKey); + return $response; } /** - * Alias of `unsuppressProfiles` + * Alias of `spawnBulkProfileImportJob` * - * @deprecated use `unsuppressProfiles` instead + * @deprecated use `spawnBulkProfileImportJob` instead */ - public function createProfileSuppressionBulkDeleteJob(...$args) { - return $this->unsuppressProfiles(...$args); + public function bulkImportProfiles(...$args) { + return $this->spawnBulkProfileImportJob(...$args); + } + + /** + * Alias of `spawnBulkProfileImportJob` + * + * @deprecated use `spawnBulkProfileImportJob` instead + */ + public function createProfileBulkImportJob(...$args) { + return $this->spawnBulkProfileImportJob(...$args); } /** - * Operation unsuppressProfilesWithHttpInfo + * Operation spawnBulkProfileImportJobWithHttpInfo * - * Unsuppress Profiles + * Spawn Bulk Profile Import Job * - * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function unsuppressProfilesWithHttpInfo($suppression_delete_job_create_query, $apiKey = null) + public function spawnBulkProfileImportJobWithHttpInfo($profile_import_job_create_query, $apiKey = null) { - $request = $this->unsuppressProfilesRequest($suppression_delete_job_create_query, $apiKey); + $request = $this->spawnBulkProfileImportJobRequest($profile_import_job_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -8437,10 +10976,103 @@ public function unsuppressProfilesWithHttpInfo($suppression_delete_job_create_qu ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 202: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8463,27 +11095,36 @@ public function unsuppressProfilesWithHttpInfo($suppression_delete_job_create_qu } /** - * Alias of `unsuppressProfilesWithHttpInfo` + * Alias of `spawnBulkProfileImportJobWithHttpInfo` * - * @deprecated use `unsuppressProfilesWithHttpInfo` instead + * @deprecated use `spawnBulkProfileImportJobWithHttpInfo` instead */ - public function createProfileSuppressionBulkDeleteJobWithHttpInfo(...$args) { - return $this->unsuppressProfilesWithHttpInfo(...$args); + public function bulkImportProfilesWithHttpInfo(...$args) { + return $this->spawnBulkProfileImportJobWithHttpInfo(...$args); + } + + /** + * Alias of `spawnBulkProfileImportJobWithHttpInfo` + * + * @deprecated use `spawnBulkProfileImportJobWithHttpInfo` instead + */ + public function createProfileBulkImportJobWithHttpInfo(...$args) { + return $this->spawnBulkProfileImportJobWithHttpInfo(...$args); } /** - * Operation unsuppressProfilesAsync + * Operation spawnBulkProfileImportJobAsync * - * Unsuppress Profiles + * Spawn Bulk Profile Import Job * - * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unsuppressProfilesAsync($suppression_delete_job_create_query, $apiKey = null) + public function spawnBulkProfileImportJobAsync($profile_import_job_create_query, $apiKey = null) { - return $this->unsuppressProfilesAsyncWithHttpInfo($suppression_delete_job_create_query, $apiKey) + return $this->spawnBulkProfileImportJobAsyncWithHttpInfo($profile_import_job_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -8492,34 +11133,61 @@ function ($response) { } /** - * Alias of `unsuppressProfilesAsync` + * Alias of `spawnBulkProfileImportJobAsync` + * + * @deprecated use `spawnBulkProfileImportJobAsync` instead + */ + public function bulkImportProfilesAsync(...$args) { + return $this->spawnBulkProfileImportJobAsync(...$args); + } + + /** + * Alias of `spawnBulkProfileImportJobAsync` * - * @deprecated use `unsuppressProfilesAsync` instead + * @deprecated use `spawnBulkProfileImportJobAsync` instead */ - public function createProfileSuppressionBulkDeleteJobAsync(...$args) { - return $this->unsuppressProfilesAsync(...$args); + public function createProfileBulkImportJobAsync(...$args) { + return $this->spawnBulkProfileImportJobAsync(...$args); } /** - * Operation unsuppressProfilesAsyncWithHttpInfo + * Operation spawnBulkProfileImportJobAsyncWithHttpInfo * - * Unsuppress Profiles + * Spawn Bulk Profile Import Job * - * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unsuppressProfilesAsyncWithHttpInfo($suppression_delete_job_create_query, $apiKey = null) + public function spawnBulkProfileImportJobAsyncWithHttpInfo($profile_import_job_create_query, $apiKey = null) { - $returnType = ''; - $request = $this->unsuppressProfilesRequest($suppression_delete_job_create_query, $apiKey); + $returnType = 'array'; + $request = $this->spawnBulkProfileImportJobRequest($profile_import_job_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -8539,32 +11207,41 @@ function ($exception) { } /** - * Alias of `unsuppressProfilesAsyncWithHttpInfo` + * Alias of `spawnBulkProfileImportJobAsyncWithHttpInfo` * - * @deprecated use `unsuppressProfilesAsyncWithHttpInfo` instead + * @deprecated use `spawnBulkProfileImportJobAsyncWithHttpInfo` instead */ - public function createProfileSuppressionBulkDeleteJobAsyncWithHttpInfo(...$args) { - return $this->unsuppressProfilesAsyncWithHttpInfo(...$args); + public function bulkImportProfilesAsyncWithHttpInfo(...$args) { + return $this->spawnBulkProfileImportJobAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'unsuppressProfiles' + * Alias of `spawnBulkProfileImportJobAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\SuppressionDeleteJobCreateQuery $suppression_delete_job_create_query Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken. (required) + * @deprecated use `spawnBulkProfileImportJobAsyncWithHttpInfo` instead + */ + public function createProfileBulkImportJobAsyncWithHttpInfo(...$args) { + return $this->spawnBulkProfileImportJobAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'spawnBulkProfileImportJob' + * + * @param \KlaviyoAPI\Model\ProfileImportJobCreateQuery $profile_import_job_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function unsuppressProfilesRequest($suppression_delete_job_create_query, $apiKey = null) + public function spawnBulkProfileImportJobRequest($profile_import_job_create_query, $apiKey = null) { - // verify the required parameter 'suppression_delete_job_create_query' is set - if ($suppression_delete_job_create_query === null || (is_array($suppression_delete_job_create_query) && count($suppression_delete_job_create_query) === 0)) { + // verify the required parameter 'profile_import_job_create_query' is set + if ($profile_import_job_create_query === null || (is_array($profile_import_job_create_query) && count($profile_import_job_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $suppression_delete_job_create_query when calling unsuppressProfiles' + 'Missing the required parameter $profile_import_job_create_query when calling spawnBulkProfileImportJob' ); } - $resourcePath = '/api/profile-suppression-bulk-delete-jobs/'; + $resourcePath = '/api/profile-bulk-import-jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8577,21 +11254,21 @@ public function unsuppressProfilesRequest($suppression_delete_job_create_query, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($suppression_delete_job_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($suppression_delete_job_create_query)); + if (isset($profile_import_job_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($profile_import_job_create_query)); } else { - $httpBody = $suppression_delete_job_create_query; + $httpBody = $profile_import_job_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8608,7 +11285,7 @@ public function unsuppressProfilesRequest($suppression_delete_job_create_query, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8632,7 +11309,7 @@ public function unsuppressProfilesRequest($suppression_delete_job_create_query, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8650,12 +11327,21 @@ public function unsuppressProfilesRequest($suppression_delete_job_create_query, } /** - * Alias of `unsuppressProfilesRequest` + * Alias of `spawnBulkProfileImportJobRequest` * - * @deprecated use `unsuppressProfilesRequest` instead + * @deprecated use `spawnBulkProfileImportJobRequest` instead */ - public function createProfileSuppressionBulkDeleteJobRequest(...$args) { - return $this->unsuppressProfilesRequest(...$args); + public function bulkImportProfilesRequest(...$args) { + return $this->spawnBulkProfileImportJobRequest(...$args); + } + + /** + * Alias of `spawnBulkProfileImportJobRequest` + * + * @deprecated use `spawnBulkProfileImportJobRequest` instead + */ + public function createProfileBulkImportJobRequest(...$args) { + return $this->spawnBulkProfileImportJobRequest(...$args); } /** @@ -8947,7 +11633,7 @@ public function updateProfileRequest($id, $profile_partial_update_query, $apiKey ); } - $resourcePath = '/api/profiles/{id}/'; + $resourcePath = '/api/profiles/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8968,18 +11654,18 @@ public function updateProfileRequest($id, $profile_partial_update_query, $apiKey if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($profile_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($profile_partial_update_query)); } else { $httpBody = $profile_partial_update_query; @@ -8999,7 +11685,7 @@ public function updateProfileRequest($id, $profile_partial_update_query, $apiKey // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -9023,7 +11709,7 @@ public function updateProfileRequest($id, $profile_partial_update_query, $apiKey $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/ReportingApi.php b/lib/API/ReportingApi.php index e2053f9..81ef50c 100644 --- a/lib/API/ReportingApi.php +++ b/lib/API/ReportingApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -122,7 +122,7 @@ public function getConfig() * Query Campaign Values * * @param \KlaviyoAPI\Model\CampaignValuesRequestDTO $campaign_values_request_dto campaign_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -149,7 +149,7 @@ public function createCampaignValueReport(...$args) { * Query Campaign Values * * @param \KlaviyoAPI\Model\CampaignValuesRequestDTO $campaign_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -327,7 +327,7 @@ public function createCampaignValueReportWithHttpInfo(...$args) { * Query Campaign Values * * @param \KlaviyoAPI\Model\CampaignValuesRequestDTO $campaign_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -357,7 +357,7 @@ public function createCampaignValueReportAsync(...$args) { * Query Campaign Values * * @param \KlaviyoAPI\Model\CampaignValuesRequestDTO $campaign_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -421,7 +421,7 @@ public function createCampaignValueReportAsyncWithHttpInfo(...$args) { * Create request for operation 'queryCampaignValues' * * @param \KlaviyoAPI\Model\CampaignValuesRequestDTO $campaign_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -435,7 +435,7 @@ public function queryCampaignValuesRequest($campaign_values_request_dto, $page_c ); } - $resourcePath = '/api/campaign-values-reports/'; + $resourcePath = '/api/campaign-values-reports'; $formParams = []; $queryParams = []; $headerParams = []; @@ -457,18 +457,18 @@ public function queryCampaignValuesRequest($campaign_values_request_dto, $page_c if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($campaign_values_request_dto)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($campaign_values_request_dto)); } else { $httpBody = $campaign_values_request_dto; @@ -488,7 +488,7 @@ public function queryCampaignValuesRequest($campaign_values_request_dto, $page_c // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -512,7 +512,7 @@ public function queryCampaignValuesRequest($campaign_values_request_dto, $page_c $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -544,7 +544,7 @@ public function createCampaignValueReportRequest(...$args) { * Query Flow Series * * @param \KlaviyoAPI\Model\FlowSeriesRequestDTO $flow_series_request_dto flow_series_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -571,7 +571,7 @@ public function createFlowSeryReport(...$args) { * Query Flow Series * * @param \KlaviyoAPI\Model\FlowSeriesRequestDTO $flow_series_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -749,7 +749,7 @@ public function createFlowSeryReportWithHttpInfo(...$args) { * Query Flow Series * * @param \KlaviyoAPI\Model\FlowSeriesRequestDTO $flow_series_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -779,7 +779,7 @@ public function createFlowSeryReportAsync(...$args) { * Query Flow Series * * @param \KlaviyoAPI\Model\FlowSeriesRequestDTO $flow_series_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -843,7 +843,7 @@ public function createFlowSeryReportAsyncWithHttpInfo(...$args) { * Create request for operation 'queryFlowSeries' * * @param \KlaviyoAPI\Model\FlowSeriesRequestDTO $flow_series_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -857,7 +857,7 @@ public function queryFlowSeriesRequest($flow_series_request_dto, $page_cursor = ); } - $resourcePath = '/api/flow-series-reports/'; + $resourcePath = '/api/flow-series-reports'; $formParams = []; $queryParams = []; $headerParams = []; @@ -879,18 +879,18 @@ public function queryFlowSeriesRequest($flow_series_request_dto, $page_cursor = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($flow_series_request_dto)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($flow_series_request_dto)); } else { $httpBody = $flow_series_request_dto; @@ -910,7 +910,7 @@ public function queryFlowSeriesRequest($flow_series_request_dto, $page_cursor = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -934,7 +934,7 @@ public function queryFlowSeriesRequest($flow_series_request_dto, $page_cursor = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -966,7 +966,7 @@ public function createFlowSeryReportRequest(...$args) { * Query Flow Values * * @param \KlaviyoAPI\Model\FlowValuesRequestDTO $flow_values_request_dto flow_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -993,7 +993,7 @@ public function createFlowValueReport(...$args) { * Query Flow Values * * @param \KlaviyoAPI\Model\FlowValuesRequestDTO $flow_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1171,7 +1171,7 @@ public function createFlowValueReportWithHttpInfo(...$args) { * Query Flow Values * * @param \KlaviyoAPI\Model\FlowValuesRequestDTO $flow_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1201,7 +1201,7 @@ public function createFlowValueReportAsync(...$args) { * Query Flow Values * * @param \KlaviyoAPI\Model\FlowValuesRequestDTO $flow_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1265,7 +1265,7 @@ public function createFlowValueReportAsyncWithHttpInfo(...$args) { * Create request for operation 'queryFlowValues' * * @param \KlaviyoAPI\Model\FlowValuesRequestDTO $flow_values_request_dto (required) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1279,7 +1279,7 @@ public function queryFlowValuesRequest($flow_values_request_dto, $page_cursor = ); } - $resourcePath = '/api/flow-values-reports/'; + $resourcePath = '/api/flow-values-reports'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1301,18 +1301,18 @@ public function queryFlowValuesRequest($flow_values_request_dto, $page_cursor = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($flow_values_request_dto)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($flow_values_request_dto)); } else { $httpBody = $flow_values_request_dto; @@ -1332,7 +1332,7 @@ public function queryFlowValuesRequest($flow_values_request_dto, $page_cursor = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1356,7 +1356,7 @@ public function queryFlowValuesRequest($flow_values_request_dto, $page_cursor = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1382,6 +1382,1638 @@ public function createFlowValueReportRequest(...$args) { return $this->queryFlowValuesRequest(...$args); } + /** + * Operation queryFormSeries + * + * Query Form Series + * + * @param \KlaviyoAPI\Model\FormSeriesRequestDTO $form_series_request_dto form_series_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function queryFormSeries($form_series_request_dto, $apiKey = null) + { + list($response) = $this->queryFormSeriesWithHttpInfo($form_series_request_dto, $apiKey); + return $response; + } + + /** + * Alias of `queryFormSeries` + * + * @deprecated use `queryFormSeries` instead + */ + public function createFormSeryReport(...$args) { + return $this->queryFormSeries(...$args); + } + + /** + * Operation queryFormSeriesWithHttpInfo + * + * Query Form Series + * + * @param \KlaviyoAPI\Model\FormSeriesRequestDTO $form_series_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function queryFormSeriesWithHttpInfo($form_series_request_dto, $apiKey = null) + { + $request = $this->queryFormSeriesRequest($form_series_request_dto, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `queryFormSeriesWithHttpInfo` + * + * @deprecated use `queryFormSeriesWithHttpInfo` instead + */ + public function createFormSeryReportWithHttpInfo(...$args) { + return $this->queryFormSeriesWithHttpInfo(...$args); + } + + /** + * Operation queryFormSeriesAsync + * + * Query Form Series + * + * @param \KlaviyoAPI\Model\FormSeriesRequestDTO $form_series_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function queryFormSeriesAsync($form_series_request_dto, $apiKey = null) + { + return $this->queryFormSeriesAsyncWithHttpInfo($form_series_request_dto, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `queryFormSeriesAsync` + * + * @deprecated use `queryFormSeriesAsync` instead + */ + public function createFormSeryReportAsync(...$args) { + return $this->queryFormSeriesAsync(...$args); + } + + /** + * Operation queryFormSeriesAsyncWithHttpInfo + * + * Query Form Series + * + * @param \KlaviyoAPI\Model\FormSeriesRequestDTO $form_series_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function queryFormSeriesAsyncWithHttpInfo($form_series_request_dto, $apiKey = null) + { + $returnType = 'array'; + $request = $this->queryFormSeriesRequest($form_series_request_dto, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `queryFormSeriesAsyncWithHttpInfo` + * + * @deprecated use `queryFormSeriesAsyncWithHttpInfo` instead + */ + public function createFormSeryReportAsyncWithHttpInfo(...$args) { + return $this->queryFormSeriesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'queryFormSeries' + * + * @param \KlaviyoAPI\Model\FormSeriesRequestDTO $form_series_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function queryFormSeriesRequest($form_series_request_dto, $apiKey = null) + { + // verify the required parameter 'form_series_request_dto' is set + if ($form_series_request_dto === null || (is_array($form_series_request_dto) && count($form_series_request_dto) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $form_series_request_dto when calling queryFormSeries' + ); + } + + $resourcePath = '/api/form-series-reports'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($form_series_request_dto)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($form_series_request_dto)); + } else { + $httpBody = $form_series_request_dto; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `queryFormSeriesRequest` + * + * @deprecated use `queryFormSeriesRequest` instead + */ + public function createFormSeryReportRequest(...$args) { + return $this->queryFormSeriesRequest(...$args); + } + + /** + * Operation queryFormValues + * + * Query Form Values + * + * @param \KlaviyoAPI\Model\FormValuesRequestDTO $form_values_request_dto form_values_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function queryFormValues($form_values_request_dto, $apiKey = null) + { + list($response) = $this->queryFormValuesWithHttpInfo($form_values_request_dto, $apiKey); + return $response; + } + + /** + * Alias of `queryFormValues` + * + * @deprecated use `queryFormValues` instead + */ + public function createFormValueReport(...$args) { + return $this->queryFormValues(...$args); + } + + /** + * Operation queryFormValuesWithHttpInfo + * + * Query Form Values + * + * @param \KlaviyoAPI\Model\FormValuesRequestDTO $form_values_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function queryFormValuesWithHttpInfo($form_values_request_dto, $apiKey = null) + { + $request = $this->queryFormValuesRequest($form_values_request_dto, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `queryFormValuesWithHttpInfo` + * + * @deprecated use `queryFormValuesWithHttpInfo` instead + */ + public function createFormValueReportWithHttpInfo(...$args) { + return $this->queryFormValuesWithHttpInfo(...$args); + } + + /** + * Operation queryFormValuesAsync + * + * Query Form Values + * + * @param \KlaviyoAPI\Model\FormValuesRequestDTO $form_values_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function queryFormValuesAsync($form_values_request_dto, $apiKey = null) + { + return $this->queryFormValuesAsyncWithHttpInfo($form_values_request_dto, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `queryFormValuesAsync` + * + * @deprecated use `queryFormValuesAsync` instead + */ + public function createFormValueReportAsync(...$args) { + return $this->queryFormValuesAsync(...$args); + } + + /** + * Operation queryFormValuesAsyncWithHttpInfo + * + * Query Form Values + * + * @param \KlaviyoAPI\Model\FormValuesRequestDTO $form_values_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function queryFormValuesAsyncWithHttpInfo($form_values_request_dto, $apiKey = null) + { + $returnType = 'array'; + $request = $this->queryFormValuesRequest($form_values_request_dto, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `queryFormValuesAsyncWithHttpInfo` + * + * @deprecated use `queryFormValuesAsyncWithHttpInfo` instead + */ + public function createFormValueReportAsyncWithHttpInfo(...$args) { + return $this->queryFormValuesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'queryFormValues' + * + * @param \KlaviyoAPI\Model\FormValuesRequestDTO $form_values_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function queryFormValuesRequest($form_values_request_dto, $apiKey = null) + { + // verify the required parameter 'form_values_request_dto' is set + if ($form_values_request_dto === null || (is_array($form_values_request_dto) && count($form_values_request_dto) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $form_values_request_dto when calling queryFormValues' + ); + } + + $resourcePath = '/api/form-values-reports'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($form_values_request_dto)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($form_values_request_dto)); + } else { + $httpBody = $form_values_request_dto; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `queryFormValuesRequest` + * + * @deprecated use `queryFormValuesRequest` instead + */ + public function createFormValueReportRequest(...$args) { + return $this->queryFormValuesRequest(...$args); + } + + /** + * Operation querySegmentSeries + * + * Query Segment Series + * + * @param \KlaviyoAPI\Model\SegmentSeriesRequestDTO $segment_series_request_dto segment_series_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function querySegmentSeries($segment_series_request_dto, $apiKey = null) + { + list($response) = $this->querySegmentSeriesWithHttpInfo($segment_series_request_dto, $apiKey); + return $response; + } + + /** + * Alias of `querySegmentSeries` + * + * @deprecated use `querySegmentSeries` instead + */ + public function createSegmentSeryReport(...$args) { + return $this->querySegmentSeries(...$args); + } + + /** + * Operation querySegmentSeriesWithHttpInfo + * + * Query Segment Series + * + * @param \KlaviyoAPI\Model\SegmentSeriesRequestDTO $segment_series_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function querySegmentSeriesWithHttpInfo($segment_series_request_dto, $apiKey = null) + { + $request = $this->querySegmentSeriesRequest($segment_series_request_dto, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `querySegmentSeriesWithHttpInfo` + * + * @deprecated use `querySegmentSeriesWithHttpInfo` instead + */ + public function createSegmentSeryReportWithHttpInfo(...$args) { + return $this->querySegmentSeriesWithHttpInfo(...$args); + } + + /** + * Operation querySegmentSeriesAsync + * + * Query Segment Series + * + * @param \KlaviyoAPI\Model\SegmentSeriesRequestDTO $segment_series_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function querySegmentSeriesAsync($segment_series_request_dto, $apiKey = null) + { + return $this->querySegmentSeriesAsyncWithHttpInfo($segment_series_request_dto, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `querySegmentSeriesAsync` + * + * @deprecated use `querySegmentSeriesAsync` instead + */ + public function createSegmentSeryReportAsync(...$args) { + return $this->querySegmentSeriesAsync(...$args); + } + + /** + * Operation querySegmentSeriesAsyncWithHttpInfo + * + * Query Segment Series + * + * @param \KlaviyoAPI\Model\SegmentSeriesRequestDTO $segment_series_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function querySegmentSeriesAsyncWithHttpInfo($segment_series_request_dto, $apiKey = null) + { + $returnType = 'array'; + $request = $this->querySegmentSeriesRequest($segment_series_request_dto, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `querySegmentSeriesAsyncWithHttpInfo` + * + * @deprecated use `querySegmentSeriesAsyncWithHttpInfo` instead + */ + public function createSegmentSeryReportAsyncWithHttpInfo(...$args) { + return $this->querySegmentSeriesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'querySegmentSeries' + * + * @param \KlaviyoAPI\Model\SegmentSeriesRequestDTO $segment_series_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function querySegmentSeriesRequest($segment_series_request_dto, $apiKey = null) + { + // verify the required parameter 'segment_series_request_dto' is set + if ($segment_series_request_dto === null || (is_array($segment_series_request_dto) && count($segment_series_request_dto) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $segment_series_request_dto when calling querySegmentSeries' + ); + } + + $resourcePath = '/api/segment-series-reports'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($segment_series_request_dto)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($segment_series_request_dto)); + } else { + $httpBody = $segment_series_request_dto; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `querySegmentSeriesRequest` + * + * @deprecated use `querySegmentSeriesRequest` instead + */ + public function createSegmentSeryReportRequest(...$args) { + return $this->querySegmentSeriesRequest(...$args); + } + + /** + * Operation querySegmentValues + * + * Query Segment Values + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTO $segment_values_request_dto segment_values_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function querySegmentValues($segment_values_request_dto, $apiKey = null) + { + list($response) = $this->querySegmentValuesWithHttpInfo($segment_values_request_dto, $apiKey); + return $response; + } + + /** + * Alias of `querySegmentValues` + * + * @deprecated use `querySegmentValues` instead + */ + public function createSegmentValueReport(...$args) { + return $this->querySegmentValues(...$args); + } + + /** + * Operation querySegmentValuesWithHttpInfo + * + * Query Segment Values + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTO $segment_values_request_dto (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function querySegmentValuesWithHttpInfo($segment_values_request_dto, $apiKey = null) + { + $request = $this->querySegmentValuesRequest($segment_values_request_dto, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `querySegmentValuesWithHttpInfo` + * + * @deprecated use `querySegmentValuesWithHttpInfo` instead + */ + public function createSegmentValueReportWithHttpInfo(...$args) { + return $this->querySegmentValuesWithHttpInfo(...$args); + } + + /** + * Operation querySegmentValuesAsync + * + * Query Segment Values + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTO $segment_values_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function querySegmentValuesAsync($segment_values_request_dto, $apiKey = null) + { + return $this->querySegmentValuesAsyncWithHttpInfo($segment_values_request_dto, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `querySegmentValuesAsync` + * + * @deprecated use `querySegmentValuesAsync` instead + */ + public function createSegmentValueReportAsync(...$args) { + return $this->querySegmentValuesAsync(...$args); + } + + /** + * Operation querySegmentValuesAsyncWithHttpInfo + * + * Query Segment Values + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTO $segment_values_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function querySegmentValuesAsyncWithHttpInfo($segment_values_request_dto, $apiKey = null) + { + $returnType = 'array'; + $request = $this->querySegmentValuesRequest($segment_values_request_dto, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `querySegmentValuesAsyncWithHttpInfo` + * + * @deprecated use `querySegmentValuesAsyncWithHttpInfo` instead + */ + public function createSegmentValueReportAsyncWithHttpInfo(...$args) { + return $this->querySegmentValuesAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'querySegmentValues' + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTO $segment_values_request_dto (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function querySegmentValuesRequest($segment_values_request_dto, $apiKey = null) + { + // verify the required parameter 'segment_values_request_dto' is set + if ($segment_values_request_dto === null || (is_array($segment_values_request_dto) && count($segment_values_request_dto) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $segment_values_request_dto when calling querySegmentValues' + ); + } + + $resourcePath = '/api/segment-values-reports'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($segment_values_request_dto)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($segment_values_request_dto)); + } else { + $httpBody = $segment_values_request_dto; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `querySegmentValuesRequest` + * + * @deprecated use `querySegmentValuesRequest` instead + */ + public function createSegmentValueReportRequest(...$args) { + return $this->querySegmentValuesRequest(...$args); + } + /** * Create http client option * diff --git a/lib/API/ReviewsApi.php b/lib/API/ReviewsApi.php new file mode 100644 index 0000000..28a5d0c --- /dev/null +++ b/lib/API/ReviewsApi.php @@ -0,0 +1,995 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getReview + * + * Get Review + * + * @param string $id The ID of the review (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getReview($id, $fields_event = null, $fields_review = null, $include = null, $apiKey = null) + { + list($response) = $this->getReviewWithHttpInfo($id, $fields_event, $fields_review, $include, $apiKey); + return $response; + } + + /** + * Operation getReviewWithHttpInfo + * + * Get Review + * + * @param string $id The ID of the review (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getReviewWithHttpInfo($id, $fields_event = null, $fields_review = null, $include = null, $apiKey = null) + { + $request = $this->getReviewRequest($id, $fields_event, $fields_review, $include, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getReviewAsync + * + * Get Review + * + * @param string $id The ID of the review (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReviewAsync($id, $fields_event = null, $fields_review = null, $include = null, $apiKey = null) + { + return $this->getReviewAsyncWithHttpInfo($id, $fields_event, $fields_review, $include, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReviewAsyncWithHttpInfo + * + * Get Review + * + * @param string $id The ID of the review (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReviewAsyncWithHttpInfo($id, $fields_event = null, $fields_review = null, $include = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getReviewRequest($id, $fields_event, $fields_review, $include, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReview' + * + * @param string $id The ID of the review (required) + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReviewRequest($id, $fields_event = null, $fields_review = null, $include = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getReview' + ); + } + + $resourcePath = '/api/reviews/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_event, + 'fields[event]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_review, + 'fields[review]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReviews + * + * Get Reviews + * + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`created`: `greater-or-equal`, `less-or-equal`<br>`rating`: `any`, `equals`, `greater-or-equal`, `less-or-equal`<br>`id`: `any`, `equals`<br>`item.id`: `any`, `equals`<br>`content`: `contains`<br>`status`: `equals`<br>`review_type`: `equals`<br>`verified`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getReviews($fields_event = null, $fields_review = null, $filter = null, $include = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + list($response) = $this->getReviewsWithHttpInfo($fields_event, $fields_review, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); + return $response; + } + + /** + * Operation getReviewsWithHttpInfo + * + * Get Reviews + * + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`created`: `greater-or-equal`, `less-or-equal`<br>`rating`: `any`, `equals`, `greater-or-equal`, `less-or-equal`<br>`id`: `any`, `equals`<br>`item.id`: `any`, `equals`<br>`content`: `contains`<br>`status`: `equals`<br>`review_type`: `equals`<br>`verified`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getReviewsWithHttpInfo($fields_event = null, $fields_review = null, $filter = null, $include = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + $request = $this->getReviewsRequest($fields_event, $fields_review, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getReviewsAsync + * + * Get Reviews + * + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`created`: `greater-or-equal`, `less-or-equal`<br>`rating`: `any`, `equals`, `greater-or-equal`, `less-or-equal`<br>`id`: `any`, `equals`<br>`item.id`: `any`, `equals`<br>`content`: `contains`<br>`status`: `equals`<br>`review_type`: `equals`<br>`verified`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReviewsAsync($fields_event = null, $fields_review = null, $filter = null, $include = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + return $this->getReviewsAsyncWithHttpInfo($fields_event, $fields_review, $filter, $include, $page_cursor, $page_size, $sort, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReviewsAsyncWithHttpInfo + * + * Get Reviews + * + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`created`: `greater-or-equal`, `less-or-equal`<br>`rating`: `any`, `equals`, `greater-or-equal`, `less-or-equal`<br>`id`: `any`, `equals`<br>`item.id`: `any`, `equals`<br>`content`: `contains`<br>`status`: `equals`<br>`review_type`: `equals`<br>`verified`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReviewsAsyncWithHttpInfo($fields_event = null, $fields_review = null, $filter = null, $include = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getReviewsRequest($fields_event, $fields_review, $filter, $include, $page_cursor, $page_size, $sort, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReviews' + * + * @param string[] $fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`created`: `greater-or-equal`, `less-or-equal`<br>`rating`: `any`, `equals`, `greater-or-equal`, `less-or-equal`<br>`id`: `any`, `equals`<br>`item.id`: `any`, `equals`<br>`content`: `contains`<br>`status`: `equals`<br>`review_type`: `equals`<br>`verified`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReviewsRequest($fields_event = null, $fields_review = null, $filter = null, $include = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + { + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ReviewsApi.getReviews, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ReviewsApi.getReviews, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/api/reviews'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_event, + 'fields[event]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_review, + 'fields[review]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/API/SegmentsApi.php b/lib/API/SegmentsApi.php index 8d5ad0b..4abc67d 100644 --- a/lib/API/SegmentsApi.php +++ b/lib/API/SegmentsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -394,7 +394,7 @@ public function createSegmentRequest($segment_create_query, $apiKey = null) ); } - $resourcePath = '/api/segments/'; + $resourcePath = '/api/segments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -407,18 +407,18 @@ public function createSegmentRequest($segment_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($segment_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($segment_create_query)); } else { $httpBody = $segment_create_query; @@ -438,7 +438,7 @@ public function createSegmentRequest($segment_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -462,7 +462,7 @@ public function createSegmentRequest($segment_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -645,7 +645,7 @@ public function deleteSegmentRequest($id, $apiKey = null) ); } - $resourcePath = '/api/segments/{id}/'; + $resourcePath = '/api/segments/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -666,11 +666,11 @@ public function deleteSegmentRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -691,7 +691,7 @@ public function deleteSegmentRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -715,7 +715,7 @@ public function deleteSegmentRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -733,44 +733,53 @@ public function deleteSegmentRequest($id, $apiKey = null) } /** - * Operation getSegment + * Operation getProfileIdsForSegment * - * Get Segment + * Get Profile IDs for Segment * - * @param string $id (required) - * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getSegment($id, $additional_fields_segment = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) + public function getProfileIdsForSegment($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - list($response) = $this->getSegmentWithHttpInfo($id, $additional_fields_segment, $fields_segment, $fields_tag, $include, $apiKey); + list($response) = $this->getProfileIdsForSegmentWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Operation getSegmentWithHttpInfo + * Alias of `getProfileIdsForSegment` * - * Get Segment + * @deprecated use `getProfileIdsForSegment` instead + */ + public function getSegmentRelationshipsProfiles(...$args) { + return $this->getProfileIdsForSegment(...$args); + } + + /** + * Operation getProfileIdsForSegmentWithHttpInfo * - * @param string $id (required) - * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Profile IDs for Segment + * + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getSegmentWithHttpInfo($id, $additional_fields_segment = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) + public function getProfileIdsForSegmentWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - $request = $this->getSegmentRequest($id, $additional_fields_segment, $fields_segment, $fields_tag, $include, $apiKey); + $request = $this->getProfileIdsForSegmentRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -926,22 +935,31 @@ public function getSegmentWithHttpInfo($id, $additional_fields_segment = null, $ } /** - * Operation getSegmentAsync + * Alias of `getProfileIdsForSegmentWithHttpInfo` * - * Get Segment + * @deprecated use `getProfileIdsForSegmentWithHttpInfo` instead + */ + public function getSegmentRelationshipsProfilesWithHttpInfo(...$args) { + return $this->getProfileIdsForSegmentWithHttpInfo(...$args); + } + + /** + * Operation getProfileIdsForSegmentAsync * - * @param string $id (required) - * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Profile IDs for Segment + * + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentAsync($id, $additional_fields_segment = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) + public function getProfileIdsForSegmentAsync($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - return $this->getSegmentAsyncWithHttpInfo($id, $additional_fields_segment, $fields_segment, $fields_tag, $include, $apiKey) + return $this->getProfileIdsForSegmentAsyncWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -950,23 +968,32 @@ function ($response) { } /** - * Operation getSegmentAsyncWithHttpInfo + * Alias of `getProfileIdsForSegmentAsync` * - * Get Segment + * @deprecated use `getProfileIdsForSegmentAsync` instead + */ + public function getSegmentRelationshipsProfilesAsync(...$args) { + return $this->getProfileIdsForSegmentAsync(...$args); + } + + /** + * Operation getProfileIdsForSegmentAsyncWithHttpInfo * - * @param string $id (required) - * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Profile IDs for Segment + * + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentAsyncWithHttpInfo($id, $additional_fields_segment = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) + public function getProfileIdsForSegmentAsyncWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getSegmentRequest($id, $additional_fields_segment, $fields_segment, $fields_tag, $include, $apiKey); + $request = $this->getProfileIdsForSegmentRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1010,27 +1037,43 @@ function ($exception) { } /** - * Create request for operation 'getSegment' + * Alias of `getProfileIdsForSegmentAsyncWithHttpInfo` * - * @param string $id (required) - * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @deprecated use `getProfileIdsForSegmentAsyncWithHttpInfo` instead + */ + public function getSegmentRelationshipsProfilesAsyncWithHttpInfo(...$args) { + return $this->getProfileIdsForSegmentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getProfileIdsForSegment' + * + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSegmentRequest($id, $additional_fields_segment = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) + public function getProfileIdsForSegmentRequest($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getSegment' + 'Missing the required parameter $id when calling getProfileIdsForSegment' ); } + if ($page_size !== null && $page_size > 1000) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getProfileIdsForSegment, must be smaller than or equal to 1000.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getProfileIdsForSegment, must be bigger than or equal to 1.'); + } + - $resourcePath = '/api/segments/{id}/'; + $resourcePath = '/api/segments/{id}/relationships/profiles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1039,38 +1082,38 @@ public function getSegmentRequest($id, $additional_fields_segment = null, $field // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $additional_fields_segment, - 'additional-fields[segment]', // param base name - 'array', // openApiType + $filter, + 'filter', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_segment, - 'fields[segment]', // param base name - 'array', // openApiType + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType + $page_size, + 'page[size]', // param base name + 'integer', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType + $sort, + 'sort', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); @@ -1087,11 +1130,11 @@ public function getSegmentRequest($id, $additional_fields_segment = null, $field if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1112,7 +1155,7 @@ public function getSegmentRequest($id, $additional_fields_segment = null, $field // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1136,7 +1179,7 @@ public function getSegmentRequest($id, $additional_fields_segment = null, $field $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1154,48 +1197,66 @@ public function getSegmentRequest($id, $additional_fields_segment = null, $field } /** - * Operation getSegmentProfiles + * Alias of `getProfileIdsForSegmentRequest` + * + * @deprecated use `getProfileIdsForSegmentRequest` instead + */ + public function getSegmentRelationshipsProfilesRequest(...$args) { + return $this->getProfileIdsForSegmentRequest(...$args); + } + + /** + * Operation getProfilesForSegment * - * Get Segment Profiles + * Get Profiles for Segment * * @param string $id (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getSegmentProfiles($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfilesForSegment($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - list($response) = $this->getSegmentProfilesWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getProfilesForSegmentWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Operation getSegmentProfilesWithHttpInfo + * Alias of `getProfilesForSegment` + * + * @deprecated use `getProfilesForSegment` instead + */ + public function getSegmentProfiles(...$args) { + return $this->getProfilesForSegment(...$args); + } + + /** + * Operation getProfilesForSegmentWithHttpInfo * - * Get Segment Profiles + * Get Profiles for Segment * * @param string $id (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getSegmentProfilesWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfilesForSegmentWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - $request = $this->getSegmentProfilesRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getProfilesForSegmentRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1351,24 +1412,33 @@ public function getSegmentProfilesWithHttpInfo($id, $additional_fields_profile = } /** - * Operation getSegmentProfilesAsync + * Alias of `getProfilesForSegmentWithHttpInfo` + * + * @deprecated use `getProfilesForSegmentWithHttpInfo` instead + */ + public function getSegmentProfilesWithHttpInfo(...$args) { + return $this->getProfilesForSegmentWithHttpInfo(...$args); + } + + /** + * Operation getProfilesForSegmentAsync * - * Get Segment Profiles + * Get Profiles for Segment * * @param string $id (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentProfilesAsync($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfilesForSegmentAsync($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - return $this->getSegmentProfilesAsyncWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getProfilesForSegmentAsyncWithHttpInfo($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -1377,25 +1447,34 @@ function ($response) { } /** - * Operation getSegmentProfilesAsyncWithHttpInfo + * Alias of `getProfilesForSegmentAsync` + * + * @deprecated use `getProfilesForSegmentAsync` instead + */ + public function getSegmentProfilesAsync(...$args) { + return $this->getProfilesForSegmentAsync(...$args); + } + + /** + * Operation getProfilesForSegmentAsyncWithHttpInfo * - * Get Segment Profiles + * Get Profiles for Segment * * @param string $id (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentProfilesAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfilesForSegmentAsyncWithHttpInfo($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getSegmentProfilesRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getProfilesForSegmentRequest($id, $additional_fields_profile, $fields_profile, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1439,36 +1518,45 @@ function ($exception) { } /** - * Create request for operation 'getSegmentProfiles' + * Alias of `getProfilesForSegmentAsyncWithHttpInfo` + * + * @deprecated use `getProfilesForSegmentAsyncWithHttpInfo` instead + */ + public function getSegmentProfilesAsyncWithHttpInfo(...$args) { + return $this->getProfilesForSegmentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getProfilesForSegment' * * @param string $id (required) * @param string[] $additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' (optional) - * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) + * @param string[] $fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSegmentProfilesRequest($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getProfilesForSegmentRequest($id, $additional_fields_profile = null, $fields_profile = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getSegmentProfiles' + 'Missing the required parameter $id when calling getProfilesForSegment' ); } if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getSegmentProfiles, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getProfilesForSegment, must be smaller than or equal to 100.'); } if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getSegmentProfiles, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getProfilesForSegment, must be bigger than or equal to 1.'); } - $resourcePath = '/api/segments/{id}/profiles/'; + $resourcePath = '/api/segments/{id}/profiles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1543,11 +1631,11 @@ public function getSegmentProfilesRequest($id, $additional_fields_profile = null if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1568,7 +1656,7 @@ public function getSegmentProfilesRequest($id, $additional_fields_profile = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1592,7 +1680,7 @@ public function getSegmentProfilesRequest($id, $additional_fields_profile = null $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1610,44 +1698,55 @@ public function getSegmentProfilesRequest($id, $additional_fields_profile = null } /** - * Operation getSegmentRelationshipsProfiles + * Alias of `getProfilesForSegmentRequest` + * + * @deprecated use `getProfilesForSegmentRequest` instead + */ + public function getSegmentProfilesRequest(...$args) { + return $this->getProfilesForSegmentRequest(...$args); + } + + /** + * Operation getSegment * - * Get Segment Relationships Profiles + * Get Segment * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getSegmentRelationshipsProfiles($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getSegment($id, $additional_fields_segment = null, $fields_flow = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) { - list($response) = $this->getSegmentRelationshipsProfilesWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + list($response) = $this->getSegmentWithHttpInfo($id, $additional_fields_segment, $fields_flow, $fields_segment, $fields_tag, $include, $apiKey); return $response; } /** - * Operation getSegmentRelationshipsProfilesWithHttpInfo + * Operation getSegmentWithHttpInfo * - * Get Segment Relationships Profiles + * Get Segment * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getSegmentRelationshipsProfilesWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getSegmentWithHttpInfo($id, $additional_fields_segment = null, $fields_flow = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) { - $request = $this->getSegmentRelationshipsProfilesRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getSegmentRequest($id, $additional_fields_segment, $fields_flow, $fields_segment, $fields_tag, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1803,22 +1902,23 @@ public function getSegmentRelationshipsProfilesWithHttpInfo($id, $filter = null, } /** - * Operation getSegmentRelationshipsProfilesAsync + * Operation getSegmentAsync * - * Get Segment Relationships Profiles + * Get Segment * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentRelationshipsProfilesAsync($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getSegmentAsync($id, $additional_fields_segment = null, $fields_flow = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) { - return $this->getSegmentRelationshipsProfilesAsyncWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey) + return $this->getSegmentAsyncWithHttpInfo($id, $additional_fields_segment, $fields_flow, $fields_segment, $fields_tag, $include, $apiKey) ->then( function ($response) { return $response[0]; @@ -1827,23 +1927,24 @@ function ($response) { } /** - * Operation getSegmentRelationshipsProfilesAsyncWithHttpInfo + * Operation getSegmentAsyncWithHttpInfo * - * Get Segment Relationships Profiles + * Get Segment * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentRelationshipsProfilesAsyncWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getSegmentAsyncWithHttpInfo($id, $additional_fields_segment = null, $fields_flow = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getSegmentRelationshipsProfilesRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey); + $request = $this->getSegmentRequest($id, $additional_fields_segment, $fields_flow, $fields_segment, $fields_tag, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1887,34 +1988,28 @@ function ($exception) { } /** - * Create request for operation 'getSegmentRelationshipsProfiles' + * Create request for operation 'getSegment' * * @param string $id (required) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param int $page_size Default: 20. Min: 1. Max: 1000. (optional, default to 20) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSegmentRelationshipsProfilesRequest($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) + public function getSegmentRequest($id, $additional_fields_segment = null, $fields_flow = null, $fields_segment = null, $fields_tag = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getSegmentRelationshipsProfiles' + 'Missing the required parameter $id when calling getSegment' ); } - if ($page_size !== null && $page_size > 1000) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getSegmentRelationshipsProfiles, must be smaller than or equal to 1000.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling SegmentsApi.getSegmentRelationshipsProfiles, must be bigger than or equal to 1.'); - } - - $resourcePath = '/api/segments/{id}/relationships/profiles/'; + $resourcePath = '/api/segments/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1923,38 +2018,47 @@ public function getSegmentRelationshipsProfilesRequest($id, $filter = null, $pag // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType + $additional_fields_segment, + 'additional-fields[segment]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'page[size]', // param base name - 'integer', // openApiType + $fields_segment, + 'fields[segment]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType 'form', // style - true, // explode + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode false // required ) ?? []); @@ -1971,11 +2075,11 @@ public function getSegmentRelationshipsProfilesRequest($id, $filter = null, $pag if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1996,7 +2100,7 @@ public function getSegmentRelationshipsProfilesRequest($id, $filter = null, $pag // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2020,7 +2124,7 @@ public function getSegmentRelationshipsProfilesRequest($id, $filter = null, $pag $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2038,36 +2142,38 @@ public function getSegmentRelationshipsProfilesRequest($id, $filter = null, $pag } /** - * Operation getSegmentRelationshipsTags + * Operation getSegmentFlowTriggers * - * Get Segment Relationships Tags + * Get Segment Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getSegmentRelationshipsTags($id, $apiKey = null) + public function getSegmentFlowTriggers($id, $fields_flow = null, $apiKey = null) { - list($response) = $this->getSegmentRelationshipsTagsWithHttpInfo($id, $apiKey); + list($response) = $this->getSegmentFlowTriggersWithHttpInfo($id, $fields_flow, $apiKey); return $response; } /** - * Operation getSegmentRelationshipsTagsWithHttpInfo + * Operation getSegmentFlowTriggersWithHttpInfo * - * Get Segment Relationships Tags + * Get Segment Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getSegmentRelationshipsTagsWithHttpInfo($id, $apiKey = null) + public function getSegmentFlowTriggersWithHttpInfo($id, $fields_flow = null, $apiKey = null) { - $request = $this->getSegmentRelationshipsTagsRequest($id, $apiKey); + $request = $this->getSegmentFlowTriggersRequest($id, $fields_flow, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2223,18 +2329,19 @@ public function getSegmentRelationshipsTagsWithHttpInfo($id, $apiKey = null) } /** - * Operation getSegmentRelationshipsTagsAsync + * Operation getSegmentFlowTriggersAsync * - * Get Segment Relationships Tags + * Get Segment Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentRelationshipsTagsAsync($id, $apiKey = null) + public function getSegmentFlowTriggersAsync($id, $fields_flow = null, $apiKey = null) { - return $this->getSegmentRelationshipsTagsAsyncWithHttpInfo($id, $apiKey) + return $this->getSegmentFlowTriggersAsyncWithHttpInfo($id, $fields_flow, $apiKey) ->then( function ($response) { return $response[0]; @@ -2243,19 +2350,20 @@ function ($response) { } /** - * Operation getSegmentRelationshipsTagsAsyncWithHttpInfo + * Operation getSegmentFlowTriggersAsyncWithHttpInfo * - * Get Segment Relationships Tags + * Get Segment Flow Triggers * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentRelationshipsTagsAsyncWithHttpInfo($id, $apiKey = null) + public function getSegmentFlowTriggersAsyncWithHttpInfo($id, $fields_flow = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getSegmentRelationshipsTagsRequest($id, $apiKey); + $request = $this->getSegmentFlowTriggersRequest($id, $fields_flow, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2299,29 +2407,39 @@ function ($exception) { } /** - * Create request for operation 'getSegmentRelationshipsTags' + * Create request for operation 'getSegmentFlowTriggers' * - * @param string $id (required) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSegmentRelationshipsTagsRequest($id, $apiKey = null) + public function getSegmentFlowTriggersRequest($id, $fields_flow = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getSegmentRelationshipsTags' + 'Missing the required parameter $id when calling getSegmentFlowTriggers' ); } - $resourcePath = '/api/segments/{id}/relationships/tags/'; + $resourcePath = '/api/segments/{id}/flow-triggers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -2336,11 +2454,11 @@ public function getSegmentRelationshipsTagsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2361,7 +2479,7 @@ public function getSegmentRelationshipsTagsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2385,7 +2503,7 @@ public function getSegmentRelationshipsTagsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2403,38 +2521,36 @@ public function getSegmentRelationshipsTagsRequest($id, $apiKey = null) } /** - * Operation getSegmentTags + * Operation getSegmentRelationshipsFlowTriggers * - * Get Segment Tags + * Get Segment Relationships Flow Triggers * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getSegmentTags($id, $fields_tag = null, $apiKey = null) + public function getSegmentRelationshipsFlowTriggers($id, $apiKey = null) { - list($response) = $this->getSegmentTagsWithHttpInfo($id, $fields_tag, $apiKey); + list($response) = $this->getSegmentRelationshipsFlowTriggersWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getSegmentTagsWithHttpInfo + * Operation getSegmentRelationshipsFlowTriggersWithHttpInfo * - * Get Segment Tags + * Get Segment Relationships Flow Triggers * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getSegmentTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function getSegmentRelationshipsFlowTriggersWithHttpInfo($id, $apiKey = null) { - $request = $this->getSegmentTagsRequest($id, $fields_tag, $apiKey); + $request = $this->getSegmentRelationshipsFlowTriggersRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2590,19 +2706,18 @@ public function getSegmentTagsWithHttpInfo($id, $fields_tag = null, $apiKey = nu } /** - * Operation getSegmentTagsAsync + * Operation getSegmentRelationshipsFlowTriggersAsync * - * Get Segment Tags + * Get Segment Relationships Flow Triggers * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentTagsAsync($id, $fields_tag = null, $apiKey = null) + public function getSegmentRelationshipsFlowTriggersAsync($id, $apiKey = null) { - return $this->getSegmentTagsAsyncWithHttpInfo($id, $fields_tag, $apiKey) + return $this->getSegmentRelationshipsFlowTriggersAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -2611,20 +2726,19 @@ function ($response) { } /** - * Operation getSegmentTagsAsyncWithHttpInfo + * Operation getSegmentRelationshipsFlowTriggersAsyncWithHttpInfo * - * Get Segment Tags + * Get Segment Relationships Flow Triggers * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentTagsAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function getSegmentRelationshipsFlowTriggersAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getSegmentTagsRequest($id, $fields_tag, $apiKey); + $request = $this->getSegmentRelationshipsFlowTriggersRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2668,39 +2782,29 @@ function ($exception) { } /** - * Create request for operation 'getSegmentTags' + * Create request for operation 'getSegmentRelationshipsFlowTriggers' * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id Primary key that uniquely identifies this segment. Generated by Klaviyo. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSegmentTagsRequest($id, $fields_tag = null, $apiKey = null) + public function getSegmentRelationshipsFlowTriggersRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getSegmentTags' + 'Missing the required parameter $id when calling getSegmentRelationshipsFlowTriggers' ); } - $resourcePath = '/api/segments/{id}/tags/'; + $resourcePath = '/api/segments/{id}/relationships/flow-triggers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -2715,11 +2819,11 @@ public function getSegmentTagsRequest($id, $fields_tag = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2740,7 +2844,7 @@ public function getSegmentTagsRequest($id, $fields_tag = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2764,7 +2868,7 @@ public function getSegmentTagsRequest($id, $fields_tag = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2786,20 +2890,21 @@ public function getSegmentTagsRequest($id, $fields_tag = null, $apiKey = null) * * Get Segments * - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getSegments($fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getSegments($fields_flow = null, $fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getSegmentsWithHttpInfo($fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + list($response) = $this->getSegmentsWithHttpInfo($fields_flow, $fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); return $response; } @@ -2808,20 +2913,21 @@ public function getSegments($fields_segment = null, $fields_tag = null, $filter * * Get Segments * - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getSegmentsWithHttpInfo($fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getSegmentsWithHttpInfo($fields_flow = null, $fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getSegmentsRequest($fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getSegmentsRequest($fields_flow, $fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2981,19 +3087,20 @@ public function getSegmentsWithHttpInfo($fields_segment = null, $fields_tag = nu * * Get Segments * - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentsAsync($fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getSegmentsAsync($fields_flow = null, $fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getSegmentsAsyncWithHttpInfo($fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey) + return $this->getSegmentsAsyncWithHttpInfo($fields_flow, $fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -3006,20 +3113,21 @@ function ($response) { * * Get Segments * - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentsAsyncWithHttpInfo($fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getSegmentsAsyncWithHttpInfo($fields_flow = null, $fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getSegmentsRequest($fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->getSegmentsRequest($fields_flow, $fields_segment, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3065,26 +3173,36 @@ function ($exception) { /** * Create request for operation 'getSegments' * - * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSegmentsRequest($fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getSegmentsRequest($fields_flow = null, $fields_segment = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $resourcePath = '/api/segments/'; + $resourcePath = '/api/segments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_flow, + 'fields[flow]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $fields_segment, @@ -3145,11 +3263,11 @@ public function getSegmentsRequest($fields_segment = null, $fields_tag = null, $ if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -3170,7 +3288,7 @@ public function getSegmentsRequest($fields_segment = null, $fields_tag = null, $ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3194,7 +3312,7 @@ public function getSegmentsRequest($fields_segment = null, $fields_tag = null, $ $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3211,6 +3329,840 @@ public function getSegmentsRequest($fields_segment = null, $fields_tag = null, $ ); } + /** + * Operation getTagIdsForSegment + * + * Get Tag IDs for Segment + * + * @param string $id (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getTagIdsForSegment($id, $apiKey = null) + { + list($response) = $this->getTagIdsForSegmentWithHttpInfo($id, $apiKey); + return $response; + } + + /** + * Alias of `getTagIdsForSegment` + * + * @deprecated use `getTagIdsForSegment` instead + */ + public function getSegmentRelationshipsTags(...$args) { + return $this->getTagIdsForSegment(...$args); + } + + /** + * Operation getTagIdsForSegmentWithHttpInfo + * + * Get Tag IDs for Segment + * + * @param string $id (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getTagIdsForSegmentWithHttpInfo($id, $apiKey = null) + { + $request = $this->getTagIdsForSegmentRequest($id, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getTagIdsForSegmentWithHttpInfo` + * + * @deprecated use `getTagIdsForSegmentWithHttpInfo` instead + */ + public function getSegmentRelationshipsTagsWithHttpInfo(...$args) { + return $this->getTagIdsForSegmentWithHttpInfo(...$args); + } + + /** + * Operation getTagIdsForSegmentAsync + * + * Get Tag IDs for Segment + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagIdsForSegmentAsync($id, $apiKey = null) + { + return $this->getTagIdsForSegmentAsyncWithHttpInfo($id, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getTagIdsForSegmentAsync` + * + * @deprecated use `getTagIdsForSegmentAsync` instead + */ + public function getSegmentRelationshipsTagsAsync(...$args) { + return $this->getTagIdsForSegmentAsync(...$args); + } + + /** + * Operation getTagIdsForSegmentAsyncWithHttpInfo + * + * Get Tag IDs for Segment + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagIdsForSegmentAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTagIdsForSegmentRequest($id, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getTagIdsForSegmentAsyncWithHttpInfo` + * + * @deprecated use `getTagIdsForSegmentAsyncWithHttpInfo` instead + */ + public function getSegmentRelationshipsTagsAsyncWithHttpInfo(...$args) { + return $this->getTagIdsForSegmentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagIdsForSegment' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTagIdsForSegmentRequest($id, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTagIdsForSegment' + ); + } + + $resourcePath = '/api/segments/{id}/relationships/tags'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getTagIdsForSegmentRequest` + * + * @deprecated use `getTagIdsForSegmentRequest` instead + */ + public function getSegmentRelationshipsTagsRequest(...$args) { + return $this->getTagIdsForSegmentRequest(...$args); + } + + /** + * Operation getTagsForSegment + * + * Get Tags for Segment + * + * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getTagsForSegment($id, $fields_tag = null, $apiKey = null) + { + list($response) = $this->getTagsForSegmentWithHttpInfo($id, $fields_tag, $apiKey); + return $response; + } + + /** + * Alias of `getTagsForSegment` + * + * @deprecated use `getTagsForSegment` instead + */ + public function getSegmentTags(...$args) { + return $this->getTagsForSegment(...$args); + } + + /** + * Operation getTagsForSegmentWithHttpInfo + * + * Get Tags for Segment + * + * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getTagsForSegmentWithHttpInfo($id, $fields_tag = null, $apiKey = null) + { + $request = $this->getTagsForSegmentRequest($id, $fields_tag, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getTagsForSegmentWithHttpInfo` + * + * @deprecated use `getTagsForSegmentWithHttpInfo` instead + */ + public function getSegmentTagsWithHttpInfo(...$args) { + return $this->getTagsForSegmentWithHttpInfo(...$args); + } + + /** + * Operation getTagsForSegmentAsync + * + * Get Tags for Segment + * + * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagsForSegmentAsync($id, $fields_tag = null, $apiKey = null) + { + return $this->getTagsForSegmentAsyncWithHttpInfo($id, $fields_tag, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getTagsForSegmentAsync` + * + * @deprecated use `getTagsForSegmentAsync` instead + */ + public function getSegmentTagsAsync(...$args) { + return $this->getTagsForSegmentAsync(...$args); + } + + /** + * Operation getTagsForSegmentAsyncWithHttpInfo + * + * Get Tags for Segment + * + * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagsForSegmentAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTagsForSegmentRequest($id, $fields_tag, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `getTagsForSegmentAsyncWithHttpInfo` + * + * @deprecated use `getTagsForSegmentAsyncWithHttpInfo` instead + */ + public function getSegmentTagsAsyncWithHttpInfo(...$args) { + return $this->getTagsForSegmentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagsForSegment' + * + * @param string $id (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTagsForSegmentRequest($id, $fields_tag = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTagsForSegment' + ); + } + + $resourcePath = '/api/segments/{id}/tags'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `getTagsForSegmentRequest` + * + * @deprecated use `getTagsForSegmentRequest` instead + */ + public function getSegmentTagsRequest(...$args) { + return $this->getTagsForSegmentRequest(...$args); + } + /** * Operation updateSegment * @@ -3500,7 +4452,7 @@ public function updateSegmentRequest($id, $segment_partial_update_query, $apiKey ); } - $resourcePath = '/api/segments/{id}/'; + $resourcePath = '/api/segments/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3521,18 +4473,18 @@ public function updateSegmentRequest($id, $segment_partial_update_query, $apiKey if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($segment_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($segment_partial_update_query)); } else { $httpBody = $segment_partial_update_query; @@ -3552,7 +4504,7 @@ public function updateSegmentRequest($id, $segment_partial_update_query, $apiKey // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3576,7 +4528,7 @@ public function updateSegmentRequest($id, $segment_partial_update_query, $apiKey $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/TagsApi.php b/lib/API/TagsApi.php index 7f454b5..96362a3 100644 --- a/lib/API/TagsApi.php +++ b/lib/API/TagsApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -394,7 +394,7 @@ public function createTagRequest($tag_create_query, $apiKey = null) ); } - $resourcePath = '/api/tags/'; + $resourcePath = '/api/tags'; $formParams = []; $queryParams = []; $headerParams = []; @@ -407,18 +407,18 @@ public function createTagRequest($tag_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($tag_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_create_query)); } else { $httpBody = $tag_create_query; @@ -438,7 +438,7 @@ public function createTagRequest($tag_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -462,7 +462,7 @@ public function createTagRequest($tag_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -757,7 +757,7 @@ public function createTagGroupRequest($tag_group_create_query, $apiKey = null) ); } - $resourcePath = '/api/tag-groups/'; + $resourcePath = '/api/tag-groups'; $formParams = []; $queryParams = []; $headerParams = []; @@ -770,18 +770,18 @@ public function createTagGroupRequest($tag_group_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($tag_group_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_group_create_query)); } else { $httpBody = $tag_group_create_query; @@ -801,7 +801,7 @@ public function createTagGroupRequest($tag_group_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -825,7 +825,7 @@ public function createTagGroupRequest($tag_group_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -843,46 +843,35 @@ public function createTagGroupRequest($tag_group_create_query, $apiKey = null) } /** - * Operation createTagRelationshipsCampaigns + * Operation deleteTag * - * Create Tag Relationships Campaigns + * Delete Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op tag_campaign_op (required) + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createTagRelationshipsCampaigns($id, $tag_campaign_op, $apiKey = null) + public function deleteTag($id, $apiKey = null) { - $this->createTagRelationshipsCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey); - } - - /** - * Alias of `createTagRelationshipsCampaigns` - * - * @deprecated use `createTagRelationshipsCampaigns` instead - */ - public function createTagRelationshipsCampaign(...$args) { - return $this->createTagRelationshipsCampaigns(...$args); + $this->deleteTagWithHttpInfo($id, $apiKey); } /** - * Operation createTagRelationshipsCampaignsWithHttpInfo + * Operation deleteTagWithHttpInfo * - * Create Tag Relationships Campaigns + * Delete Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createTagRelationshipsCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey = null) + public function deleteTagWithHttpInfo($id, $apiKey = null) { - $request = $this->createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $apiKey); + $request = $this->deleteTagRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -945,28 +934,18 @@ public function createTagRelationshipsCampaignsWithHttpInfo($id, $tag_campaign_o } /** - * Alias of `createTagRelationshipsCampaignsWithHttpInfo` - * - * @deprecated use `createTagRelationshipsCampaignsWithHttpInfo` instead - */ - public function createTagRelationshipsCampaignWithHttpInfo(...$args) { - return $this->createTagRelationshipsCampaignsWithHttpInfo(...$args); - } - - /** - * Operation createTagRelationshipsCampaignsAsync + * Operation deleteTagAsync * - * Create Tag Relationships Campaigns + * Delete Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTagRelationshipsCampaignsAsync($id, $tag_campaign_op, $apiKey = null) + public function deleteTagAsync($id, $apiKey = null) { - return $this->createTagRelationshipsCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey) + return $this->deleteTagAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -975,29 +954,19 @@ function ($response) { } /** - * Alias of `createTagRelationshipsCampaignsAsync` - * - * @deprecated use `createTagRelationshipsCampaignsAsync` instead - */ - public function createTagRelationshipsCampaignAsync(...$args) { - return $this->createTagRelationshipsCampaignsAsync(...$args); - } - - /** - * Operation createTagRelationshipsCampaignsAsyncWithHttpInfo + * Operation deleteTagAsyncWithHttpInfo * - * Create Tag Relationships Campaigns + * Delete Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTagRelationshipsCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey = null) + public function deleteTagAsyncWithHttpInfo($id, $apiKey = null) { $returnType = ''; - $request = $this->createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $apiKey); + $request = $this->deleteTagRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1023,39 +992,23 @@ function ($exception) { } /** - * Alias of `createTagRelationshipsCampaignsAsyncWithHttpInfo` - * - * @deprecated use `createTagRelationshipsCampaignsAsyncWithHttpInfo` instead - */ - public function createTagRelationshipsCampaignAsyncWithHttpInfo(...$args) { - return $this->createTagRelationshipsCampaignsAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'createTagRelationshipsCampaigns' + * Create request for operation 'deleteTag' * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $apiKey = null) + public function deleteTagRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling createTagRelationshipsCampaigns' - ); - } - // verify the required parameter 'tag_campaign_op' is set - if ($tag_campaign_op === null || (is_array($tag_campaign_op) && count($tag_campaign_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_campaign_op when calling createTagRelationshipsCampaigns' + 'Missing the required parameter $id when calling deleteTag' ); } - $resourcePath = '/api/tags/{id}/relationships/campaigns/'; + $resourcePath = '/api/tags/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1076,23 +1029,17 @@ public function createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_campaign_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_campaign_op)); - } else { - $httpBody = $tag_campaign_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1107,7 +1054,7 @@ public function createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1131,7 +1078,7 @@ public function createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1141,7 +1088,7 @@ public function createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1149,55 +1096,36 @@ public function createTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a } /** - * Alias of `createTagRelationshipsCampaignsRequest` - * - * @deprecated use `createTagRelationshipsCampaignsRequest` instead - */ - public function createTagRelationshipsCampaignRequest(...$args) { - return $this->createTagRelationshipsCampaignsRequest(...$args); - } - - /** - * Operation createTagRelationshipsFlows + * Operation deleteTagGroup * - * Create Tag Relationships Flows + * Delete Tag Group * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op tag_flow_op (required) + * @param string $id The Tag Group ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createTagRelationshipsFlows($id, $tag_flow_op, $apiKey = null) + public function deleteTagGroup($id, $apiKey = null) { - $this->createTagRelationshipsFlowsWithHttpInfo($id, $tag_flow_op, $apiKey); - } - - /** - * Alias of `createTagRelationshipsFlows` - * - * @deprecated use `createTagRelationshipsFlows` instead - */ - public function createTagRelationshipsFlow(...$args) { - return $this->createTagRelationshipsFlows(...$args); + list($response) = $this->deleteTagGroupWithHttpInfo($id, $apiKey); + return $response; } /** - * Operation createTagRelationshipsFlowsWithHttpInfo + * Operation deleteTagGroupWithHttpInfo * - * Create Tag Relationships Flows + * Delete Tag Group * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) + * @param string $id The Tag Group ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createTagRelationshipsFlowsWithHttpInfo($id, $tag_flow_op, $apiKey = null) + public function deleteTagGroupWithHttpInfo($id, $apiKey = null) { - $request = $this->createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey); + $request = $this->deleteTagGroupRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1234,10 +1162,103 @@ public function createTagRelationshipsFlowsWithHttpInfo($id, $tag_flow_op, $apiK ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1260,28 +1281,18 @@ public function createTagRelationshipsFlowsWithHttpInfo($id, $tag_flow_op, $apiK } /** - * Alias of `createTagRelationshipsFlowsWithHttpInfo` - * - * @deprecated use `createTagRelationshipsFlowsWithHttpInfo` instead - */ - public function createTagRelationshipsFlowWithHttpInfo(...$args) { - return $this->createTagRelationshipsFlowsWithHttpInfo(...$args); - } - - /** - * Operation createTagRelationshipsFlowsAsync + * Operation deleteTagGroupAsync * - * Create Tag Relationships Flows + * Delete Tag Group * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) + * @param string $id The Tag Group ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTagRelationshipsFlowsAsync($id, $tag_flow_op, $apiKey = null) + public function deleteTagGroupAsync($id, $apiKey = null) { - return $this->createTagRelationshipsFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey) + return $this->deleteTagGroupAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -1290,35 +1301,43 @@ function ($response) { } /** - * Alias of `createTagRelationshipsFlowsAsync` - * - * @deprecated use `createTagRelationshipsFlowsAsync` instead - */ - public function createTagRelationshipsFlowAsync(...$args) { - return $this->createTagRelationshipsFlowsAsync(...$args); - } - - /** - * Operation createTagRelationshipsFlowsAsyncWithHttpInfo + * Operation deleteTagGroupAsyncWithHttpInfo * - * Create Tag Relationships Flows + * Delete Tag Group * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) + * @param string $id The Tag Group ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTagRelationshipsFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey = null) + public function deleteTagGroupAsyncWithHttpInfo($id, $apiKey = null) { - $returnType = ''; - $request = $this->createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey); + $returnType = 'array'; + $request = $this->deleteTagGroupRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1338,39 +1357,23 @@ function ($exception) { } /** - * Alias of `createTagRelationshipsFlowsAsyncWithHttpInfo` - * - * @deprecated use `createTagRelationshipsFlowsAsyncWithHttpInfo` instead - */ - public function createTagRelationshipsFlowAsyncWithHttpInfo(...$args) { - return $this->createTagRelationshipsFlowsAsyncWithHttpInfo(...$args); - } - - /** - * Create request for operation 'createTagRelationshipsFlows' + * Create request for operation 'deleteTagGroup' * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) + * @param string $id The Tag Group ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = null) + public function deleteTagGroupRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling createTagRelationshipsFlows' - ); - } - // verify the required parameter 'tag_flow_op' is set - if ($tag_flow_op === null || (is_array($tag_flow_op) && count($tag_flow_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_flow_op when calling createTagRelationshipsFlows' + 'Missing the required parameter $id when calling deleteTagGroup' ); } - $resourcePath = '/api/tags/{id}/relationships/flows/'; + $resourcePath = '/api/tag-groups/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1391,23 +1394,17 @@ public function createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_flow_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_flow_op)); - } else { - $httpBody = $tag_flow_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1422,7 +1419,7 @@ public function createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1446,7 +1443,7 @@ public function createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1456,7 +1453,7 @@ public function createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1464,55 +1461,45 @@ public function createTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = } /** - * Alias of `createTagRelationshipsFlowsRequest` + * Operation getCampaignIdsForTag * - * @deprecated use `createTagRelationshipsFlowsRequest` instead - */ - public function createTagRelationshipsFlowRequest(...$args) { - return $this->createTagRelationshipsFlowsRequest(...$args); - } - - /** - * Operation createTagRelationshipsLists - * - * Create Tag Relationships Lists + * Get Campaign IDs for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op tag_list_op (required) + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createTagRelationshipsLists($id, $tag_list_op, $apiKey = null) + public function getCampaignIdsForTag($id, $apiKey = null) { - $this->createTagRelationshipsListsWithHttpInfo($id, $tag_list_op, $apiKey); + list($response) = $this->getCampaignIdsForTagWithHttpInfo($id, $apiKey); + return $response; } /** - * Alias of `createTagRelationshipsLists` + * Alias of `getCampaignIdsForTag` * - * @deprecated use `createTagRelationshipsLists` instead + * @deprecated use `getCampaignIdsForTag` instead */ - public function createTagRelationshipsList(...$args) { - return $this->createTagRelationshipsLists(...$args); + public function getTagRelationshipsCampaigns(...$args) { + return $this->getCampaignIdsForTag(...$args); } /** - * Operation createTagRelationshipsListsWithHttpInfo + * Operation getCampaignIdsForTagWithHttpInfo * - * Create Tag Relationships Lists + * Get Campaign IDs for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createTagRelationshipsListsWithHttpInfo($id, $tag_list_op, $apiKey = null) + public function getCampaignIdsForTagWithHttpInfo($id, $apiKey = null) { - $request = $this->createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey); + $request = $this->getCampaignIdsForTagRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1549,10 +1536,103 @@ public function createTagRelationshipsListsWithHttpInfo($id, $tag_list_op, $apiK ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1575,28 +1655,27 @@ public function createTagRelationshipsListsWithHttpInfo($id, $tag_list_op, $apiK } /** - * Alias of `createTagRelationshipsListsWithHttpInfo` + * Alias of `getCampaignIdsForTagWithHttpInfo` * - * @deprecated use `createTagRelationshipsListsWithHttpInfo` instead + * @deprecated use `getCampaignIdsForTagWithHttpInfo` instead */ - public function createTagRelationshipsListWithHttpInfo(...$args) { - return $this->createTagRelationshipsListsWithHttpInfo(...$args); + public function getTagRelationshipsCampaignsWithHttpInfo(...$args) { + return $this->getCampaignIdsForTagWithHttpInfo(...$args); } /** - * Operation createTagRelationshipsListsAsync + * Operation getCampaignIdsForTagAsync * - * Create Tag Relationships Lists + * Get Campaign IDs for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTagRelationshipsListsAsync($id, $tag_list_op, $apiKey = null) + public function getCampaignIdsForTagAsync($id, $apiKey = null) { - return $this->createTagRelationshipsListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey) + return $this->getCampaignIdsForTagAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -1605,35 +1684,52 @@ function ($response) { } /** - * Alias of `createTagRelationshipsListsAsync` + * Alias of `getCampaignIdsForTagAsync` * - * @deprecated use `createTagRelationshipsListsAsync` instead + * @deprecated use `getCampaignIdsForTagAsync` instead */ - public function createTagRelationshipsListAsync(...$args) { - return $this->createTagRelationshipsListsAsync(...$args); + public function getTagRelationshipsCampaignsAsync(...$args) { + return $this->getCampaignIdsForTagAsync(...$args); } /** - * Operation createTagRelationshipsListsAsyncWithHttpInfo + * Operation getCampaignIdsForTagAsyncWithHttpInfo * - * Create Tag Relationships Lists + * Get Campaign IDs for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTagRelationshipsListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey = null) + public function getCampaignIdsForTagAsyncWithHttpInfo($id, $apiKey = null) { - $returnType = ''; - $request = $this->createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey); + $returnType = 'array'; + $request = $this->getCampaignIdsForTagRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1653,39 +1749,32 @@ function ($exception) { } /** - * Alias of `createTagRelationshipsListsAsyncWithHttpInfo` + * Alias of `getCampaignIdsForTagAsyncWithHttpInfo` * - * @deprecated use `createTagRelationshipsListsAsyncWithHttpInfo` instead + * @deprecated use `getCampaignIdsForTagAsyncWithHttpInfo` instead */ - public function createTagRelationshipsListAsyncWithHttpInfo(...$args) { - return $this->createTagRelationshipsListsAsyncWithHttpInfo(...$args); + public function getTagRelationshipsCampaignsAsyncWithHttpInfo(...$args) { + return $this->getCampaignIdsForTagAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'createTagRelationshipsLists' + * Create request for operation 'getCampaignIdsForTag' * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = null) + public function getCampaignIdsForTagRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling createTagRelationshipsLists' - ); - } - // verify the required parameter 'tag_list_op' is set - if ($tag_list_op === null || (is_array($tag_list_op) && count($tag_list_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_list_op when calling createTagRelationshipsLists' + 'Missing the required parameter $id when calling getCampaignIdsForTag' ); } - $resourcePath = '/api/tags/{id}/relationships/lists/'; + $resourcePath = '/api/tags/{id}/relationships/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1706,23 +1795,17 @@ public function createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_list_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_list_op)); - } else { - $httpBody = $tag_list_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1737,7 +1820,7 @@ public function createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1761,7 +1844,7 @@ public function createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1771,7 +1854,7 @@ public function createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1779,55 +1862,54 @@ public function createTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = } /** - * Alias of `createTagRelationshipsListsRequest` + * Alias of `getCampaignIdsForTagRequest` * - * @deprecated use `createTagRelationshipsListsRequest` instead + * @deprecated use `getCampaignIdsForTagRequest` instead */ - public function createTagRelationshipsListRequest(...$args) { - return $this->createTagRelationshipsListsRequest(...$args); + public function getTagRelationshipsCampaignsRequest(...$args) { + return $this->getCampaignIdsForTagRequest(...$args); } /** - * Operation createTagRelationshipsSegments + * Operation getFlowIdsForTag * - * Create Tag Relationships Segments + * Get Flow IDs for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op tag_segment_op (required) + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createTagRelationshipsSegments($id, $tag_segment_op, $apiKey = null) + public function getFlowIdsForTag($id, $apiKey = null) { - $this->createTagRelationshipsSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey); + list($response) = $this->getFlowIdsForTagWithHttpInfo($id, $apiKey); + return $response; } /** - * Alias of `createTagRelationshipsSegments` + * Alias of `getFlowIdsForTag` * - * @deprecated use `createTagRelationshipsSegments` instead + * @deprecated use `getFlowIdsForTag` instead */ - public function createTagRelationshipsSegment(...$args) { - return $this->createTagRelationshipsSegments(...$args); + public function getTagRelationshipsFlows(...$args) { + return $this->getFlowIdsForTag(...$args); } /** - * Operation createTagRelationshipsSegmentsWithHttpInfo + * Operation getFlowIdsForTagWithHttpInfo * - * Create Tag Relationships Segments + * Get Flow IDs for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createTagRelationshipsSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey = null) + public function getFlowIdsForTagWithHttpInfo($id, $apiKey = null) { - $request = $this->createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $apiKey); + $request = $this->getFlowIdsForTagRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1864,91 +1946,200 @@ public function createTagRelationshipsSegmentsWithHttpInfo($id, $tag_segment_op, ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - /** - * Alias of `createTagRelationshipsSegmentsWithHttpInfo` - * - * @deprecated use `createTagRelationshipsSegmentsWithHttpInfo` instead - */ - public function createTagRelationshipsSegmentWithHttpInfo(...$args) { - return $this->createTagRelationshipsSegmentsWithHttpInfo(...$args); - } + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } - /** - * Operation createTagRelationshipsSegmentsAsync - * - * Create Tag Relationships Segments - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createTagRelationshipsSegmentsAsync($id, $tag_segment_op, $apiKey = null) - { - return $this->createTagRelationshipsSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } - /** - * Alias of `createTagRelationshipsSegmentsAsync` - * - * @deprecated use `createTagRelationshipsSegmentsAsync` instead - */ - public function createTagRelationshipsSegmentAsync(...$args) { - return $this->createTagRelationshipsSegmentsAsync(...$args); - } - /** - * Operation createTagRelationshipsSegmentsAsyncWithHttpInfo - * - * Create Tag Relationships Segments - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getFlowIdsForTagWithHttpInfo` + * + * @deprecated use `getFlowIdsForTagWithHttpInfo` instead + */ + public function getTagRelationshipsFlowsWithHttpInfo(...$args) { + return $this->getFlowIdsForTagWithHttpInfo(...$args); + } + + /** + * Operation getFlowIdsForTagAsync + * + * Get Flow IDs for Tag + * + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTagRelationshipsSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey = null) + public function getFlowIdsForTagAsync($id, $apiKey = null) { - $returnType = ''; - $request = $this->createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $apiKey); + return $this->getFlowIdsForTagAsyncWithHttpInfo($id, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getFlowIdsForTagAsync` + * + * @deprecated use `getFlowIdsForTagAsync` instead + */ + public function getTagRelationshipsFlowsAsync(...$args) { + return $this->getFlowIdsForTagAsync(...$args); + } + + /** + * Operation getFlowIdsForTagAsyncWithHttpInfo + * + * Get Flow IDs for Tag + * + * @param string $id The Tag ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFlowIdsForTagAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getFlowIdsForTagRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1968,39 +2159,32 @@ function ($exception) { } /** - * Alias of `createTagRelationshipsSegmentsAsyncWithHttpInfo` + * Alias of `getFlowIdsForTagAsyncWithHttpInfo` * - * @deprecated use `createTagRelationshipsSegmentsAsyncWithHttpInfo` instead + * @deprecated use `getFlowIdsForTagAsyncWithHttpInfo` instead */ - public function createTagRelationshipsSegmentAsyncWithHttpInfo(...$args) { - return $this->createTagRelationshipsSegmentsAsyncWithHttpInfo(...$args); + public function getTagRelationshipsFlowsAsyncWithHttpInfo(...$args) { + return $this->getFlowIdsForTagAsyncWithHttpInfo(...$args); } /** - * Create request for operation 'createTagRelationshipsSegments' + * Create request for operation 'getFlowIdsForTag' * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $apiKey = null) + public function getFlowIdsForTagRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling createTagRelationshipsSegments' - ); - } - // verify the required parameter 'tag_segment_op' is set - if ($tag_segment_op === null || (is_array($tag_segment_op) && count($tag_segment_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_segment_op when calling createTagRelationshipsSegments' + 'Missing the required parameter $id when calling getFlowIdsForTag' ); } - $resourcePath = '/api/tags/{id}/relationships/segments/'; + $resourcePath = '/api/tags/{id}/relationships/flows'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2021,23 +2205,17 @@ public function createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_segment_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_segment_op)); - } else { - $httpBody = $tag_segment_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2052,7 +2230,7 @@ public function createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2076,7 +2254,7 @@ public function createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2086,7 +2264,7 @@ public function createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2094,44 +2272,54 @@ public function createTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api } /** - * Alias of `createTagRelationshipsSegmentsRequest` + * Alias of `getFlowIdsForTagRequest` * - * @deprecated use `createTagRelationshipsSegmentsRequest` instead + * @deprecated use `getFlowIdsForTagRequest` instead */ - public function createTagRelationshipsSegmentRequest(...$args) { - return $this->createTagRelationshipsSegmentsRequest(...$args); + public function getTagRelationshipsFlowsRequest(...$args) { + return $this->getFlowIdsForTagRequest(...$args); } /** - * Operation deleteTag + * Operation getListIdsForTag * - * Delete Tag + * Get List IDs for Tag * * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteTag($id, $apiKey = null) + public function getListIdsForTag($id, $apiKey = null) { - $this->deleteTagWithHttpInfo($id, $apiKey); + list($response) = $this->getListIdsForTagWithHttpInfo($id, $apiKey); + return $response; } /** - * Operation deleteTagWithHttpInfo + * Alias of `getListIdsForTag` * - * Delete Tag + * @deprecated use `getListIdsForTag` instead + */ + public function getTagRelationshipsLists(...$args) { + return $this->getListIdsForTag(...$args); + } + + /** + * Operation getListIdsForTagWithHttpInfo + * + * Get List IDs for Tag * * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTagWithHttpInfo($id, $apiKey = null) + public function getListIdsForTagWithHttpInfo($id, $apiKey = null) { - $request = $this->deleteTagRequest($id, $apiKey); + $request = $this->getListIdsForTagRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2168,44 +2356,146 @@ public function deleteTagWithHttpInfo($id, $apiKey = null) ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - } catch (ApiException $e) { - switch ($e->getCode()) { + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; } - throw $e; - } - } - /** - * Operation deleteTagAsync + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getListIdsForTagWithHttpInfo` * - * Delete Tag + * @deprecated use `getListIdsForTagWithHttpInfo` instead + */ + public function getTagRelationshipsListsWithHttpInfo(...$args) { + return $this->getListIdsForTagWithHttpInfo(...$args); + } + + /** + * Operation getListIdsForTagAsync + * + * Get List IDs for Tag * * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagAsync($id, $apiKey = null) + public function getListIdsForTagAsync($id, $apiKey = null) { - return $this->deleteTagAsyncWithHttpInfo($id, $apiKey) + return $this->getListIdsForTagAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -2214,25 +2504,52 @@ function ($response) { } /** - * Operation deleteTagAsyncWithHttpInfo + * Alias of `getListIdsForTagAsync` * - * Delete Tag + * @deprecated use `getListIdsForTagAsync` instead + */ + public function getTagRelationshipsListsAsync(...$args) { + return $this->getListIdsForTagAsync(...$args); + } + + /** + * Operation getListIdsForTagAsyncWithHttpInfo + * + * Get List IDs for Tag * * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagAsyncWithHttpInfo($id, $apiKey = null) + public function getListIdsForTagAsyncWithHttpInfo($id, $apiKey = null) { - $returnType = ''; - $request = $this->deleteTagRequest($id, $apiKey); + $returnType = 'array'; + $request = $this->getListIdsForTagRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2252,23 +2569,32 @@ function ($exception) { } /** - * Create request for operation 'deleteTag' + * Alias of `getListIdsForTagAsyncWithHttpInfo` + * + * @deprecated use `getListIdsForTagAsyncWithHttpInfo` instead + */ + public function getTagRelationshipsListsAsyncWithHttpInfo(...$args) { + return $this->getListIdsForTagAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getListIdsForTag' * * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteTagRequest($id, $apiKey = null) + public function getListIdsForTagRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteTag' + 'Missing the required parameter $id when calling getListIdsForTag' ); } - $resourcePath = '/api/tags/{id}/'; + $resourcePath = '/api/tags/{id}/relationships/lists'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2289,11 +2615,11 @@ public function deleteTagRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2314,7 +2640,7 @@ public function deleteTagRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2338,7 +2664,7 @@ public function deleteTagRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2348,7 +2674,7 @@ public function deleteTagRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2356,36 +2682,54 @@ public function deleteTagRequest($id, $apiKey = null) } /** - * Operation deleteTagGroup + * Alias of `getListIdsForTagRequest` * - * Delete Tag Group + * @deprecated use `getListIdsForTagRequest` instead + */ + public function getTagRelationshipsListsRequest(...$args) { + return $this->getListIdsForTagRequest(...$args); + } + + /** + * Operation getSegmentIdsForTag * - * @param string $id The Tag Group ID (required) + * Get Segment IDs for Tag + * + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteTagGroup($id, $apiKey = null) + public function getSegmentIdsForTag($id, $apiKey = null) { - list($response) = $this->deleteTagGroupWithHttpInfo($id, $apiKey); + list($response) = $this->getSegmentIdsForTagWithHttpInfo($id, $apiKey); return $response; } /** - * Operation deleteTagGroupWithHttpInfo + * Alias of `getSegmentIdsForTag` * - * Delete Tag Group + * @deprecated use `getSegmentIdsForTag` instead + */ + public function getTagRelationshipsSegments(...$args) { + return $this->getSegmentIdsForTag(...$args); + } + + /** + * Operation getSegmentIdsForTagWithHttpInfo * - * @param string $id The Tag Group ID (required) + * Get Segment IDs for Tag + * + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTagGroupWithHttpInfo($id, $apiKey = null) + public function getSegmentIdsForTagWithHttpInfo($id, $apiKey = null) { - $request = $this->deleteTagGroupRequest($id, $apiKey); + $request = $this->getSegmentIdsForTagRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2541,18 +2885,27 @@ public function deleteTagGroupWithHttpInfo($id, $apiKey = null) } /** - * Operation deleteTagGroupAsync + * Alias of `getSegmentIdsForTagWithHttpInfo` * - * Delete Tag Group + * @deprecated use `getSegmentIdsForTagWithHttpInfo` instead + */ + public function getTagRelationshipsSegmentsWithHttpInfo(...$args) { + return $this->getSegmentIdsForTagWithHttpInfo(...$args); + } + + /** + * Operation getSegmentIdsForTagAsync * - * @param string $id The Tag Group ID (required) + * Get Segment IDs for Tag + * + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagGroupAsync($id, $apiKey = null) + public function getSegmentIdsForTagAsync($id, $apiKey = null) { - return $this->deleteTagGroupAsyncWithHttpInfo($id, $apiKey) + return $this->getSegmentIdsForTagAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -2561,19 +2914,28 @@ function ($response) { } /** - * Operation deleteTagGroupAsyncWithHttpInfo + * Alias of `getSegmentIdsForTagAsync` * - * Delete Tag Group + * @deprecated use `getSegmentIdsForTagAsync` instead + */ + public function getTagRelationshipsSegmentsAsync(...$args) { + return $this->getSegmentIdsForTagAsync(...$args); + } + + /** + * Operation getSegmentIdsForTagAsyncWithHttpInfo * - * @param string $id The Tag Group ID (required) + * Get Segment IDs for Tag + * + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagGroupAsyncWithHttpInfo($id, $apiKey = null) + public function getSegmentIdsForTagAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->deleteTagGroupRequest($id, $apiKey); + $request = $this->getSegmentIdsForTagRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2617,23 +2979,32 @@ function ($exception) { } /** - * Create request for operation 'deleteTagGroup' + * Alias of `getSegmentIdsForTagAsyncWithHttpInfo` * - * @param string $id The Tag Group ID (required) + * @deprecated use `getSegmentIdsForTagAsyncWithHttpInfo` instead + */ + public function getTagRelationshipsSegmentsAsyncWithHttpInfo(...$args) { + return $this->getSegmentIdsForTagAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getSegmentIdsForTag' + * + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteTagGroupRequest($id, $apiKey = null) + public function getSegmentIdsForTagRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteTagGroup' + 'Missing the required parameter $id when calling getSegmentIdsForTag' ); } - $resourcePath = '/api/tag-groups/{id}/'; + $resourcePath = '/api/tags/{id}/relationships/segments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2654,11 +3025,11 @@ public function deleteTagGroupRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2679,7 +3050,7 @@ public function deleteTagGroupRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2703,7 +3074,7 @@ public function deleteTagGroupRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2713,7 +3084,7 @@ public function deleteTagGroupRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2721,37 +3092,51 @@ public function deleteTagGroupRequest($id, $apiKey = null) } /** - * Operation deleteTagRelationshipsCampaigns + * Alias of `getSegmentIdsForTagRequest` + * + * @deprecated use `getSegmentIdsForTagRequest` instead + */ + public function getTagRelationshipsSegmentsRequest(...$args) { + return $this->getSegmentIdsForTagRequest(...$args); + } + + /** + * Operation getTag * - * Delete Tag Relationships Campaigns + * Get Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op tag_campaign_op (required) + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteTagRelationshipsCampaigns($id, $tag_campaign_op, $apiKey = null) + public function getTag($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) { - $this->deleteTagRelationshipsCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey); + list($response) = $this->getTagWithHttpInfo($id, $fields_tag_group, $fields_tag, $include, $apiKey); + return $response; } /** - * Operation deleteTagRelationshipsCampaignsWithHttpInfo + * Operation getTagWithHttpInfo * - * Delete Tag Relationships Campaigns + * Get Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTagRelationshipsCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey = null) + public function getTagWithHttpInfo($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) { - $request = $this->deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $apiKey); + $request = $this->getTagRequest($id, $fields_tag_group, $fields_tag, $include, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2788,73 +3173,188 @@ public function deleteTagRelationshipsCampaignsWithHttpInfo($id, $tag_campaign_o ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - } catch (ApiException $e) { - switch ($e->getCode()) { + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } - /** - * Operation deleteTagRelationshipsCampaignsAsync - * - * Delete Tag Relationships Campaigns - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteTagRelationshipsCampaignsAsync($id, $tag_campaign_op, $apiKey = null) - { - return $this->deleteTagRelationshipsCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } - /** - * Operation deleteTagRelationshipsCampaignsAsyncWithHttpInfo - * - * Delete Tag Relationships Campaigns - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteTagRelationshipsCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey = null) - { - $returnType = ''; - $request = $this->deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $apiKey); + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTagAsync + * + * Get Tag + * + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagAsync($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) + { + return $this->getTagAsyncWithHttpInfo($id, $fields_tag_group, $fields_tag, $include, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTagAsyncWithHttpInfo + * + * Get Tag + * + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagAsyncWithHttpInfo($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTagRequest($id, $fields_tag_group, $fields_tag, $include, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2874,36 +3374,59 @@ function ($exception) { } /** - * Create request for operation 'deleteTagRelationshipsCampaigns' + * Create request for operation 'getTag' * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $apiKey = null) + public function getTagRequest($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteTagRelationshipsCampaigns' - ); - } - // verify the required parameter 'tag_campaign_op' is set - if ($tag_campaign_op === null || (is_array($tag_campaign_op) && count($tag_campaign_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_campaign_op when calling deleteTagRelationshipsCampaigns' + 'Missing the required parameter $id when calling getTag' ); } - $resourcePath = '/api/tags/{id}/relationships/campaigns/'; + $resourcePath = '/api/tags/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag_group, + 'fields[tag-group]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -2918,23 +3441,17 @@ public function deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_campaign_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_campaign_op)); - } else { - $httpBody = $tag_campaign_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2949,7 +3466,7 @@ public function deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2973,7 +3490,7 @@ public function deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2983,7 +3500,7 @@ public function deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2991,37 +3508,38 @@ public function deleteTagRelationshipsCampaignsRequest($id, $tag_campaign_op, $a } /** - * Operation deleteTagRelationshipsFlows + * Operation getTagGroup * - * Delete Tag Relationships Flows + * Get Tag Group * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op tag_flow_op (required) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteTagRelationshipsFlows($id, $tag_flow_op, $apiKey = null) + public function getTagGroup($id, $fields_tag_group = null, $apiKey = null) { - $this->deleteTagRelationshipsFlowsWithHttpInfo($id, $tag_flow_op, $apiKey); + list($response) = $this->getTagGroupWithHttpInfo($id, $fields_tag_group, $apiKey); + return $response; } /** - * Operation deleteTagRelationshipsFlowsWithHttpInfo + * Operation getTagGroupWithHttpInfo * - * Delete Tag Relationships Flows + * Get Tag Group * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTagRelationshipsFlowsWithHttpInfo($id, $tag_flow_op, $apiKey = null) + public function getTagGroupWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) { - $request = $this->deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey); + $request = $this->getTagGroupRequest($id, $fields_tag_group, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3058,73 +3576,184 @@ public function deleteTagRelationshipsFlowsWithHttpInfo($id, $tag_flow_op, $apiK ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - /** - * Operation deleteTagRelationshipsFlowsAsync - * - * Delete Tag Relationships Flows - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteTagRelationshipsFlowsAsync($id, $tag_flow_op, $apiKey = null) - { - return $this->deleteTagRelationshipsFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } /** - * Operation deleteTagRelationshipsFlowsAsyncWithHttpInfo + * Operation getTagGroupAsync * - * Delete Tag Relationships Flows + * Get Tag Group * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagRelationshipsFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey = null) + public function getTagGroupAsync($id, $fields_tag_group = null, $apiKey = null) { - $returnType = ''; - $request = $this->deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey); + return $this->getTagGroupAsyncWithHttpInfo($id, $fields_tag_group, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTagGroupAsyncWithHttpInfo + * + * Get Tag Group + * + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagGroupAsyncWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTagGroupRequest($id, $fields_tag_group, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -3144,36 +3773,39 @@ function ($exception) { } /** - * Create request for operation 'deleteTagRelationshipsFlows' + * Create request for operation 'getTagGroup' * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = null) + public function getTagGroupRequest($id, $fields_tag_group = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteTagRelationshipsFlows' - ); - } - // verify the required parameter 'tag_flow_op' is set - if ($tag_flow_op === null || (is_array($tag_flow_op) && count($tag_flow_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_flow_op when calling deleteTagRelationshipsFlows' + 'Missing the required parameter $id when calling getTagGroup' ); } - $resourcePath = '/api/tags/{id}/relationships/flows/'; + $resourcePath = '/api/tag-groups/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag_group, + 'fields[tag-group]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -3188,23 +3820,17 @@ public function deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_flow_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_flow_op)); - } else { - $httpBody = $tag_flow_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -3219,7 +3845,7 @@ public function deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3243,7 +3869,7 @@ public function deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3253,7 +3879,7 @@ public function deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3261,37 +3887,47 @@ public function deleteTagRelationshipsFlowsRequest($id, $tag_flow_op, $apiKey = } /** - * Operation deleteTagRelationshipsLists + * Operation getTagGroupForTag * - * Delete Tag Relationships Lists + * Get Tag Group for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op tag_list_op (required) + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteTagRelationshipsLists($id, $tag_list_op, $apiKey = null) + public function getTagGroupForTag($id, $fields_tag_group = null, $apiKey = null) { - $this->deleteTagRelationshipsListsWithHttpInfo($id, $tag_list_op, $apiKey); + list($response) = $this->getTagGroupForTagWithHttpInfo($id, $fields_tag_group, $apiKey); + return $response; + } + + /** + * Alias of `getTagGroupForTag` + * + * @deprecated use `getTagGroupForTag` instead + */ + public function getTagTagGroup(...$args) { + return $this->getTagGroupForTag(...$args); } /** - * Operation deleteTagRelationshipsListsWithHttpInfo + * Operation getTagGroupForTagWithHttpInfo * - * Delete Tag Relationships Lists + * Get Tag Group for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTagRelationshipsListsWithHttpInfo($id, $tag_list_op, $apiKey = null) + public function getTagGroupForTagWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) { - $request = $this->deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey); + $request = $this->getTagGroupForTagRequest($id, $fields_tag_group, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3328,73 +3964,202 @@ public function deleteTagRelationshipsListsWithHttpInfo($id, $tag_list_op, $apiK ); } - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - /** - * Operation deleteTagRelationshipsListsAsync - * - * Delete Tag Relationships Lists - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteTagRelationshipsListsAsync($id, $tag_list_op, $apiKey = null) - { - return $this->deleteTagRelationshipsListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } - /** - * Operation deleteTagRelationshipsListsAsyncWithHttpInfo - * - * Delete Tag Relationships Lists - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteTagRelationshipsListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey = null) - { - $returnType = ''; - $request = $this->deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey); + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } - return $this->client + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `getTagGroupForTagWithHttpInfo` + * + * @deprecated use `getTagGroupForTagWithHttpInfo` instead + */ + public function getTagTagGroupWithHttpInfo(...$args) { + return $this->getTagGroupForTagWithHttpInfo(...$args); + } + + /** + * Operation getTagGroupForTagAsync + * + * Get Tag Group for Tag + * + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagGroupForTagAsync($id, $fields_tag_group = null, $apiKey = null) + { + return $this->getTagGroupForTagAsyncWithHttpInfo($id, $fields_tag_group, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getTagGroupForTagAsync` + * + * @deprecated use `getTagGroupForTagAsync` instead + */ + public function getTagTagGroupAsync(...$args) { + return $this->getTagGroupForTagAsync(...$args); + } + + /** + * Operation getTagGroupForTagAsyncWithHttpInfo + * + * Get Tag Group for Tag + * + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagGroupForTagAsyncWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTagGroupForTagRequest($id, $fields_tag_group, $apiKey); + + return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -3414,36 +4179,48 @@ function ($exception) { } /** - * Create request for operation 'deleteTagRelationshipsLists' + * Alias of `getTagGroupForTagAsyncWithHttpInfo` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) + * @deprecated use `getTagGroupForTagAsyncWithHttpInfo` instead + */ + public function getTagTagGroupAsyncWithHttpInfo(...$args) { + return $this->getTagGroupForTagAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagGroupForTag' + * + * @param string $id The Tag ID (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = null) + public function getTagGroupForTagRequest($id, $fields_tag_group = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteTagRelationshipsLists' - ); - } - // verify the required parameter 'tag_list_op' is set - if ($tag_list_op === null || (is_array($tag_list_op) && count($tag_list_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_list_op when calling deleteTagRelationshipsLists' + 'Missing the required parameter $id when calling getTagGroupForTag' ); } - $resourcePath = '/api/tags/{id}/relationships/lists/'; + $resourcePath = '/api/tags/{id}/tag-group'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag_group, + 'fields[tag-group]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -3458,23 +4235,17 @@ public function deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_list_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_list_op)); - } else { - $httpBody = $tag_list_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -3489,7 +4260,7 @@ public function deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3513,7 +4284,7 @@ public function deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3523,7 +4294,7 @@ public function deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3531,37 +4302,54 @@ public function deleteTagRelationshipsListsRequest($id, $tag_list_op, $apiKey = } /** - * Operation deleteTagRelationshipsSegments + * Alias of `getTagGroupForTagRequest` + * + * @deprecated use `getTagGroupForTagRequest` instead + */ + public function getTagTagGroupRequest(...$args) { + return $this->getTagGroupForTagRequest(...$args); + } + + /** + * Operation getTagGroupIdForTag * - * Delete Tag Relationships Segments + * Get Tag Group ID for Tag * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op tag_segment_op (required) + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function deleteTagRelationshipsSegments($id, $tag_segment_op, $apiKey = null) + public function getTagGroupIdForTag($id, $apiKey = null) { - $this->deleteTagRelationshipsSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey); + list($response) = $this->getTagGroupIdForTagWithHttpInfo($id, $apiKey); + return $response; } /** - * Operation deleteTagRelationshipsSegmentsWithHttpInfo + * Alias of `getTagGroupIdForTag` * - * Delete Tag Relationships Segments + * @deprecated use `getTagGroupIdForTag` instead + */ + public function getTagRelationshipsTagGroup(...$args) { + return $this->getTagGroupIdForTag(...$args); + } + + /** + * Operation getTagGroupIdForTagWithHttpInfo * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) + * Get Tag Group ID for Tag + * + * @param string $id The Tag ID (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTagRelationshipsSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey = null) + public function getTagGroupIdForTagWithHttpInfo($id, $apiKey = null) { - $request = $this->deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $apiKey); + $request = $this->getTagGroupIdForTagRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3598,73 +4386,200 @@ public function deleteTagRelationshipsSegmentsWithHttpInfo($id, $tag_segment_op, ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } - } catch (ApiException $e) { - switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - /** - * Operation deleteTagRelationshipsSegmentsAsync - * - * Delete Tag Relationships Segments - * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteTagRelationshipsSegmentsAsync($id, $tag_segment_op, $apiKey = null) - { - return $this->deleteTagRelationshipsSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey) - ->then( - function ($response) { - return $response[0]; - } - ); + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } } /** - * Operation deleteTagRelationshipsSegmentsAsyncWithHttpInfo + * Alias of `getTagGroupIdForTagWithHttpInfo` * - * Delete Tag Relationships Segments + * @deprecated use `getTagGroupIdForTagWithHttpInfo` instead + */ + public function getTagRelationshipsTagGroupWithHttpInfo(...$args) { + return $this->getTagGroupIdForTagWithHttpInfo(...$args); + } + + /** + * Operation getTagGroupIdForTagAsync * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) + * Get Tag Group ID for Tag + * + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTagRelationshipsSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey = null) + public function getTagGroupIdForTagAsync($id, $apiKey = null) { - $returnType = ''; - $request = $this->deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $apiKey); + return $this->getTagGroupIdForTagAsyncWithHttpInfo($id, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `getTagGroupIdForTagAsync` + * + * @deprecated use `getTagGroupIdForTagAsync` instead + */ + public function getTagRelationshipsTagGroupAsync(...$args) { + return $this->getTagGroupIdForTagAsync(...$args); + } + + /** + * Operation getTagGroupIdForTagAsyncWithHttpInfo + * + * Get Tag Group ID for Tag + * + * @param string $id The Tag ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTagGroupIdForTagAsyncWithHttpInfo($id, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTagGroupIdForTagRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -3684,30 +4599,32 @@ function ($exception) { } /** - * Create request for operation 'deleteTagRelationshipsSegments' + * Alias of `getTagGroupIdForTagAsyncWithHttpInfo` * - * @param string $id (required) - * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) + * @deprecated use `getTagGroupIdForTagAsyncWithHttpInfo` instead + */ + public function getTagRelationshipsTagGroupAsyncWithHttpInfo(...$args) { + return $this->getTagGroupIdForTagAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagGroupIdForTag' + * + * @param string $id The Tag ID (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $apiKey = null) + public function getTagGroupIdForTagRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling deleteTagRelationshipsSegments' - ); - } - // verify the required parameter 'tag_segment_op' is set - if ($tag_segment_op === null || (is_array($tag_segment_op) && count($tag_segment_op) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tag_segment_op when calling deleteTagRelationshipsSegments' + 'Missing the required parameter $id when calling getTagGroupIdForTag' ); } - $resourcePath = '/api/tags/{id}/relationships/segments/'; + $resourcePath = '/api/tags/{id}/relationships/tag-group'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3728,23 +4645,17 @@ public function deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($tag_segment_op)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_segment_op)); - } else { - $httpBody = $tag_segment_op; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -3759,7 +4670,7 @@ public function deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -3783,7 +4694,7 @@ public function deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -3793,7 +4704,7 @@ public function deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3801,42 +4712,51 @@ public function deleteTagRelationshipsSegmentsRequest($id, $tag_segment_op, $api } /** - * Operation getTag + * Alias of `getTagGroupIdForTagRequest` * - * Get Tag + * @deprecated use `getTagGroupIdForTagRequest` instead + */ + public function getTagRelationshipsTagGroupRequest(...$args) { + return $this->getTagGroupIdForTagRequest(...$args); + } + + /** + * Operation getTagGroups * - * @param string $id The Tag ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * Get Tag Groups + * + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getTag($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) + public function getTagGroups($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getTagWithHttpInfo($id, $fields_tag_group, $fields_tag, $include, $apiKey); + list($response) = $this->getTagGroupsWithHttpInfo($fields_tag_group, $filter, $page_cursor, $sort, $apiKey); return $response; } /** - * Operation getTagWithHttpInfo + * Operation getTagGroupsWithHttpInfo * - * Get Tag + * Get Tag Groups * - * @param string $id The Tag ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getTagWithHttpInfo($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) + public function getTagGroupsWithHttpInfo($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getTagRequest($id, $fields_tag_group, $fields_tag, $include, $apiKey); + $request = $this->getTagGroupsRequest($fields_tag_group, $filter, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -3992,21 +4912,21 @@ public function getTagWithHttpInfo($id, $fields_tag_group = null, $fields_tag = } /** - * Operation getTagAsync + * Operation getTagGroupsAsync * - * Get Tag + * Get Tag Groups * - * @param string $id The Tag ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagAsync($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) + public function getTagGroupsAsync($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getTagAsyncWithHttpInfo($id, $fields_tag_group, $fields_tag, $include, $apiKey) + return $this->getTagGroupsAsyncWithHttpInfo($fields_tag_group, $filter, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -4015,22 +4935,22 @@ function ($response) { } /** - * Operation getTagAsyncWithHttpInfo + * Operation getTagGroupsAsyncWithHttpInfo * - * Get Tag + * Get Tag Groups * - * @param string $id The Tag ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagAsyncWithHttpInfo($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) + public function getTagGroupsAsyncWithHttpInfo($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getTagRequest($id, $fields_tag_group, $fields_tag, $include, $apiKey); + $request = $this->getTagGroupsRequest($fields_tag_group, $filter, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4074,26 +4994,20 @@ function ($exception) { } /** - * Create request for operation 'getTag' + * Create request for operation 'getTagGroups' * - * @param string $id The Tag ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagRequest($id, $fields_tag_group = null, $fields_tag = null, $include = null, $apiKey = null) + public function getTagGroupsRequest($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTag' - ); - } - $resourcePath = '/api/tags/{id}/'; + $resourcePath = '/api/tag-groups'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4111,41 +5025,42 @@ public function getTagRequest($id, $fields_tag_group = null, $fields_tag = null, ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType + $filter, + 'filter', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType 'form', // style - false, // explode + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode false // required ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4166,7 +5081,7 @@ public function getTagRequest($id, $fields_tag_group = null, $fields_tag = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4190,7 +5105,7 @@ public function getTagRequest($id, $fields_tag_group = null, $fields_tag = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4208,38 +5123,45 @@ public function getTagRequest($id, $fields_tag_group = null, $fields_tag = null, } /** - * Operation getTagGroup + * Operation getTagIdsForTagGroup * - * Get Tag Group + * Get Tag IDs for Tag Group * * @param string $id The Tag Group ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getTagGroup($id, $fields_tag_group = null, $apiKey = null) + public function getTagIdsForTagGroup($id, $apiKey = null) { - list($response) = $this->getTagGroupWithHttpInfo($id, $fields_tag_group, $apiKey); + list($response) = $this->getTagIdsForTagGroupWithHttpInfo($id, $apiKey); return $response; } /** - * Operation getTagGroupWithHttpInfo + * Alias of `getTagIdsForTagGroup` * - * Get Tag Group + * @deprecated use `getTagIdsForTagGroup` instead + */ + public function getTagGroupRelationshipsTags(...$args) { + return $this->getTagIdsForTagGroup(...$args); + } + + /** + * Operation getTagIdsForTagGroupWithHttpInfo + * + * Get Tag IDs for Tag Group * * @param string $id The Tag Group ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getTagGroupWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) + public function getTagIdsForTagGroupWithHttpInfo($id, $apiKey = null) { - $request = $this->getTagGroupRequest($id, $fields_tag_group, $apiKey); + $request = $this->getTagIdsForTagGroupRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4395,19 +5317,27 @@ public function getTagGroupWithHttpInfo($id, $fields_tag_group = null, $apiKey = } /** - * Operation getTagGroupAsync + * Alias of `getTagIdsForTagGroupWithHttpInfo` * - * Get Tag Group + * @deprecated use `getTagIdsForTagGroupWithHttpInfo` instead + */ + public function getTagGroupRelationshipsTagsWithHttpInfo(...$args) { + return $this->getTagIdsForTagGroupWithHttpInfo(...$args); + } + + /** + * Operation getTagIdsForTagGroupAsync + * + * Get Tag IDs for Tag Group * * @param string $id The Tag Group ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupAsync($id, $fields_tag_group = null, $apiKey = null) + public function getTagIdsForTagGroupAsync($id, $apiKey = null) { - return $this->getTagGroupAsyncWithHttpInfo($id, $fields_tag_group, $apiKey) + return $this->getTagIdsForTagGroupAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -4416,20 +5346,28 @@ function ($response) { } /** - * Operation getTagGroupAsyncWithHttpInfo + * Alias of `getTagIdsForTagGroupAsync` * - * Get Tag Group + * @deprecated use `getTagIdsForTagGroupAsync` instead + */ + public function getTagGroupRelationshipsTagsAsync(...$args) { + return $this->getTagIdsForTagGroupAsync(...$args); + } + + /** + * Operation getTagIdsForTagGroupAsyncWithHttpInfo + * + * Get Tag IDs for Tag Group * * @param string $id The Tag Group ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupAsyncWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) + public function getTagIdsForTagGroupAsyncWithHttpInfo($id, $apiKey = null) { $returnType = 'array'; - $request = $this->getTagGroupRequest($id, $fields_tag_group, $apiKey); + $request = $this->getTagIdsForTagGroupRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4473,39 +5411,38 @@ function ($exception) { } /** - * Create request for operation 'getTagGroup' + * Alias of `getTagIdsForTagGroupAsyncWithHttpInfo` + * + * @deprecated use `getTagIdsForTagGroupAsyncWithHttpInfo` instead + */ + public function getTagGroupRelationshipsTagsAsyncWithHttpInfo(...$args) { + return $this->getTagIdsForTagGroupAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagIdsForTagGroup' * * @param string $id The Tag Group ID (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagGroupRequest($id, $fields_tag_group = null, $apiKey = null) + public function getTagIdsForTagGroupRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagGroup' + 'Missing the required parameter $id when calling getTagIdsForTagGroup' ); } - $resourcePath = '/api/tag-groups/{id}/'; + $resourcePath = '/api/tag-groups/{id}/relationships/tags'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag_group, - 'fields[tag-group]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -4520,11 +5457,11 @@ public function getTagGroupRequest($id, $fields_tag_group = null, $apiKey = null if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4545,7 +5482,7 @@ public function getTagGroupRequest($id, $fields_tag_group = null, $apiKey = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4569,7 +5506,7 @@ public function getTagGroupRequest($id, $fields_tag_group = null, $apiKey = null $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4587,36 +5524,55 @@ public function getTagGroupRequest($id, $fields_tag_group = null, $apiKey = null } /** - * Operation getTagGroupRelationshipsTags + * Alias of `getTagIdsForTagGroupRequest` + * + * @deprecated use `getTagIdsForTagGroupRequest` instead + */ + public function getTagGroupRelationshipsTagsRequest(...$args) { + return $this->getTagIdsForTagGroupRequest(...$args); + } + + /** + * Operation getTags * - * Get Tag Group Relationships Tags + * Get Tags * - * @param string $id (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getTagGroupRelationshipsTags($id, $apiKey = null) + public function getTags($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - list($response) = $this->getTagGroupRelationshipsTagsWithHttpInfo($id, $apiKey); + list($response) = $this->getTagsWithHttpInfo($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); return $response; } /** - * Operation getTagGroupRelationshipsTagsWithHttpInfo + * Operation getTagsWithHttpInfo * - * Get Tag Group Relationships Tags + * Get Tags * - * @param string $id (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getTagGroupRelationshipsTagsWithHttpInfo($id, $apiKey = null) + public function getTagsWithHttpInfo($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - $request = $this->getTagGroupRelationshipsTagsRequest($id, $apiKey); + $request = $this->getTagsRequest($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -4772,18 +5728,23 @@ public function getTagGroupRelationshipsTagsWithHttpInfo($id, $apiKey = null) } /** - * Operation getTagGroupRelationshipsTagsAsync + * Operation getTagsAsync * - * Get Tag Group Relationships Tags + * Get Tags * - * @param string $id (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupRelationshipsTagsAsync($id, $apiKey = null) + public function getTagsAsync($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - return $this->getTagGroupRelationshipsTagsAsyncWithHttpInfo($id, $apiKey) + return $this->getTagsAsyncWithHttpInfo($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -4792,19 +5753,24 @@ function ($response) { } /** - * Operation getTagGroupRelationshipsTagsAsyncWithHttpInfo + * Operation getTagsAsyncWithHttpInfo * - * Get Tag Group Relationships Tags + * Get Tags * - * @param string $id (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupRelationshipsTagsAsyncWithHttpInfo($id, $apiKey = null) + public function getTagsAsyncWithHttpInfo($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getTagGroupRelationshipsTagsRequest($id, $apiKey); + $request = $this->getTagsRequest($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4848,48 +5814,93 @@ function ($exception) { } /** - * Create request for operation 'getTagGroupRelationshipsTags' + * Create request for operation 'getTags' * - * @param string $id (required) + * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagGroupRelationshipsTagsRequest($id, $apiKey = null) + public function getTagsRequest($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagGroupRelationshipsTags' - ); - } - $resourcePath = '/api/tag-groups/{id}/relationships/tags/'; + $resourcePath = '/api/tags'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag_group, + 'fields[tag-group]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tag, + 'fields[tag]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -4910,7 +5921,7 @@ public function getTagGroupRelationshipsTagsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -4934,7 +5945,7 @@ public function getTagGroupRelationshipsTagsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -4952,38 +5963,47 @@ public function getTagGroupRelationshipsTagsRequest($id, $apiKey = null) } /** - * Operation getTagGroupTags + * Operation getTagsForTagGroup * - * Get Tag Group Tags + * Get Tags for Tag Group * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getTagGroupTags($id, $fields_tag = null, $apiKey = null) + public function getTagsForTagGroup($id, $fields_tag = null, $apiKey = null) { - list($response) = $this->getTagGroupTagsWithHttpInfo($id, $fields_tag, $apiKey); + list($response) = $this->getTagsForTagGroupWithHttpInfo($id, $fields_tag, $apiKey); return $response; } /** - * Operation getTagGroupTagsWithHttpInfo + * Alias of `getTagsForTagGroup` * - * Get Tag Group Tags + * @deprecated use `getTagsForTagGroup` instead + */ + public function getTagGroupTags(...$args) { + return $this->getTagsForTagGroup(...$args); + } + + /** + * Operation getTagsForTagGroupWithHttpInfo * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Get Tags for Tag Group + * + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getTagGroupTagsWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function getTagsForTagGroupWithHttpInfo($id, $fields_tag = null, $apiKey = null) { - $request = $this->getTagGroupTagsRequest($id, $fields_tag, $apiKey); + $request = $this->getTagsForTagGroupRequest($id, $fields_tag, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5139,19 +6159,28 @@ public function getTagGroupTagsWithHttpInfo($id, $fields_tag = null, $apiKey = n } /** - * Operation getTagGroupTagsAsync + * Alias of `getTagsForTagGroupWithHttpInfo` + * + * @deprecated use `getTagsForTagGroupWithHttpInfo` instead + */ + public function getTagGroupTagsWithHttpInfo(...$args) { + return $this->getTagsForTagGroupWithHttpInfo(...$args); + } + + /** + * Operation getTagsForTagGroupAsync * - * Get Tag Group Tags + * Get Tags for Tag Group * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupTagsAsync($id, $fields_tag = null, $apiKey = null) + public function getTagsForTagGroupAsync($id, $fields_tag = null, $apiKey = null) { - return $this->getTagGroupTagsAsyncWithHttpInfo($id, $fields_tag, $apiKey) + return $this->getTagsForTagGroupAsyncWithHttpInfo($id, $fields_tag, $apiKey) ->then( function ($response) { return $response[0]; @@ -5160,20 +6189,29 @@ function ($response) { } /** - * Operation getTagGroupTagsAsyncWithHttpInfo + * Alias of `getTagsForTagGroupAsync` + * + * @deprecated use `getTagsForTagGroupAsync` instead + */ + public function getTagGroupTagsAsync(...$args) { + return $this->getTagsForTagGroupAsync(...$args); + } + + /** + * Operation getTagsForTagGroupAsyncWithHttpInfo * - * Get Tag Group Tags + * Get Tags for Tag Group * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupTagsAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) + public function getTagsForTagGroupAsyncWithHttpInfo($id, $fields_tag = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getTagGroupTagsRequest($id, $fields_tag, $apiKey); + $request = $this->getTagsForTagGroupRequest($id, $fields_tag, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5217,24 +6255,33 @@ function ($exception) { } /** - * Create request for operation 'getTagGroupTags' + * Alias of `getTagsForTagGroupAsyncWithHttpInfo` + * + * @deprecated use `getTagsForTagGroupAsyncWithHttpInfo` instead + */ + public function getTagGroupTagsAsyncWithHttpInfo(...$args) { + return $this->getTagsForTagGroupAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getTagsForTagGroup' * - * @param string $id (required) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag Group ID (required) + * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagGroupTagsRequest($id, $fields_tag = null, $apiKey = null) + public function getTagsForTagGroupRequest($id, $fields_tag = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagGroupTags' + 'Missing the required parameter $id when calling getTagsForTagGroup' ); } - $resourcePath = '/api/tag-groups/{id}/tags/'; + $resourcePath = '/api/tag-groups/{id}/tags'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5264,11 +6311,11 @@ public function getTagGroupTagsRequest($id, $fields_tag = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -5289,7 +6336,7 @@ public function getTagGroupTagsRequest($id, $fields_tag = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5313,7 +6360,7 @@ public function getTagGroupTagsRequest($id, $fields_tag = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5331,42 +6378,55 @@ public function getTagGroupTagsRequest($id, $fields_tag = null, $apiKey = null) } /** - * Operation getTagGroups + * Alias of `getTagsForTagGroupRequest` * - * Get Tag Groups + * @deprecated use `getTagsForTagGroupRequest` instead + */ + public function getTagGroupTagsRequest(...$args) { + return $this->getTagsForTagGroupRequest(...$args); + } + + /** + * Operation removeTagFromCampaigns * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Remove Tag from Campaigns + * + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op tag_campaign_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTagGroups($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function removeTagFromCampaigns($id, $tag_campaign_op, $apiKey = null) { - list($response) = $this->getTagGroupsWithHttpInfo($fields_tag_group, $filter, $page_cursor, $sort, $apiKey); - return $response; + $this->removeTagFromCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey); } /** - * Operation getTagGroupsWithHttpInfo + * Alias of `removeTagFromCampaigns` * - * Get Tag Groups + * @deprecated use `removeTagFromCampaigns` instead + */ + public function deleteTagRelationshipsCampaigns(...$args) { + return $this->removeTagFromCampaigns(...$args); + } + + /** + * Operation removeTagFromCampaignsWithHttpInfo * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Remove Tag from Campaigns + * + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagGroupsWithHttpInfo($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function removeTagFromCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey = null) { - $request = $this->getTagGroupsRequest($fields_tag_group, $filter, $page_cursor, $sort, $apiKey); + $request = $this->removeTagFromCampaignsRequest($id, $tag_campaign_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5403,140 +6463,54 @@ public function getTagGroupsWithHttpInfo($fields_tag_group = null, $filter = nul ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } + return [null, $statusCode, $response->getHeaders()]; - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + } catch (ApiException $e) { + switch ($e->getCode()) { case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } + /** + * Alias of `removeTagFromCampaignsWithHttpInfo` + * + * @deprecated use `removeTagFromCampaignsWithHttpInfo` instead + */ + public function deleteTagRelationshipsCampaignsWithHttpInfo(...$args) { + return $this->removeTagFromCampaignsWithHttpInfo(...$args); + } /** - * Operation getTagGroupsAsync + * Operation removeTagFromCampaignsAsync * - * Get Tag Groups + * Remove Tag from Campaigns * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupsAsync($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function removeTagFromCampaignsAsync($id, $tag_campaign_op, $apiKey = null) { - return $this->getTagGroupsAsyncWithHttpInfo($fields_tag_group, $filter, $page_cursor, $sort, $apiKey) + return $this->removeTagFromCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -5545,46 +6519,35 @@ function ($response) { } /** - * Operation getTagGroupsAsyncWithHttpInfo + * Alias of `removeTagFromCampaignsAsync` * - * Get Tag Groups + * @deprecated use `removeTagFromCampaignsAsync` instead + */ + public function deleteTagRelationshipsCampaignsAsync(...$args) { + return $this->removeTagFromCampaignsAsync(...$args); + } + + /** + * Operation removeTagFromCampaignsAsyncWithHttpInfo + * + * Remove Tag from Campaigns * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagGroupsAsyncWithHttpInfo($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function removeTagFromCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagGroupsRequest($fields_tag_group, $filter, $page_cursor, $sort, $apiKey); + $returnType = ''; + $request = $this->removeTagFromCampaignsRequest($id, $tag_campaign_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -5604,79 +6567,76 @@ function ($exception) { } /** - * Create request for operation 'getTagGroups' + * Alias of `removeTagFromCampaignsAsyncWithHttpInfo` + * + * @deprecated use `removeTagFromCampaignsAsyncWithHttpInfo` instead + */ + public function deleteTagRelationshipsCampaignsAsyncWithHttpInfo(...$args) { + return $this->removeTagFromCampaignsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'removeTagFromCampaigns' * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagGroupsRequest($fields_tag_group = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function removeTagFromCampaignsRequest($id, $tag_campaign_op, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling removeTagFromCampaigns' + ); + } + // verify the required parameter 'tag_campaign_op' is set + if ($tag_campaign_op === null || (is_array($tag_campaign_op) && count($tag_campaign_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_campaign_op when calling removeTagFromCampaigns' + ); + } - $resourcePath = '/api/tag-groups/'; + $resourcePath = '/api/tags/{id}/relationships/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag_group, - 'fields[tag-group]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_campaign_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_campaign_op)); + } else { + $httpBody = $tag_campaign_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -5691,7 +6651,7 @@ public function getTagGroupsRequest($fields_tag_group = null, $filter = null, $p // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -5715,7 +6675,7 @@ public function getTagGroupsRequest($fields_tag_group = null, $filter = null, $p $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -5725,7 +6685,7 @@ public function getTagGroupsRequest($fields_tag_group = null, $filter = null, $p $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5733,36 +6693,55 @@ public function getTagGroupsRequest($fields_tag_group = null, $filter = null, $p } /** - * Operation getTagRelationshipsCampaigns + * Alias of `removeTagFromCampaignsRequest` + * + * @deprecated use `removeTagFromCampaignsRequest` instead + */ + public function deleteTagRelationshipsCampaignsRequest(...$args) { + return $this->removeTagFromCampaignsRequest(...$args); + } + + /** + * Operation removeTagFromFlows * - * Get Tag Relationships Campaigns + * Remove Tag from Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op tag_flow_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTagRelationshipsCampaigns($id, $apiKey = null) + public function removeTagFromFlows($id, $tag_flow_op, $apiKey = null) { - list($response) = $this->getTagRelationshipsCampaignsWithHttpInfo($id, $apiKey); - return $response; + $this->removeTagFromFlowsWithHttpInfo($id, $tag_flow_op, $apiKey); + } + + /** + * Alias of `removeTagFromFlows` + * + * @deprecated use `removeTagFromFlows` instead + */ + public function deleteTagRelationshipsFlows(...$args) { + return $this->removeTagFromFlows(...$args); } /** - * Operation getTagRelationshipsCampaignsWithHttpInfo + * Operation removeTagFromFlowsWithHttpInfo * - * Get Tag Relationships Campaigns + * Remove Tag from Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagRelationshipsCampaignsWithHttpInfo($id, $apiKey = null) + public function removeTagFromFlowsWithHttpInfo($id, $tag_flow_op, $apiKey = null) { - $request = $this->getTagRelationshipsCampaignsRequest($id, $apiKey); + $request = $this->removeTagFromFlowsRequest($id, $tag_flow_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -5799,137 +6778,54 @@ public function getTagRelationshipsCampaignsWithHttpInfo($id, $apiKey = null) ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } + /** + * Alias of `removeTagFromFlowsWithHttpInfo` + * + * @deprecated use `removeTagFromFlowsWithHttpInfo` instead + */ + public function deleteTagRelationshipsFlowsWithHttpInfo(...$args) { + return $this->removeTagFromFlowsWithHttpInfo(...$args); + } /** - * Operation getTagRelationshipsCampaignsAsync + * Operation removeTagFromFlowsAsync * - * Get Tag Relationships Campaigns + * Remove Tag from Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsCampaignsAsync($id, $apiKey = null) + public function removeTagFromFlowsAsync($id, $tag_flow_op, $apiKey = null) { - return $this->getTagRelationshipsCampaignsAsyncWithHttpInfo($id, $apiKey) + return $this->removeTagFromFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -5938,43 +6834,35 @@ function ($response) { } /** - * Operation getTagRelationshipsCampaignsAsyncWithHttpInfo + * Alias of `removeTagFromFlowsAsync` + * + * @deprecated use `removeTagFromFlowsAsync` instead + */ + public function deleteTagRelationshipsFlowsAsync(...$args) { + return $this->removeTagFromFlowsAsync(...$args); + } + + /** + * Operation removeTagFromFlowsAsyncWithHttpInfo * - * Get Tag Relationships Campaigns + * Remove Tag from Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsCampaignsAsyncWithHttpInfo($id, $apiKey = null) + public function removeTagFromFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagRelationshipsCampaignsRequest($id, $apiKey); + $returnType = ''; + $request = $this->removeTagFromFlowsRequest($id, $tag_flow_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -5994,23 +6882,39 @@ function ($exception) { } /** - * Create request for operation 'getTagRelationshipsCampaigns' + * Alias of `removeTagFromFlowsAsyncWithHttpInfo` + * + * @deprecated use `removeTagFromFlowsAsyncWithHttpInfo` instead + */ + public function deleteTagRelationshipsFlowsAsyncWithHttpInfo(...$args) { + return $this->removeTagFromFlowsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'removeTagFromFlows' * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagRelationshipsCampaignsRequest($id, $apiKey = null) + public function removeTagFromFlowsRequest($id, $tag_flow_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagRelationshipsCampaigns' + 'Missing the required parameter $id when calling removeTagFromFlows' + ); + } + // verify the required parameter 'tag_flow_op' is set + if ($tag_flow_op === null || (is_array($tag_flow_op) && count($tag_flow_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_flow_op when calling removeTagFromFlows' ); } - $resourcePath = '/api/tags/{id}/relationships/campaigns/'; + $resourcePath = '/api/tags/{id}/relationships/flows'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6031,17 +6935,23 @@ public function getTagRelationshipsCampaignsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_flow_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_flow_op)); + } else { + $httpBody = $tag_flow_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -6056,7 +6966,7 @@ public function getTagRelationshipsCampaignsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6080,7 +6990,7 @@ public function getTagRelationshipsCampaignsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6090,7 +7000,7 @@ public function getTagRelationshipsCampaignsRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6098,36 +7008,55 @@ public function getTagRelationshipsCampaignsRequest($id, $apiKey = null) } /** - * Operation getTagRelationshipsFlows + * Alias of `removeTagFromFlowsRequest` + * + * @deprecated use `removeTagFromFlowsRequest` instead + */ + public function deleteTagRelationshipsFlowsRequest(...$args) { + return $this->removeTagFromFlowsRequest(...$args); + } + + /** + * Operation removeTagFromLists * - * Get Tag Relationships Flows + * Remove Tag from Lists * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op tag_list_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTagRelationshipsFlows($id, $apiKey = null) + public function removeTagFromLists($id, $tag_list_op, $apiKey = null) { - list($response) = $this->getTagRelationshipsFlowsWithHttpInfo($id, $apiKey); - return $response; + $this->removeTagFromListsWithHttpInfo($id, $tag_list_op, $apiKey); + } + + /** + * Alias of `removeTagFromLists` + * + * @deprecated use `removeTagFromLists` instead + */ + public function deleteTagRelationshipsLists(...$args) { + return $this->removeTagFromLists(...$args); } /** - * Operation getTagRelationshipsFlowsWithHttpInfo + * Operation removeTagFromListsWithHttpInfo * - * Get Tag Relationships Flows + * Remove Tag from Lists * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagRelationshipsFlowsWithHttpInfo($id, $apiKey = null) + public function removeTagFromListsWithHttpInfo($id, $tag_list_op, $apiKey = null) { - $request = $this->getTagRelationshipsFlowsRequest($id, $apiKey); + $request = $this->removeTagFromListsRequest($id, $tag_list_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6164,137 +7093,54 @@ public function getTagRelationshipsFlowsWithHttpInfo($id, $apiKey = null) ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } + return [null, $statusCode, $response->getHeaders()]; - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + } catch (ApiException $e) { + switch ($e->getCode()) { case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } + throw $e; + } + } - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } + /** + * Alias of `removeTagFromListsWithHttpInfo` + * + * @deprecated use `removeTagFromListsWithHttpInfo` instead + */ + public function deleteTagRelationshipsListsWithHttpInfo(...$args) { + return $this->removeTagFromListsWithHttpInfo(...$args); } /** - * Operation getTagRelationshipsFlowsAsync + * Operation removeTagFromListsAsync * - * Get Tag Relationships Flows + * Remove Tag from Lists * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsFlowsAsync($id, $apiKey = null) + public function removeTagFromListsAsync($id, $tag_list_op, $apiKey = null) { - return $this->getTagRelationshipsFlowsAsyncWithHttpInfo($id, $apiKey) + return $this->removeTagFromListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -6303,43 +7149,35 @@ function ($response) { } /** - * Operation getTagRelationshipsFlowsAsyncWithHttpInfo + * Alias of `removeTagFromListsAsync` * - * Get Tag Relationships Flows + * @deprecated use `removeTagFromListsAsync` instead + */ + public function deleteTagRelationshipsListsAsync(...$args) { + return $this->removeTagFromListsAsync(...$args); + } + + /** + * Operation removeTagFromListsAsyncWithHttpInfo * - * @param string $id (required) + * Remove Tag from Lists + * + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsFlowsAsyncWithHttpInfo($id, $apiKey = null) + public function removeTagFromListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagRelationshipsFlowsRequest($id, $apiKey); + $returnType = ''; + $request = $this->removeTagFromListsRequest($id, $tag_list_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -6359,23 +7197,39 @@ function ($exception) { } /** - * Create request for operation 'getTagRelationshipsFlows' + * Alias of `removeTagFromListsAsyncWithHttpInfo` + * + * @deprecated use `removeTagFromListsAsyncWithHttpInfo` instead + */ + public function deleteTagRelationshipsListsAsyncWithHttpInfo(...$args) { + return $this->removeTagFromListsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'removeTagFromLists' * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagRelationshipsFlowsRequest($id, $apiKey = null) + public function removeTagFromListsRequest($id, $tag_list_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagRelationshipsFlows' + 'Missing the required parameter $id when calling removeTagFromLists' + ); + } + // verify the required parameter 'tag_list_op' is set + if ($tag_list_op === null || (is_array($tag_list_op) && count($tag_list_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_list_op when calling removeTagFromLists' ); } - $resourcePath = '/api/tags/{id}/relationships/flows/'; + $resourcePath = '/api/tags/{id}/relationships/lists'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6396,17 +7250,23 @@ public function getTagRelationshipsFlowsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_list_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_list_op)); + } else { + $httpBody = $tag_list_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -6421,7 +7281,7 @@ public function getTagRelationshipsFlowsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6445,7 +7305,7 @@ public function getTagRelationshipsFlowsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6455,7 +7315,7 @@ public function getTagRelationshipsFlowsRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6463,36 +7323,55 @@ public function getTagRelationshipsFlowsRequest($id, $apiKey = null) } /** - * Operation getTagRelationshipsLists + * Alias of `removeTagFromListsRequest` + * + * @deprecated use `removeTagFromListsRequest` instead + */ + public function deleteTagRelationshipsListsRequest(...$args) { + return $this->removeTagFromListsRequest(...$args); + } + + /** + * Operation removeTagFromSegments * - * Get Tag Relationships Lists + * Remove Tag from Segments * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op tag_segment_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTagRelationshipsLists($id, $apiKey = null) + public function removeTagFromSegments($id, $tag_segment_op, $apiKey = null) { - list($response) = $this->getTagRelationshipsListsWithHttpInfo($id, $apiKey); - return $response; + $this->removeTagFromSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey); + } + + /** + * Alias of `removeTagFromSegments` + * + * @deprecated use `removeTagFromSegments` instead + */ + public function deleteTagRelationshipsSegments(...$args) { + return $this->removeTagFromSegments(...$args); } /** - * Operation getTagRelationshipsListsWithHttpInfo + * Operation removeTagFromSegmentsWithHttpInfo * - * Get Tag Relationships Lists + * Remove Tag from Segments * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagRelationshipsListsWithHttpInfo($id, $apiKey = null) + public function removeTagFromSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey = null) { - $request = $this->getTagRelationshipsListsRequest($id, $apiKey); + $request = $this->removeTagFromSegmentsRequest($id, $tag_segment_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6529,103 +7408,10 @@ public function getTagRelationshipsListsWithHttpInfo($id, $apiKey = null) ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6648,18 +7434,28 @@ public function getTagRelationshipsListsWithHttpInfo($id, $apiKey = null) } /** - * Operation getTagRelationshipsListsAsync + * Alias of `removeTagFromSegmentsWithHttpInfo` + * + * @deprecated use `removeTagFromSegmentsWithHttpInfo` instead + */ + public function deleteTagRelationshipsSegmentsWithHttpInfo(...$args) { + return $this->removeTagFromSegmentsWithHttpInfo(...$args); + } + + /** + * Operation removeTagFromSegmentsAsync * - * Get Tag Relationships Lists + * Remove Tag from Segments * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsListsAsync($id, $apiKey = null) + public function removeTagFromSegmentsAsync($id, $tag_segment_op, $apiKey = null) { - return $this->getTagRelationshipsListsAsyncWithHttpInfo($id, $apiKey) + return $this->removeTagFromSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -6668,43 +7464,35 @@ function ($response) { } /** - * Operation getTagRelationshipsListsAsyncWithHttpInfo + * Alias of `removeTagFromSegmentsAsync` + * + * @deprecated use `removeTagFromSegmentsAsync` instead + */ + public function deleteTagRelationshipsSegmentsAsync(...$args) { + return $this->removeTagFromSegmentsAsync(...$args); + } + + /** + * Operation removeTagFromSegmentsAsyncWithHttpInfo * - * Get Tag Relationships Lists + * Remove Tag from Segments * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsListsAsyncWithHttpInfo($id, $apiKey = null) + public function removeTagFromSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagRelationshipsListsRequest($id, $apiKey); + $returnType = ''; + $request = $this->removeTagFromSegmentsRequest($id, $tag_segment_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -6724,23 +7512,39 @@ function ($exception) { } /** - * Create request for operation 'getTagRelationshipsLists' + * Alias of `removeTagFromSegmentsAsyncWithHttpInfo` + * + * @deprecated use `removeTagFromSegmentsAsyncWithHttpInfo` instead + */ + public function deleteTagRelationshipsSegmentsAsyncWithHttpInfo(...$args) { + return $this->removeTagFromSegmentsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'removeTagFromSegments' * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagRelationshipsListsRequest($id, $apiKey = null) + public function removeTagFromSegmentsRequest($id, $tag_segment_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagRelationshipsLists' + 'Missing the required parameter $id when calling removeTagFromSegments' + ); + } + // verify the required parameter 'tag_segment_op' is set + if ($tag_segment_op === null || (is_array($tag_segment_op) && count($tag_segment_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_segment_op when calling removeTagFromSegments' ); } - $resourcePath = '/api/tags/{id}/relationships/lists/'; + $resourcePath = '/api/tags/{id}/relationships/segments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6761,17 +7565,23 @@ public function getTagRelationshipsListsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_segment_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_segment_op)); + } else { + $httpBody = $tag_segment_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -6786,7 +7596,7 @@ public function getTagRelationshipsListsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -6810,7 +7620,7 @@ public function getTagRelationshipsListsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -6820,7 +7630,7 @@ public function getTagRelationshipsListsRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6828,36 +7638,64 @@ public function getTagRelationshipsListsRequest($id, $apiKey = null) } /** - * Operation getTagRelationshipsSegments + * Alias of `removeTagFromSegmentsRequest` + * + * @deprecated use `removeTagFromSegmentsRequest` instead + */ + public function deleteTagRelationshipsSegmentsRequest(...$args) { + return $this->removeTagFromSegmentsRequest(...$args); + } + + /** + * Operation tagCampaigns * - * Get Tag Relationships Segments + * Tag Campaigns * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op tag_campaign_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTagRelationshipsSegments($id, $apiKey = null) + public function tagCampaigns($id, $tag_campaign_op, $apiKey = null) { - list($response) = $this->getTagRelationshipsSegmentsWithHttpInfo($id, $apiKey); - return $response; + $this->tagCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey); + } + + /** + * Alias of `tagCampaigns` + * + * @deprecated use `tagCampaigns` instead + */ + public function createTagRelationshipsCampaigns(...$args) { + return $this->tagCampaigns(...$args); + } + + /** + * Alias of `tagCampaigns` + * + * @deprecated use `tagCampaigns` instead + */ + public function createTagRelationshipsCampaign(...$args) { + return $this->tagCampaigns(...$args); } /** - * Operation getTagRelationshipsSegmentsWithHttpInfo + * Operation tagCampaignsWithHttpInfo * - * Get Tag Relationships Segments + * Tag Campaigns * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagRelationshipsSegmentsWithHttpInfo($id, $apiKey = null) + public function tagCampaignsWithHttpInfo($id, $tag_campaign_op, $apiKey = null) { - $request = $this->getTagRelationshipsSegmentsRequest($id, $apiKey); + $request = $this->tagCampaignsRequest($id, $tag_campaign_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -6894,103 +7732,10 @@ public function getTagRelationshipsSegmentsWithHttpInfo($id, $apiKey = null) ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7013,18 +7758,37 @@ public function getTagRelationshipsSegmentsWithHttpInfo($id, $apiKey = null) } /** - * Operation getTagRelationshipsSegmentsAsync + * Alias of `tagCampaignsWithHttpInfo` + * + * @deprecated use `tagCampaignsWithHttpInfo` instead + */ + public function createTagRelationshipsCampaignsWithHttpInfo(...$args) { + return $this->tagCampaignsWithHttpInfo(...$args); + } + + /** + * Alias of `tagCampaignsWithHttpInfo` + * + * @deprecated use `tagCampaignsWithHttpInfo` instead + */ + public function createTagRelationshipsCampaignWithHttpInfo(...$args) { + return $this->tagCampaignsWithHttpInfo(...$args); + } + + /** + * Operation tagCampaignsAsync * - * Get Tag Relationships Segments + * Tag Campaigns * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsSegmentsAsync($id, $apiKey = null) + public function tagCampaignsAsync($id, $tag_campaign_op, $apiKey = null) { - return $this->getTagRelationshipsSegmentsAsyncWithHttpInfo($id, $apiKey) + return $this->tagCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -7033,43 +7797,44 @@ function ($response) { } /** - * Operation getTagRelationshipsSegmentsAsyncWithHttpInfo + * Alias of `tagCampaignsAsync` + * + * @deprecated use `tagCampaignsAsync` instead + */ + public function createTagRelationshipsCampaignsAsync(...$args) { + return $this->tagCampaignsAsync(...$args); + } + + /** + * Alias of `tagCampaignsAsync` + * + * @deprecated use `tagCampaignsAsync` instead + */ + public function createTagRelationshipsCampaignAsync(...$args) { + return $this->tagCampaignsAsync(...$args); + } + + /** + * Operation tagCampaignsAsyncWithHttpInfo * - * Get Tag Relationships Segments + * Tag Campaigns * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsSegmentsAsyncWithHttpInfo($id, $apiKey = null) + public function tagCampaignsAsyncWithHttpInfo($id, $tag_campaign_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagRelationshipsSegmentsRequest($id, $apiKey); + $returnType = ''; + $request = $this->tagCampaignsRequest($id, $tag_campaign_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -7089,23 +7854,48 @@ function ($exception) { } /** - * Create request for operation 'getTagRelationshipsSegments' + * Alias of `tagCampaignsAsyncWithHttpInfo` + * + * @deprecated use `tagCampaignsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsCampaignsAsyncWithHttpInfo(...$args) { + return $this->tagCampaignsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `tagCampaignsAsyncWithHttpInfo` + * + * @deprecated use `tagCampaignsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsCampaignAsyncWithHttpInfo(...$args) { + return $this->tagCampaignsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'tagCampaigns' * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagCampaignOp $tag_campaign_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagRelationshipsSegmentsRequest($id, $apiKey = null) + public function tagCampaignsRequest($id, $tag_campaign_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagRelationshipsSegments' + 'Missing the required parameter $id when calling tagCampaigns' + ); + } + // verify the required parameter 'tag_campaign_op' is set + if ($tag_campaign_op === null || (is_array($tag_campaign_op) && count($tag_campaign_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_campaign_op when calling tagCampaigns' ); } - $resourcePath = '/api/tags/{id}/relationships/segments/'; + $resourcePath = '/api/tags/{id}/relationships/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7126,17 +7916,23 @@ public function getTagRelationshipsSegmentsRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_campaign_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_campaign_op)); + } else { + $httpBody = $tag_campaign_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7151,7 +7947,7 @@ public function getTagRelationshipsSegmentsRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7175,7 +7971,7 @@ public function getTagRelationshipsSegmentsRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7185,7 +7981,7 @@ public function getTagRelationshipsSegmentsRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7193,36 +7989,73 @@ public function getTagRelationshipsSegmentsRequest($id, $apiKey = null) } /** - * Operation getTagRelationshipsTagGroup + * Alias of `tagCampaignsRequest` + * + * @deprecated use `tagCampaignsRequest` instead + */ + public function createTagRelationshipsCampaignsRequest(...$args) { + return $this->tagCampaignsRequest(...$args); + } + + /** + * Alias of `tagCampaignsRequest` * - * Get Tag Relationships Tag Group + * @deprecated use `tagCampaignsRequest` instead + */ + public function createTagRelationshipsCampaignRequest(...$args) { + return $this->tagCampaignsRequest(...$args); + } + + /** + * Operation tagFlows + * + * Tag Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op tag_flow_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTagRelationshipsTagGroup($id, $apiKey = null) + public function tagFlows($id, $tag_flow_op, $apiKey = null) { - list($response) = $this->getTagRelationshipsTagGroupWithHttpInfo($id, $apiKey); - return $response; + $this->tagFlowsWithHttpInfo($id, $tag_flow_op, $apiKey); + } + + /** + * Alias of `tagFlows` + * + * @deprecated use `tagFlows` instead + */ + public function createTagRelationshipsFlows(...$args) { + return $this->tagFlows(...$args); } /** - * Operation getTagRelationshipsTagGroupWithHttpInfo + * Alias of `tagFlows` * - * Get Tag Relationships Tag Group + * @deprecated use `tagFlows` instead + */ + public function createTagRelationshipsFlow(...$args) { + return $this->tagFlows(...$args); + } + + /** + * Operation tagFlowsWithHttpInfo + * + * Tag Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagRelationshipsTagGroupWithHttpInfo($id, $apiKey = null) + public function tagFlowsWithHttpInfo($id, $tag_flow_op, $apiKey = null) { - $request = $this->getTagRelationshipsTagGroupRequest($id, $apiKey); + $request = $this->tagFlowsRequest($id, $tag_flow_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7259,103 +8092,10 @@ public function getTagRelationshipsTagGroupWithHttpInfo($id, $apiKey = null) ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7378,18 +8118,37 @@ public function getTagRelationshipsTagGroupWithHttpInfo($id, $apiKey = null) } /** - * Operation getTagRelationshipsTagGroupAsync + * Alias of `tagFlowsWithHttpInfo` + * + * @deprecated use `tagFlowsWithHttpInfo` instead + */ + public function createTagRelationshipsFlowsWithHttpInfo(...$args) { + return $this->tagFlowsWithHttpInfo(...$args); + } + + /** + * Alias of `tagFlowsWithHttpInfo` + * + * @deprecated use `tagFlowsWithHttpInfo` instead + */ + public function createTagRelationshipsFlowWithHttpInfo(...$args) { + return $this->tagFlowsWithHttpInfo(...$args); + } + + /** + * Operation tagFlowsAsync * - * Get Tag Relationships Tag Group + * Tag Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsTagGroupAsync($id, $apiKey = null) + public function tagFlowsAsync($id, $tag_flow_op, $apiKey = null) { - return $this->getTagRelationshipsTagGroupAsyncWithHttpInfo($id, $apiKey) + return $this->tagFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -7398,43 +8157,44 @@ function ($response) { } /** - * Operation getTagRelationshipsTagGroupAsyncWithHttpInfo + * Alias of `tagFlowsAsync` + * + * @deprecated use `tagFlowsAsync` instead + */ + public function createTagRelationshipsFlowsAsync(...$args) { + return $this->tagFlowsAsync(...$args); + } + + /** + * Alias of `tagFlowsAsync` + * + * @deprecated use `tagFlowsAsync` instead + */ + public function createTagRelationshipsFlowAsync(...$args) { + return $this->tagFlowsAsync(...$args); + } + + /** + * Operation tagFlowsAsyncWithHttpInfo * - * Get Tag Relationships Tag Group + * Tag Flows * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagRelationshipsTagGroupAsyncWithHttpInfo($id, $apiKey = null) + public function tagFlowsAsyncWithHttpInfo($id, $tag_flow_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagRelationshipsTagGroupRequest($id, $apiKey); + $returnType = ''; + $request = $this->tagFlowsRequest($id, $tag_flow_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -7454,23 +8214,48 @@ function ($exception) { } /** - * Create request for operation 'getTagRelationshipsTagGroup' + * Alias of `tagFlowsAsyncWithHttpInfo` + * + * @deprecated use `tagFlowsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsFlowsAsyncWithHttpInfo(...$args) { + return $this->tagFlowsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `tagFlowsAsyncWithHttpInfo` + * + * @deprecated use `tagFlowsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsFlowAsyncWithHttpInfo(...$args) { + return $this->tagFlowsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'tagFlows' * - * @param string $id (required) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagFlowOp $tag_flow_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagRelationshipsTagGroupRequest($id, $apiKey = null) + public function tagFlowsRequest($id, $tag_flow_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagRelationshipsTagGroup' + 'Missing the required parameter $id when calling tagFlows' + ); + } + // verify the required parameter 'tag_flow_op' is set + if ($tag_flow_op === null || (is_array($tag_flow_op) && count($tag_flow_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_flow_op when calling tagFlows' ); } - $resourcePath = '/api/tags/{id}/relationships/tag-group/'; + $resourcePath = '/api/tags/{id}/relationships/flows'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7491,17 +8276,23 @@ public function getTagRelationshipsTagGroupRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_flow_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_flow_op)); + } else { + $httpBody = $tag_flow_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7516,7 +8307,7 @@ public function getTagRelationshipsTagGroupRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7540,7 +8331,7 @@ public function getTagRelationshipsTagGroupRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7550,7 +8341,7 @@ public function getTagRelationshipsTagGroupRequest($id, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7558,38 +8349,73 @@ public function getTagRelationshipsTagGroupRequest($id, $apiKey = null) } /** - * Operation getTagTagGroup + * Alias of `tagFlowsRequest` + * + * @deprecated use `tagFlowsRequest` instead + */ + public function createTagRelationshipsFlowsRequest(...$args) { + return $this->tagFlowsRequest(...$args); + } + + /** + * Alias of `tagFlowsRequest` + * + * @deprecated use `tagFlowsRequest` instead + */ + public function createTagRelationshipsFlowRequest(...$args) { + return $this->tagFlowsRequest(...$args); + } + + /** + * Operation tagLists * - * Get Tag Tag Group + * Tag Lists * - * @param string $id (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op tag_list_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTagTagGroup($id, $fields_tag_group = null, $apiKey = null) + public function tagLists($id, $tag_list_op, $apiKey = null) { - list($response) = $this->getTagTagGroupWithHttpInfo($id, $fields_tag_group, $apiKey); - return $response; + $this->tagListsWithHttpInfo($id, $tag_list_op, $apiKey); + } + + /** + * Alias of `tagLists` + * + * @deprecated use `tagLists` instead + */ + public function createTagRelationshipsLists(...$args) { + return $this->tagLists(...$args); + } + + /** + * Alias of `tagLists` + * + * @deprecated use `tagLists` instead + */ + public function createTagRelationshipsList(...$args) { + return $this->tagLists(...$args); } /** - * Operation getTagTagGroupWithHttpInfo + * Operation tagListsWithHttpInfo * - * Get Tag Tag Group + * Tag Lists * - * @param string $id (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagTagGroupWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) + public function tagListsWithHttpInfo($id, $tag_list_op, $apiKey = null) { - $request = $this->getTagTagGroupRequest($id, $fields_tag_group, $apiKey); + $request = $this->tagListsRequest($id, $tag_list_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -7626,138 +8452,63 @@ public function getTagTagGroupWithHttpInfo($id, $fields_tag_group = null, $apiKe ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } + return [null, $statusCode, $response->getHeaders()]; - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + } catch (ApiException $e) { + switch ($e->getCode()) { case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Alias of `tagListsWithHttpInfo` + * + * @deprecated use `tagListsWithHttpInfo` instead + */ + public function createTagRelationshipsListsWithHttpInfo(...$args) { + return $this->tagListsWithHttpInfo(...$args); + } - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\KlaviyoAPI\Model\GetAccounts400Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } + /** + * Alias of `tagListsWithHttpInfo` + * + * @deprecated use `tagListsWithHttpInfo` instead + */ + public function createTagRelationshipsListWithHttpInfo(...$args) { + return $this->tagListsWithHttpInfo(...$args); + } /** - * Operation getTagTagGroupAsync + * Operation tagListsAsync * - * Get Tag Tag Group + * Tag Lists * - * @param string $id (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagTagGroupAsync($id, $fields_tag_group = null, $apiKey = null) + public function tagListsAsync($id, $tag_list_op, $apiKey = null) { - return $this->getTagTagGroupAsyncWithHttpInfo($id, $fields_tag_group, $apiKey) + return $this->tagListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -7766,44 +8517,44 @@ function ($response) { } /** - * Operation getTagTagGroupAsyncWithHttpInfo + * Alias of `tagListsAsync` + * + * @deprecated use `tagListsAsync` instead + */ + public function createTagRelationshipsListsAsync(...$args) { + return $this->tagListsAsync(...$args); + } + + /** + * Alias of `tagListsAsync` + * + * @deprecated use `tagListsAsync` instead + */ + public function createTagRelationshipsListAsync(...$args) { + return $this->tagListsAsync(...$args); + } + + /** + * Operation tagListsAsyncWithHttpInfo * - * Get Tag Tag Group + * Tag Lists * - * @param string $id (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagTagGroupAsyncWithHttpInfo($id, $fields_tag_group = null, $apiKey = null) + public function tagListsAsyncWithHttpInfo($id, $tag_list_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagTagGroupRequest($id, $fields_tag_group, $apiKey); + $returnType = ''; + $request = $this->tagListsRequest($id, $tag_list_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -7823,39 +8574,54 @@ function ($exception) { } /** - * Create request for operation 'getTagTagGroup' + * Alias of `tagListsAsyncWithHttpInfo` + * + * @deprecated use `tagListsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsListsAsyncWithHttpInfo(...$args) { + return $this->tagListsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `tagListsAsyncWithHttpInfo` + * + * @deprecated use `tagListsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsListAsyncWithHttpInfo(...$args) { + return $this->tagListsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'tagLists' * - * @param string $id (required) - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagListOp $tag_list_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagTagGroupRequest($id, $fields_tag_group = null, $apiKey = null) + public function tagListsRequest($id, $tag_list_op, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTagTagGroup' + 'Missing the required parameter $id when calling tagLists' + ); + } + // verify the required parameter 'tag_list_op' is set + if ($tag_list_op === null || (is_array($tag_list_op) && count($tag_list_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_list_op when calling tagLists' ); } - $resourcePath = '/api/tags/{id}/tag-group/'; + $resourcePath = '/api/tags/{id}/relationships/lists'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag_group, - 'fields[tag-group]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -7870,17 +8636,23 @@ public function getTagTagGroupRequest($id, $fields_tag_group = null, $apiKey = n if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_list_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_list_op)); + } else { + $httpBody = $tag_list_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -7895,7 +8667,7 @@ public function getTagTagGroupRequest($id, $fields_tag_group = null, $apiKey = n // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -7919,7 +8691,7 @@ public function getTagTagGroupRequest($id, $fields_tag_group = null, $apiKey = n $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -7929,7 +8701,7 @@ public function getTagTagGroupRequest($id, $fields_tag_group = null, $apiKey = n $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7937,46 +8709,73 @@ public function getTagTagGroupRequest($id, $fields_tag_group = null, $apiKey = n } /** - * Operation getTags + * Alias of `tagListsRequest` * - * Get Tags + * @deprecated use `tagListsRequest` instead + */ + public function createTagRelationshipsListsRequest(...$args) { + return $this->tagListsRequest(...$args); + } + + /** + * Alias of `tagListsRequest` + * + * @deprecated use `tagListsRequest` instead + */ + public function createTagRelationshipsListRequest(...$args) { + return $this->tagListsRequest(...$args); + } + + /** + * Operation tagSegments + * + * Tag Segments * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op tag_segment_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTags($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function tagSegments($id, $tag_segment_op, $apiKey = null) { - list($response) = $this->getTagsWithHttpInfo($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); - return $response; + $this->tagSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey); } /** - * Operation getTagsWithHttpInfo + * Alias of `tagSegments` * - * Get Tags + * @deprecated use `tagSegments` instead + */ + public function createTagRelationshipsSegments(...$args) { + return $this->tagSegments(...$args); + } + + /** + * Alias of `tagSegments` + * + * @deprecated use `tagSegments` instead + */ + public function createTagRelationshipsSegment(...$args) { + return $this->tagSegments(...$args); + } + + /** + * Operation tagSegmentsWithHttpInfo * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Tag Segments + * + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTagsWithHttpInfo($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function tagSegmentsWithHttpInfo($id, $tag_segment_op, $apiKey = null) { - $request = $this->getTagsRequest($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + $request = $this->tagSegmentsRequest($id, $tag_segment_op, $apiKey); try { $options = $this->createHttpClientOption(); @@ -8013,103 +8812,10 @@ public function getTagsWithHttpInfo($fields_tag_group = null, $fields_tag = null ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8132,23 +8838,37 @@ public function getTagsWithHttpInfo($fields_tag_group = null, $fields_tag = null } /** - * Operation getTagsAsync + * Alias of `tagSegmentsWithHttpInfo` * - * Get Tags + * @deprecated use `tagSegmentsWithHttpInfo` instead + */ + public function createTagRelationshipsSegmentsWithHttpInfo(...$args) { + return $this->tagSegmentsWithHttpInfo(...$args); + } + + /** + * Alias of `tagSegmentsWithHttpInfo` + * + * @deprecated use `tagSegmentsWithHttpInfo` instead + */ + public function createTagRelationshipsSegmentWithHttpInfo(...$args) { + return $this->tagSegmentsWithHttpInfo(...$args); + } + + /** + * Operation tagSegmentsAsync * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Tag Segments + * + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagsAsync($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function tagSegmentsAsync($id, $tag_segment_op, $apiKey = null) { - return $this->getTagsAsyncWithHttpInfo($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey) + return $this->tagSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey) ->then( function ($response) { return $response[0]; @@ -8157,48 +8877,44 @@ function ($response) { } /** - * Operation getTagsAsyncWithHttpInfo + * Alias of `tagSegmentsAsync` * - * Get Tags + * @deprecated use `tagSegmentsAsync` instead + */ + public function createTagRelationshipsSegmentsAsync(...$args) { + return $this->tagSegmentsAsync(...$args); + } + + /** + * Alias of `tagSegmentsAsync` + * + * @deprecated use `tagSegmentsAsync` instead + */ + public function createTagRelationshipsSegmentAsync(...$args) { + return $this->tagSegmentsAsync(...$args); + } + + /** + * Operation tagSegmentsAsyncWithHttpInfo + * + * Tag Segments * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTagsAsyncWithHttpInfo($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function tagSegmentsAsyncWithHttpInfo($id, $tag_segment_op, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTagsRequest($fields_tag_group, $fields_tag, $filter, $include, $page_cursor, $sort, $apiKey); + $returnType = ''; + $request = $this->tagSegmentsRequest($id, $tag_segment_op, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -8218,99 +8934,85 @@ function ($exception) { } /** - * Create request for operation 'getTags' + * Alias of `tagSegmentsAsyncWithHttpInfo` + * + * @deprecated use `tagSegmentsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsSegmentsAsyncWithHttpInfo(...$args) { + return $this->tagSegmentsAsyncWithHttpInfo(...$args); + } + + /** + * Alias of `tagSegmentsAsyncWithHttpInfo` + * + * @deprecated use `tagSegmentsAsyncWithHttpInfo` instead + */ + public function createTagRelationshipsSegmentAsyncWithHttpInfo(...$args) { + return $this->tagSegmentsAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'tagSegments' * - * @param string[] $fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string $id The Tag ID (required) + * @param \KlaviyoAPI\Model\TagSegmentOp $tag_segment_op (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTagsRequest($fields_tag_group = null, $fields_tag = null, $filter = null, $include = null, $page_cursor = null, $sort = null, $apiKey = null) + public function tagSegmentsRequest($id, $tag_segment_op, $apiKey = null) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling tagSegments' + ); + } + // verify the required parameter 'tag_segment_op' is set + if ($tag_segment_op === null || (is_array($tag_segment_op) && count($tag_segment_op) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tag_segment_op when calling tagSegments' + ); + } - $resourcePath = '/api/tags/'; + $resourcePath = '/api/tags/{id}/relationships/segments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag_group, - 'fields[tag-group]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_tag, - 'fields[tag]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $filter, - 'filter', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include, - 'include', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_cursor, - 'page[cursor]', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $sort, - 'sort', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($tag_segment_op)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_segment_op)); + } else { + $httpBody = $tag_segment_op; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -8325,7 +9027,7 @@ public function getTagsRequest($fields_tag_group = null, $fields_tag = null, $fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8349,7 +9051,7 @@ public function getTagsRequest($fields_tag_group = null, $fields_tag = null, $fi $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8359,13 +9061,31 @@ public function getTagsRequest($fields_tag_group = null, $fields_tag = null, $fi $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } + /** + * Alias of `tagSegmentsRequest` + * + * @deprecated use `tagSegmentsRequest` instead + */ + public function createTagRelationshipsSegmentsRequest(...$args) { + return $this->tagSegmentsRequest(...$args); + } + + /** + * Alias of `tagSegmentsRequest` + * + * @deprecated use `tagSegmentsRequest` instead + */ + public function createTagRelationshipsSegmentRequest(...$args) { + return $this->tagSegmentsRequest(...$args); + } + /** * Operation updateTag * @@ -8543,7 +9263,7 @@ public function updateTagRequest($id, $tag_update_query, $apiKey = null) ); } - $resourcePath = '/api/tags/{id}/'; + $resourcePath = '/api/tags/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8564,18 +9284,18 @@ public function updateTagRequest($id, $tag_update_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($tag_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_update_query)); } else { $httpBody = $tag_update_query; @@ -8595,7 +9315,7 @@ public function updateTagRequest($id, $tag_update_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -8619,7 +9339,7 @@ public function updateTagRequest($id, $tag_update_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -8925,7 +9645,7 @@ public function updateTagGroupRequest($id, $tag_group_update_query, $apiKey = nu ); } - $resourcePath = '/api/tag-groups/{id}/'; + $resourcePath = '/api/tag-groups/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8946,18 +9666,18 @@ public function updateTagGroupRequest($id, $tag_group_update_query, $apiKey = nu if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($tag_group_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tag_group_update_query)); } else { $httpBody = $tag_group_update_query; @@ -8977,7 +9697,7 @@ public function updateTagGroupRequest($id, $tag_group_update_query, $apiKey = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -9001,7 +9721,7 @@ public function updateTagGroupRequest($id, $tag_group_update_query, $apiKey = nu $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/API/TemplatesApi.php b/lib/API/TemplatesApi.php index 232d745..5c84e96 100644 --- a/lib/API/TemplatesApi.php +++ b/lib/API/TemplatesApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -117,36 +117,45 @@ public function getConfig() } /** - * Operation createTemplate + * Operation cloneTemplate * - * Create Template + * Clone Template * - * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query template_create_query (required) + * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query template_clone_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createTemplate($template_create_query, $apiKey = null) + public function cloneTemplate($template_clone_query, $apiKey = null) { - list($response) = $this->createTemplateWithHttpInfo($template_create_query, $apiKey); + list($response) = $this->cloneTemplateWithHttpInfo($template_clone_query, $apiKey); return $response; } /** - * Operation createTemplateWithHttpInfo + * Alias of `cloneTemplate` * - * Create Template + * @deprecated use `cloneTemplate` instead + */ + public function createTemplateClone(...$args) { + return $this->cloneTemplate(...$args); + } + + /** + * Operation cloneTemplateWithHttpInfo * - * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) + * Clone Template + * + * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createTemplateWithHttpInfo($template_create_query, $apiKey = null) + public function cloneTemplateWithHttpInfo($template_clone_query, $apiKey = null) { - $request = $this->createTemplateRequest($template_create_query, $apiKey); + $request = $this->cloneTemplateRequest($template_clone_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -302,18 +311,27 @@ public function createTemplateWithHttpInfo($template_create_query, $apiKey = nul } /** - * Operation createTemplateAsync + * Alias of `cloneTemplateWithHttpInfo` * - * Create Template + * @deprecated use `cloneTemplateWithHttpInfo` instead + */ + public function createTemplateCloneWithHttpInfo(...$args) { + return $this->cloneTemplateWithHttpInfo(...$args); + } + + /** + * Operation cloneTemplateAsync * - * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) + * Clone Template + * + * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTemplateAsync($template_create_query, $apiKey = null) + public function cloneTemplateAsync($template_clone_query, $apiKey = null) { - return $this->createTemplateAsyncWithHttpInfo($template_create_query, $apiKey) + return $this->cloneTemplateAsyncWithHttpInfo($template_clone_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -322,19 +340,28 @@ function ($response) { } /** - * Operation createTemplateAsyncWithHttpInfo + * Alias of `cloneTemplateAsync` * - * Create Template + * @deprecated use `cloneTemplateAsync` instead + */ + public function createTemplateCloneAsync(...$args) { + return $this->cloneTemplateAsync(...$args); + } + + /** + * Operation cloneTemplateAsyncWithHttpInfo * - * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) + * Clone Template + * + * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTemplateAsyncWithHttpInfo($template_create_query, $apiKey = null) + public function cloneTemplateAsyncWithHttpInfo($template_clone_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createTemplateRequest($template_create_query, $apiKey); + $request = $this->cloneTemplateRequest($template_clone_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -378,23 +405,32 @@ function ($exception) { } /** - * Create request for operation 'createTemplate' + * Alias of `cloneTemplateAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) + * @deprecated use `cloneTemplateAsyncWithHttpInfo` instead + */ + public function createTemplateCloneAsyncWithHttpInfo(...$args) { + return $this->cloneTemplateAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'cloneTemplate' + * + * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTemplateRequest($template_create_query, $apiKey = null) + public function cloneTemplateRequest($template_clone_query, $apiKey = null) { - // verify the required parameter 'template_create_query' is set - if ($template_create_query === null || (is_array($template_create_query) && count($template_create_query) === 0)) { + // verify the required parameter 'template_clone_query' is set + if ($template_clone_query === null || (is_array($template_clone_query) && count($template_clone_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $template_create_query when calling createTemplate' + 'Missing the required parameter $template_clone_query when calling cloneTemplate' ); } - $resourcePath = '/api/templates/'; + $resourcePath = '/api/template-clone'; $formParams = []; $queryParams = []; $headerParams = []; @@ -407,21 +443,21 @@ public function createTemplateRequest($template_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($template_create_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_create_query)); + if (isset($template_clone_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_clone_query)); } else { - $httpBody = $template_create_query; + $httpBody = $template_clone_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -438,7 +474,7 @@ public function createTemplateRequest($template_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -462,7 +498,7 @@ public function createTemplateRequest($template_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -480,36 +516,45 @@ public function createTemplateRequest($template_create_query, $apiKey = null) } /** - * Operation createTemplateClone + * Alias of `cloneTemplateRequest` + * + * @deprecated use `cloneTemplateRequest` instead + */ + public function createTemplateCloneRequest(...$args) { + return $this->cloneTemplateRequest(...$args); + } + + /** + * Operation createTemplate * - * Create Template Clone + * Create Template * - * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query template_clone_query (required) + * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query template_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createTemplateClone($template_clone_query, $apiKey = null) + public function createTemplate($template_create_query, $apiKey = null) { - list($response) = $this->createTemplateCloneWithHttpInfo($template_clone_query, $apiKey); + list($response) = $this->createTemplateWithHttpInfo($template_create_query, $apiKey); return $response; } /** - * Operation createTemplateCloneWithHttpInfo + * Operation createTemplateWithHttpInfo * - * Create Template Clone + * Create Template * - * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) + * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createTemplateCloneWithHttpInfo($template_clone_query, $apiKey = null) + public function createTemplateWithHttpInfo($template_create_query, $apiKey = null) { - $request = $this->createTemplateCloneRequest($template_clone_query, $apiKey); + $request = $this->createTemplateRequest($template_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -665,18 +710,18 @@ public function createTemplateCloneWithHttpInfo($template_clone_query, $apiKey = } /** - * Operation createTemplateCloneAsync + * Operation createTemplateAsync * - * Create Template Clone + * Create Template * - * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) + * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTemplateCloneAsync($template_clone_query, $apiKey = null) + public function createTemplateAsync($template_create_query, $apiKey = null) { - return $this->createTemplateCloneAsyncWithHttpInfo($template_clone_query, $apiKey) + return $this->createTemplateAsyncWithHttpInfo($template_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -685,19 +730,19 @@ function ($response) { } /** - * Operation createTemplateCloneAsyncWithHttpInfo + * Operation createTemplateAsyncWithHttpInfo * - * Create Template Clone + * Create Template * - * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) + * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTemplateCloneAsyncWithHttpInfo($template_clone_query, $apiKey = null) + public function createTemplateAsyncWithHttpInfo($template_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createTemplateCloneRequest($template_clone_query, $apiKey); + $request = $this->createTemplateRequest($template_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -741,23 +786,23 @@ function ($exception) { } /** - * Create request for operation 'createTemplateClone' + * Create request for operation 'createTemplate' * - * @param \KlaviyoAPI\Model\TemplateCloneQuery $template_clone_query (required) + * @param \KlaviyoAPI\Model\TemplateCreateQuery $template_create_query (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTemplateCloneRequest($template_clone_query, $apiKey = null) + public function createTemplateRequest($template_create_query, $apiKey = null) { - // verify the required parameter 'template_clone_query' is set - if ($template_clone_query === null || (is_array($template_clone_query) && count($template_clone_query) === 0)) { + // verify the required parameter 'template_create_query' is set + if ($template_create_query === null || (is_array($template_create_query) && count($template_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $template_clone_query when calling createTemplateClone' + 'Missing the required parameter $template_create_query when calling createTemplate' ); } - $resourcePath = '/api/template-clone/'; + $resourcePath = '/api/templates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -770,21 +815,21 @@ public function createTemplateCloneRequest($template_clone_query, $apiKey = null if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($template_clone_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_clone_query)); + if (isset($template_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_create_query)); } else { - $httpBody = $template_clone_query; + $httpBody = $template_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -801,7 +846,7 @@ public function createTemplateCloneRequest($template_clone_query, $apiKey = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -825,7 +870,7 @@ public function createTemplateCloneRequest($template_clone_query, $apiKey = null $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -843,36 +888,45 @@ public function createTemplateCloneRequest($template_clone_query, $apiKey = null } /** - * Operation createTemplateRender + * Operation createUniversalContent * - * Create Template Render + * Create Universal Content * - * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query template_render_query (required) + * @param \KlaviyoAPI\Model\UniversalContentCreateQuery $universal_content_create_query Create a template universal content (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function createTemplateRender($template_render_query, $apiKey = null) + public function createUniversalContent($universal_content_create_query, $apiKey = null) { - list($response) = $this->createTemplateRenderWithHttpInfo($template_render_query, $apiKey); + list($response) = $this->createUniversalContentWithHttpInfo($universal_content_create_query, $apiKey); return $response; } /** - * Operation createTemplateRenderWithHttpInfo + * Alias of `createUniversalContent` * - * Create Template Render + * @deprecated use `createUniversalContent` instead + */ + public function createTemplateUniversalContent(...$args) { + return $this->createUniversalContent(...$args); + } + + /** + * Operation createUniversalContentWithHttpInfo * - * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * Create Universal Content + * + * @param \KlaviyoAPI\Model\UniversalContentCreateQuery $universal_content_create_query Create a template universal content (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function createTemplateRenderWithHttpInfo($template_render_query, $apiKey = null) + public function createUniversalContentWithHttpInfo($universal_content_create_query, $apiKey = null) { - $request = $this->createTemplateRenderRequest($template_render_query, $apiKey); + $request = $this->createUniversalContentRequest($universal_content_create_query, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1028,18 +1082,27 @@ public function createTemplateRenderWithHttpInfo($template_render_query, $apiKey } /** - * Operation createTemplateRenderAsync + * Alias of `createUniversalContentWithHttpInfo` + * + * @deprecated use `createUniversalContentWithHttpInfo` instead + */ + public function createTemplateUniversalContentWithHttpInfo(...$args) { + return $this->createUniversalContentWithHttpInfo(...$args); + } + + /** + * Operation createUniversalContentAsync * - * Create Template Render + * Create Universal Content * - * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * @param \KlaviyoAPI\Model\UniversalContentCreateQuery $universal_content_create_query Create a template universal content (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTemplateRenderAsync($template_render_query, $apiKey = null) + public function createUniversalContentAsync($universal_content_create_query, $apiKey = null) { - return $this->createTemplateRenderAsyncWithHttpInfo($template_render_query, $apiKey) + return $this->createUniversalContentAsyncWithHttpInfo($universal_content_create_query, $apiKey) ->then( function ($response) { return $response[0]; @@ -1048,19 +1111,28 @@ function ($response) { } /** - * Operation createTemplateRenderAsyncWithHttpInfo + * Alias of `createUniversalContentAsync` + * + * @deprecated use `createUniversalContentAsync` instead + */ + public function createTemplateUniversalContentAsync(...$args) { + return $this->createUniversalContentAsync(...$args); + } + + /** + * Operation createUniversalContentAsyncWithHttpInfo * - * Create Template Render + * Create Universal Content * - * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * @param \KlaviyoAPI\Model\UniversalContentCreateQuery $universal_content_create_query Create a template universal content (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTemplateRenderAsyncWithHttpInfo($template_render_query, $apiKey = null) + public function createUniversalContentAsyncWithHttpInfo($universal_content_create_query, $apiKey = null) { $returnType = 'array'; - $request = $this->createTemplateRenderRequest($template_render_query, $apiKey); + $request = $this->createUniversalContentRequest($universal_content_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1104,23 +1176,32 @@ function ($exception) { } /** - * Create request for operation 'createTemplateRender' + * Alias of `createUniversalContentAsyncWithHttpInfo` * - * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * @deprecated use `createUniversalContentAsyncWithHttpInfo` instead + */ + public function createTemplateUniversalContentAsyncWithHttpInfo(...$args) { + return $this->createUniversalContentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'createUniversalContent' + * + * @param \KlaviyoAPI\Model\UniversalContentCreateQuery $universal_content_create_query Create a template universal content (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTemplateRenderRequest($template_render_query, $apiKey = null) + public function createUniversalContentRequest($universal_content_create_query, $apiKey = null) { - // verify the required parameter 'template_render_query' is set - if ($template_render_query === null || (is_array($template_render_query) && count($template_render_query) === 0)) { + // verify the required parameter 'universal_content_create_query' is set + if ($universal_content_create_query === null || (is_array($universal_content_create_query) && count($universal_content_create_query) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $template_render_query when calling createTemplateRender' + 'Missing the required parameter $universal_content_create_query when calling createUniversalContent' ); } - $resourcePath = '/api/template-render/'; + $resourcePath = '/api/template-universal-content'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1133,21 +1214,21 @@ public function createTemplateRenderRequest($template_render_query, $apiKey = nu if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) - if (isset($template_render_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_render_query)); + if (isset($universal_content_create_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($universal_content_create_query)); } else { - $httpBody = $template_render_query; + $httpBody = $universal_content_create_query; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1164,7 +1245,7 @@ public function createTemplateRenderRequest($template_render_query, $apiKey = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1188,7 +1269,7 @@ public function createTemplateRenderRequest($template_render_query, $apiKey = nu $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1205,6 +1286,15 @@ public function createTemplateRenderRequest($template_render_query, $apiKey = nu ); } + /** + * Alias of `createUniversalContentRequest` + * + * @deprecated use `createUniversalContentRequest` instead + */ + public function createTemplateUniversalContentRequest(...$args) { + return $this->createUniversalContentRequest(...$args); + } + /** * Operation deleteTemplate * @@ -1371,7 +1461,7 @@ public function deleteTemplateRequest($id, $apiKey = null) ); } - $resourcePath = '/api/templates/{id}/'; + $resourcePath = '/api/templates/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1392,11 +1482,11 @@ public function deleteTemplateRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1417,7 +1507,7 @@ public function deleteTemplateRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1441,7 +1531,7 @@ public function deleteTemplateRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1459,38 +1549,44 @@ public function deleteTemplateRequest($id, $apiKey = null) } /** - * Operation getTemplate + * Operation deleteUniversalContent * - * Get Template + * Delete Universal Content * - * @param string $id The ID of template (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $id The ID of the template universal content (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + * @return void */ - public function getTemplate($id, $fields_template = null, $apiKey = null) + public function deleteUniversalContent($id, $apiKey = null) { - list($response) = $this->getTemplateWithHttpInfo($id, $fields_template, $apiKey); - return $response; + $this->deleteUniversalContentWithHttpInfo($id, $apiKey); } /** - * Operation getTemplateWithHttpInfo + * Alias of `deleteUniversalContent` * - * Get Template + * @deprecated use `deleteUniversalContent` instead + */ + public function deleteTemplateUniversalContent(...$args) { + return $this->deleteUniversalContent(...$args); + } + + /** + * Operation deleteUniversalContentWithHttpInfo * - * @param string $id The ID of template (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Delete Universal Content + * + * @param string $id The ID of the template universal content (required) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getTemplateWithHttpInfo($id, $fields_template = null, $apiKey = null) + public function deleteUniversalContentWithHttpInfo($id, $apiKey = null) { - $request = $this->getTemplateRequest($id, $fields_template, $apiKey); + $request = $this->deleteUniversalContentRequest($id, $apiKey); try { $options = $this->createHttpClientOption(); @@ -1527,103 +1623,10 @@ public function getTemplateWithHttpInfo($id, $fields_template = null, $apiKey = ); } - switch($statusCode) { - case 200: - if ('array' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('array<string,mixed>' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { - $content = json_decode($content); - } - } - - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'array'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'array', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1646,19 +1649,27 @@ public function getTemplateWithHttpInfo($id, $fields_template = null, $apiKey = } /** - * Operation getTemplateAsync - * - * Get Template + * Alias of `deleteUniversalContentWithHttpInfo` * - * @param string $id The ID of template (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `deleteUniversalContentWithHttpInfo` instead + */ + public function deleteTemplateUniversalContentWithHttpInfo(...$args) { + return $this->deleteUniversalContentWithHttpInfo(...$args); + } + + /** + * Operation deleteUniversalContentAsync + * + * Delete Universal Content + * + * @param string $id The ID of the template universal content (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplateAsync($id, $fields_template = null, $apiKey = null) + public function deleteUniversalContentAsync($id, $apiKey = null) { - return $this->getTemplateAsyncWithHttpInfo($id, $fields_template, $apiKey) + return $this->deleteUniversalContentAsyncWithHttpInfo($id, $apiKey) ->then( function ($response) { return $response[0]; @@ -1667,44 +1678,34 @@ function ($response) { } /** - * Operation getTemplateAsyncWithHttpInfo + * Alias of `deleteUniversalContentAsync` * - * Get Template + * @deprecated use `deleteUniversalContentAsync` instead + */ + public function deleteTemplateUniversalContentAsync(...$args) { + return $this->deleteUniversalContentAsync(...$args); + } + + /** + * Operation deleteUniversalContentAsyncWithHttpInfo * - * @param string $id The ID of template (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * Delete Universal Content + * + * @param string $id The ID of the template universal content (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplateAsyncWithHttpInfo($id, $fields_template = null, $apiKey = null) + public function deleteUniversalContentAsyncWithHttpInfo($id, $apiKey = null) { - $returnType = 'array'; - $request = $this->getTemplateRequest($id, $fields_template, $apiKey); + $returnType = ''; + $request = $this->deleteUniversalContentRequest($id, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - $parsed_content = json_decode(json_encode($content), TRUE); - if (json_last_error() != JSON_ERROR_NONE) { - $parsed_content = $content; - } - - return [ - $parsed_content, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1724,39 +1725,38 @@ function ($exception) { } /** - * Create request for operation 'getTemplate' + * Alias of `deleteUniversalContentAsyncWithHttpInfo` * - * @param string $id The ID of template (required) - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) + * @deprecated use `deleteUniversalContentAsyncWithHttpInfo` instead + */ + public function deleteTemplateUniversalContentAsyncWithHttpInfo(...$args) { + return $this->deleteUniversalContentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'deleteUniversalContent' + * + * @param string $id The ID of the template universal content (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTemplateRequest($id, $fields_template = null, $apiKey = null) + public function deleteUniversalContentRequest($id, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getTemplate' + 'Missing the required parameter $id when calling deleteUniversalContent' ); } - $resourcePath = '/api/templates/{id}/'; + $resourcePath = '/api/template-universal-content/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_template, - 'fields[template]', // param base name - 'array', // openApiType - 'form', // style - false, // explode - false // required - ) ?? []); // path params @@ -1771,11 +1771,11 @@ public function getTemplateRequest($id, $fields_template = null, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1796,7 +1796,7 @@ public function getTemplateRequest($id, $fields_template = null, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1820,7 +1820,7 @@ public function getTemplateRequest($id, $fields_template = null, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1830,7 +1830,7 @@ public function getTemplateRequest($id, $fields_template = null, $apiKey = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1838,42 +1838,62 @@ public function getTemplateRequest($id, $fields_template = null, $apiKey = null) } /** - * Operation getTemplates + * Alias of `deleteUniversalContentRequest` * - * Get Templates + * @deprecated use `deleteUniversalContentRequest` instead + */ + public function deleteTemplateUniversalContentRequest(...$args) { + return $this->deleteUniversalContentRequest(...$args); + } + + /** + * Operation getAllUniversalContent + * + * Get All Universal Content * - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function getTemplates($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getAllUniversalContent($fields_template_universal_content = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - list($response) = $this->getTemplatesWithHttpInfo($fields_template, $filter, $page_cursor, $sort, $apiKey); + list($response) = $this->getAllUniversalContentWithHttpInfo($fields_template_universal_content, $filter, $page_cursor, $page_size, $sort, $apiKey); return $response; } /** - * Operation getTemplatesWithHttpInfo + * Alias of `getAllUniversalContent` * - * Get Templates + * @deprecated use `getAllUniversalContent` instead + */ + public function getTemplateUniversalContent(...$args) { + return $this->getAllUniversalContent(...$args); + } + + /** + * Operation getAllUniversalContentWithHttpInfo * - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get All Universal Content + * + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function getTemplatesWithHttpInfo($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getAllUniversalContentWithHttpInfo($fields_template_universal_content = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - $request = $this->getTemplatesRequest($fields_template, $filter, $page_cursor, $sort, $apiKey); + $request = $this->getAllUniversalContentRequest($fields_template_universal_content, $filter, $page_cursor, $page_size, $sort, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2029,21 +2049,31 @@ public function getTemplatesWithHttpInfo($fields_template = null, $filter = null } /** - * Operation getTemplatesAsync + * Alias of `getAllUniversalContentWithHttpInfo` * - * Get Templates + * @deprecated use `getAllUniversalContentWithHttpInfo` instead + */ + public function getTemplateUniversalContentWithHttpInfo(...$args) { + return $this->getAllUniversalContentWithHttpInfo(...$args); + } + + /** + * Operation getAllUniversalContentAsync + * + * Get All Universal Content * - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplatesAsync($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getAllUniversalContentAsync($fields_template_universal_content = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { - return $this->getTemplatesAsyncWithHttpInfo($fields_template, $filter, $page_cursor, $sort, $apiKey) + return $this->getAllUniversalContentAsyncWithHttpInfo($fields_template_universal_content, $filter, $page_cursor, $page_size, $sort, $apiKey) ->then( function ($response) { return $response[0]; @@ -2052,22 +2082,32 @@ function ($response) { } /** - * Operation getTemplatesAsyncWithHttpInfo + * Alias of `getAllUniversalContentAsync` * - * Get Templates + * @deprecated use `getAllUniversalContentAsync` instead + */ + public function getTemplateUniversalContentAsync(...$args) { + return $this->getAllUniversalContentAsync(...$args); + } + + /** + * Operation getAllUniversalContentAsyncWithHttpInfo * - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * Get All Universal Content + * + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplatesAsyncWithHttpInfo($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getAllUniversalContentAsyncWithHttpInfo($fields_template_universal_content = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { $returnType = 'array'; - $request = $this->getTemplatesRequest($fields_template, $filter, $page_cursor, $sort, $apiKey); + $request = $this->getAllUniversalContentRequest($fields_template_universal_content, $filter, $page_cursor, $page_size, $sort, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2111,20 +2151,37 @@ function ($exception) { } /** - * Create request for operation 'getTemplates' + * Alias of `getAllUniversalContentAsyncWithHttpInfo` + * + * @deprecated use `getAllUniversalContentAsyncWithHttpInfo` instead + */ + public function getTemplateUniversalContentAsyncWithHttpInfo(...$args) { + return $this->getAllUniversalContentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'getAllUniversalContent' * - * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) - * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination (optional) - * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting (optional) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getTemplatesRequest($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + public function getAllUniversalContentRequest($fields_template_universal_content = null, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null) { + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TemplatesApi.getAllUniversalContent, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TemplatesApi.getAllUniversalContent, must be bigger than or equal to 1.'); + } - $resourcePath = '/api/templates/'; + + $resourcePath = '/api/template-universal-content'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2133,8 +2190,8 @@ public function getTemplatesRequest($fields_template = null, $filter = null, $pa // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fields_template, - 'fields[template]', // param base name + $fields_template_universal_content, + 'fields[template-universal-content]', // param base name 'array', // openApiType 'form', // style false, // explode @@ -2159,6 +2216,15 @@ public function getTemplatesRequest($fields_template = null, $filter = null, $pa false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $sort, 'sort', // param base name @@ -2173,11 +2239,11 @@ public function getTemplatesRequest($fields_template = null, $filter = null, $pa if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2198,7 +2264,7 @@ public function getTemplatesRequest($fields_template = null, $filter = null, $pa // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2222,7 +2288,7 @@ public function getTemplatesRequest($fields_template = null, $filter = null, $pa $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2240,38 +2306,47 @@ public function getTemplatesRequest($fields_template = null, $filter = null, $pa } /** - * Operation updateTemplate + * Alias of `getAllUniversalContentRequest` * - * Update Template + * @deprecated use `getAllUniversalContentRequest` instead + */ + public function getTemplateUniversalContentRequest(...$args) { + return $this->getAllUniversalContentRequest(...$args); + } + + /** + * Operation getTemplate + * + * Get Template * * @param string $id The ID of template (required) - * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query template_update_query (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response */ - public function updateTemplate($id, $template_update_query, $apiKey = null) + public function getTemplate($id, $fields_template = null, $apiKey = null) { - list($response) = $this->updateTemplateWithHttpInfo($id, $template_update_query, $apiKey); + list($response) = $this->getTemplateWithHttpInfo($id, $fields_template, $apiKey); return $response; } /** - * Operation updateTemplateWithHttpInfo + * Operation getTemplateWithHttpInfo * - * Update Template + * Get Template * * @param string $id The ID of template (required) - * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) */ - public function updateTemplateWithHttpInfo($id, $template_update_query, $apiKey = null) + public function getTemplateWithHttpInfo($id, $fields_template = null, $apiKey = null) { - $request = $this->updateTemplateRequest($id, $template_update_query, $apiKey); + $request = $this->getTemplateRequest($id, $fields_template, $apiKey); try { $options = $this->createHttpClientOption(); @@ -2427,19 +2502,19 @@ public function updateTemplateWithHttpInfo($id, $template_update_query, $apiKey } /** - * Operation updateTemplateAsync + * Operation getTemplateAsync * - * Update Template + * Get Template * * @param string $id The ID of template (required) - * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTemplateAsync($id, $template_update_query, $apiKey = null) + public function getTemplateAsync($id, $fields_template = null, $apiKey = null) { - return $this->updateTemplateAsyncWithHttpInfo($id, $template_update_query, $apiKey) + return $this->getTemplateAsyncWithHttpInfo($id, $fields_template, $apiKey) ->then( function ($response) { return $response[0]; @@ -2448,20 +2523,20 @@ function ($response) { } /** - * Operation updateTemplateAsyncWithHttpInfo + * Operation getTemplateAsyncWithHttpInfo * - * Update Template + * Get Template * * @param string $id The ID of template (required) - * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTemplateAsyncWithHttpInfo($id, $template_update_query, $apiKey = null) + public function getTemplateAsyncWithHttpInfo($id, $fields_template = null, $apiKey = null) { $returnType = 'array'; - $request = $this->updateTemplateRequest($id, $template_update_query, $apiKey); + $request = $this->getTemplateRequest($id, $fields_template, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2505,36 +2580,39 @@ function ($exception) { } /** - * Create request for operation 'updateTemplate' + * Create request for operation 'getTemplate' * * @param string $id The ID of template (required) - * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateTemplateRequest($id, $template_update_query, $apiKey = null) + public function getTemplateRequest($id, $fields_template = null, $apiKey = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling updateTemplate' - ); - } - // verify the required parameter 'template_update_query' is set - if ($template_update_query === null || (is_array($template_update_query) && count($template_update_query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $template_update_query when calling updateTemplate' + 'Missing the required parameter $id when calling getTemplate' ); } - $resourcePath = '/api/templates/{id}/'; + $resourcePath = '/api/templates/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_template, + 'fields[template]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); // path params @@ -2549,23 +2627,17 @@ public function updateTemplateRequest($id, $template_update_query, $apiKey = nul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + [] ); } // for model (json/xml) - if (isset($template_update_query)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_update_query)); - } else { - $httpBody = $template_update_query; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2580,7 +2652,7 @@ public function updateTemplateRequest($id, $template_update_query, $apiKey = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2604,7 +2676,7 @@ public function updateTemplateRequest($id, $template_update_query, $apiKey = nul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2614,13 +2686,2011 @@ public function updateTemplateRequest($id, $template_update_query, $apiKey = nul $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } + /** + * Operation getTemplates + * + * Get Templates + * + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getTemplates($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + { + list($response) = $this->getTemplatesWithHttpInfo($fields_template, $filter, $page_cursor, $sort, $apiKey); + return $response; + } + + /** + * Operation getTemplatesWithHttpInfo + * + * Get Templates + * + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getTemplatesWithHttpInfo($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + { + $request = $this->getTemplatesRequest($fields_template, $filter, $page_cursor, $sort, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTemplatesAsync + * + * Get Templates + * + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTemplatesAsync($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + { + return $this->getTemplatesAsyncWithHttpInfo($fields_template, $filter, $page_cursor, $sort, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTemplatesAsyncWithHttpInfo + * + * Get Templates + * + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTemplatesAsyncWithHttpInfo($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTemplatesRequest($fields_template, $filter, $page_cursor, $sort, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTemplates' + * + * @param string[] $fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTemplatesRequest($fields_template = null, $filter = null, $page_cursor = null, $sort = null, $apiKey = null) + { + + $resourcePath = '/api/templates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_template, + 'fields[template]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter, + 'filter', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort, + 'sort', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUniversalContent + * + * Get Universal Content + * + * @param string $id The ID of the universal content (required) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getUniversalContent($id, $fields_template_universal_content = null, $apiKey = null) + { + list($response) = $this->getUniversalContentWithHttpInfo($id, $fields_template_universal_content, $apiKey); + return $response; + } + + /** + * Operation getUniversalContentWithHttpInfo + * + * Get Universal Content + * + * @param string $id The ID of the universal content (required) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getUniversalContentWithHttpInfo($id, $fields_template_universal_content = null, $apiKey = null) + { + $request = $this->getUniversalContentRequest($id, $fields_template_universal_content, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUniversalContentAsync + * + * Get Universal Content + * + * @param string $id The ID of the universal content (required) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUniversalContentAsync($id, $fields_template_universal_content = null, $apiKey = null) + { + return $this->getUniversalContentAsyncWithHttpInfo($id, $fields_template_universal_content, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUniversalContentAsyncWithHttpInfo + * + * Get Universal Content + * + * @param string $id The ID of the universal content (required) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getUniversalContentAsyncWithHttpInfo($id, $fields_template_universal_content = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getUniversalContentRequest($id, $fields_template_universal_content, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUniversalContent' + * + * @param string $id The ID of the universal content (required) + * @param string[] $fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getUniversalContentRequest($id, $fields_template_universal_content = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUniversalContent' + ); + } + + $resourcePath = '/api/template-universal-content/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_template_universal_content, + 'fields[template-universal-content]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation renderTemplate + * + * Render Template + * + * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query template_render_query (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function renderTemplate($template_render_query, $apiKey = null) + { + list($response) = $this->renderTemplateWithHttpInfo($template_render_query, $apiKey); + return $response; + } + + /** + * Alias of `renderTemplate` + * + * @deprecated use `renderTemplate` instead + */ + public function createTemplateRender(...$args) { + return $this->renderTemplate(...$args); + } + + /** + * Operation renderTemplateWithHttpInfo + * + * Render Template + * + * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function renderTemplateWithHttpInfo($template_render_query, $apiKey = null) + { + $request = $this->renderTemplateRequest($template_render_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `renderTemplateWithHttpInfo` + * + * @deprecated use `renderTemplateWithHttpInfo` instead + */ + public function createTemplateRenderWithHttpInfo(...$args) { + return $this->renderTemplateWithHttpInfo(...$args); + } + + /** + * Operation renderTemplateAsync + * + * Render Template + * + * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function renderTemplateAsync($template_render_query, $apiKey = null) + { + return $this->renderTemplateAsyncWithHttpInfo($template_render_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `renderTemplateAsync` + * + * @deprecated use `renderTemplateAsync` instead + */ + public function createTemplateRenderAsync(...$args) { + return $this->renderTemplateAsync(...$args); + } + + /** + * Operation renderTemplateAsyncWithHttpInfo + * + * Render Template + * + * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function renderTemplateAsyncWithHttpInfo($template_render_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->renderTemplateRequest($template_render_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `renderTemplateAsyncWithHttpInfo` + * + * @deprecated use `renderTemplateAsyncWithHttpInfo` instead + */ + public function createTemplateRenderAsyncWithHttpInfo(...$args) { + return $this->renderTemplateAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'renderTemplate' + * + * @param \KlaviyoAPI\Model\TemplateRenderQuery $template_render_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function renderTemplateRequest($template_render_query, $apiKey = null) + { + // verify the required parameter 'template_render_query' is set + if ($template_render_query === null || (is_array($template_render_query) && count($template_render_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $template_render_query when calling renderTemplate' + ); + } + + $resourcePath = '/api/template-render'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($template_render_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_render_query)); + } else { + $httpBody = $template_render_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `renderTemplateRequest` + * + * @deprecated use `renderTemplateRequest` instead + */ + public function createTemplateRenderRequest(...$args) { + return $this->renderTemplateRequest(...$args); + } + + /** + * Operation updateTemplate + * + * Update Template + * + * @param string $id The ID of template (required) + * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query template_update_query (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function updateTemplate($id, $template_update_query, $apiKey = null) + { + list($response) = $this->updateTemplateWithHttpInfo($id, $template_update_query, $apiKey); + return $response; + } + + /** + * Operation updateTemplateWithHttpInfo + * + * Update Template + * + * @param string $id The ID of template (required) + * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTemplateWithHttpInfo($id, $template_update_query, $apiKey = null) + { + $request = $this->updateTemplateRequest($id, $template_update_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTemplateAsync + * + * Update Template + * + * @param string $id The ID of template (required) + * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateTemplateAsync($id, $template_update_query, $apiKey = null) + { + return $this->updateTemplateAsyncWithHttpInfo($id, $template_update_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTemplateAsyncWithHttpInfo + * + * Update Template + * + * @param string $id The ID of template (required) + * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateTemplateAsyncWithHttpInfo($id, $template_update_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->updateTemplateRequest($id, $template_update_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTemplate' + * + * @param string $id The ID of template (required) + * @param \KlaviyoAPI\Model\TemplateUpdateQuery $template_update_query (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTemplateRequest($id, $template_update_query, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateTemplate' + ); + } + // verify the required parameter 'template_update_query' is set + if ($template_update_query === null || (is_array($template_update_query) && count($template_update_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $template_update_query when calling updateTemplate' + ); + } + + $resourcePath = '/api/templates/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($template_update_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($template_update_query)); + } else { + $httpBody = $template_update_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateUniversalContent + * + * Update Universal Content + * + * @param string $id The ID of the template universal content (required) + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQuery $universal_content_partial_update_query Update a universal content by ID (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function updateUniversalContent($id, $universal_content_partial_update_query, $apiKey = null) + { + list($response) = $this->updateUniversalContentWithHttpInfo($id, $universal_content_partial_update_query, $apiKey); + return $response; + } + + /** + * Alias of `updateUniversalContent` + * + * @deprecated use `updateUniversalContent` instead + */ + public function updateTemplateUniversalContent(...$args) { + return $this->updateUniversalContent(...$args); + } + + /** + * Operation updateUniversalContentWithHttpInfo + * + * Update Universal Content + * + * @param string $id The ID of the template universal content (required) + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQuery $universal_content_partial_update_query Update a universal content by ID (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function updateUniversalContentWithHttpInfo($id, $universal_content_partial_update_query, $apiKey = null) + { + $request = $this->updateUniversalContentRequest($id, $universal_content_partial_update_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Alias of `updateUniversalContentWithHttpInfo` + * + * @deprecated use `updateUniversalContentWithHttpInfo` instead + */ + public function updateTemplateUniversalContentWithHttpInfo(...$args) { + return $this->updateUniversalContentWithHttpInfo(...$args); + } + + /** + * Operation updateUniversalContentAsync + * + * Update Universal Content + * + * @param string $id The ID of the template universal content (required) + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQuery $universal_content_partial_update_query Update a universal content by ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateUniversalContentAsync($id, $universal_content_partial_update_query, $apiKey = null) + { + return $this->updateUniversalContentAsyncWithHttpInfo($id, $universal_content_partial_update_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Alias of `updateUniversalContentAsync` + * + * @deprecated use `updateUniversalContentAsync` instead + */ + public function updateTemplateUniversalContentAsync(...$args) { + return $this->updateUniversalContentAsync(...$args); + } + + /** + * Operation updateUniversalContentAsyncWithHttpInfo + * + * Update Universal Content + * + * @param string $id The ID of the template universal content (required) + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQuery $universal_content_partial_update_query Update a universal content by ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateUniversalContentAsyncWithHttpInfo($id, $universal_content_partial_update_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->updateUniversalContentRequest($id, $universal_content_partial_update_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Alias of `updateUniversalContentAsyncWithHttpInfo` + * + * @deprecated use `updateUniversalContentAsyncWithHttpInfo` instead + */ + public function updateTemplateUniversalContentAsyncWithHttpInfo(...$args) { + return $this->updateUniversalContentAsyncWithHttpInfo(...$args); + } + + /** + * Create request for operation 'updateUniversalContent' + * + * @param string $id The ID of the template universal content (required) + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQuery $universal_content_partial_update_query Update a universal content by ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateUniversalContentRequest($id, $universal_content_partial_update_query, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateUniversalContent' + ); + } + // verify the required parameter 'universal_content_partial_update_query' is set + if ($universal_content_partial_update_query === null || (is_array($universal_content_partial_update_query) && count($universal_content_partial_update_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $universal_content_partial_update_query when calling updateUniversalContent' + ); + } + + $resourcePath = '/api/template-universal-content/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($universal_content_partial_update_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($universal_content_partial_update_query)); + } else { + $httpBody = $universal_content_partial_update_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Alias of `updateUniversalContentRequest` + * + * @deprecated use `updateUniversalContentRequest` instead + */ + public function updateTemplateUniversalContentRequest(...$args) { + return $this->updateUniversalContentRequest(...$args); + } + /** * Create http client option * diff --git a/lib/API/TrackingSettingsApi.php b/lib/API/TrackingSettingsApi.php new file mode 100644 index 0000000..f34b613 --- /dev/null +++ b/lib/API/TrackingSettingsApi.php @@ -0,0 +1,1293 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getTrackingSetting + * + * Get Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getTrackingSetting($id, $fields_tracking_setting = null, $apiKey = null) + { + list($response) = $this->getTrackingSettingWithHttpInfo($id, $fields_tracking_setting, $apiKey); + return $response; + } + + /** + * Operation getTrackingSettingWithHttpInfo + * + * Get Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getTrackingSettingWithHttpInfo($id, $fields_tracking_setting = null, $apiKey = null) + { + $request = $this->getTrackingSettingRequest($id, $fields_tracking_setting, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTrackingSettingAsync + * + * Get Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTrackingSettingAsync($id, $fields_tracking_setting = null, $apiKey = null) + { + return $this->getTrackingSettingAsyncWithHttpInfo($id, $fields_tracking_setting, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTrackingSettingAsyncWithHttpInfo + * + * Get Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTrackingSettingAsyncWithHttpInfo($id, $fields_tracking_setting = null, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTrackingSettingRequest($id, $fields_tracking_setting, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTrackingSetting' + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTrackingSettingRequest($id, $fields_tracking_setting = null, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTrackingSetting' + ); + } + + $resourcePath = '/api/tracking-settings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tracking_setting, + 'fields[tracking-setting]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTrackingSettings + * + * Get Tracking Settings + * + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 1. Min: 1. Max: 1. (optional, default to 1) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function getTrackingSettings($fields_tracking_setting = null, $page_cursor = null, $page_size = 1, $apiKey = null) + { + list($response) = $this->getTrackingSettingsWithHttpInfo($fields_tracking_setting, $page_cursor, $page_size, $apiKey); + return $response; + } + + /** + * Operation getTrackingSettingsWithHttpInfo + * + * Get Tracking Settings + * + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 1. Min: 1. Max: 1. (optional, default to 1) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getTrackingSettingsWithHttpInfo($fields_tracking_setting = null, $page_cursor = null, $page_size = 1, $apiKey = null) + { + $request = $this->getTrackingSettingsRequest($fields_tracking_setting, $page_cursor, $page_size, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTrackingSettingsAsync + * + * Get Tracking Settings + * + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 1. Min: 1. Max: 1. (optional, default to 1) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTrackingSettingsAsync($fields_tracking_setting = null, $page_cursor = null, $page_size = 1, $apiKey = null) + { + return $this->getTrackingSettingsAsyncWithHttpInfo($fields_tracking_setting, $page_cursor, $page_size, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTrackingSettingsAsyncWithHttpInfo + * + * Get Tracking Settings + * + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 1. Min: 1. Max: 1. (optional, default to 1) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTrackingSettingsAsyncWithHttpInfo($fields_tracking_setting = null, $page_cursor = null, $page_size = 1, $apiKey = null) + { + $returnType = 'array'; + $request = $this->getTrackingSettingsRequest($fields_tracking_setting, $page_cursor, $page_size, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTrackingSettings' + * + * @param string[] $fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional) + * @param int $page_size Default: 1. Min: 1. Max: 1. (optional, default to 1) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTrackingSettingsRequest($fields_tracking_setting = null, $page_cursor = null, $page_size = 1, $apiKey = null) + { + if ($page_size !== null && $page_size > 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TrackingSettingsApi.getTrackingSettings, must be smaller than or equal to 1.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling TrackingSettingsApi.getTrackingSettings, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/api/tracking-settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fields_tracking_setting, + 'fields[tracking-setting]', // param base name + 'array', // openApiType + 'form', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_cursor, + 'page[cursor]', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page[size]', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTrackingSetting + * + * Update Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param \KlaviyoAPI\Model\TrackingSettingPartialUpdateQuery $tracking_setting_partial_update_query DTO for updating tracking settings (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response + */ + public function updateTrackingSetting($id, $tracking_setting_partial_update_query, $apiKey = null) + { + list($response) = $this->updateTrackingSettingWithHttpInfo($id, $tracking_setting_partial_update_query, $apiKey); + return $response; + } + + /** + * Operation updateTrackingSettingWithHttpInfo + * + * Update Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param \KlaviyoAPI\Model\TrackingSettingPartialUpdateQuery $tracking_setting_partial_update_query DTO for updating tracking settings (required) + * + * @throws \KlaviyoAPI\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of array|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function updateTrackingSettingWithHttpInfo($id, $tracking_setting_partial_update_query, $apiKey = null) + { + $request = $this->updateTrackingSettingRequest($id, $tracking_setting_partial_update_query, $apiKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('array' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('array<string,mixed>' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\KlaviyoAPI\Model\GetAccounts400Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\KlaviyoAPI\Model\GetAccounts400Response' !== 'string') { + $content = json_decode($content); + } + } + + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'array'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'array', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\KlaviyoAPI\Model\GetAccounts400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTrackingSettingAsync + * + * Update Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param \KlaviyoAPI\Model\TrackingSettingPartialUpdateQuery $tracking_setting_partial_update_query DTO for updating tracking settings (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateTrackingSettingAsync($id, $tracking_setting_partial_update_query, $apiKey = null) + { + return $this->updateTrackingSettingAsyncWithHttpInfo($id, $tracking_setting_partial_update_query, $apiKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTrackingSettingAsyncWithHttpInfo + * + * Update Tracking Setting + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param \KlaviyoAPI\Model\TrackingSettingPartialUpdateQuery $tracking_setting_partial_update_query DTO for updating tracking settings (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateTrackingSettingAsyncWithHttpInfo($id, $tracking_setting_partial_update_query, $apiKey = null) + { + $returnType = 'array'; + $request = $this->updateTrackingSettingRequest($id, $tracking_setting_partial_update_query, $apiKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + $parsed_content = json_decode(json_encode($content), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + $parsed_content = $content; + } + + return [ + $parsed_content, + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTrackingSetting' + * + * @param string $id The id of the tracking setting (account ID). (required) + * @param \KlaviyoAPI\Model\TrackingSettingPartialUpdateQuery $tracking_setting_partial_update_query DTO for updating tracking settings (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateTrackingSettingRequest($id, $tracking_setting_partial_update_query, $apiKey = null) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateTrackingSetting' + ); + } + // verify the required parameter 'tracking_setting_partial_update_query' is set + if ($tracking_setting_partial_update_query === null || (is_array($tracking_setting_partial_update_query) && count($tracking_setting_partial_update_query) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tracking_setting_partial_update_query when calling updateTrackingSetting' + ); + } + + $resourcePath = '/api/tracking-settings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($tracking_setting_partial_update_query)) { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($tracking_setting_partial_update_query)); + } else { + $httpBody = $tracking_setting_partial_update_query; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + if ($apiKey == null) { + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + } else { + $apiKey = 'Klaviyo-API-Key '.$apiKey; + } + + $headers['Authorization'] = $apiKey; + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $defaultHeaders['revision'] = ['2024-10-15']; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/API/WebhooksApi.php b/lib/API/WebhooksApi.php index 4f72f1b..074f142 100644 --- a/lib/API/WebhooksApi.php +++ b/lib/API/WebhooksApi.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -394,7 +394,7 @@ public function createWebhookRequest($webhook_create_query, $apiKey = null) ); } - $resourcePath = '/api/webhooks/'; + $resourcePath = '/api/webhooks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -407,18 +407,18 @@ public function createWebhookRequest($webhook_create_query, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($webhook_create_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($webhook_create_query)); } else { $httpBody = $webhook_create_query; @@ -438,7 +438,7 @@ public function createWebhookRequest($webhook_create_query, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -462,7 +462,7 @@ public function createWebhookRequest($webhook_create_query, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -645,7 +645,7 @@ public function deleteWebhookRequest($id, $apiKey = null) ); } - $resourcePath = '/api/webhooks/{id}/'; + $resourcePath = '/api/webhooks/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -666,11 +666,11 @@ public function deleteWebhookRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -691,7 +691,7 @@ public function deleteWebhookRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -715,7 +715,7 @@ public function deleteWebhookRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -738,8 +738,8 @@ public function deleteWebhookRequest($id, $apiKey = null) * Get Webhook * * @param string $id The ID of the webhook. (required) - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -757,8 +757,8 @@ public function getWebhook($id, $fields_webhook = null, $include = null, $apiKey * Get Webhook * * @param string $id The ID of the webhook. (required) - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -927,8 +927,8 @@ public function getWebhookWithHttpInfo($id, $fields_webhook = null, $include = n * Get Webhook * * @param string $id The ID of the webhook. (required) - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -949,8 +949,8 @@ function ($response) { * Get Webhook * * @param string $id The ID of the webhook. (required) - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1005,8 +1005,8 @@ function ($exception) { * Create request for operation 'getWebhook' * * @param string $id The ID of the webhook. (required) - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1020,7 +1020,7 @@ public function getWebhookRequest($id, $fields_webhook = null, $include = null, ); } - $resourcePath = '/api/webhooks/{id}/'; + $resourcePath = '/api/webhooks/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1059,11 +1059,11 @@ public function getWebhookRequest($id, $fields_webhook = null, $include = null, if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1084,7 +1084,7 @@ public function getWebhookRequest($id, $fields_webhook = null, $include = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1108,7 +1108,7 @@ public function getWebhookRequest($id, $fields_webhook = null, $include = null, $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1403,7 +1403,7 @@ public function getWebhookTopicRequest($id, $apiKey = null) ); } - $resourcePath = '/api/webhook-topics/{id}/'; + $resourcePath = '/api/webhook-topics/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1424,11 +1424,11 @@ public function getWebhookTopicRequest($id, $apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1449,7 +1449,7 @@ public function getWebhookTopicRequest($id, $apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1473,7 +1473,7 @@ public function getWebhookTopicRequest($id, $apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1757,7 +1757,7 @@ function ($exception) { public function getWebhookTopicsRequest($apiKey = null) { - $resourcePath = '/api/webhook-topics/'; + $resourcePath = '/api/webhook-topics'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1770,11 +1770,11 @@ public function getWebhookTopicsRequest($apiKey = null) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -1795,7 +1795,7 @@ public function getWebhookTopicsRequest($apiKey = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -1819,7 +1819,7 @@ public function getWebhookTopicsRequest($apiKey = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -1841,8 +1841,8 @@ public function getWebhookTopicsRequest($apiKey = null) * * Get Webhooks * - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1859,8 +1859,8 @@ public function getWebhooks($fields_webhook = null, $include = null, $apiKey = n * * Get Webhooks * - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \KlaviyoAPI\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2028,8 +2028,8 @@ public function getWebhooksWithHttpInfo($fields_webhook = null, $include = null, * * Get Webhooks * - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2049,8 +2049,8 @@ function ($response) { * * Get Webhooks * - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2104,8 +2104,8 @@ function ($exception) { /** * Create request for operation 'getWebhooks' * - * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets (optional) - * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships (optional) + * @param string[] $fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets (optional) + * @param string[] $include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2113,7 +2113,7 @@ function ($exception) { public function getWebhooksRequest($fields_webhook = null, $include = null, $apiKey = null) { - $resourcePath = '/api/webhooks/'; + $resourcePath = '/api/webhooks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2144,11 +2144,11 @@ public function getWebhooksRequest($fields_webhook = null, $include = null, $api if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/vnd.api+json'], [] ); } @@ -2169,7 +2169,7 @@ public function getWebhooksRequest($fields_webhook = null, $include = null, $api // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2193,7 +2193,7 @@ public function getWebhooksRequest($fields_webhook = null, $include = null, $api $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, @@ -2499,7 +2499,7 @@ public function updateWebhookRequest($id, $webhook_partial_update_query, $apiKey ); } - $resourcePath = '/api/webhooks/{id}/'; + $resourcePath = '/api/webhooks/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2520,18 +2520,18 @@ public function updateWebhookRequest($id, $webhook_partial_update_query, $apiKey if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/vnd.api+json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + ['application/vnd.api+json'], + ['application/vnd.api+json'] ); } // for model (json/xml) if (isset($webhook_partial_update_query)) { - if ($headers['Content-Type'] === 'application/json') { + if ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($webhook_partial_update_query)); } else { $httpBody = $webhook_partial_update_query; @@ -2551,7 +2551,7 @@ public function updateWebhookRequest($id, $webhook_partial_update_query, $apiKey // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif ($headers['Content-Type'] === 'application/json' || $headers['Content-Type'] === 'application/vnd.api+json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { @@ -2575,7 +2575,7 @@ public function updateWebhookRequest($id, $webhook_partial_update_query, $apiKey $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $defaultHeaders['revision'] = ['2024-07-15']; + $defaultHeaders['revision'] = ['2024-10-15']; $headers = array_merge( $defaultHeaders, diff --git a/lib/ApiException.php b/lib/ApiException.php index a700f79..097de58 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Configuration.php b/lib/Configuration.php index 2ad3c2b..27ff0b3 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -101,7 +101,7 @@ class Configuration * * @var string */ - protected $userAgent = 'klaviyo-api-php/10.0.0'; + protected $userAgent = 'klaviyo-api-php/11.0.0'; /** * Debug switch (default set to false) @@ -433,8 +433,8 @@ public static function toDebugReport() $report = 'PHP SDK (KlaviyoAPI) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 2024-07-15' . PHP_EOL; - $report .= ' SDK Package Version: 10.0.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 2024-10-15' . PHP_EOL; + $report .= ' SDK Package Version: 11.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index a16975d..0eec437 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -14,7 +14,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/KlaviyoAPI.php b/lib/KlaviyoAPI.php index 6bfabde..592f217 100644 --- a/lib/KlaviyoAPI.php +++ b/lib/KlaviyoAPI.php @@ -18,9 +18,11 @@ use KlaviyoAPI\API\MetricsApi; use KlaviyoAPI\API\ProfilesApi; use KlaviyoAPI\API\ReportingApi; +use KlaviyoAPI\API\ReviewsApi; use KlaviyoAPI\API\SegmentsApi; use KlaviyoAPI\API\TagsApi; use KlaviyoAPI\API\TemplatesApi; +use KlaviyoAPI\API\TrackingSettingsApi; use KlaviyoAPI\API\WebhooksApi; @@ -45,9 +47,11 @@ class KlaviyoAPI { public $Metrics; public $Profiles; public $Reporting; + public $Reviews; public $Segments; public $Tags; public $Templates; + public $TrackingSettings; public $Webhooks; @@ -152,6 +156,12 @@ public function __construct($api_key, $num_retries = 3, $wait_seconds = 3, $guzz $num_retries = $this->num_retries, ); + $this->Reviews = new Subclient( + new ReviewsApi(new GuzzleClient($this->guzzle_options),$this->config), + $wait_seconds = $this->wait_seconds, + $num_retries = $this->num_retries, + ); + $this->Segments = new Subclient( new SegmentsApi(new GuzzleClient($this->guzzle_options),$this->config), $wait_seconds = $this->wait_seconds, @@ -170,6 +180,12 @@ public function __construct($api_key, $num_retries = 3, $wait_seconds = 3, $guzz $num_retries = $this->num_retries, ); + $this->TrackingSettings = new Subclient( + new TrackingSettingsApi(new GuzzleClient($this->guzzle_options),$this->config), + $wait_seconds = $this->wait_seconds, + $num_retries = $this->num_retries, + ); + $this->Webhooks = new Subclient( new WebhooksApi(new GuzzleClient($this->guzzle_options),$this->config), $wait_seconds = $this->wait_seconds, diff --git a/lib/Model/APIMethodFilter.php b/lib/Model/APIMethodFilter.php index fdfee6d..2cf4556 100644 --- a/lib/Model/APIMethodFilter.php +++ b/lib/Model/APIMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/AlltimeDateFilter.php b/lib/Model/AlltimeDateFilter.php index c9ec3c5..5b0a4bb 100644 --- a/lib/Model/AlltimeDateFilter.php +++ b/lib/Model/AlltimeDateFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/AnniversaryDateFilter.php b/lib/Model/AnniversaryDateFilter.php index 3c0477f..3f1d79a 100644 --- a/lib/Model/AnniversaryDateFilter.php +++ b/lib/Model/AnniversaryDateFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/AnyEnum.php b/lib/Model/AnyEnum.php index f21debf..3c4794c 100644 --- a/lib/Model/AnyEnum.php +++ b/lib/Model/AnyEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ApiEnum.php b/lib/Model/ApiEnum.php index 3f77d7b..12bbe9a 100644 --- a/lib/Model/ApiEnum.php +++ b/lib/Model/ApiEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/AudiencesSubObject.php b/lib/Model/AudiencesSubObject.php index feda7e6..838dfd2 100644 --- a/lib/Model/AudiencesSubObject.php +++ b/lib/Model/AudiencesSubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/BackInStockEnum.php b/lib/Model/BackInStockEnum.php index 3de2621..8dcff9b 100644 --- a/lib/Model/BackInStockEnum.php +++ b/lib/Model/BackInStockEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/BackInStockMethodFilter.php b/lib/Model/BackInStockMethodFilter.php index e23bc8f..47dde8e 100644 --- a/lib/Model/BackInStockMethodFilter.php +++ b/lib/Model/BackInStockMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/BackInStockSubscriptionEnum.php b/lib/Model/BackInStockSubscriptionEnum.php index 8e0e230..8b241f6 100644 --- a/lib/Model/BackInStockSubscriptionEnum.php +++ b/lib/Model/BackInStockSubscriptionEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/BaseEventCreateQueryResourceObject.php b/lib/Model/BaseEventCreateQueryResourceObject.php index 3a37882..36401cd 100644 --- a/lib/Model/BaseEventCreateQueryResourceObject.php +++ b/lib/Model/BaseEventCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/BaseEventCreateQueryResourceObjectAttributes.php b/lib/Model/BaseEventCreateQueryResourceObjectAttributes.php index 6c8c466..6e0793b 100644 --- a/lib/Model/BaseEventCreateQueryResourceObjectAttributes.php +++ b/lib/Model/BaseEventCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/BlockDisplayOptions.php b/lib/Model/BlockDisplayOptions.php new file mode 100644 index 0000000..1ebd055 --- /dev/null +++ b/lib/Model/BlockDisplayOptions.php @@ -0,0 +1,524 @@ + + */ +class BlockDisplayOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BlockDisplayOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'show_on' => 'string', + 'visible_check' => 'string', + 'content_repeat' => '\KlaviyoAPI\Model\ContentRepeat' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'show_on' => null, + 'visible_check' => null, + 'content_repeat' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'show_on' => true, + 'visible_check' => true, + 'content_repeat' => 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 = [ + 'show_on' => 'show_on', + 'visible_check' => 'visible_check', + 'content_repeat' => 'content_repeat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'show_on' => 'setShowOn', + 'visible_check' => 'setVisibleCheck', + 'content_repeat' => 'setContentRepeat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'show_on' => 'getShowOn', + 'visible_check' => 'getVisibleCheck', + 'content_repeat' => 'getContentRepeat' + ]; + + /** + * 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; + } + + public const SHOW_ON_ALL = 'all'; + public const SHOW_ON_DESKTOP = 'desktop'; + public const SHOW_ON_MOBILE = 'mobile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShowOnAllowableValues() + { + return [ + self::SHOW_ON_ALL, + self::SHOW_ON_DESKTOP, + self::SHOW_ON_MOBILE, + ]; + } + + /** + * 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('show_on', $data ?? [], null); + $this->setIfExists('visible_check', $data ?? [], null); + $this->setIfExists('content_repeat', $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 = []; + + $allowedValues = $this->getShowOnAllowableValues(); + if (!is_null($this->container['show_on']) && !in_array($this->container['show_on'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'show_on', must be one of '%s'", + $this->container['show_on'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets show_on + * + * @return string|null + */ + public function getShowOn() + { + return $this->container['show_on']; + } + + /** + * Sets show_on + * + * @param string|null $show_on Show on. + * + * @return self + */ + public function setShowOn($show_on) + { + $allowedValues = $this->getShowOnAllowableValues(); + if (!is_null($show_on) && !in_array($show_on, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'show_on', must be one of '%s'", + $show_on, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($show_on)) { + array_push($this->openAPINullablesSetToNull, 'show_on'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('show_on', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['show_on'] = $show_on; + + return $this; + } + + /** + * Gets visible_check + * + * @return string|null + */ + public function getVisibleCheck() + { + return $this->container['visible_check']; + } + + /** + * Sets visible_check + * + * @param string|null $visible_check visible_check + * + * @return self + */ + public function setVisibleCheck($visible_check) + { + + if (is_null($visible_check)) { + array_push($this->openAPINullablesSetToNull, 'visible_check'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('visible_check', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['visible_check'] = $visible_check; + + return $this; + } + + /** + * Gets content_repeat + * + * @return \KlaviyoAPI\Model\ContentRepeat|null + */ + public function getContentRepeat() + { + return $this->container['content_repeat']; + } + + /** + * Sets content_repeat + * + * @param \KlaviyoAPI\Model\ContentRepeat|null $content_repeat content_repeat + * + * @return self + */ + public function setContentRepeat($content_repeat) + { + + if (is_null($content_repeat)) { + throw new \InvalidArgumentException('non-nullable content_repeat cannot be null'); + } + + $this->container['content_repeat'] = $content_repeat; + + 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/BlockEnum.php b/lib/Model/BlockEnum.php new file mode 100644 index 0000000..e74b03f --- /dev/null +++ b/lib/Model/BlockEnum.php @@ -0,0 +1,60 @@ + 'bool', - 'utm_params' => '\KlaviyoAPI\Model\UTMParamsSubObject[]', + 'add_tracking_params' => 'bool', + 'custom_tracking_params' => '\KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]', 'is_tracking_clicks' => 'bool', 'is_tracking_opens' => 'bool' ]; @@ -73,8 +73,8 @@ class CampaignCreateQueryResourceObjectAttributesTrackingOptions implements Mode * @psalm-var array */ protected static $openAPIFormats = [ - 'is_add_utm' => null, - 'utm_params' => null, + 'add_tracking_params' => null, + 'custom_tracking_params' => null, 'is_tracking_clicks' => null, 'is_tracking_opens' => null ]; @@ -85,8 +85,8 @@ class CampaignCreateQueryResourceObjectAttributesTrackingOptions implements Mode * @var boolean[] */ protected static array $openAPINullables = [ - 'is_add_utm' => true, - 'utm_params' => true, + 'add_tracking_params' => true, + 'custom_tracking_params' => true, 'is_tracking_clicks' => true, 'is_tracking_opens' => true ]; @@ -167,8 +167,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'is_add_utm' => 'is_add_utm', - 'utm_params' => 'utm_params', + 'add_tracking_params' => 'add_tracking_params', + 'custom_tracking_params' => 'custom_tracking_params', 'is_tracking_clicks' => 'is_tracking_clicks', 'is_tracking_opens' => 'is_tracking_opens' ]; @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'is_add_utm' => 'setIsAddUtm', - 'utm_params' => 'setUtmParams', + 'add_tracking_params' => 'setAddTrackingParams', + 'custom_tracking_params' => 'setCustomTrackingParams', 'is_tracking_clicks' => 'setIsTrackingClicks', 'is_tracking_opens' => 'setIsTrackingOpens' ]; @@ -191,8 +191,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'is_add_utm' => 'getIsAddUtm', - 'utm_params' => 'getUtmParams', + 'add_tracking_params' => 'getAddTrackingParams', + 'custom_tracking_params' => 'getCustomTrackingParams', 'is_tracking_clicks' => 'getIsTrackingClicks', 'is_tracking_opens' => 'getIsTrackingOpens' ]; @@ -254,8 +254,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('is_add_utm', $data ?? [], null); - $this->setIfExists('utm_params', $data ?? [], null); + $this->setIfExists('add_tracking_params', $data ?? [], null); + $this->setIfExists('custom_tracking_params', $data ?? [], null); $this->setIfExists('is_tracking_clicks', $data ?? [], null); $this->setIfExists('is_tracking_opens', $data ?? [], null); } @@ -303,73 +303,73 @@ public function valid() /** - * Gets is_add_utm + * Gets add_tracking_params * * @return bool|null */ - public function getIsAddUtm() + public function getAddTrackingParams() { - return $this->container['is_add_utm']; + return $this->container['add_tracking_params']; } /** - * Sets is_add_utm + * Sets add_tracking_params * - * @param bool|null $is_add_utm Whether the campaign needs UTM parameters. If set to False, UTM params will not be used. + * @param bool|null $add_tracking_params Whether the campaign needs custom tracking parameters. If set to False, tracking params will not be used. * * @return self */ - public function setIsAddUtm($is_add_utm) + public function setAddTrackingParams($add_tracking_params) { - if (is_null($is_add_utm)) { - array_push($this->openAPINullablesSetToNull, 'is_add_utm'); + if (is_null($add_tracking_params)) { + array_push($this->openAPINullablesSetToNull, 'add_tracking_params'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_add_utm', $nullablesSetToNull); + $index = array_search('add_tracking_params', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['is_add_utm'] = $is_add_utm; + $this->container['add_tracking_params'] = $add_tracking_params; return $this; } /** - * Gets utm_params + * Gets custom_tracking_params * - * @return \KlaviyoAPI\Model\UTMParamsSubObject[]|null + * @return \KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]|null */ - public function getUtmParams() + public function getCustomTrackingParams() { - return $this->container['utm_params']; + return $this->container['custom_tracking_params']; } /** - * Sets utm_params + * Sets custom_tracking_params * - * @param \KlaviyoAPI\Model\UTMParamsSubObject[]|null $utm_params A list of UTM parameters. If an empty list is given and is_add_utm is True, uses company defaults. + * @param \KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]|null $custom_tracking_params A list of custom tracking parameters. If an empty list is given and add_tracking_params is True, uses company defaults. * * @return self */ - public function setUtmParams($utm_params) + public function setCustomTrackingParams($custom_tracking_params) { - if (is_null($utm_params)) { - array_push($this->openAPINullablesSetToNull, 'utm_params'); + if (is_null($custom_tracking_params)) { + array_push($this->openAPINullablesSetToNull, 'custom_tracking_params'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('utm_params', $nullablesSetToNull); + $index = array_search('custom_tracking_params', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['utm_params'] = $utm_params; + $this->container['custom_tracking_params'] = $custom_tracking_params; return $this; } diff --git a/lib/Model/CampaignEnum.php b/lib/Model/CampaignEnum.php index 8227015..c470bb5 100644 --- a/lib/Model/CampaignEnum.php +++ b/lib/Model/CampaignEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageAssignTemplateQuery.php b/lib/Model/CampaignMessageAssignTemplateQuery.php index 92ad7b8..a034320 100644 --- a/lib/Model/CampaignMessageAssignTemplateQuery.php +++ b/lib/Model/CampaignMessageAssignTemplateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageAssignTemplateQueryResourceObject.php b/lib/Model/CampaignMessageAssignTemplateQueryResourceObject.php index 252f01c..1b76d96 100644 --- a/lib/Model/CampaignMessageAssignTemplateQueryResourceObject.php +++ b/lib/Model/CampaignMessageAssignTemplateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationships.php b/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationships.php index 2b36a38..66368cd 100644 --- a/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationships.php +++ b/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplate.php b/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplate.php index b5c79cc..c204779 100644 --- a/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplate.php +++ b/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplate.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplateData.php b/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplateData.php index 9128e20..51fce25 100644 --- a/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplateData.php +++ b/lib/Model/CampaignMessageAssignTemplateQueryResourceObjectRelationshipsTemplateData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageCreateQueryResourceObject.php b/lib/Model/CampaignMessageCreateQueryResourceObject.php index acee514..947ee08 100644 --- a/lib/Model/CampaignMessageCreateQueryResourceObject.php +++ b/lib/Model/CampaignMessageCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php index 8c8905a..6756d55 100644 --- a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php index d1292d1..fee6f75 100644 --- a/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php +++ b/lib/Model/CampaignMessageCreateQueryResourceObjectAttributesContent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessageEnum.php b/lib/Model/CampaignMessageEnum.php index 234915b..8b072ca 100644 --- a/lib/Model/CampaignMessageEnum.php +++ b/lib/Model/CampaignMessageEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessagePartialUpdateQuery.php b/lib/Model/CampaignMessagePartialUpdateQuery.php index 62e7ca6..934e521 100644 --- a/lib/Model/CampaignMessagePartialUpdateQuery.php +++ b/lib/Model/CampaignMessagePartialUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessagePartialUpdateQueryResourceObject.php b/lib/Model/CampaignMessagePartialUpdateQueryResourceObject.php index 1bdbb86..0853dda 100644 --- a/lib/Model/CampaignMessagePartialUpdateQueryResourceObject.php +++ b/lib/Model/CampaignMessagePartialUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php b/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php index f0dcced..4c8dfd5 100644 --- a/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignMessagePartialUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignPartialUpdateQuery.php b/lib/Model/CampaignPartialUpdateQuery.php index ace89f6..8a31dfd 100644 --- a/lib/Model/CampaignPartialUpdateQuery.php +++ b/lib/Model/CampaignPartialUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignPartialUpdateQueryResourceObject.php b/lib/Model/CampaignPartialUpdateQueryResourceObject.php index 850d160..f5bdc83 100644 --- a/lib/Model/CampaignPartialUpdateQueryResourceObject.php +++ b/lib/Model/CampaignPartialUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php index 5cc067d..4ec55b5 100644 --- a/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignPartialUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignRecipientEstimationJobCreateQuery.php b/lib/Model/CampaignRecipientEstimationJobCreateQuery.php index 457a7f0..2b01274 100644 --- a/lib/Model/CampaignRecipientEstimationJobCreateQuery.php +++ b/lib/Model/CampaignRecipientEstimationJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignRecipientEstimationJobCreateQueryResourceObject.php b/lib/Model/CampaignRecipientEstimationJobCreateQueryResourceObject.php index 17c45c1..8d8882b 100644 --- a/lib/Model/CampaignRecipientEstimationJobCreateQueryResourceObject.php +++ b/lib/Model/CampaignRecipientEstimationJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignRecipientEstimationJobEnum.php b/lib/Model/CampaignRecipientEstimationJobEnum.php index 650fd87..edae6f5 100644 --- a/lib/Model/CampaignRecipientEstimationJobEnum.php +++ b/lib/Model/CampaignRecipientEstimationJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignSendJobCreateQuery.php b/lib/Model/CampaignSendJobCreateQuery.php index 716c676..79d614a 100644 --- a/lib/Model/CampaignSendJobCreateQuery.php +++ b/lib/Model/CampaignSendJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignSendJobCreateQueryResourceObject.php b/lib/Model/CampaignSendJobCreateQueryResourceObject.php index d75a713..4be6788 100644 --- a/lib/Model/CampaignSendJobCreateQueryResourceObject.php +++ b/lib/Model/CampaignSendJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignSendJobEnum.php b/lib/Model/CampaignSendJobEnum.php index 4bdbec2..5c24aa7 100644 --- a/lib/Model/CampaignSendJobEnum.php +++ b/lib/Model/CampaignSendJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignSendJobPartialUpdateQuery.php b/lib/Model/CampaignSendJobPartialUpdateQuery.php index 1ed9515..b041628 100644 --- a/lib/Model/CampaignSendJobPartialUpdateQuery.php +++ b/lib/Model/CampaignSendJobPartialUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignSendJobPartialUpdateQueryResourceObject.php b/lib/Model/CampaignSendJobPartialUpdateQueryResourceObject.php index 3ede5fc..abb6341 100644 --- a/lib/Model/CampaignSendJobPartialUpdateQueryResourceObject.php +++ b/lib/Model/CampaignSendJobPartialUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignSendJobPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/CampaignSendJobPartialUpdateQueryResourceObjectAttributes.php index 58b5e17..67fd8d5 100644 --- a/lib/Model/CampaignSendJobPartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CampaignSendJobPartialUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignTrackingSettingDynamicParam.php b/lib/Model/CampaignTrackingSettingDynamicParam.php new file mode 100644 index 0000000..3780bee --- /dev/null +++ b/lib/Model/CampaignTrackingSettingDynamicParam.php @@ -0,0 +1,498 @@ + + */ +class CampaignTrackingSettingDynamicParam implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CampaignTrackingSettingDynamicParam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\DynamicEnum', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * 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; + } + + public const VALUE_CAMPAIGN_ID = 'campaign_id'; + public const VALUE_CAMPAIGN_NAME = 'campaign_name'; + public const VALUE_CAMPAIGN_NAME_ID = 'campaign_name_id'; + public const VALUE_CAMPAIGN_NAME_SEND_DAY = 'campaign_name_send_day'; + public const VALUE_EMAIL_SUBJECT = 'email_subject'; + public const VALUE_GROUP_ID = 'group_id'; + public const VALUE_GROUP_NAME = 'group_name'; + public const VALUE_GROUP_NAME_ID = 'group_name_id'; + public const VALUE_LINK_ALT_TEXT = 'link_alt_text'; + public const VALUE_MESSAGE_TYPE = 'message_type'; + public const VALUE_PROFILE_EXTERNAL_ID = 'profile_external_id'; + public const VALUE_PROFILE_ID = 'profile_id'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_CAMPAIGN_ID, + self::VALUE_CAMPAIGN_NAME, + self::VALUE_CAMPAIGN_NAME_ID, + self::VALUE_CAMPAIGN_NAME_SEND_DAY, + self::VALUE_EMAIL_SUBJECT, + self::VALUE_GROUP_ID, + self::VALUE_GROUP_NAME, + self::VALUE_GROUP_NAME_ID, + self::VALUE_LINK_ALT_TEXT, + self::VALUE_MESSAGE_TYPE, + self::VALUE_PROFILE_EXTERNAL_ID, + self::VALUE_PROFILE_ID, + ]; + } + + /** + * 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('value', $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['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\DynamicEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\DynamicEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|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/CampaignTrackingSettingStaticParam.php b/lib/Model/CampaignTrackingSettingStaticParam.php new file mode 100644 index 0000000..39ced54 --- /dev/null +++ b/lib/Model/CampaignTrackingSettingStaticParam.php @@ -0,0 +1,444 @@ + + */ +class CampaignTrackingSettingStaticParam implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CampaignTrackingSettingStaticParam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\StaticEnum', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * 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('value', $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['value'] === null) { + $invalidProperties[] = "'value' 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\StaticEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\StaticEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|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/CampaignValuesReportEnum.php b/lib/Model/CampaignValuesReportEnum.php index 0c8dd3e..c91ee32 100644 --- a/lib/Model/CampaignValuesReportEnum.php +++ b/lib/Model/CampaignValuesReportEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignValuesRequestDTO.php b/lib/Model/CampaignValuesRequestDTO.php index b12affd..67b784d 100644 --- a/lib/Model/CampaignValuesRequestDTO.php +++ b/lib/Model/CampaignValuesRequestDTO.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignValuesRequestDTOResourceObject.php b/lib/Model/CampaignValuesRequestDTOResourceObject.php index 3fe4dae..5f3152d 100644 --- a/lib/Model/CampaignValuesRequestDTOResourceObject.php +++ b/lib/Model/CampaignValuesRequestDTOResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php b/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php index b71b36d..74eb374 100644 --- a/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php +++ b/lib/Model/CampaignValuesRequestDTOResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CampaignValuesRequestDTOResourceObjectAttributesTimeframe.php b/lib/Model/CampaignValuesRequestDTOResourceObjectAttributesTimeframe.php index 2e8bf20..5d98c58 100644 --- a/lib/Model/CampaignValuesRequestDTOResourceObjectAttributesTimeframe.php +++ b/lib/Model/CampaignValuesRequestDTOResourceObjectAttributesTimeframe.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CarrierDeactivationEnum.php b/lib/Model/CarrierDeactivationEnum.php index 3cd8c9d..100f47e 100644 --- a/lib/Model/CarrierDeactivationEnum.php +++ b/lib/Model/CarrierDeactivationEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CarrierDeactivationMethodFilter.php b/lib/Model/CarrierDeactivationMethodFilter.php index 5c98318..89353e3 100644 --- a/lib/Model/CarrierDeactivationMethodFilter.php +++ b/lib/Model/CarrierDeactivationMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryBulkCreateJobEnum.php b/lib/Model/CatalogCategoryBulkCreateJobEnum.php index c4310cb..8bbf203 100644 --- a/lib/Model/CatalogCategoryBulkCreateJobEnum.php +++ b/lib/Model/CatalogCategoryBulkCreateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryBulkDeleteJobEnum.php b/lib/Model/CatalogCategoryBulkDeleteJobEnum.php index 97fb77f..3d093b6 100644 --- a/lib/Model/CatalogCategoryBulkDeleteJobEnum.php +++ b/lib/Model/CatalogCategoryBulkDeleteJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryBulkUpdateJobEnum.php b/lib/Model/CatalogCategoryBulkUpdateJobEnum.php index 37e701e..c35ce64 100644 --- a/lib/Model/CatalogCategoryBulkUpdateJobEnum.php +++ b/lib/Model/CatalogCategoryBulkUpdateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateJobCreateQuery.php b/lib/Model/CatalogCategoryCreateJobCreateQuery.php index 9517af4..8d140df 100644 --- a/lib/Model/CatalogCategoryCreateJobCreateQuery.php +++ b/lib/Model/CatalogCategoryCreateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObject.php b/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObject.php index 958aeaa..1616bd0 100644 --- a/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributes.php index a3f01ac..533c4ed 100644 --- a/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributesCategories.php b/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributesCategories.php index efc8677..1503f6b 100644 --- a/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributesCategories.php +++ b/lib/Model/CatalogCategoryCreateJobCreateQueryResourceObjectAttributesCategories.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateQuery.php b/lib/Model/CatalogCategoryCreateQuery.php index a329adc..13f5a91 100644 --- a/lib/Model/CatalogCategoryCreateQuery.php +++ b/lib/Model/CatalogCategoryCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateQueryResourceObject.php b/lib/Model/CatalogCategoryCreateQueryResourceObject.php index fb78b1d..cf71e0c 100644 --- a/lib/Model/CatalogCategoryCreateQueryResourceObject.php +++ b/lib/Model/CatalogCategoryCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php index 11613a4..0d1681d 100644 --- a/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogCategoryCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationships.php b/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationships.php index 1a9e5cb..8869044 100644 --- a/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationships.php +++ b/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItems.php b/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItems.php index f25281c..a58c88e 100644 --- a/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItems.php +++ b/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItems.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItemsDataInner.php b/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItemsDataInner.php index fd355e6..224cbc6 100644 --- a/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItemsDataInner.php +++ b/lib/Model/CatalogCategoryCreateQueryResourceObjectRelationshipsItemsDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryDeleteJobCreateQuery.php b/lib/Model/CatalogCategoryDeleteJobCreateQuery.php index 401763c..5892f24 100644 --- a/lib/Model/CatalogCategoryDeleteJobCreateQuery.php +++ b/lib/Model/CatalogCategoryDeleteJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObject.php b/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObject.php index dfe9a36..d127be4 100644 --- a/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributes.php index 335e1a9..01b8840 100644 --- a/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributesCategories.php b/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributesCategories.php index 8f5851b..1d70bb2 100644 --- a/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributesCategories.php +++ b/lib/Model/CatalogCategoryDeleteJobCreateQueryResourceObjectAttributesCategories.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryDeleteQueryResourceObject.php b/lib/Model/CatalogCategoryDeleteQueryResourceObject.php index 427c90c..b6d4aa8 100644 --- a/lib/Model/CatalogCategoryDeleteQueryResourceObject.php +++ b/lib/Model/CatalogCategoryDeleteQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryEnum.php b/lib/Model/CatalogCategoryEnum.php index 73bf408..e0ecf4c 100644 --- a/lib/Model/CatalogCategoryEnum.php +++ b/lib/Model/CatalogCategoryEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryItemOp.php b/lib/Model/CatalogCategoryItemOp.php index 36def47..65e9925 100644 --- a/lib/Model/CatalogCategoryItemOp.php +++ b/lib/Model/CatalogCategoryItemOp.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryUpdateJobCreateQuery.php b/lib/Model/CatalogCategoryUpdateJobCreateQuery.php index fe77a7f..53f14c5 100644 --- a/lib/Model/CatalogCategoryUpdateJobCreateQuery.php +++ b/lib/Model/CatalogCategoryUpdateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObject.php b/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObject.php index 5dff4c1..c859a18 100644 --- a/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributes.php index 30486a9..bfb1037 100644 --- a/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributesCategories.php b/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributesCategories.php index 5e859af..ecb2417 100644 --- a/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributesCategories.php +++ b/lib/Model/CatalogCategoryUpdateJobCreateQueryResourceObjectAttributesCategories.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryUpdateQuery.php b/lib/Model/CatalogCategoryUpdateQuery.php index a9be884..ab192ed 100644 --- a/lib/Model/CatalogCategoryUpdateQuery.php +++ b/lib/Model/CatalogCategoryUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryUpdateQueryResourceObject.php b/lib/Model/CatalogCategoryUpdateQueryResourceObject.php index 0bb7e14..4a7c745 100644 --- a/lib/Model/CatalogCategoryUpdateQueryResourceObject.php +++ b/lib/Model/CatalogCategoryUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php b/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php index 28ed0cd..1fda771 100644 --- a/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogCategoryUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemBulkCreateJobEnum.php b/lib/Model/CatalogItemBulkCreateJobEnum.php index 43ed1e9..90fea0d 100644 --- a/lib/Model/CatalogItemBulkCreateJobEnum.php +++ b/lib/Model/CatalogItemBulkCreateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemBulkDeleteJobEnum.php b/lib/Model/CatalogItemBulkDeleteJobEnum.php index 5f2f387..c3637c5 100644 --- a/lib/Model/CatalogItemBulkDeleteJobEnum.php +++ b/lib/Model/CatalogItemBulkDeleteJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemBulkUpdateJobEnum.php b/lib/Model/CatalogItemBulkUpdateJobEnum.php index 0f1d122..9eac320 100644 --- a/lib/Model/CatalogItemBulkUpdateJobEnum.php +++ b/lib/Model/CatalogItemBulkUpdateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCategoryOp.php b/lib/Model/CatalogItemCategoryOp.php index f11c024..5de65e0 100644 --- a/lib/Model/CatalogItemCategoryOp.php +++ b/lib/Model/CatalogItemCategoryOp.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateJobCreateQuery.php b/lib/Model/CatalogItemCreateJobCreateQuery.php index 89c97e8..db98ecf 100644 --- a/lib/Model/CatalogItemCreateJobCreateQuery.php +++ b/lib/Model/CatalogItemCreateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateJobCreateQueryResourceObject.php b/lib/Model/CatalogItemCreateJobCreateQueryResourceObject.php index b477347..0a2fae2 100644 --- a/lib/Model/CatalogItemCreateJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogItemCreateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributes.php index 35e04e9..01a695d 100644 --- a/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributesItems.php b/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributesItems.php index d6534ed..49a6a81 100644 --- a/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributesItems.php +++ b/lib/Model/CatalogItemCreateJobCreateQueryResourceObjectAttributesItems.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateQuery.php b/lib/Model/CatalogItemCreateQuery.php index f0f8d18..41b8a4c 100644 --- a/lib/Model/CatalogItemCreateQuery.php +++ b/lib/Model/CatalogItemCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateQueryResourceObject.php b/lib/Model/CatalogItemCreateQueryResourceObject.php index 1543070..849b500 100644 --- a/lib/Model/CatalogItemCreateQueryResourceObject.php +++ b/lib/Model/CatalogItemCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php index 05de2d7..44a2f6f 100644 --- a/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogItemCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateQueryResourceObjectRelationships.php b/lib/Model/CatalogItemCreateQueryResourceObjectRelationships.php index 8c701f3..95fc771 100644 --- a/lib/Model/CatalogItemCreateQueryResourceObjectRelationships.php +++ b/lib/Model/CatalogItemCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategories.php b/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategories.php index c4bc9c4..ed503a3 100644 --- a/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategories.php +++ b/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategories.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategoriesDataInner.php b/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategoriesDataInner.php index 68d32b3..9c1df80 100644 --- a/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategoriesDataInner.php +++ b/lib/Model/CatalogItemCreateQueryResourceObjectRelationshipsCategoriesDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemDeleteJobCreateQuery.php b/lib/Model/CatalogItemDeleteJobCreateQuery.php index bd58dde..34281dd 100644 --- a/lib/Model/CatalogItemDeleteJobCreateQuery.php +++ b/lib/Model/CatalogItemDeleteJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemDeleteJobCreateQueryResourceObject.php b/lib/Model/CatalogItemDeleteJobCreateQueryResourceObject.php index fb85c0f..8ea0488 100644 --- a/lib/Model/CatalogItemDeleteJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogItemDeleteJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributes.php index 58fb8d5..0544e9a 100644 --- a/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributesItems.php b/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributesItems.php index 9e51240..bb0ba92 100644 --- a/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributesItems.php +++ b/lib/Model/CatalogItemDeleteJobCreateQueryResourceObjectAttributesItems.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemDeleteQueryResourceObject.php b/lib/Model/CatalogItemDeleteQueryResourceObject.php index 6bab608..1640626 100644 --- a/lib/Model/CatalogItemDeleteQueryResourceObject.php +++ b/lib/Model/CatalogItemDeleteQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemEnum.php b/lib/Model/CatalogItemEnum.php index 7ce201b..47d7f2c 100644 --- a/lib/Model/CatalogItemEnum.php +++ b/lib/Model/CatalogItemEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemUpdateJobCreateQuery.php b/lib/Model/CatalogItemUpdateJobCreateQuery.php index 39a5168..57e7225 100644 --- a/lib/Model/CatalogItemUpdateJobCreateQuery.php +++ b/lib/Model/CatalogItemUpdateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemUpdateJobCreateQueryResourceObject.php b/lib/Model/CatalogItemUpdateJobCreateQueryResourceObject.php index 059c235..5dae716 100644 --- a/lib/Model/CatalogItemUpdateJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogItemUpdateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributes.php index 1737530..ee8c503 100644 --- a/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributesItems.php b/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributesItems.php index 5ff0461..c3f09e6 100644 --- a/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributesItems.php +++ b/lib/Model/CatalogItemUpdateJobCreateQueryResourceObjectAttributesItems.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemUpdateQuery.php b/lib/Model/CatalogItemUpdateQuery.php index 35e6bb0..a310d82 100644 --- a/lib/Model/CatalogItemUpdateQuery.php +++ b/lib/Model/CatalogItemUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemUpdateQueryResourceObject.php b/lib/Model/CatalogItemUpdateQueryResourceObject.php index 0a475f0..e00b55a 100644 --- a/lib/Model/CatalogItemUpdateQueryResourceObject.php +++ b/lib/Model/CatalogItemUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php b/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php index f4cccaa..254947f 100644 --- a/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogItemUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantBulkCreateJobEnum.php b/lib/Model/CatalogVariantBulkCreateJobEnum.php index cdb6a8d..970b3ed 100644 --- a/lib/Model/CatalogVariantBulkCreateJobEnum.php +++ b/lib/Model/CatalogVariantBulkCreateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantBulkDeleteJobEnum.php b/lib/Model/CatalogVariantBulkDeleteJobEnum.php index f6d3766..5832e10 100644 --- a/lib/Model/CatalogVariantBulkDeleteJobEnum.php +++ b/lib/Model/CatalogVariantBulkDeleteJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantBulkUpdateJobEnum.php b/lib/Model/CatalogVariantBulkUpdateJobEnum.php index 66d69ec..a02ef92 100644 --- a/lib/Model/CatalogVariantBulkUpdateJobEnum.php +++ b/lib/Model/CatalogVariantBulkUpdateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateJobCreateQuery.php b/lib/Model/CatalogVariantCreateJobCreateQuery.php index afb5ef9..db2ac8c 100644 --- a/lib/Model/CatalogVariantCreateJobCreateQuery.php +++ b/lib/Model/CatalogVariantCreateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateJobCreateQueryResourceObject.php b/lib/Model/CatalogVariantCreateJobCreateQueryResourceObject.php index f85f2dc..25c4515 100644 --- a/lib/Model/CatalogVariantCreateJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogVariantCreateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributes.php index 0d3bf5d..20545c5 100644 --- a/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributesVariants.php b/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributesVariants.php index 2a595bf..434f742 100644 --- a/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributesVariants.php +++ b/lib/Model/CatalogVariantCreateJobCreateQueryResourceObjectAttributesVariants.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateQuery.php b/lib/Model/CatalogVariantCreateQuery.php index 2233626..e866d0f 100644 --- a/lib/Model/CatalogVariantCreateQuery.php +++ b/lib/Model/CatalogVariantCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateQueryResourceObject.php b/lib/Model/CatalogVariantCreateQueryResourceObject.php index f3f10ca..5c2aee8 100644 --- a/lib/Model/CatalogVariantCreateQueryResourceObject.php +++ b/lib/Model/CatalogVariantCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php index 3dd54c1..aef6d23 100644 --- a/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogVariantCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateQueryResourceObjectRelationships.php b/lib/Model/CatalogVariantCreateQueryResourceObjectRelationships.php index 081dc08..3d7dde7 100644 --- a/lib/Model/CatalogVariantCreateQueryResourceObjectRelationships.php +++ b/lib/Model/CatalogVariantCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItem.php b/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItem.php index 6ae8989..ee92663 100644 --- a/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItem.php +++ b/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItem.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItemData.php b/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItemData.php index 45db1c2..e847b5f 100644 --- a/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItemData.php +++ b/lib/Model/CatalogVariantCreateQueryResourceObjectRelationshipsItemData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantDeleteJobCreateQuery.php b/lib/Model/CatalogVariantDeleteJobCreateQuery.php index a6db8e6..990a821 100644 --- a/lib/Model/CatalogVariantDeleteJobCreateQuery.php +++ b/lib/Model/CatalogVariantDeleteJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObject.php b/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObject.php index 7d207dd..869ae2a 100644 --- a/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributes.php index 7aaa6dd..d2e0b42 100644 --- a/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributesVariants.php b/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributesVariants.php index 5c6a87c..160ff65 100644 --- a/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributesVariants.php +++ b/lib/Model/CatalogVariantDeleteJobCreateQueryResourceObjectAttributesVariants.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantDeleteQueryResourceObject.php b/lib/Model/CatalogVariantDeleteQueryResourceObject.php index 3e280ec..f1325ba 100644 --- a/lib/Model/CatalogVariantDeleteQueryResourceObject.php +++ b/lib/Model/CatalogVariantDeleteQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantEnum.php b/lib/Model/CatalogVariantEnum.php index 2666e1d..b1b0d7f 100644 --- a/lib/Model/CatalogVariantEnum.php +++ b/lib/Model/CatalogVariantEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantUpdateJobCreateQuery.php b/lib/Model/CatalogVariantUpdateJobCreateQuery.php index 532853c..e1de5a1 100644 --- a/lib/Model/CatalogVariantUpdateJobCreateQuery.php +++ b/lib/Model/CatalogVariantUpdateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObject.php b/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObject.php index bf8b0ce..4c30338 100644 --- a/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObject.php +++ b/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributes.php b/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributes.php index 7ded379..a77fbf9 100644 --- a/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributesVariants.php b/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributesVariants.php index 34e8de1..677941c 100644 --- a/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributesVariants.php +++ b/lib/Model/CatalogVariantUpdateJobCreateQueryResourceObjectAttributesVariants.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantUpdateQuery.php b/lib/Model/CatalogVariantUpdateQuery.php index bf7d068..18c2f32 100644 --- a/lib/Model/CatalogVariantUpdateQuery.php +++ b/lib/Model/CatalogVariantUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantUpdateQueryResourceObject.php b/lib/Model/CatalogVariantUpdateQueryResourceObject.php index 393a2d7..4b07b9f 100644 --- a/lib/Model/CatalogVariantUpdateQueryResourceObject.php +++ b/lib/Model/CatalogVariantUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php b/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php index 62ee307..8524428 100644 --- a/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CatalogVariantUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CheckoutEnum.php b/lib/Model/CheckoutEnum.php index ce10eb5..3ce4b06 100644 --- a/lib/Model/CheckoutEnum.php +++ b/lib/Model/CheckoutEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CheckoutMethodFilter.php b/lib/Model/CheckoutMethodFilter.php index 25880c3..5cb6133 100644 --- a/lib/Model/CheckoutMethodFilter.php +++ b/lib/Model/CheckoutMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ConditionGroup.php b/lib/Model/ConditionGroup.php index e9e27b9..e701ed8 100644 --- a/lib/Model/ConditionGroup.php +++ b/lib/Model/ConditionGroup.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ConditionGroupConditionsInner.php b/lib/Model/ConditionGroupConditionsInner.php index 09e17bc..f2215d1 100644 --- a/lib/Model/ConditionGroupConditionsInner.php +++ b/lib/Model/ConditionGroupConditionsInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ConstantContactEnum.php b/lib/Model/ConstantContactEnum.php index 06b28f2..0319cca 100644 --- a/lib/Model/ConstantContactEnum.php +++ b/lib/Model/ConstantContactEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ConstantContactIntegrationFilter.php b/lib/Model/ConstantContactIntegrationFilter.php index 0690ddc..f8c9c2f 100644 --- a/lib/Model/ConstantContactIntegrationFilter.php +++ b/lib/Model/ConstantContactIntegrationFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ConstantContactIntegrationMethodFilter.php b/lib/Model/ConstantContactIntegrationMethodFilter.php index 2afc4ef..af1ebb5 100644 --- a/lib/Model/ConstantContactIntegrationMethodFilter.php +++ b/lib/Model/ConstantContactIntegrationMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ContentRepeat.php b/lib/Model/ContentRepeat.php new file mode 100644 index 0000000..6b52c32 --- /dev/null +++ b/lib/Model/ContentRepeat.php @@ -0,0 +1,444 @@ + + */ +class ContentRepeat implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ContentRepeat'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'repeat_for' => 'string', + 'item_alias' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'repeat_for' => null, + 'item_alias' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'repeat_for' => false, + 'item_alias' => 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 = [ + 'repeat_for' => 'repeat_for', + 'item_alias' => 'item_alias' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'repeat_for' => 'setRepeatFor', + 'item_alias' => 'setItemAlias' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'repeat_for' => 'getRepeatFor', + 'item_alias' => 'getItemAlias' + ]; + + /** + * 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('repeat_for', $data ?? [], null); + $this->setIfExists('item_alias', $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['repeat_for'] === null) { + $invalidProperties[] = "'repeat_for' can't be null"; + } + if ($this->container['item_alias'] === null) { + $invalidProperties[] = "'item_alias' 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 repeat_for + * + * @return string + */ + public function getRepeatFor() + { + return $this->container['repeat_for']; + } + + /** + * Sets repeat_for + * + * @param string $repeat_for repeat_for + * + * @return self + */ + public function setRepeatFor($repeat_for) + { + + if (is_null($repeat_for)) { + throw new \InvalidArgumentException('non-nullable repeat_for cannot be null'); + } + + $this->container['repeat_for'] = $repeat_for; + + return $this; + } + + /** + * Gets item_alias + * + * @return string + */ + public function getItemAlias() + { + return $this->container['item_alias']; + } + + /** + * Sets item_alias + * + * @param string $item_alias item_alias + * + * @return self + */ + public function setItemAlias($item_alias) + { + + if (is_null($item_alias)) { + throw new \InvalidArgumentException('non-nullable item_alias cannot be null'); + } + + $this->container['item_alias'] = $item_alias; + + 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/CouponCodeBulkCreateJobEnum.php b/lib/Model/CouponCodeBulkCreateJobEnum.php index 0150da0..5fcf931 100644 --- a/lib/Model/CouponCodeBulkCreateJobEnum.php +++ b/lib/Model/CouponCodeBulkCreateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateJobCreateQuery.php b/lib/Model/CouponCodeCreateJobCreateQuery.php index 10daf11..9649fc1 100644 --- a/lib/Model/CouponCodeCreateJobCreateQuery.php +++ b/lib/Model/CouponCodeCreateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateJobCreateQueryResourceObject.php b/lib/Model/CouponCodeCreateJobCreateQueryResourceObject.php index 609dd6b..365f455 100644 --- a/lib/Model/CouponCodeCreateJobCreateQueryResourceObject.php +++ b/lib/Model/CouponCodeCreateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributes.php index e58da36..7ea0b04 100644 --- a/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributesCouponCodes.php b/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributesCouponCodes.php index fc12c4a..7c3babe 100644 --- a/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributesCouponCodes.php +++ b/lib/Model/CouponCodeCreateJobCreateQueryResourceObjectAttributesCouponCodes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateQuery.php b/lib/Model/CouponCodeCreateQuery.php index 8d1afc9..37f174c 100644 --- a/lib/Model/CouponCodeCreateQuery.php +++ b/lib/Model/CouponCodeCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateQueryResourceObject.php b/lib/Model/CouponCodeCreateQueryResourceObject.php index 2902877..5c41389 100644 --- a/lib/Model/CouponCodeCreateQueryResourceObject.php +++ b/lib/Model/CouponCodeCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php b/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php index 4fda648..2f58c93 100644 --- a/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponCodeCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateQueryResourceObjectRelationships.php b/lib/Model/CouponCodeCreateQueryResourceObjectRelationships.php index 357b454..9805da0 100644 --- a/lib/Model/CouponCodeCreateQueryResourceObjectRelationships.php +++ b/lib/Model/CouponCodeCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCoupon.php b/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCoupon.php index 8fa16b6..ef22264 100644 --- a/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCoupon.php +++ b/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCoupon.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCouponData.php b/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCouponData.php index 6730b1d..0a5c9bb 100644 --- a/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCouponData.php +++ b/lib/Model/CouponCodeCreateQueryResourceObjectRelationshipsCouponData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeEnum.php b/lib/Model/CouponCodeEnum.php index 6c9853a..286c9bd 100644 --- a/lib/Model/CouponCodeEnum.php +++ b/lib/Model/CouponCodeEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeUpdateQuery.php b/lib/Model/CouponCodeUpdateQuery.php index 662d566..3188fbd 100644 --- a/lib/Model/CouponCodeUpdateQuery.php +++ b/lib/Model/CouponCodeUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeUpdateQueryResourceObject.php b/lib/Model/CouponCodeUpdateQueryResourceObject.php index 848016a..ea0f92f 100644 --- a/lib/Model/CouponCodeUpdateQueryResourceObject.php +++ b/lib/Model/CouponCodeUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php b/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php index 73532d2..79faf42 100644 --- a/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponCodeUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCreateQuery.php b/lib/Model/CouponCreateQuery.php index 3e3d683..1248dd3 100644 --- a/lib/Model/CouponCreateQuery.php +++ b/lib/Model/CouponCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCreateQueryResourceObject.php b/lib/Model/CouponCreateQueryResourceObject.php index 535c074..194fe00 100644 --- a/lib/Model/CouponCreateQueryResourceObject.php +++ b/lib/Model/CouponCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponCreateQueryResourceObjectAttributes.php b/lib/Model/CouponCreateQueryResourceObjectAttributes.php index d85c300..20e200e 100644 --- a/lib/Model/CouponCreateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponEnum.php b/lib/Model/CouponEnum.php index e840553..4253318 100644 --- a/lib/Model/CouponEnum.php +++ b/lib/Model/CouponEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponUpdateQuery.php b/lib/Model/CouponUpdateQuery.php index 5c057bf..ce34bb2 100644 --- a/lib/Model/CouponUpdateQuery.php +++ b/lib/Model/CouponUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponUpdateQueryResourceObject.php b/lib/Model/CouponUpdateQueryResourceObject.php index fc3996e..2dde2b8 100644 --- a/lib/Model/CouponUpdateQueryResourceObject.php +++ b/lib/Model/CouponUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CouponUpdateQueryResourceObjectAttributes.php b/lib/Model/CouponUpdateQueryResourceObjectAttributes.php index 7482a04..eaddf66 100644 --- a/lib/Model/CouponUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/CouponUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CustomSourceEnum.php b/lib/Model/CustomSourceEnum.php index 11e0030..8dc50cd 100644 --- a/lib/Model/CustomSourceEnum.php +++ b/lib/Model/CustomSourceEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CustomSourceFilter.php b/lib/Model/CustomSourceFilter.php index 4fa655c..577e693 100644 --- a/lib/Model/CustomSourceFilter.php +++ b/lib/Model/CustomSourceFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CustomTimeframe.php b/lib/Model/CustomTimeframe.php index 0373c81..9454a7b 100644 --- a/lib/Model/CustomTimeframe.php +++ b/lib/Model/CustomTimeframe.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/CustomTrackingParamDTO.php b/lib/Model/CustomTrackingParamDTO.php new file mode 100644 index 0000000..88bcd9e --- /dev/null +++ b/lib/Model/CustomTrackingParamDTO.php @@ -0,0 +1,491 @@ + + */ +class CustomTrackingParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CustomTrackingParamDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'flow' => '\KlaviyoAPI\Model\TrackingParamDTOFlow', + 'campaign' => '\KlaviyoAPI\Model\TrackingParamDTOCampaign', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'flow' => null, + 'campaign' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'flow' => true, + 'campaign' => true, + 'name' => 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 = [ + 'flow' => 'flow', + 'campaign' => 'campaign', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'flow' => 'setFlow', + 'campaign' => 'setCampaign', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'flow' => 'getFlow', + 'campaign' => 'getCampaign', + 'name' => 'getName' + ]; + + /** + * 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('flow', $data ?? [], null); + $this->setIfExists('campaign', $data ?? [], null); + $this->setIfExists('name', $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['name'] === null) { + $invalidProperties[] = "'name' 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 flow + * + * @return \KlaviyoAPI\Model\TrackingParamDTOFlow|null + */ + public function getFlow() + { + return $this->container['flow']; + } + + /** + * Sets flow + * + * @param \KlaviyoAPI\Model\TrackingParamDTOFlow|null $flow flow + * + * @return self + */ + public function setFlow($flow) + { + + if (is_null($flow)) { + array_push($this->openAPINullablesSetToNull, 'flow'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('flow', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['flow'] = $flow; + + return $this; + } + + /** + * Gets campaign + * + * @return \KlaviyoAPI\Model\TrackingParamDTOCampaign|null + */ + public function getCampaign() + { + return $this->container['campaign']; + } + + /** + * Sets campaign + * + * @param \KlaviyoAPI\Model\TrackingParamDTOCampaign|null $campaign campaign + * + * @return self + */ + public function setCampaign($campaign) + { + + if (is_null($campaign)) { + array_push($this->openAPINullablesSetToNull, 'campaign'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('campaign', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['campaign'] = $campaign; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the custom tracking parameter + * + * @return self + */ + public function setName($name) + { + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + $this->container['name'] = $name; + + 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/DataPrivacyCreateDeletionJobQuery.php b/lib/Model/DataPrivacyCreateDeletionJobQuery.php index 7ee30a0..bb208d3 100644 --- a/lib/Model/DataPrivacyCreateDeletionJobQuery.php +++ b/lib/Model/DataPrivacyCreateDeletionJobQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObject.php b/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObject.php index 6f43da9..d090ffc 100644 --- a/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObject.php +++ b/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributes.php b/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributes.php index 282e02d..c2858e4 100644 --- a/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributes.php +++ b/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributesProfile.php b/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributesProfile.php index f62b824..ce14494 100644 --- a/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributesProfile.php +++ b/lib/Model/DataPrivacyCreateDeletionJobQueryResourceObjectAttributesProfile.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DataPrivacyDeletionJobEnum.php b/lib/Model/DataPrivacyDeletionJobEnum.php index 265752c..f93aa85 100644 --- a/lib/Model/DataPrivacyDeletionJobEnum.php +++ b/lib/Model/DataPrivacyDeletionJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DataPrivacyProfileQueryResourceObject.php b/lib/Model/DataPrivacyProfileQueryResourceObject.php index ceb526a..c80c2b5 100644 --- a/lib/Model/DataPrivacyProfileQueryResourceObject.php +++ b/lib/Model/DataPrivacyProfileQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php b/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php index fbb285b..a44954c 100644 --- a/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php +++ b/lib/Model/DataPrivacyProfileQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DateEnum.php b/lib/Model/DateEnum.php index bde23ca..8e66e1d 100644 --- a/lib/Model/DateEnum.php +++ b/lib/Model/DateEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DeviceMetadata.php b/lib/Model/DeviceMetadata.php index 320f74e..7ddaefb 100644 --- a/lib/Model/DeviceMetadata.php +++ b/lib/Model/DeviceMetadata.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -286,6 +286,7 @@ public function getModelName() } public const KLAVIYO_SDK_ANDROID = 'android'; + public const KLAVIYO_SDK_REACT_NATIVE = 'react_native'; public const KLAVIYO_SDK_SWIFT = 'swift'; public const OS_NAME_ANDROID = 'android'; public const OS_NAME_IOS = 'ios'; @@ -304,6 +305,7 @@ public function getKlaviyoSdkAllowableValues() { return [ self::KLAVIYO_SDK_ANDROID, + self::KLAVIYO_SDK_REACT_NATIVE, self::KLAVIYO_SDK_SWIFT, ]; } diff --git a/lib/Model/DoubleOptinFilter.php b/lib/Model/DoubleOptinFilter.php index 1c09dce..6877de6 100644 --- a/lib/Model/DoubleOptinFilter.php +++ b/lib/Model/DoubleOptinFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/DynamicEnum.php b/lib/Model/DynamicEnum.php new file mode 100644 index 0000000..02119b0 --- /dev/null +++ b/lib/Model/DynamicEnum.php @@ -0,0 +1,60 @@ + + */ +class DynamicTrackingParam implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DynamicTrackingParam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\DynamicEnum', + 'value' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => false, + 'name' => 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', + 'value' => 'value', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue', + 'name' => 'getName' + ]; + + /** + * 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; + } + + public const VALUE_CAMPAIGN_ID = 'campaign_id'; + public const VALUE_CAMPAIGN_NAME = 'campaign_name'; + public const VALUE_CAMPAIGN_NAME_ID = 'campaign_name_id'; + public const VALUE_CAMPAIGN_NAME_SEND_DAY = 'campaign_name_send_day'; + public const VALUE_EMAIL_SUBJECT = 'email_subject'; + public const VALUE_GROUP_ID = 'group_id'; + public const VALUE_GROUP_NAME = 'group_name'; + public const VALUE_GROUP_NAME_ID = 'group_name_id'; + public const VALUE_LINK_ALT_TEXT = 'link_alt_text'; + public const VALUE_MESSAGE_TYPE = 'message_type'; + public const VALUE_PROFILE_EXTERNAL_ID = 'profile_external_id'; + public const VALUE_PROFILE_ID = 'profile_id'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_CAMPAIGN_ID, + self::VALUE_CAMPAIGN_NAME, + self::VALUE_CAMPAIGN_NAME_ID, + self::VALUE_CAMPAIGN_NAME_SEND_DAY, + self::VALUE_EMAIL_SUBJECT, + self::VALUE_GROUP_ID, + self::VALUE_GROUP_NAME, + self::VALUE_GROUP_NAME_ID, + self::VALUE_LINK_ALT_TEXT, + self::VALUE_MESSAGE_TYPE, + self::VALUE_PROFILE_EXTERNAL_ID, + self::VALUE_PROFILE_ID, + ]; + } + + /** + * 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('value', $data ?? [], null); + $this->setIfExists('name', $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['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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\DynamicEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\DynamicEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the tracking param + * + * @return self + */ + public function setName($name) + { + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + $this->container['name'] = $name; + + 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/EmailContentSubObject.php b/lib/Model/EmailContentSubObject.php index 3f1f6f6..cd28df8 100644 --- a/lib/Model/EmailContentSubObject.php +++ b/lib/Model/EmailContentSubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EmailEnum.php b/lib/Model/EmailEnum.php index 0bd3fe2..538d1a0 100644 --- a/lib/Model/EmailEnum.php +++ b/lib/Model/EmailEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EmailSendOptionsSubObject.php b/lib/Model/EmailSendOptionsSubObject.php index 70ec207..40fc0b2 100644 --- a/lib/Model/EmailSendOptionsSubObject.php +++ b/lib/Model/EmailSendOptionsSubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EmailSubscriptionParameters.php b/lib/Model/EmailSubscriptionParameters.php index e3d9d12..a3b29ce 100644 --- a/lib/Model/EmailSubscriptionParameters.php +++ b/lib/Model/EmailSubscriptionParameters.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -58,7 +58,7 @@ class EmailSubscriptionParameters implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'marketing' => '\KlaviyoAPI\Model\MarketingSubscriptionParameters' + 'marketing' => '\KlaviyoAPI\Model\SubscriptionParameters' ]; /** @@ -286,7 +286,7 @@ public function valid() /** * Gets marketing * - * @return \KlaviyoAPI\Model\MarketingSubscriptionParameters + * @return \KlaviyoAPI\Model\SubscriptionParameters */ public function getMarketing() { @@ -296,7 +296,7 @@ public function getMarketing() /** * Sets marketing * - * @param \KlaviyoAPI\Model\MarketingSubscriptionParameters $marketing marketing + * @param \KlaviyoAPI\Model\SubscriptionParameters $marketing marketing * * @return self */ diff --git a/lib/Model/EmailTrackingOptionsSubObject.php b/lib/Model/EmailTrackingOptionsSubObject.php index dcbc5f2..fba0a5f 100644 --- a/lib/Model/EmailTrackingOptionsSubObject.php +++ b/lib/Model/EmailTrackingOptionsSubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -58,8 +58,8 @@ class EmailTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'is_add_utm' => 'bool', - 'utm_params' => '\KlaviyoAPI\Model\UTMParamsSubObject[]', + 'add_tracking_params' => 'bool', + 'custom_tracking_params' => '\KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]', 'is_tracking_clicks' => 'bool', 'is_tracking_opens' => 'bool' ]; @@ -72,8 +72,8 @@ class EmailTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'is_add_utm' => null, - 'utm_params' => null, + 'add_tracking_params' => null, + 'custom_tracking_params' => null, 'is_tracking_clicks' => null, 'is_tracking_opens' => null ]; @@ -84,8 +84,8 @@ class EmailTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'is_add_utm' => true, - 'utm_params' => true, + 'add_tracking_params' => true, + 'custom_tracking_params' => true, 'is_tracking_clicks' => true, 'is_tracking_opens' => true ]; @@ -166,8 +166,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'is_add_utm' => 'is_add_utm', - 'utm_params' => 'utm_params', + 'add_tracking_params' => 'add_tracking_params', + 'custom_tracking_params' => 'custom_tracking_params', 'is_tracking_clicks' => 'is_tracking_clicks', 'is_tracking_opens' => 'is_tracking_opens' ]; @@ -178,8 +178,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'is_add_utm' => 'setIsAddUtm', - 'utm_params' => 'setUtmParams', + 'add_tracking_params' => 'setAddTrackingParams', + 'custom_tracking_params' => 'setCustomTrackingParams', 'is_tracking_clicks' => 'setIsTrackingClicks', 'is_tracking_opens' => 'setIsTrackingOpens' ]; @@ -190,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'is_add_utm' => 'getIsAddUtm', - 'utm_params' => 'getUtmParams', + 'add_tracking_params' => 'getAddTrackingParams', + 'custom_tracking_params' => 'getCustomTrackingParams', 'is_tracking_clicks' => 'getIsTrackingClicks', 'is_tracking_opens' => 'getIsTrackingOpens' ]; @@ -253,8 +253,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('is_add_utm', $data ?? [], null); - $this->setIfExists('utm_params', $data ?? [], null); + $this->setIfExists('add_tracking_params', $data ?? [], null); + $this->setIfExists('custom_tracking_params', $data ?? [], null); $this->setIfExists('is_tracking_clicks', $data ?? [], null); $this->setIfExists('is_tracking_opens', $data ?? [], null); } @@ -302,73 +302,73 @@ public function valid() /** - * Gets is_add_utm + * Gets add_tracking_params * * @return bool|null */ - public function getIsAddUtm() + public function getAddTrackingParams() { - return $this->container['is_add_utm']; + return $this->container['add_tracking_params']; } /** - * Sets is_add_utm + * Sets add_tracking_params * - * @param bool|null $is_add_utm Whether the campaign needs UTM parameters. If set to False, UTM params will not be used. + * @param bool|null $add_tracking_params Whether the campaign needs custom tracking parameters. If set to False, tracking params will not be used. * * @return self */ - public function setIsAddUtm($is_add_utm) + public function setAddTrackingParams($add_tracking_params) { - if (is_null($is_add_utm)) { - array_push($this->openAPINullablesSetToNull, 'is_add_utm'); + if (is_null($add_tracking_params)) { + array_push($this->openAPINullablesSetToNull, 'add_tracking_params'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_add_utm', $nullablesSetToNull); + $index = array_search('add_tracking_params', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['is_add_utm'] = $is_add_utm; + $this->container['add_tracking_params'] = $add_tracking_params; return $this; } /** - * Gets utm_params + * Gets custom_tracking_params * - * @return \KlaviyoAPI\Model\UTMParamsSubObject[]|null + * @return \KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]|null */ - public function getUtmParams() + public function getCustomTrackingParams() { - return $this->container['utm_params']; + return $this->container['custom_tracking_params']; } /** - * Sets utm_params + * Sets custom_tracking_params * - * @param \KlaviyoAPI\Model\UTMParamsSubObject[]|null $utm_params A list of UTM parameters. If an empty list is given and is_add_utm is True, uses company defaults. + * @param \KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]|null $custom_tracking_params A list of custom tracking parameters. If an empty list is given and add_tracking_params is True, uses company defaults. * * @return self */ - public function setUtmParams($utm_params) + public function setCustomTrackingParams($custom_tracking_params) { - if (is_null($utm_params)) { - array_push($this->openAPINullablesSetToNull, 'utm_params'); + if (is_null($custom_tracking_params)) { + array_push($this->openAPINullablesSetToNull, 'custom_tracking_params'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('utm_params', $nullablesSetToNull); + $index = array_search('custom_tracking_params', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['utm_params'] = $utm_params; + $this->container['custom_tracking_params'] = $custom_tracking_params; return $this; } diff --git a/lib/Model/EmailTrackingOptionsSubObjectCustomTrackingParamsInner.php b/lib/Model/EmailTrackingOptionsSubObjectCustomTrackingParamsInner.php new file mode 100644 index 0000000..d20864d --- /dev/null +++ b/lib/Model/EmailTrackingOptionsSubObjectCustomTrackingParamsInner.php @@ -0,0 +1,483 @@ + + */ +class EmailTrackingOptionsSubObjectCustomTrackingParamsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EmailTrackingOptionsSubObject_custom_tracking_params_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\StaticEnum', + 'value' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => false, + 'name' => 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', + 'value' => 'value', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue', + 'name' => 'getName' + ]; + + /** + * 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('value', $data ?? [], null); + $this->setIfExists('name', $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['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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\StaticEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\StaticEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the tracking param + * + * @return self + */ + public function setName($name) + { + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + $this->container['name'] = $name; + + 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/EqualsEnum.php b/lib/Model/EqualsEnum.php index d3882e1..8082d30 100644 --- a/lib/Model/EqualsEnum.php +++ b/lib/Model/EqualsEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EqualsStringFilter.php b/lib/Model/EqualsStringFilter.php index c8ec7b0..574de21 100644 --- a/lib/Model/EqualsStringFilter.php +++ b/lib/Model/EqualsStringFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventBulkCreateEnum.php b/lib/Model/EventBulkCreateEnum.php index 3fa5e3b..99e4c54 100644 --- a/lib/Model/EventBulkCreateEnum.php +++ b/lib/Model/EventBulkCreateEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventBulkCreateJobEnum.php b/lib/Model/EventBulkCreateJobEnum.php index f751e7b..9f74c17 100644 --- a/lib/Model/EventBulkCreateJobEnum.php +++ b/lib/Model/EventBulkCreateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventCreateQueryV2.php b/lib/Model/EventCreateQueryV2.php index dd853fb..0df239e 100644 --- a/lib/Model/EventCreateQueryV2.php +++ b/lib/Model/EventCreateQueryV2.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventCreateQueryV2ResourceObject.php b/lib/Model/EventCreateQueryV2ResourceObject.php index 7271b9a..83121e7 100644 --- a/lib/Model/EventCreateQueryV2ResourceObject.php +++ b/lib/Model/EventCreateQueryV2ResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php b/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php index a7effb6..7685087 100644 --- a/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php +++ b/lib/Model/EventCreateQueryV2ResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventCreateQueryV2ResourceObjectAttributesMetric.php b/lib/Model/EventCreateQueryV2ResourceObjectAttributesMetric.php index db46883..8ac6842 100644 --- a/lib/Model/EventCreateQueryV2ResourceObjectAttributesMetric.php +++ b/lib/Model/EventCreateQueryV2ResourceObjectAttributesMetric.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php b/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php index 7442cab..9bcf568 100644 --- a/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php +++ b/lib/Model/EventCreateQueryV2ResourceObjectAttributesProfile.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventEnum.php b/lib/Model/EventEnum.php index 356d5c3..9008c1d 100644 --- a/lib/Model/EventEnum.php +++ b/lib/Model/EventEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventProfileCreateQueryResourceObject.php b/lib/Model/EventProfileCreateQueryResourceObject.php index 5d627e9..9fb437b 100644 --- a/lib/Model/EventProfileCreateQueryResourceObject.php +++ b/lib/Model/EventProfileCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventProfileCreateQueryResourceObjectAttributes.php b/lib/Model/EventProfileCreateQueryResourceObjectAttributes.php index b1c8d38..a24b3a2 100644 --- a/lib/Model/EventProfileCreateQueryResourceObjectAttributes.php +++ b/lib/Model/EventProfileCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -66,6 +66,7 @@ class EventProfileCreateQueryResourceObjectAttributes implements ModelInterface, 'first_name' => 'string', 'last_name' => 'string', 'organization' => 'string', + 'locale' => 'string', 'title' => 'string', 'image' => 'string', 'location' => '\KlaviyoAPI\Model\ProfileLocation', @@ -89,6 +90,7 @@ class EventProfileCreateQueryResourceObjectAttributes implements ModelInterface, 'first_name' => null, 'last_name' => null, 'organization' => null, + 'locale' => null, 'title' => null, 'image' => null, 'location' => null, @@ -110,6 +112,7 @@ class EventProfileCreateQueryResourceObjectAttributes implements ModelInterface, 'first_name' => true, 'last_name' => true, 'organization' => true, + 'locale' => true, 'title' => true, 'image' => true, 'location' => false, @@ -201,6 +204,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'first_name', 'last_name' => 'last_name', 'organization' => 'organization', + 'locale' => 'locale', 'title' => 'title', 'image' => 'image', 'location' => 'location', @@ -222,6 +226,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'organization' => 'setOrganization', + 'locale' => 'setLocale', 'title' => 'setTitle', 'image' => 'setImage', 'location' => 'setLocation', @@ -243,6 +248,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'organization' => 'getOrganization', + 'locale' => 'getLocale', 'title' => 'getTitle', 'image' => 'getImage', 'location' => 'getLocation', @@ -315,6 +321,7 @@ public function __construct(array $data = null) $this->setIfExists('first_name', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('image', $data ?? [], null); $this->setIfExists('location', $data ?? [], null); @@ -652,6 +659,42 @@ public function setOrganization($organization) return $this; } + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + * + * @return self + */ + public function setLocale($locale) + { + + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['locale'] = $locale; + + return $this; + } + /** * Gets title * diff --git a/lib/Model/EventsBulkCreateJob.php b/lib/Model/EventsBulkCreateJob.php index 28dd8ab..e3a0d44 100644 --- a/lib/Model/EventsBulkCreateJob.php +++ b/lib/Model/EventsBulkCreateJob.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventsBulkCreateJobResourceObject.php b/lib/Model/EventsBulkCreateJobResourceObject.php index 70293ab..62f217d 100644 --- a/lib/Model/EventsBulkCreateJobResourceObject.php +++ b/lib/Model/EventsBulkCreateJobResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventsBulkCreateJobResourceObjectAttributes.php b/lib/Model/EventsBulkCreateJobResourceObjectAttributes.php index 5a9c3ae..f9598a3 100644 --- a/lib/Model/EventsBulkCreateJobResourceObjectAttributes.php +++ b/lib/Model/EventsBulkCreateJobResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventsBulkCreateJobResourceObjectAttributesEventsBulkCreate.php b/lib/Model/EventsBulkCreateJobResourceObjectAttributesEventsBulkCreate.php index 5e29849..c27e25a 100644 --- a/lib/Model/EventsBulkCreateJobResourceObjectAttributesEventsBulkCreate.php +++ b/lib/Model/EventsBulkCreateJobResourceObjectAttributesEventsBulkCreate.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventsBulkCreateQueryResourceObject.php b/lib/Model/EventsBulkCreateQueryResourceObject.php index cf19b97..2f37e76 100644 --- a/lib/Model/EventsBulkCreateQueryResourceObject.php +++ b/lib/Model/EventsBulkCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventsBulkCreateQueryResourceObjectAttributes.php b/lib/Model/EventsBulkCreateQueryResourceObjectAttributes.php index e0e8063..4a6d0bb 100644 --- a/lib/Model/EventsBulkCreateQueryResourceObjectAttributes.php +++ b/lib/Model/EventsBulkCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventsBulkCreateQueryResourceObjectAttributesEvents.php b/lib/Model/EventsBulkCreateQueryResourceObjectAttributesEvents.php index 3ef8e35..3d80adb 100644 --- a/lib/Model/EventsBulkCreateQueryResourceObjectAttributesEvents.php +++ b/lib/Model/EventsBulkCreateQueryResourceObjectAttributesEvents.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/EventsBulkCreateQueryResourceObjectAttributesProfile.php b/lib/Model/EventsBulkCreateQueryResourceObjectAttributesProfile.php index 607c738..9abfade 100644 --- a/lib/Model/EventsBulkCreateQueryResourceObjectAttributesProfile.php +++ b/lib/Model/EventsBulkCreateQueryResourceObjectAttributesProfile.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ExistenceEnum.php b/lib/Model/ExistenceEnum.php index 8c3a3ee..ee06e3a 100644 --- a/lib/Model/ExistenceEnum.php +++ b/lib/Model/ExistenceEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ExistenceOperatorFilter.php b/lib/Model/ExistenceOperatorFilter.php index c67bcd9..abf86d0 100644 --- a/lib/Model/ExistenceOperatorFilter.php +++ b/lib/Model/ExistenceOperatorFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FailedAgeGateEnum.php b/lib/Model/FailedAgeGateEnum.php index 215d80e..195001e 100644 --- a/lib/Model/FailedAgeGateEnum.php +++ b/lib/Model/FailedAgeGateEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FailedAgeGateMethodFilter.php b/lib/Model/FailedAgeGateMethodFilter.php index 1193051..2fe5cbb 100644 --- a/lib/Model/FailedAgeGateMethodFilter.php +++ b/lib/Model/FailedAgeGateMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowEnum.php b/lib/Model/FlowEnum.php index 52cb624..b0fc910 100644 --- a/lib/Model/FlowEnum.php +++ b/lib/Model/FlowEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowSeriesReportEnum.php b/lib/Model/FlowSeriesReportEnum.php index 6ba6f18..6b773b0 100644 --- a/lib/Model/FlowSeriesReportEnum.php +++ b/lib/Model/FlowSeriesReportEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowSeriesRequestDTO.php b/lib/Model/FlowSeriesRequestDTO.php index a95f7e8..b92a6e3 100644 --- a/lib/Model/FlowSeriesRequestDTO.php +++ b/lib/Model/FlowSeriesRequestDTO.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowSeriesRequestDTOResourceObject.php b/lib/Model/FlowSeriesRequestDTOResourceObject.php index a78184a..fac6e29 100644 --- a/lib/Model/FlowSeriesRequestDTOResourceObject.php +++ b/lib/Model/FlowSeriesRequestDTOResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php b/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php index 3fad88c..11aa7c0 100644 --- a/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php +++ b/lib/Model/FlowSeriesRequestDTOResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowTrackingSettingDynamicParam.php b/lib/Model/FlowTrackingSettingDynamicParam.php new file mode 100644 index 0000000..30c3d09 --- /dev/null +++ b/lib/Model/FlowTrackingSettingDynamicParam.php @@ -0,0 +1,492 @@ + + */ +class FlowTrackingSettingDynamicParam implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FlowTrackingSettingDynamicParam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\DynamicEnum', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * 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; + } + + public const VALUE_EMAIL_SUBJECT = 'email_subject'; + public const VALUE_FLOW_ID = 'flow_id'; + public const VALUE_FLOW_NAME = 'flow_name'; + public const VALUE_LINK_ALT_TEXT = 'link_alt_text'; + public const VALUE_MESSAGE_NAME = 'message_name'; + public const VALUE_MESSAGE_NAME_ID = 'message_name_id'; + public const VALUE_MESSAGE_TYPE = 'message_type'; + public const VALUE_PROFILE_EXTERNAL_ID = 'profile_external_id'; + public const VALUE_PROFILE_ID = 'profile_id'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_EMAIL_SUBJECT, + self::VALUE_FLOW_ID, + self::VALUE_FLOW_NAME, + self::VALUE_LINK_ALT_TEXT, + self::VALUE_MESSAGE_NAME, + self::VALUE_MESSAGE_NAME_ID, + self::VALUE_MESSAGE_TYPE, + self::VALUE_PROFILE_EXTERNAL_ID, + self::VALUE_PROFILE_ID, + ]; + } + + /** + * 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('value', $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['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\DynamicEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\DynamicEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|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/UTMParamsSubObject.php b/lib/Model/FlowTrackingSettingStaticParam.php similarity index 89% rename from lib/Model/UTMParamsSubObject.php rename to lib/Model/FlowTrackingSettingStaticParam.php index b01e983..7cb5885 100644 --- a/lib/Model/UTMParamsSubObject.php +++ b/lib/Model/FlowTrackingSettingStaticParam.php @@ -1,6 +1,6 @@ */ -class UTMParamsSubObject implements ModelInterface, ArrayAccess, \JsonSerializable +class FlowTrackingSettingStaticParam implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class UTMParamsSubObject implements ModelInterface, ArrayAccess, \JsonSerializab * * @var string */ - protected static $openAPIModelName = 'UTMParamsSubObject'; + protected static $openAPIModelName = 'FlowTrackingSettingStaticParam'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,7 +58,7 @@ class UTMParamsSubObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string', + 'type' => '\KlaviyoAPI\Model\StaticEnum', 'value' => 'string' ]; @@ -70,7 +70,7 @@ class UTMParamsSubObject implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'name' => null, + 'type' => null, 'value' => null ]; @@ -80,7 +80,7 @@ class UTMParamsSubObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, + 'type' => false, 'value' => false ]; @@ -160,7 +160,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', + 'type' => 'type', 'value' => 'value' ]; @@ -170,7 +170,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', + 'type' => 'setType', 'value' => 'setValue' ]; @@ -180,7 +180,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', + 'type' => 'getType', 'value' => 'getValue' ]; @@ -241,7 +241,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); } @@ -272,8 +272,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; } if ($this->container['value'] === null) { $invalidProperties[] = "'value' can't be null"; @@ -294,30 +294,30 @@ public function valid() /** - * Gets name + * Gets type * - * @return string + * @return \KlaviyoAPI\Model\StaticEnum */ - public function getName() + public function getType() { - return $this->container['name']; + return $this->container['type']; } /** - * Sets name + * Sets type * - * @param string $name Name of the UTM param + * @param \KlaviyoAPI\Model\StaticEnum $type type * * @return self */ - public function setName($name) + public function setType($type) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['name'] = $name; + $this->container['type'] = $type; return $this; } @@ -335,7 +335,7 @@ public function getValue() /** * Sets value * - * @param string $value Value of the UTM param. Can be templated data. + * @param string $value The value of the tracking parameter * * @return self */ diff --git a/lib/Model/FlowUpdateQuery.php b/lib/Model/FlowUpdateQuery.php index 2d06311..c7dfdbd 100644 --- a/lib/Model/FlowUpdateQuery.php +++ b/lib/Model/FlowUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowUpdateQueryResourceObject.php b/lib/Model/FlowUpdateQueryResourceObject.php index d5ecf71..249f9d6 100644 --- a/lib/Model/FlowUpdateQueryResourceObject.php +++ b/lib/Model/FlowUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowUpdateQueryResourceObjectAttributes.php b/lib/Model/FlowUpdateQueryResourceObjectAttributes.php index aa1b6b9..fb2ad0b 100644 --- a/lib/Model/FlowUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/FlowUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowValuesReportEnum.php b/lib/Model/FlowValuesReportEnum.php index 6532053..fca5c9e 100644 --- a/lib/Model/FlowValuesReportEnum.php +++ b/lib/Model/FlowValuesReportEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowValuesRequestDTO.php b/lib/Model/FlowValuesRequestDTO.php index aa5654b..d270b8d 100644 --- a/lib/Model/FlowValuesRequestDTO.php +++ b/lib/Model/FlowValuesRequestDTO.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowValuesRequestDTOResourceObject.php b/lib/Model/FlowValuesRequestDTOResourceObject.php index 10aafd3..5b4ca17 100644 --- a/lib/Model/FlowValuesRequestDTOResourceObject.php +++ b/lib/Model/FlowValuesRequestDTOResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php b/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php index 22bc63a..30d4bff 100644 --- a/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php +++ b/lib/Model/FlowValuesRequestDTOResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FormEnum.php b/lib/Model/FormEnum.php index cd6d016..23366a9 100644 --- a/lib/Model/FormEnum.php +++ b/lib/Model/FormEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FormMethodFilter.php b/lib/Model/FormMethodFilter.php index a36e8b3..b05d77f 100644 --- a/lib/Model/FormMethodFilter.php +++ b/lib/Model/FormMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/FormSeriesReportEnum.php b/lib/Model/FormSeriesReportEnum.php new file mode 100644 index 0000000..cfa9d45 --- /dev/null +++ b/lib/Model/FormSeriesReportEnum.php @@ -0,0 +1,60 @@ + + */ +class FormSeriesRequestDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FormSeriesRequestDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\FormSeriesRequestDTOResourceObject' + ]; + + /** + * 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\FormSeriesRequestDTOResourceObject + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\FormSeriesRequestDTOResourceObject $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/FormSeriesRequestDTOResourceObject.php b/lib/Model/FormSeriesRequestDTOResourceObject.php new file mode 100644 index 0000000..80794a1 --- /dev/null +++ b/lib/Model/FormSeriesRequestDTOResourceObject.php @@ -0,0 +1,444 @@ + + */ +class FormSeriesRequestDTOResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FormSeriesRequestDTOResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\FormSeriesReportEnum', + 'attributes' => '\KlaviyoAPI\Model\FormSeriesRequestDTOResourceObjectAttributes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + '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', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + '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('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\FormSeriesReportEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\FormSeriesReportEnum $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 attributes + * + * @return \KlaviyoAPI\Model\FormSeriesRequestDTOResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\FormSeriesRequestDTOResourceObjectAttributes $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/FormSeriesRequestDTOResourceObjectAttributes.php b/lib/Model/FormSeriesRequestDTOResourceObjectAttributes.php new file mode 100644 index 0000000..07c84c8 --- /dev/null +++ b/lib/Model/FormSeriesRequestDTOResourceObjectAttributes.php @@ -0,0 +1,675 @@ + + */ +class FormSeriesRequestDTOResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FormSeriesRequestDTOResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'statistics' => 'string[]', + 'timeframe' => '\KlaviyoAPI\Model\CampaignValuesRequestDTOResourceObjectAttributesTimeframe', + 'interval' => 'string', + 'group_by' => 'string[]', + 'filter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'statistics' => null, + 'timeframe' => null, + 'interval' => null, + 'group_by' => null, + 'filter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'statistics' => false, + 'timeframe' => false, + 'interval' => false, + 'group_by' => true, + 'filter' => 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 = [ + 'statistics' => 'statistics', + 'timeframe' => 'timeframe', + 'interval' => 'interval', + 'group_by' => 'group_by', + 'filter' => 'filter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'statistics' => 'setStatistics', + 'timeframe' => 'setTimeframe', + 'interval' => 'setInterval', + 'group_by' => 'setGroupBy', + 'filter' => 'setFilter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'statistics' => 'getStatistics', + 'timeframe' => 'getTimeframe', + 'interval' => 'getInterval', + 'group_by' => 'getGroupBy', + 'filter' => 'getFilter' + ]; + + /** + * 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; + } + + public const STATISTICS_CLOSED_FORM = 'closed_form'; + public const STATISTICS_CLOSED_FORM_UNIQUES = 'closed_form_uniques'; + public const STATISTICS_QUALIFIED_FORM = 'qualified_form'; + public const STATISTICS_QUALIFIED_FORM_UNIQUES = 'qualified_form_uniques'; + public const STATISTICS_SUBMIT_RATE = 'submit_rate'; + public const STATISTICS_SUBMITS = 'submits'; + public const STATISTICS_SUBMITTED_FORM_STEP = 'submitted_form_step'; + public const STATISTICS_SUBMITTED_FORM_STEP_UNIQUES = 'submitted_form_step_uniques'; + public const STATISTICS_VIEWED_FORM = 'viewed_form'; + public const STATISTICS_VIEWED_FORM_STEP = 'viewed_form_step'; + public const STATISTICS_VIEWED_FORM_STEP_UNIQUES = 'viewed_form_step_uniques'; + public const STATISTICS_VIEWED_FORM_UNIQUES = 'viewed_form_uniques'; + public const INTERVAL_DAILY = 'daily'; + public const INTERVAL_HOURLY = 'hourly'; + public const INTERVAL_MONTHLY = 'monthly'; + public const INTERVAL_WEEKLY = 'weekly'; + public const GROUP_BY_ID = 'form_id'; + public const GROUP_BY_VERSION_ID = 'form_version_id'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatisticsAllowableValues() + { + return [ + self::STATISTICS_CLOSED_FORM, + self::STATISTICS_CLOSED_FORM_UNIQUES, + self::STATISTICS_QUALIFIED_FORM, + self::STATISTICS_QUALIFIED_FORM_UNIQUES, + self::STATISTICS_SUBMIT_RATE, + self::STATISTICS_SUBMITS, + self::STATISTICS_SUBMITTED_FORM_STEP, + self::STATISTICS_SUBMITTED_FORM_STEP_UNIQUES, + self::STATISTICS_VIEWED_FORM, + self::STATISTICS_VIEWED_FORM_STEP, + self::STATISTICS_VIEWED_FORM_STEP_UNIQUES, + self::STATISTICS_VIEWED_FORM_UNIQUES, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIntervalAllowableValues() + { + return [ + self::INTERVAL_DAILY, + self::INTERVAL_HOURLY, + self::INTERVAL_MONTHLY, + self::INTERVAL_WEEKLY, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getGroupByAllowableValues() + { + return [ + self::GROUP_BY_ID, + self::GROUP_BY_VERSION_ID, + ]; + } + + /** + * 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('statistics', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + $this->setIfExists('interval', $data ?? [], null); + $this->setIfExists('group_by', $data ?? [], null); + $this->setIfExists('filter', $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['statistics'] === null) { + $invalidProperties[] = "'statistics' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + if ($this->container['interval'] === null) { + $invalidProperties[] = "'interval' can't be null"; + } + $allowedValues = $this->getIntervalAllowableValues(); + if (!is_null($this->container['interval']) && !in_array($this->container['interval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interval', must be one of '%s'", + $this->container['interval'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets statistics + * + * @return string[] + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param string[] $statistics List of statistics to query for. All rate statistics will be returned in fractional form [0.0, 1.0] + * + * @return self + */ + public function setStatistics($statistics) + { + $allowedValues = $this->getStatisticsAllowableValues(); + if (array_diff($statistics, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'statistics', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($statistics)) { + throw new \InvalidArgumentException('non-nullable statistics cannot be null'); + } + + $this->container['statistics'] = $statistics; + + return $this; + } + + /** + * Gets timeframe + * + * @return \KlaviyoAPI\Model\CampaignValuesRequestDTOResourceObjectAttributesTimeframe + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param \KlaviyoAPI\Model\CampaignValuesRequestDTOResourceObjectAttributesTimeframe $timeframe timeframe + * + * @return self + */ + public function setTimeframe($timeframe) + { + + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + + $this->container['timeframe'] = $timeframe; + + return $this; + } + + /** + * Gets interval + * + * @return string + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string $interval The interval used to aggregate data within the series request. If hourly is used, the timeframe cannot be longer than 7 days. If daily is used, the timeframe cannot be longer than 60 days. If monthly is used, the timeframe cannot be longer than 52 weeks. + * + * @return self + */ + public function setInterval($interval) + { + $allowedValues = $this->getIntervalAllowableValues(); + if (!in_array($interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interval', must be one of '%s'", + $interval, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($interval)) { + throw new \InvalidArgumentException('non-nullable interval cannot be null'); + } + + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets group_by + * + * @return string[]|null + */ + public function getGroupBy() + { + return $this->container['group_by']; + } + + /** + * Sets group_by + * + * @param string[]|null $group_by List of attributes to group the data by. Allowed group-bys are form_id, form_version_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id + * + * @return self + */ + public function setGroupBy($group_by) + { + $allowedValues = $this->getGroupByAllowableValues(); + if (!is_null($group_by) && array_diff($group_by, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'group_by', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($group_by)) { + array_push($this->openAPINullablesSetToNull, 'group_by'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('group_by', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['group_by'] = $group_by; + + return $this; + } + + /** + * Gets filter + * + * @return string|null + */ + public function getFilter() + { + return $this->container['filter']; + } + + /** + * Sets filter + * + * @param string|null $filter API filter string used to filter the query. Allowed filters are form_id, form_version_id. Allowed operators are equals, 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. + * + * @return self + */ + public function setFilter($filter) + { + + if (is_null($filter)) { + 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; + + 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/FormValuesReportEnum.php b/lib/Model/FormValuesReportEnum.php new file mode 100644 index 0000000..be1a895 --- /dev/null +++ b/lib/Model/FormValuesReportEnum.php @@ -0,0 +1,60 @@ + + */ +class FormValuesRequestDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FormValuesRequestDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\FormValuesRequestDTOResourceObject' + ]; + + /** + * 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\FormValuesRequestDTOResourceObject + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\FormValuesRequestDTOResourceObject $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/FormValuesRequestDTOResourceObject.php b/lib/Model/FormValuesRequestDTOResourceObject.php new file mode 100644 index 0000000..b63f508 --- /dev/null +++ b/lib/Model/FormValuesRequestDTOResourceObject.php @@ -0,0 +1,444 @@ + + */ +class FormValuesRequestDTOResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FormValuesRequestDTOResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\FormValuesReportEnum', + 'attributes' => '\KlaviyoAPI\Model\FormValuesRequestDTOResourceObjectAttributes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + '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', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + '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('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\FormValuesReportEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\FormValuesReportEnum $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 attributes + * + * @return \KlaviyoAPI\Model\FormValuesRequestDTOResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\FormValuesRequestDTOResourceObjectAttributes $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/FormValuesRequestDTOResourceObjectAttributes.php b/lib/Model/FormValuesRequestDTOResourceObjectAttributes.php new file mode 100644 index 0000000..1aef1fc --- /dev/null +++ b/lib/Model/FormValuesRequestDTOResourceObjectAttributes.php @@ -0,0 +1,598 @@ + + */ +class FormValuesRequestDTOResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FormValuesRequestDTOResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'statistics' => 'string[]', + 'timeframe' => '\KlaviyoAPI\Model\CampaignValuesRequestDTOResourceObjectAttributesTimeframe', + 'group_by' => 'string[]', + 'filter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'statistics' => null, + 'timeframe' => null, + 'group_by' => null, + 'filter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'statistics' => false, + 'timeframe' => false, + 'group_by' => true, + 'filter' => 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 = [ + 'statistics' => 'statistics', + 'timeframe' => 'timeframe', + 'group_by' => 'group_by', + 'filter' => 'filter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'statistics' => 'setStatistics', + 'timeframe' => 'setTimeframe', + 'group_by' => 'setGroupBy', + 'filter' => 'setFilter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'statistics' => 'getStatistics', + 'timeframe' => 'getTimeframe', + 'group_by' => 'getGroupBy', + 'filter' => 'getFilter' + ]; + + /** + * 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; + } + + public const STATISTICS_CLOSED_FORM = 'closed_form'; + public const STATISTICS_CLOSED_FORM_UNIQUES = 'closed_form_uniques'; + public const STATISTICS_QUALIFIED_FORM = 'qualified_form'; + public const STATISTICS_QUALIFIED_FORM_UNIQUES = 'qualified_form_uniques'; + public const STATISTICS_SUBMIT_RATE = 'submit_rate'; + public const STATISTICS_SUBMITS = 'submits'; + public const STATISTICS_SUBMITTED_FORM_STEP = 'submitted_form_step'; + public const STATISTICS_SUBMITTED_FORM_STEP_UNIQUES = 'submitted_form_step_uniques'; + public const STATISTICS_VIEWED_FORM = 'viewed_form'; + public const STATISTICS_VIEWED_FORM_STEP = 'viewed_form_step'; + public const STATISTICS_VIEWED_FORM_STEP_UNIQUES = 'viewed_form_step_uniques'; + public const STATISTICS_VIEWED_FORM_UNIQUES = 'viewed_form_uniques'; + public const GROUP_BY_ID = 'form_id'; + public const GROUP_BY_VERSION_ID = 'form_version_id'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatisticsAllowableValues() + { + return [ + self::STATISTICS_CLOSED_FORM, + self::STATISTICS_CLOSED_FORM_UNIQUES, + self::STATISTICS_QUALIFIED_FORM, + self::STATISTICS_QUALIFIED_FORM_UNIQUES, + self::STATISTICS_SUBMIT_RATE, + self::STATISTICS_SUBMITS, + self::STATISTICS_SUBMITTED_FORM_STEP, + self::STATISTICS_SUBMITTED_FORM_STEP_UNIQUES, + self::STATISTICS_VIEWED_FORM, + self::STATISTICS_VIEWED_FORM_STEP, + self::STATISTICS_VIEWED_FORM_STEP_UNIQUES, + self::STATISTICS_VIEWED_FORM_UNIQUES, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getGroupByAllowableValues() + { + return [ + self::GROUP_BY_ID, + self::GROUP_BY_VERSION_ID, + ]; + } + + /** + * 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('statistics', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + $this->setIfExists('group_by', $data ?? [], null); + $this->setIfExists('filter', $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['statistics'] === null) { + $invalidProperties[] = "'statistics' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' 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 statistics + * + * @return string[] + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param string[] $statistics List of statistics to query for. All rate statistics will be returned in fractional form [0.0, 1.0] + * + * @return self + */ + public function setStatistics($statistics) + { + $allowedValues = $this->getStatisticsAllowableValues(); + if (array_diff($statistics, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'statistics', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($statistics)) { + throw new \InvalidArgumentException('non-nullable statistics cannot be null'); + } + + $this->container['statistics'] = $statistics; + + return $this; + } + + /** + * Gets timeframe + * + * @return \KlaviyoAPI\Model\CampaignValuesRequestDTOResourceObjectAttributesTimeframe + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param \KlaviyoAPI\Model\CampaignValuesRequestDTOResourceObjectAttributesTimeframe $timeframe timeframe + * + * @return self + */ + public function setTimeframe($timeframe) + { + + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + + $this->container['timeframe'] = $timeframe; + + return $this; + } + + /** + * Gets group_by + * + * @return string[]|null + */ + public function getGroupBy() + { + return $this->container['group_by']; + } + + /** + * Sets group_by + * + * @param string[]|null $group_by List of attributes to group the data by. Allowed group-bys are form_id, form_version_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id + * + * @return self + */ + public function setGroupBy($group_by) + { + $allowedValues = $this->getGroupByAllowableValues(); + if (!is_null($group_by) && array_diff($group_by, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'group_by', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($group_by)) { + array_push($this->openAPINullablesSetToNull, 'group_by'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('group_by', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['group_by'] = $group_by; + + return $this; + } + + /** + * Gets filter + * + * @return string|null + */ + public function getFilter() + { + return $this->container['filter']; + } + + /** + * Sets filter + * + * @param string|null $filter API filter string used to filter the query. Allowed filters are form_id, form_version_id. Allowed operators are equals, 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. + * + * @return self + */ + public function setFilter($filter) + { + + if (is_null($filter)) { + 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; + + 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/GetAccounts400Response.php b/lib/Model/GetAccounts400Response.php index 1b083f7..33132e9 100644 --- a/lib/Model/GetAccounts400Response.php +++ b/lib/Model/GetAccounts400Response.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/GetAccounts400ResponseErrorsInner.php b/lib/Model/GetAccounts400ResponseErrorsInner.php index 2a14ec1..ae22921 100644 --- a/lib/Model/GetAccounts400ResponseErrorsInner.php +++ b/lib/Model/GetAccounts400ResponseErrorsInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/GetAccounts400ResponseErrorsInnerSource.php b/lib/Model/GetAccounts400ResponseErrorsInnerSource.php index 0d20f64..a219156 100644 --- a/lib/Model/GetAccounts400ResponseErrorsInnerSource.php +++ b/lib/Model/GetAccounts400ResponseErrorsInnerSource.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/GreaterThanEnum.php b/lib/Model/GreaterThanEnum.php index 397e2e1..ed67ec6 100644 --- a/lib/Model/GreaterThanEnum.php +++ b/lib/Model/GreaterThanEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HTMLBlock.php b/lib/Model/HTMLBlock.php new file mode 100644 index 0000000..739ec8d --- /dev/null +++ b/lib/Model/HTMLBlock.php @@ -0,0 +1,483 @@ + + */ +class HTMLBlock implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HTMLBlock'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content_type' => '\KlaviyoAPI\Model\BlockEnum', + 'type' => '\KlaviyoAPI\Model\HtmlEnum', + 'data' => '\KlaviyoAPI\Model\HTMLBlockData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content_type' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'content_type' => false, + 'type' => false, + '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 = [ + 'content_type' => 'content_type', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content_type' => 'setContentType', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content_type' => 'getContentType', + 'type' => 'getType', + '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('content_type', $data ?? [], null); + $this->setIfExists('type', $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['content_type'] === null) { + $invalidProperties[] = "'content_type' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 content_type + * + * @return \KlaviyoAPI\Model\BlockEnum + */ + public function getContentType() + { + return $this->container['content_type']; + } + + /** + * Sets content_type + * + * @param \KlaviyoAPI\Model\BlockEnum $content_type content_type + * + * @return self + */ + public function setContentType($content_type) + { + + if (is_null($content_type)) { + throw new \InvalidArgumentException('non-nullable content_type cannot be null'); + } + + $this->container['content_type'] = $content_type; + + return $this; + } + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\HtmlEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\HtmlEnum $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 data + * + * @return \KlaviyoAPI\Model\HTMLBlockData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\HTMLBlockData $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/HTMLBlockData.php b/lib/Model/HTMLBlockData.php new file mode 100644 index 0000000..e2e9c13 --- /dev/null +++ b/lib/Model/HTMLBlockData.php @@ -0,0 +1,487 @@ + + */ +class HTMLBlockData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HTMLBlockData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content' => 'string', + 'display_options' => '\KlaviyoAPI\Model\BlockDisplayOptions', + 'styles' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null, + 'display_options' => null, + 'styles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'content' => false, + 'display_options' => false, + 'styles' => 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 = [ + 'content' => 'content', + 'display_options' => 'display_options', + 'styles' => 'styles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'display_options' => 'setDisplayOptions', + 'styles' => 'setStyles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'display_options' => 'getDisplayOptions', + 'styles' => 'getStyles' + ]; + + /** + * 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('content', $data ?? [], null); + $this->setIfExists('display_options', $data ?? [], null); + $this->setIfExists('styles', $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['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if ($this->container['display_options'] === null) { + $invalidProperties[] = "'display_options' 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 content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content content + * + * @return self + */ + public function setContent($content) + { + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets display_options + * + * @return \KlaviyoAPI\Model\BlockDisplayOptions + */ + public function getDisplayOptions() + { + return $this->container['display_options']; + } + + /** + * Sets display_options + * + * @param \KlaviyoAPI\Model\BlockDisplayOptions $display_options display_options + * + * @return self + */ + public function setDisplayOptions($display_options) + { + + if (is_null($display_options)) { + throw new \InvalidArgumentException('non-nullable display_options cannot be null'); + } + + $this->container['display_options'] = $display_options; + + return $this; + } + + /** + * Gets styles + * + * @return string|null + */ + public function getStyles() + { + return $this->container['styles']; + } + + /** + * Sets styles + * + * @param string|null $styles styles + * + * @return self + */ + public function setStyles($styles) + { + + if (is_null($styles)) { + array_push($this->openAPINullablesSetToNull, 'styles'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('styles', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['styles'] = $styles; + + 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/HasEmailMarketing.php b/lib/Model/HasEmailMarketing.php index b2ee489..b521587 100644 --- a/lib/Model/HasEmailMarketing.php +++ b/lib/Model/HasEmailMarketing.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasEmailMarketingConsent.php b/lib/Model/HasEmailMarketingConsent.php index 520d21a..a8adfa6 100644 --- a/lib/Model/HasEmailMarketingConsent.php +++ b/lib/Model/HasEmailMarketingConsent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasEmailMarketingConsentConsentStatus.php b/lib/Model/HasEmailMarketingConsentConsentStatus.php index b1c5187..d3baa56 100644 --- a/lib/Model/HasEmailMarketingConsentConsentStatus.php +++ b/lib/Model/HasEmailMarketingConsentConsentStatus.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasEmailMarketingNeverSubscribed.php b/lib/Model/HasEmailMarketingNeverSubscribed.php index bda603a..74a29b1 100644 --- a/lib/Model/HasEmailMarketingNeverSubscribed.php +++ b/lib/Model/HasEmailMarketingNeverSubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasEmailMarketingSubscribed.php b/lib/Model/HasEmailMarketingSubscribed.php index 4a73533..4e09652 100644 --- a/lib/Model/HasEmailMarketingSubscribed.php +++ b/lib/Model/HasEmailMarketingSubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasEmailMarketingSubscribedFiltersInner.php b/lib/Model/HasEmailMarketingSubscribedFiltersInner.php index 615ca5b..6630551 100644 --- a/lib/Model/HasEmailMarketingSubscribedFiltersInner.php +++ b/lib/Model/HasEmailMarketingSubscribedFiltersInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasPushMarketing.php b/lib/Model/HasPushMarketing.php index 5c482a5..4e74220 100644 --- a/lib/Model/HasPushMarketing.php +++ b/lib/Model/HasPushMarketing.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasPushMarketingConsent.php b/lib/Model/HasPushMarketingConsent.php index 1636728..a23727c 100644 --- a/lib/Model/HasPushMarketingConsent.php +++ b/lib/Model/HasPushMarketingConsent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasSMSMarketingConsent.php b/lib/Model/HasSMSMarketingConsent.php index 9402f7a..50f20eb 100644 --- a/lib/Model/HasSMSMarketingConsent.php +++ b/lib/Model/HasSMSMarketingConsent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasSMSMarketingSubscribed.php b/lib/Model/HasSMSMarketingSubscribed.php index e9fedbb..e4112dd 100644 --- a/lib/Model/HasSMSMarketingSubscribed.php +++ b/lib/Model/HasSMSMarketingSubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HasSMSMarketingSubscribedFiltersInner.php b/lib/Model/HasSMSMarketingSubscribedFiltersInner.php index 4d1fe22..99976d0 100644 --- a/lib/Model/HasSMSMarketingSubscribedFiltersInner.php +++ b/lib/Model/HasSMSMarketingSubscribedFiltersInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/HtmlEnum.php b/lib/Model/HtmlEnum.php new file mode 100644 index 0000000..7a8c826 --- /dev/null +++ b/lib/Model/HtmlEnum.php @@ -0,0 +1,60 @@ + + */ +class ListSubstringFilter implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListSubstringFilter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\ListEnum', + 'operator' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'operator' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'operator' => false, + 'value' => 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 = [ + 'type' => 'type', + 'operator' => 'operator', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'operator' => 'setOperator', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'operator' => 'getOperator', + 'value' => 'getValue' + ]; + + /** + * 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; + } + + public const OPERATOR_CONTAINS_SUBSTRING = 'contains-substring'; + public const OPERATOR_NOT_CONTAINS_SUBSTRING = 'not-contains-substring'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOperatorAllowableValues() + { + return [ + self::OPERATOR_CONTAINS_SUBSTRING, + self::OPERATOR_NOT_CONTAINS_SUBSTRING, + ]; + } + + /** + * 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('operator', $data ?? [], null); + $this->setIfExists('value', $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['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + $allowedValues = $this->getOperatorAllowableValues(); + if (!is_null($this->container['operator']) && !in_array($this->container['operator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'operator', must be one of '%s'", + $this->container['operator'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' 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 operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Operators for list substring filters. + * + * @return self + */ + public function setOperator($operator) + { + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value value + * + * @return self + */ + public function setValue($value) + { + + if (is_null($value)) { + 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; + + 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/MailboxProviderEnum.php b/lib/Model/MailboxProviderEnum.php index ff613ea..4041e0a 100644 --- a/lib/Model/MailboxProviderEnum.php +++ b/lib/Model/MailboxProviderEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MailboxProviderMethodFilter.php b/lib/Model/MailboxProviderMethodFilter.php index 842a0a2..b9fb876 100644 --- a/lib/Model/MailboxProviderMethodFilter.php +++ b/lib/Model/MailboxProviderMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualAddEnum.php b/lib/Model/ManualAddEnum.php index 75d3271..da7ce46 100644 --- a/lib/Model/ManualAddEnum.php +++ b/lib/Model/ManualAddEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualAddMethodFilter.php b/lib/Model/ManualAddMethodFilter.php index 835d162..ce433ff 100644 --- a/lib/Model/ManualAddMethodFilter.php +++ b/lib/Model/ManualAddMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualImportEnum.php b/lib/Model/ManualImportEnum.php index ec9ec28..9ac27ba 100644 --- a/lib/Model/ManualImportEnum.php +++ b/lib/Model/ManualImportEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualImportMethodFilter.php b/lib/Model/ManualImportMethodFilter.php index d017377..ea345f4 100644 --- a/lib/Model/ManualImportMethodFilter.php +++ b/lib/Model/ManualImportMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualRemoveEnum.php b/lib/Model/ManualRemoveEnum.php index 573040e..ecdf1fc 100644 --- a/lib/Model/ManualRemoveEnum.php +++ b/lib/Model/ManualRemoveEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualRemoveMethodFilter.php b/lib/Model/ManualRemoveMethodFilter.php index 75f7798..34f9353 100644 --- a/lib/Model/ManualRemoveMethodFilter.php +++ b/lib/Model/ManualRemoveMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualSuppressionDateEnum.php b/lib/Model/ManualSuppressionDateEnum.php index d8d2232..ca11715 100644 --- a/lib/Model/ManualSuppressionDateEnum.php +++ b/lib/Model/ManualSuppressionDateEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ManualSuppressionDateFilter.php b/lib/Model/ManualSuppressionDateFilter.php index 19db812..4aa079d 100644 --- a/lib/Model/ManualSuppressionDateFilter.php +++ b/lib/Model/ManualSuppressionDateFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MessageBlockedEnum.php b/lib/Model/MessageBlockedEnum.php index a0e00c2..39b5a94 100644 --- a/lib/Model/MessageBlockedEnum.php +++ b/lib/Model/MessageBlockedEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MessageBlockedMethodFilter.php b/lib/Model/MessageBlockedMethodFilter.php index a0edb0a..3d1f1eb 100644 --- a/lib/Model/MessageBlockedMethodFilter.php +++ b/lib/Model/MessageBlockedMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MethodEnum.php b/lib/Model/MethodEnum.php index 043b537..3ed7348 100644 --- a/lib/Model/MethodEnum.php +++ b/lib/Model/MethodEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MetricAggregateEnum.php b/lib/Model/MetricAggregateEnum.php index 2cebcea..d2f187d 100644 --- a/lib/Model/MetricAggregateEnum.php +++ b/lib/Model/MetricAggregateEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MetricAggregateQuery.php b/lib/Model/MetricAggregateQuery.php index 5f201b0..dcd2d2d 100644 --- a/lib/Model/MetricAggregateQuery.php +++ b/lib/Model/MetricAggregateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MetricAggregateQueryResourceObject.php b/lib/Model/MetricAggregateQueryResourceObject.php index 5a2d42c..79d45de 100644 --- a/lib/Model/MetricAggregateQueryResourceObject.php +++ b/lib/Model/MetricAggregateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MetricAggregateQueryResourceObjectAttributes.php b/lib/Model/MetricAggregateQueryResourceObjectAttributes.php index 531a973..66db2f6 100644 --- a/lib/Model/MetricAggregateQueryResourceObjectAttributes.php +++ b/lib/Model/MetricAggregateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MetricCreateQueryResourceObject.php b/lib/Model/MetricCreateQueryResourceObject.php index 7ce9453..2e617148 100644 --- a/lib/Model/MetricCreateQueryResourceObject.php +++ b/lib/Model/MetricCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MetricCreateQueryResourceObjectAttributes.php b/lib/Model/MetricCreateQueryResourceObjectAttributes.php index 538b509..60da8a5 100644 --- a/lib/Model/MetricCreateQueryResourceObjectAttributes.php +++ b/lib/Model/MetricCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MetricEnum.php b/lib/Model/MetricEnum.php index 6b425b9..1bb92ea 100644 --- a/lib/Model/MetricEnum.php +++ b/lib/Model/MetricEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 64bb26d..2faa89e 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NeverSubscribedEnum.php b/lib/Model/NeverSubscribedEnum.php index c4254c6..0500cfe 100644 --- a/lib/Model/NeverSubscribedEnum.php +++ b/lib/Model/NeverSubscribedEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketing.php b/lib/Model/NoEmailMarketing.php index 6eac39d..d8df2a0 100644 --- a/lib/Model/NoEmailMarketing.php +++ b/lib/Model/NoEmailMarketing.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingConsent.php b/lib/Model/NoEmailMarketingConsent.php index e19c9e9..a80d6b3 100644 --- a/lib/Model/NoEmailMarketingConsent.php +++ b/lib/Model/NoEmailMarketingConsent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingConsentConsentStatus.php b/lib/Model/NoEmailMarketingConsentConsentStatus.php index a6d731a..63666c4 100644 --- a/lib/Model/NoEmailMarketingConsentConsentStatus.php +++ b/lib/Model/NoEmailMarketingConsentConsentStatus.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingFiltersInner.php b/lib/Model/NoEmailMarketingFiltersInner.php index 8b896ee..44a0225 100644 --- a/lib/Model/NoEmailMarketingFiltersInner.php +++ b/lib/Model/NoEmailMarketingFiltersInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingNeverSubscribed.php b/lib/Model/NoEmailMarketingNeverSubscribed.php index c1b80c8..387ec02 100644 --- a/lib/Model/NoEmailMarketingNeverSubscribed.php +++ b/lib/Model/NoEmailMarketingNeverSubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingSubscribed.php b/lib/Model/NoEmailMarketingSubscribed.php index 16fdd8e..e3eeebc 100644 --- a/lib/Model/NoEmailMarketingSubscribed.php +++ b/lib/Model/NoEmailMarketingSubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingUnsubscribed.php b/lib/Model/NoEmailMarketingUnsubscribed.php index 8f8d0fd..2d041ff 100644 --- a/lib/Model/NoEmailMarketingUnsubscribed.php +++ b/lib/Model/NoEmailMarketingUnsubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingUnsubscribedFilters.php b/lib/Model/NoEmailMarketingUnsubscribedFilters.php index e4bbbe1..4dc8afe 100644 --- a/lib/Model/NoEmailMarketingUnsubscribedFilters.php +++ b/lib/Model/NoEmailMarketingUnsubscribedFilters.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoEmailMarketingUnsubscribedFiltersOneOfInner.php b/lib/Model/NoEmailMarketingUnsubscribedFiltersOneOfInner.php index 60ce8b9..af5f435 100644 --- a/lib/Model/NoEmailMarketingUnsubscribedFiltersOneOfInner.php +++ b/lib/Model/NoEmailMarketingUnsubscribedFiltersOneOfInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoPushMarketing.php b/lib/Model/NoPushMarketing.php index 03db7d0..1208ab2 100644 --- a/lib/Model/NoPushMarketing.php +++ b/lib/Model/NoPushMarketing.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoPushMarketingConsent.php b/lib/Model/NoPushMarketingConsent.php index 3152214..f197dba 100644 --- a/lib/Model/NoPushMarketingConsent.php +++ b/lib/Model/NoPushMarketingConsent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoSMSMarketing.php b/lib/Model/NoSMSMarketing.php index 343cec5..d58289b 100644 --- a/lib/Model/NoSMSMarketing.php +++ b/lib/Model/NoSMSMarketing.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoSMSMarketingConsent.php b/lib/Model/NoSMSMarketingConsent.php index 6016284..7364c44 100644 --- a/lib/Model/NoSMSMarketingConsent.php +++ b/lib/Model/NoSMSMarketingConsent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoSMSMarketingConsentConsentStatus.php b/lib/Model/NoSMSMarketingConsentConsentStatus.php index 7a27e4a..c2aabc9 100644 --- a/lib/Model/NoSMSMarketingConsentConsentStatus.php +++ b/lib/Model/NoSMSMarketingConsentConsentStatus.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoSMSMarketingNeverSubscribed.php b/lib/Model/NoSMSMarketingNeverSubscribed.php index b221dd3..e9d682f 100644 --- a/lib/Model/NoSMSMarketingNeverSubscribed.php +++ b/lib/Model/NoSMSMarketingNeverSubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoSMSMarketingUnsubscribed.php b/lib/Model/NoSMSMarketingUnsubscribed.php index d1716db..9d10912 100644 --- a/lib/Model/NoSMSMarketingUnsubscribed.php +++ b/lib/Model/NoSMSMarketingUnsubscribed.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NoSMSMarketingUnsubscribedFiltersInner.php b/lib/Model/NoSMSMarketingUnsubscribedFiltersInner.php index 265ebed..afe58f1 100644 --- a/lib/Model/NoSMSMarketingUnsubscribedFiltersInner.php +++ b/lib/Model/NoSMSMarketingUnsubscribedFiltersInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NotEqualsEnum.php b/lib/Model/NotEqualsEnum.php index 3481d0e..4d7a9b8 100644 --- a/lib/Model/NotEqualsEnum.php +++ b/lib/Model/NotEqualsEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NumericEnum.php b/lib/Model/NumericEnum.php index 654cd35..12af4d3 100644 --- a/lib/Model/NumericEnum.php +++ b/lib/Model/NumericEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NumericOperatorFilter.php b/lib/Model/NumericOperatorFilter.php index 87ca7e1..ec6492d 100644 --- a/lib/Model/NumericOperatorFilter.php +++ b/lib/Model/NumericOperatorFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/NumericOperatorFilterValue.php b/lib/Model/NumericOperatorFilterValue.php index 16b91b2..9ac05cc 100644 --- a/lib/Model/NumericOperatorFilterValue.php +++ b/lib/Model/NumericOperatorFilterValue.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/OnsiteProfileCreateQueryResourceObject.php b/lib/Model/OnsiteProfileCreateQueryResourceObject.php index cb1d56f..4ad6205 100644 --- a/lib/Model/OnsiteProfileCreateQueryResourceObject.php +++ b/lib/Model/OnsiteProfileCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/OnsiteProfileCreateQueryResourceObjectAttributes.php b/lib/Model/OnsiteProfileCreateQueryResourceObjectAttributes.php index 164f1fb..e5640cd 100644 --- a/lib/Model/OnsiteProfileCreateQueryResourceObjectAttributes.php +++ b/lib/Model/OnsiteProfileCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -66,6 +66,7 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface 'first_name' => 'string', 'last_name' => 'string', 'organization' => 'string', + 'locale' => 'string', 'title' => 'string', 'image' => 'string', 'location' => '\KlaviyoAPI\Model\ProfileLocation', @@ -88,6 +89,7 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface 'first_name' => null, 'last_name' => null, 'organization' => null, + 'locale' => null, 'title' => null, 'image' => null, 'location' => null, @@ -108,6 +110,7 @@ class OnsiteProfileCreateQueryResourceObjectAttributes implements ModelInterface 'first_name' => true, 'last_name' => true, 'organization' => true, + 'locale' => true, 'title' => true, 'image' => true, 'location' => false, @@ -198,6 +201,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'first_name', 'last_name' => 'last_name', 'organization' => 'organization', + 'locale' => 'locale', 'title' => 'title', 'image' => 'image', 'location' => 'location', @@ -218,6 +222,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'organization' => 'setOrganization', + 'locale' => 'setLocale', 'title' => 'setTitle', 'image' => 'setImage', 'location' => 'setLocation', @@ -238,6 +243,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'organization' => 'getOrganization', + 'locale' => 'getLocale', 'title' => 'getTitle', 'image' => 'getImage', 'location' => 'getLocation', @@ -309,6 +315,7 @@ public function __construct(array $data = null) $this->setIfExists('first_name', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('image', $data ?? [], null); $this->setIfExists('location', $data ?? [], null); @@ -645,6 +652,42 @@ public function setOrganization($organization) return $this; } + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + * + * @return self + */ + public function setLocale($locale) + { + + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['locale'] = $locale; + + return $this; + } + /** * Gets title * diff --git a/lib/Model/OnsiteProfileMeta.php b/lib/Model/OnsiteProfileMeta.php index 92268b4..5a056c5 100644 --- a/lib/Model/OnsiteProfileMeta.php +++ b/lib/Model/OnsiteProfileMeta.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PreferencePageEnum.php b/lib/Model/PreferencePageEnum.php index 15085ef..2f30079 100644 --- a/lib/Model/PreferencePageEnum.php +++ b/lib/Model/PreferencePageEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PreferencePageFilter.php b/lib/Model/PreferencePageFilter.php index 1e1ffa9..11fecfb 100644 --- a/lib/Model/PreferencePageFilter.php +++ b/lib/Model/PreferencePageFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PreferencePageMethodFilter.php b/lib/Model/PreferencePageMethodFilter.php index 129a460..74fb657 100644 --- a/lib/Model/PreferencePageMethodFilter.php +++ b/lib/Model/PreferencePageMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileBulkImportJobEnum.php b/lib/Model/ProfileBulkImportJobEnum.php index 7e17e70..a876a64 100644 --- a/lib/Model/ProfileBulkImportJobEnum.php +++ b/lib/Model/ProfileBulkImportJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileCreateQuery.php b/lib/Model/ProfileCreateQuery.php index 82792ed..616600e 100644 --- a/lib/Model/ProfileCreateQuery.php +++ b/lib/Model/ProfileCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileCreateQueryResourceObject.php b/lib/Model/ProfileCreateQueryResourceObject.php index 534a9b6..c1e30d3 100644 --- a/lib/Model/ProfileCreateQueryResourceObject.php +++ b/lib/Model/ProfileCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileCreateQueryResourceObjectAttributes.php b/lib/Model/ProfileCreateQueryResourceObjectAttributes.php index 141a5a5..0755a1f 100644 --- a/lib/Model/ProfileCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -64,6 +64,7 @@ class ProfileCreateQueryResourceObjectAttributes implements ModelInterface, Arra 'first_name' => 'string', 'last_name' => 'string', 'organization' => 'string', + 'locale' => 'string', 'title' => 'string', 'image' => 'string', 'location' => '\KlaviyoAPI\Model\ProfileLocation', @@ -84,6 +85,7 @@ class ProfileCreateQueryResourceObjectAttributes implements ModelInterface, Arra 'first_name' => null, 'last_name' => null, 'organization' => null, + 'locale' => null, 'title' => null, 'image' => null, 'location' => null, @@ -102,6 +104,7 @@ class ProfileCreateQueryResourceObjectAttributes implements ModelInterface, Arra 'first_name' => true, 'last_name' => true, 'organization' => true, + 'locale' => true, 'title' => true, 'image' => true, 'location' => false, @@ -190,6 +193,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'first_name', 'last_name' => 'last_name', 'organization' => 'organization', + 'locale' => 'locale', 'title' => 'title', 'image' => 'image', 'location' => 'location', @@ -208,6 +212,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'organization' => 'setOrganization', + 'locale' => 'setLocale', 'title' => 'setTitle', 'image' => 'setImage', 'location' => 'setLocation', @@ -226,6 +231,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'organization' => 'getOrganization', + 'locale' => 'getLocale', 'title' => 'getTitle', 'image' => 'getImage', 'location' => 'getLocation', @@ -295,6 +301,7 @@ public function __construct(array $data = null) $this->setIfExists('first_name', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('image', $data ?? [], null); $this->setIfExists('location', $data ?? [], null); @@ -559,6 +566,42 @@ public function setOrganization($organization) return $this; } + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + * + * @return self + */ + public function setLocale($locale) + { + + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['locale'] = $locale; + + return $this; + } + /** * Gets title * diff --git a/lib/Model/ProfileEnum.php b/lib/Model/ProfileEnum.php index 4f79352..9b5b099 100644 --- a/lib/Model/ProfileEnum.php +++ b/lib/Model/ProfileEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileGroupMembershipEnum.php b/lib/Model/ProfileGroupMembershipEnum.php index f0312b1..a51051c 100644 --- a/lib/Model/ProfileGroupMembershipEnum.php +++ b/lib/Model/ProfileGroupMembershipEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileHasGroupMembershipCondition.php b/lib/Model/ProfileHasGroupMembershipCondition.php index da6e5c5..eb17ece 100644 --- a/lib/Model/ProfileHasGroupMembershipCondition.php +++ b/lib/Model/ProfileHasGroupMembershipCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileHasGroupMembershipConditionTimeframeFilter.php b/lib/Model/ProfileHasGroupMembershipConditionTimeframeFilter.php index 21c939a..f6fa5af 100644 --- a/lib/Model/ProfileHasGroupMembershipConditionTimeframeFilter.php +++ b/lib/Model/ProfileHasGroupMembershipConditionTimeframeFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileIdentifierDTOResourceObject.php b/lib/Model/ProfileIdentifierDTOResourceObject.php index 568caec..7d3b7de 100644 --- a/lib/Model/ProfileIdentifierDTOResourceObject.php +++ b/lib/Model/ProfileIdentifierDTOResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php b/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php index 09a2c79..f3a64ae 100644 --- a/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php +++ b/lib/Model/ProfileIdentifierDTOResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileImportJobCreateQuery.php b/lib/Model/ProfileImportJobCreateQuery.php index 4a9e607..47408fe 100644 --- a/lib/Model/ProfileImportJobCreateQuery.php +++ b/lib/Model/ProfileImportJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileImportJobCreateQueryResourceObject.php b/lib/Model/ProfileImportJobCreateQueryResourceObject.php index facb010..cd81317 100644 --- a/lib/Model/ProfileImportJobCreateQueryResourceObject.php +++ b/lib/Model/ProfileImportJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributes.php b/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributes.php index 9549fe7..0e4ec79 100644 --- a/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributesProfiles.php b/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributesProfiles.php index aef3b34..a8b4b68 100644 --- a/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributesProfiles.php +++ b/lib/Model/ProfileImportJobCreateQueryResourceObjectAttributesProfiles.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationships.php b/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationships.php index cdbe3fc..6afe103 100644 --- a/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationships.php +++ b/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsLists.php b/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsLists.php index 98c4b15..bb5f7db 100644 --- a/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsLists.php +++ b/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsLists.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsListsDataInner.php b/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsListsDataInner.php index d136287..05c9386 100644 --- a/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsListsDataInner.php +++ b/lib/Model/ProfileImportJobCreateQueryResourceObjectRelationshipsListsDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileLocation.php b/lib/Model/ProfileLocation.php index fa970bf..6ea174c 100644 --- a/lib/Model/ProfileLocation.php +++ b/lib/Model/ProfileLocation.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileLocationLatitude.php b/lib/Model/ProfileLocationLatitude.php index 0c6fb2f..b4b0901 100644 --- a/lib/Model/ProfileLocationLatitude.php +++ b/lib/Model/ProfileLocationLatitude.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileLocationLongitude.php b/lib/Model/ProfileLocationLongitude.php index 3b1204d..97405ca 100644 --- a/lib/Model/ProfileLocationLongitude.php +++ b/lib/Model/ProfileLocationLongitude.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMarketingConsentCondition.php b/lib/Model/ProfileMarketingConsentCondition.php index e4042cc..cc19880 100644 --- a/lib/Model/ProfileMarketingConsentCondition.php +++ b/lib/Model/ProfileMarketingConsentCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMarketingConsentConditionConsent.php b/lib/Model/ProfileMarketingConsentConditionConsent.php index c894dfd..a3ea119 100644 --- a/lib/Model/ProfileMarketingConsentConditionConsent.php +++ b/lib/Model/ProfileMarketingConsentConditionConsent.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMarketingConsentEnum.php b/lib/Model/ProfileMarketingConsentEnum.php index 1250183..1df0c1e 100644 --- a/lib/Model/ProfileMarketingConsentEnum.php +++ b/lib/Model/ProfileMarketingConsentEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMergeEnum.php b/lib/Model/ProfileMergeEnum.php index ffcdad0..192a23b 100644 --- a/lib/Model/ProfileMergeEnum.php +++ b/lib/Model/ProfileMergeEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMergeQuery.php b/lib/Model/ProfileMergeQuery.php index d298c9e..765af80 100644 --- a/lib/Model/ProfileMergeQuery.php +++ b/lib/Model/ProfileMergeQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMergeQueryResourceObject.php b/lib/Model/ProfileMergeQueryResourceObject.php index 7fca5cb..5019696 100644 --- a/lib/Model/ProfileMergeQueryResourceObject.php +++ b/lib/Model/ProfileMergeQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMergeQueryResourceObjectRelationships.php b/lib/Model/ProfileMergeQueryResourceObjectRelationships.php index 95b91c6..fb3c560 100644 --- a/lib/Model/ProfileMergeQueryResourceObjectRelationships.php +++ b/lib/Model/ProfileMergeQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfiles.php b/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfiles.php index 2cd28c1..f744551 100644 --- a/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfiles.php +++ b/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfiles.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfilesDataInner.php b/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfilesDataInner.php index 4ee2e0b..e2512af 100644 --- a/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfilesDataInner.php +++ b/lib/Model/ProfileMergeQueryResourceObjectRelationshipsProfilesDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMeta.php b/lib/Model/ProfileMeta.php index 22561eb..e501a52 100644 --- a/lib/Model/ProfileMeta.php +++ b/lib/Model/ProfileMeta.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMetaPatchProperties.php b/lib/Model/ProfileMetaPatchProperties.php index d004aae..4538035 100644 --- a/lib/Model/ProfileMetaPatchProperties.php +++ b/lib/Model/ProfileMetaPatchProperties.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMetaPatchPropertiesUnset.php b/lib/Model/ProfileMetaPatchPropertiesUnset.php index 24b83da..068d6e4 100644 --- a/lib/Model/ProfileMetaPatchPropertiesUnset.php +++ b/lib/Model/ProfileMetaPatchPropertiesUnset.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMetricCondition.php b/lib/Model/ProfileMetricCondition.php index f336a47..3b7b422 100644 --- a/lib/Model/ProfileMetricCondition.php +++ b/lib/Model/ProfileMetricCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMetricConditionTimeframeFilter.php b/lib/Model/ProfileMetricConditionTimeframeFilter.php index 9fb5ff9..c30d388 100644 --- a/lib/Model/ProfileMetricConditionTimeframeFilter.php +++ b/lib/Model/ProfileMetricConditionTimeframeFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMetricEnum.php b/lib/Model/ProfileMetricEnum.php index 6deb617..97cf468 100644 --- a/lib/Model/ProfileMetricEnum.php +++ b/lib/Model/ProfileMetricEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMetricPropertyFilter.php b/lib/Model/ProfileMetricPropertyFilter.php index 71429cb..9d47a8c 100644 --- a/lib/Model/ProfileMetricPropertyFilter.php +++ b/lib/Model/ProfileMetricPropertyFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileMetricPropertyFilterFilter.php b/lib/Model/ProfileMetricPropertyFilterFilter.php index c84a2d1..7734b79 100644 --- a/lib/Model/ProfileMetricPropertyFilterFilter.php +++ b/lib/Model/ProfileMetricPropertyFilterFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -58,9 +58,9 @@ class ProfileMetricPropertyFilterFilter implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'type' => '\KlaviyoAPI\Model\ListEnum', + 'type' => '\KlaviyoAPI\Model\NumericEnum', 'operator' => 'string', - 'value' => 'string[]' + 'value' => '\KlaviyoAPI\Model\NumericOperatorFilterValue' ]; /** @@ -231,7 +231,12 @@ public function getModelName() return self::$openAPIModelName; } - public const OPERATOR_CONTAINS_ANY = 'contains-any'; + public const OPERATOR_EQUALS = 'equals'; + public const OPERATOR_GREATER_THAN = 'greater-than'; + public const OPERATOR_GREATER_THAN_OR_EQUAL = 'greater-than-or-equal'; + public const OPERATOR_LESS_THAN = 'less-than'; + public const OPERATOR_LESS_THAN_OR_EQUAL = 'less-than-or-equal'; + public const OPERATOR_NOT_EQUALS = 'not-equals'; /** * Gets allowable values of the enum @@ -241,7 +246,12 @@ public function getModelName() public function getOperatorAllowableValues() { return [ - self::OPERATOR_CONTAINS_ANY, + self::OPERATOR_EQUALS, + self::OPERATOR_GREATER_THAN, + self::OPERATOR_GREATER_THAN_OR_EQUAL, + self::OPERATOR_LESS_THAN, + self::OPERATOR_LESS_THAN_OR_EQUAL, + self::OPERATOR_NOT_EQUALS, ]; } @@ -328,7 +338,7 @@ public function valid() /** * Gets type * - * @return \KlaviyoAPI\Model\ListEnum + * @return \KlaviyoAPI\Model\NumericEnum */ public function getType() { @@ -338,7 +348,7 @@ public function getType() /** * Sets type * - * @param \KlaviyoAPI\Model\ListEnum $type type + * @param \KlaviyoAPI\Model\NumericEnum $type type * * @return self */ @@ -367,7 +377,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator Operators for list contains set filters. + * @param string $operator Operators for numeric filters. * * @return self */ @@ -396,7 +406,7 @@ public function setOperator($operator) /** * Gets value * - * @return string[] + * @return \KlaviyoAPI\Model\NumericOperatorFilterValue */ public function getValue() { @@ -406,7 +416,7 @@ public function getValue() /** * Sets value * - * @param string[] $value value + * @param \KlaviyoAPI\Model\NumericOperatorFilterValue $value value * * @return self */ diff --git a/lib/Model/ProfileNoGroupMembershipCondition.php b/lib/Model/ProfileNoGroupMembershipCondition.php index c3922ee..ef22bbf 100644 --- a/lib/Model/ProfileNoGroupMembershipCondition.php +++ b/lib/Model/ProfileNoGroupMembershipCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePartialUpdateQuery.php b/lib/Model/ProfilePartialUpdateQuery.php index daddaa1..69b36b8 100644 --- a/lib/Model/ProfilePartialUpdateQuery.php +++ b/lib/Model/ProfilePartialUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePartialUpdateQueryResourceObject.php b/lib/Model/ProfilePartialUpdateQueryResourceObject.php index b85e97c..4142060 100644 --- a/lib/Model/ProfilePartialUpdateQueryResourceObject.php +++ b/lib/Model/ProfilePartialUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php b/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php index 8f21232..404f0d5 100644 --- a/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfilePartialUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -65,6 +65,7 @@ class ProfilePartialUpdateQueryResourceObjectAttributes implements ModelInterfac 'first_name' => 'string', 'last_name' => 'string', 'organization' => 'string', + 'locale' => 'string', 'title' => 'string', 'image' => 'string', 'location' => '\KlaviyoAPI\Model\ProfileLocation', @@ -86,6 +87,7 @@ class ProfilePartialUpdateQueryResourceObjectAttributes implements ModelInterfac 'first_name' => null, 'last_name' => null, 'organization' => null, + 'locale' => null, 'title' => null, 'image' => null, 'location' => null, @@ -105,6 +107,7 @@ class ProfilePartialUpdateQueryResourceObjectAttributes implements ModelInterfac 'first_name' => true, 'last_name' => true, 'organization' => true, + 'locale' => true, 'title' => true, 'image' => true, 'location' => false, @@ -194,6 +197,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'first_name', 'last_name' => 'last_name', 'organization' => 'organization', + 'locale' => 'locale', 'title' => 'title', 'image' => 'image', 'location' => 'location', @@ -213,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'organization' => 'setOrganization', + 'locale' => 'setLocale', 'title' => 'setTitle', 'image' => 'setImage', 'location' => 'setLocation', @@ -232,6 +237,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'organization' => 'getOrganization', + 'locale' => 'getLocale', 'title' => 'getTitle', 'image' => 'getImage', 'location' => 'getLocation', @@ -302,6 +308,7 @@ public function __construct(array $data = null) $this->setIfExists('first_name', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('image', $data ?? [], null); $this->setIfExists('location', $data ?? [], null); @@ -602,6 +609,42 @@ public function setOrganization($organization) return $this; } + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + * + * @return self + */ + public function setLocale($locale) + { + + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['locale'] = $locale; + + return $this; + } + /** * Gets title * diff --git a/lib/Model/ProfilePostalCodeDistanceCondition.php b/lib/Model/ProfilePostalCodeDistanceCondition.php index 3d55fe4..cdde736 100644 --- a/lib/Model/ProfilePostalCodeDistanceCondition.php +++ b/lib/Model/ProfilePostalCodeDistanceCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePostalCodeDistanceEnum.php b/lib/Model/ProfilePostalCodeDistanceEnum.php index 07fde6a..0520069 100644 --- a/lib/Model/ProfilePostalCodeDistanceEnum.php +++ b/lib/Model/ProfilePostalCodeDistanceEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePredictiveAnalyticsEnum.php b/lib/Model/ProfilePredictiveAnalyticsEnum.php index c344803..b939ab1 100644 --- a/lib/Model/ProfilePredictiveAnalyticsEnum.php +++ b/lib/Model/ProfilePredictiveAnalyticsEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePredictiveAnalyticsNumericCondition.php b/lib/Model/ProfilePredictiveAnalyticsNumericCondition.php index 81776d9..1ab85d5 100644 --- a/lib/Model/ProfilePredictiveAnalyticsNumericCondition.php +++ b/lib/Model/ProfilePredictiveAnalyticsNumericCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePredictiveAnalyticsStringCondition.php b/lib/Model/ProfilePredictiveAnalyticsStringCondition.php index 3a78976..8afa1c4 100644 --- a/lib/Model/ProfilePredictiveAnalyticsStringCondition.php +++ b/lib/Model/ProfilePredictiveAnalyticsStringCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePredictiveAnalyticsStringFilter.php b/lib/Model/ProfilePredictiveAnalyticsStringFilter.php index 19fec31..6cae993 100644 --- a/lib/Model/ProfilePredictiveAnalyticsStringFilter.php +++ b/lib/Model/ProfilePredictiveAnalyticsStringFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePredictiveAnalyticsStringFilterOperator.php b/lib/Model/ProfilePredictiveAnalyticsStringFilterOperator.php index c46f2d2..e295b48 100644 --- a/lib/Model/ProfilePredictiveAnalyticsStringFilterOperator.php +++ b/lib/Model/ProfilePredictiveAnalyticsStringFilterOperator.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePropertyCondition.php b/lib/Model/ProfilePropertyCondition.php index 8cc1d9e..2a243cf 100644 --- a/lib/Model/ProfilePropertyCondition.php +++ b/lib/Model/ProfilePropertyCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePropertyConditionFilter.php b/lib/Model/ProfilePropertyConditionFilter.php index 1ec86bc..0cffc1a 100644 --- a/lib/Model/ProfilePropertyConditionFilter.php +++ b/lib/Model/ProfilePropertyConditionFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfilePropertyEnum.php b/lib/Model/ProfilePropertyEnum.php index e3dd900..018c5b8 100644 --- a/lib/Model/ProfilePropertyEnum.php +++ b/lib/Model/ProfilePropertyEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileRegionCondition.php b/lib/Model/ProfileRegionCondition.php index 630d98a..d004e24 100644 --- a/lib/Model/ProfileRegionCondition.php +++ b/lib/Model/ProfileRegionCondition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileRegionEnum.php b/lib/Model/ProfileRegionEnum.php index 386206a..ebf4b57 100644 --- a/lib/Model/ProfileRegionEnum.php +++ b/lib/Model/ProfileRegionEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSubscriptionBulkCreateJobEnum.php b/lib/Model/ProfileSubscriptionBulkCreateJobEnum.php index 0710d57..fa8ed06 100644 --- a/lib/Model/ProfileSubscriptionBulkCreateJobEnum.php +++ b/lib/Model/ProfileSubscriptionBulkCreateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSubscriptionBulkDeleteJobEnum.php b/lib/Model/ProfileSubscriptionBulkDeleteJobEnum.php index 5afeafc..a68e0ad 100644 --- a/lib/Model/ProfileSubscriptionBulkDeleteJobEnum.php +++ b/lib/Model/ProfileSubscriptionBulkDeleteJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php b/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php index 52ef6d2..50dc2e3 100644 --- a/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php +++ b/lib/Model/ProfileSubscriptionCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php b/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php index f6f0309..439adfe 100644 --- a/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSubscriptionCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSubscriptionDeleteQueryResourceObject.php b/lib/Model/ProfileSubscriptionDeleteQueryResourceObject.php index 6114c37..b6f3f4c 100644 --- a/lib/Model/ProfileSubscriptionDeleteQueryResourceObject.php +++ b/lib/Model/ProfileSubscriptionDeleteQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php b/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php index 20fb2ac..8f68c00 100644 --- a/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSubscriptionDeleteQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSuppressionBulkCreateJobEnum.php b/lib/Model/ProfileSuppressionBulkCreateJobEnum.php index db6e105..be15a89 100644 --- a/lib/Model/ProfileSuppressionBulkCreateJobEnum.php +++ b/lib/Model/ProfileSuppressionBulkCreateJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSuppressionBulkDeleteJobEnum.php b/lib/Model/ProfileSuppressionBulkDeleteJobEnum.php index 84877c0..f1365d9 100644 --- a/lib/Model/ProfileSuppressionBulkDeleteJobEnum.php +++ b/lib/Model/ProfileSuppressionBulkDeleteJobEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSuppressionCreateQueryResourceObject.php b/lib/Model/ProfileSuppressionCreateQueryResourceObject.php index 8076111..6445880 100644 --- a/lib/Model/ProfileSuppressionCreateQueryResourceObject.php +++ b/lib/Model/ProfileSuppressionCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php b/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php index 3ce7c09..f82590f 100644 --- a/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSuppressionCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSuppressionDeleteQueryResourceObject.php b/lib/Model/ProfileSuppressionDeleteQueryResourceObject.php index 71e5397..0d3b51d 100644 --- a/lib/Model/ProfileSuppressionDeleteQueryResourceObject.php +++ b/lib/Model/ProfileSuppressionDeleteQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php b/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php index c240772..fd1601a 100644 --- a/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileSuppressionDeleteQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileUpsertQuery.php b/lib/Model/ProfileUpsertQuery.php index dec3147..63bd61a 100644 --- a/lib/Model/ProfileUpsertQuery.php +++ b/lib/Model/ProfileUpsertQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileUpsertQueryResourceObject.php b/lib/Model/ProfileUpsertQueryResourceObject.php index f1232cc..70fb194 100644 --- a/lib/Model/ProfileUpsertQueryResourceObject.php +++ b/lib/Model/ProfileUpsertQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php b/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php index 1e3b15d..16dad4b 100644 --- a/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php +++ b/lib/Model/ProfileUpsertQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -66,6 +66,7 @@ class ProfileUpsertQueryResourceObjectAttributes implements ModelInterface, Arra 'first_name' => 'string', 'last_name' => 'string', 'organization' => 'string', + 'locale' => 'string', 'title' => 'string', 'image' => 'string', 'location' => '\KlaviyoAPI\Model\ProfileLocation', @@ -88,6 +89,7 @@ class ProfileUpsertQueryResourceObjectAttributes implements ModelInterface, Arra 'first_name' => null, 'last_name' => null, 'organization' => null, + 'locale' => null, 'title' => null, 'image' => null, 'location' => null, @@ -108,6 +110,7 @@ class ProfileUpsertQueryResourceObjectAttributes implements ModelInterface, Arra 'first_name' => true, 'last_name' => true, 'organization' => true, + 'locale' => true, 'title' => true, 'image' => true, 'location' => false, @@ -198,6 +201,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'first_name', 'last_name' => 'last_name', 'organization' => 'organization', + 'locale' => 'locale', 'title' => 'title', 'image' => 'image', 'location' => 'location', @@ -218,6 +222,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'organization' => 'setOrganization', + 'locale' => 'setLocale', 'title' => 'setTitle', 'image' => 'setImage', 'location' => 'setLocation', @@ -238,6 +243,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'organization' => 'getOrganization', + 'locale' => 'getLocale', 'title' => 'getTitle', 'image' => 'getImage', 'location' => 'getLocation', @@ -309,6 +315,7 @@ public function __construct(array $data = null) $this->setIfExists('first_name', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('image', $data ?? [], null); $this->setIfExists('location', $data ?? [], null); @@ -645,6 +652,42 @@ public function setOrganization($organization) return $this; } + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + * + * @return self + */ + public function setLocale($locale) + { + + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['locale'] = $locale; + + return $this; + } + /** * Gets title * diff --git a/lib/Model/ProvidedLandlineEnum.php b/lib/Model/ProvidedLandlineEnum.php index 104b5aa..58bf615 100644 --- a/lib/Model/ProvidedLandlineEnum.php +++ b/lib/Model/ProvidedLandlineEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProvidedLandlineMethodFilter.php b/lib/Model/ProvidedLandlineMethodFilter.php index 7085cb4..1d453b0 100644 --- a/lib/Model/ProvidedLandlineMethodFilter.php +++ b/lib/Model/ProvidedLandlineMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProvidedNoAgeEnum.php b/lib/Model/ProvidedNoAgeEnum.php index f2926bf..690eef5 100644 --- a/lib/Model/ProvidedNoAgeEnum.php +++ b/lib/Model/ProvidedNoAgeEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ProvidedNoAgeMethodFilter.php b/lib/Model/ProvidedNoAgeMethodFilter.php index b169429..fb44642 100644 --- a/lib/Model/ProvidedNoAgeMethodFilter.php +++ b/lib/Model/ProvidedNoAgeMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PushEnum.php b/lib/Model/PushEnum.php index 541635c..99792ad 100644 --- a/lib/Model/PushEnum.php +++ b/lib/Model/PushEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PushProfileUpsertQueryResourceObject.php b/lib/Model/PushProfileUpsertQueryResourceObject.php index bd8a99a..2281d7f 100644 --- a/lib/Model/PushProfileUpsertQueryResourceObject.php +++ b/lib/Model/PushProfileUpsertQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php b/lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php index f80171b..3d13edd 100644 --- a/lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php +++ b/lib/Model/PushProfileUpsertQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -65,6 +65,7 @@ class PushProfileUpsertQueryResourceObjectAttributes implements ModelInterface, 'first_name' => 'string', 'last_name' => 'string', 'organization' => 'string', + 'locale' => 'string', 'title' => 'string', 'image' => 'string', 'location' => '\KlaviyoAPI\Model\ProfileLocation', @@ -88,6 +89,7 @@ class PushProfileUpsertQueryResourceObjectAttributes implements ModelInterface, 'first_name' => null, 'last_name' => null, 'organization' => null, + 'locale' => null, 'title' => null, 'image' => null, 'location' => null, @@ -109,6 +111,7 @@ class PushProfileUpsertQueryResourceObjectAttributes implements ModelInterface, 'first_name' => true, 'last_name' => true, 'organization' => true, + 'locale' => true, 'title' => true, 'image' => true, 'location' => false, @@ -200,6 +203,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'first_name', 'last_name' => 'last_name', 'organization' => 'organization', + 'locale' => 'locale', 'title' => 'title', 'image' => 'image', 'location' => 'location', @@ -221,6 +225,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'organization' => 'setOrganization', + 'locale' => 'setLocale', 'title' => 'setTitle', 'image' => 'setImage', 'location' => 'setLocation', @@ -242,6 +247,7 @@ public function isNullableSetToNull(string $property): bool 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'organization' => 'getOrganization', + 'locale' => 'getLocale', 'title' => 'getTitle', 'image' => 'getImage', 'location' => 'getLocation', @@ -314,6 +320,7 @@ public function __construct(array $data = null) $this->setIfExists('first_name', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('image', $data ?? [], null); $this->setIfExists('location', $data ?? [], null); @@ -616,6 +623,42 @@ public function setOrganization($organization) return $this; } + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + * + * @return self + */ + public function setLocale($locale) + { + + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['locale'] = $locale; + + return $this; + } + /** * Gets title * diff --git a/lib/Model/PushTokenCreateQuery.php b/lib/Model/PushTokenCreateQuery.php index 1c48f09..d475b3b 100644 --- a/lib/Model/PushTokenCreateQuery.php +++ b/lib/Model/PushTokenCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PushTokenCreateQueryResourceObject.php b/lib/Model/PushTokenCreateQueryResourceObject.php index 17a9b76..43a417d 100644 --- a/lib/Model/PushTokenCreateQueryResourceObject.php +++ b/lib/Model/PushTokenCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php b/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php index fa7c365..c2d9f13 100644 --- a/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php +++ b/lib/Model/PushTokenCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php b/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php index 8fe3c06..55e8698 100644 --- a/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php +++ b/lib/Model/PushTokenCreateQueryResourceObjectAttributesProfile.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/PushTokenEnum.php b/lib/Model/PushTokenEnum.php index 8ad9a12..4cc88e9 100644 --- a/lib/Model/PushTokenEnum.php +++ b/lib/Model/PushTokenEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/RelativeAnniversaryDateFilter.php b/lib/Model/RelativeAnniversaryDateFilter.php index b6b0a66..7ce7ec0 100644 --- a/lib/Model/RelativeAnniversaryDateFilter.php +++ b/lib/Model/RelativeAnniversaryDateFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/RelativeDateOperatorBaseFilter.php b/lib/Model/RelativeDateOperatorBaseFilter.php index af8867f..f4adcc5 100644 --- a/lib/Model/RelativeDateOperatorBaseFilter.php +++ b/lib/Model/RelativeDateOperatorBaseFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/RelativeDateRangeFilter.php b/lib/Model/RelativeDateRangeFilter.php index a99a8ca..d5c805a 100644 --- a/lib/Model/RelativeDateRangeFilter.php +++ b/lib/Model/RelativeDateRangeFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/RenderOptionsSubObject.php b/lib/Model/RenderOptionsSubObject.php index a00f315..eb1cdd3 100644 --- a/lib/Model/RenderOptionsSubObject.php +++ b/lib/Model/RenderOptionsSubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SMSContentSubObjectCreate.php b/lib/Model/SMSContentSubObjectCreate.php index 160fc52..f98d0a5 100644 --- a/lib/Model/SMSContentSubObjectCreate.php +++ b/lib/Model/SMSContentSubObjectCreate.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SMSSendOptionsSubObject.php b/lib/Model/SMSSendOptionsSubObject.php index fc2d7f0..6b46e41 100644 --- a/lib/Model/SMSSendOptionsSubObject.php +++ b/lib/Model/SMSSendOptionsSubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SMSSubscriptionParameters.php b/lib/Model/SMSSubscriptionParameters.php index d52943d..57b0ad5 100644 --- a/lib/Model/SMSSubscriptionParameters.php +++ b/lib/Model/SMSSubscriptionParameters.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -58,7 +58,7 @@ class SMSSubscriptionParameters implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'marketing' => '\KlaviyoAPI\Model\MarketingSubscriptionParameters' + 'marketing' => '\KlaviyoAPI\Model\SubscriptionParameters' ]; /** @@ -265,9 +265,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['marketing'] === null) { - $invalidProperties[] = "'marketing' can't be null"; - } return $invalidProperties; } @@ -286,7 +283,7 @@ public function valid() /** * Gets marketing * - * @return \KlaviyoAPI\Model\MarketingSubscriptionParameters + * @return \KlaviyoAPI\Model\SubscriptionParameters|null */ public function getMarketing() { @@ -296,7 +293,7 @@ public function getMarketing() /** * Sets marketing * - * @param \KlaviyoAPI\Model\MarketingSubscriptionParameters $marketing marketing + * @param \KlaviyoAPI\Model\SubscriptionParameters|null $marketing marketing * * @return self */ diff --git a/lib/Model/SMSTrackingOptionsSubObject.php b/lib/Model/SMSTrackingOptionsSubObject.php index b255764..92d5216 100644 --- a/lib/Model/SMSTrackingOptionsSubObject.php +++ b/lib/Model/SMSTrackingOptionsSubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 @@ -58,8 +58,8 @@ class SMSTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'is_add_utm' => 'bool', - 'utm_params' => '\KlaviyoAPI\Model\UTMParamsSubObject[]' + 'add_tracking_params' => 'bool', + 'custom_tracking_params' => '\KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]' ]; /** @@ -70,8 +70,8 @@ class SMSTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'is_add_utm' => null, - 'utm_params' => null + 'add_tracking_params' => null, + 'custom_tracking_params' => null ]; /** @@ -80,8 +80,8 @@ class SMSTrackingOptionsSubObject implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'is_add_utm' => true, - 'utm_params' => true + 'add_tracking_params' => true, + 'custom_tracking_params' => true ]; /** @@ -160,8 +160,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'is_add_utm' => 'is_add_utm', - 'utm_params' => 'utm_params' + 'add_tracking_params' => 'add_tracking_params', + 'custom_tracking_params' => 'custom_tracking_params' ]; /** @@ -170,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'is_add_utm' => 'setIsAddUtm', - 'utm_params' => 'setUtmParams' + 'add_tracking_params' => 'setAddTrackingParams', + 'custom_tracking_params' => 'setCustomTrackingParams' ]; /** @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'is_add_utm' => 'getIsAddUtm', - 'utm_params' => 'getUtmParams' + 'add_tracking_params' => 'getAddTrackingParams', + 'custom_tracking_params' => 'getCustomTrackingParams' ]; /** @@ -241,8 +241,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('is_add_utm', $data ?? [], null); - $this->setIfExists('utm_params', $data ?? [], null); + $this->setIfExists('add_tracking_params', $data ?? [], null); + $this->setIfExists('custom_tracking_params', $data ?? [], null); } /** @@ -288,73 +288,73 @@ public function valid() /** - * Gets is_add_utm + * Gets add_tracking_params * * @return bool|null */ - public function getIsAddUtm() + public function getAddTrackingParams() { - return $this->container['is_add_utm']; + return $this->container['add_tracking_params']; } /** - * Sets is_add_utm + * Sets add_tracking_params * - * @param bool|null $is_add_utm Whether the campaign needs UTM parameters. If set to False, UTM params will not be used. + * @param bool|null $add_tracking_params Whether the campaign needs custom tracking parameters. If set to False, tracking params will not be used. * * @return self */ - public function setIsAddUtm($is_add_utm) + public function setAddTrackingParams($add_tracking_params) { - if (is_null($is_add_utm)) { - array_push($this->openAPINullablesSetToNull, 'is_add_utm'); + if (is_null($add_tracking_params)) { + array_push($this->openAPINullablesSetToNull, 'add_tracking_params'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('is_add_utm', $nullablesSetToNull); + $index = array_search('add_tracking_params', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['is_add_utm'] = $is_add_utm; + $this->container['add_tracking_params'] = $add_tracking_params; return $this; } /** - * Gets utm_params + * Gets custom_tracking_params * - * @return \KlaviyoAPI\Model\UTMParamsSubObject[]|null + * @return \KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]|null */ - public function getUtmParams() + public function getCustomTrackingParams() { - return $this->container['utm_params']; + return $this->container['custom_tracking_params']; } /** - * Sets utm_params + * Sets custom_tracking_params * - * @param \KlaviyoAPI\Model\UTMParamsSubObject[]|null $utm_params A list of UTM parameters. If an empty list is given and is_add_utm is True, uses company defaults. + * @param \KlaviyoAPI\Model\EmailTrackingOptionsSubObjectCustomTrackingParamsInner[]|null $custom_tracking_params A list of custom tracking parameters. If an empty list is given and add_tracking_params is True, uses company defaults. * * @return self */ - public function setUtmParams($utm_params) + public function setCustomTrackingParams($custom_tracking_params) { - if (is_null($utm_params)) { - array_push($this->openAPINullablesSetToNull, 'utm_params'); + if (is_null($custom_tracking_params)) { + array_push($this->openAPINullablesSetToNull, 'custom_tracking_params'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('utm_params', $nullablesSetToNull); + $index = array_search('custom_tracking_params', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['utm_params'] = $utm_params; + $this->container['custom_tracking_params'] = $custom_tracking_params; return $this; } diff --git a/lib/Model/STOScheduleOptions.php b/lib/Model/STOScheduleOptions.php index e2c573a..4f24289 100644 --- a/lib/Model/STOScheduleOptions.php +++ b/lib/Model/STOScheduleOptions.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentCreateQuery.php b/lib/Model/SegmentCreateQuery.php index 3839b9e..ebc00cd 100644 --- a/lib/Model/SegmentCreateQuery.php +++ b/lib/Model/SegmentCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentCreateQueryResourceObject.php b/lib/Model/SegmentCreateQueryResourceObject.php index 5e28fcc..f037ee8 100644 --- a/lib/Model/SegmentCreateQueryResourceObject.php +++ b/lib/Model/SegmentCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentCreateQueryResourceObjectAttributes.php b/lib/Model/SegmentCreateQueryResourceObjectAttributes.php index 39629c3..5f6e343 100644 --- a/lib/Model/SegmentCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SegmentCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentDefinition.php b/lib/Model/SegmentDefinition.php index 5546c6e..156f204 100644 --- a/lib/Model/SegmentDefinition.php +++ b/lib/Model/SegmentDefinition.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentEnum.php b/lib/Model/SegmentEnum.php index 71af6cb..b9d48b6 100644 --- a/lib/Model/SegmentEnum.php +++ b/lib/Model/SegmentEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentPartialUpdateQuery.php b/lib/Model/SegmentPartialUpdateQuery.php index 5b18f7e..fd76bf9 100644 --- a/lib/Model/SegmentPartialUpdateQuery.php +++ b/lib/Model/SegmentPartialUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentPartialUpdateQueryResourceObject.php b/lib/Model/SegmentPartialUpdateQueryResourceObject.php index 745dabd..1f878d9 100644 --- a/lib/Model/SegmentPartialUpdateQueryResourceObject.php +++ b/lib/Model/SegmentPartialUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php index 94cb8e5..dd56f3e 100644 --- a/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/SegmentPartialUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SegmentSeriesReportEnum.php b/lib/Model/SegmentSeriesReportEnum.php new file mode 100644 index 0000000..e671e5b --- /dev/null +++ b/lib/Model/SegmentSeriesReportEnum.php @@ -0,0 +1,60 @@ + + */ +class SegmentSeriesRequestDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentSeriesRequestDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\SegmentSeriesRequestDTOResourceObject' + ]; + + /** + * 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\SegmentSeriesRequestDTOResourceObject + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\SegmentSeriesRequestDTOResourceObject $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/SegmentSeriesRequestDTOResourceObject.php b/lib/Model/SegmentSeriesRequestDTOResourceObject.php new file mode 100644 index 0000000..6e2834d --- /dev/null +++ b/lib/Model/SegmentSeriesRequestDTOResourceObject.php @@ -0,0 +1,444 @@ + + */ +class SegmentSeriesRequestDTOResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentSeriesRequestDTOResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\SegmentSeriesReportEnum', + 'attributes' => '\KlaviyoAPI\Model\SegmentSeriesRequestDTOResourceObjectAttributes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + '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', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + '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('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\SegmentSeriesReportEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\SegmentSeriesReportEnum $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 attributes + * + * @return \KlaviyoAPI\Model\SegmentSeriesRequestDTOResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\SegmentSeriesRequestDTOResourceObjectAttributes $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/SegmentSeriesRequestDTOResourceObjectAttributes.php b/lib/Model/SegmentSeriesRequestDTOResourceObjectAttributes.php new file mode 100644 index 0000000..ce690c1 --- /dev/null +++ b/lib/Model/SegmentSeriesRequestDTOResourceObjectAttributes.php @@ -0,0 +1,592 @@ + + */ +class SegmentSeriesRequestDTOResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentSeriesRequestDTOResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'statistics' => 'string[]', + 'timeframe' => '\KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributesTimeframe', + 'interval' => 'string', + 'filter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'statistics' => null, + 'timeframe' => null, + 'interval' => null, + 'filter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'statistics' => false, + 'timeframe' => false, + 'interval' => false, + 'filter' => 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 = [ + 'statistics' => 'statistics', + 'timeframe' => 'timeframe', + 'interval' => 'interval', + 'filter' => 'filter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'statistics' => 'setStatistics', + 'timeframe' => 'setTimeframe', + 'interval' => 'setInterval', + 'filter' => 'setFilter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'statistics' => 'getStatistics', + 'timeframe' => 'getTimeframe', + 'interval' => 'getInterval', + 'filter' => 'getFilter' + ]; + + /** + * 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; + } + + public const STATISTICS_MEMBERS_ADDED = 'members_added'; + public const STATISTICS_MEMBERS_REMOVED = 'members_removed'; + public const STATISTICS_NET_MEMBERS_CHANGED = 'net_members_changed'; + public const STATISTICS_TOTAL_MEMBERS = 'total_members'; + public const INTERVAL_DAILY = 'daily'; + public const INTERVAL_HOURLY = 'hourly'; + public const INTERVAL_MONTHLY = 'monthly'; + public const INTERVAL_WEEKLY = 'weekly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatisticsAllowableValues() + { + return [ + self::STATISTICS_MEMBERS_ADDED, + self::STATISTICS_MEMBERS_REMOVED, + self::STATISTICS_NET_MEMBERS_CHANGED, + self::STATISTICS_TOTAL_MEMBERS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIntervalAllowableValues() + { + return [ + self::INTERVAL_DAILY, + self::INTERVAL_HOURLY, + self::INTERVAL_MONTHLY, + self::INTERVAL_WEEKLY, + ]; + } + + /** + * 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('statistics', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + $this->setIfExists('interval', $data ?? [], null); + $this->setIfExists('filter', $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['statistics'] === null) { + $invalidProperties[] = "'statistics' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' can't be null"; + } + if ($this->container['interval'] === null) { + $invalidProperties[] = "'interval' can't be null"; + } + $allowedValues = $this->getIntervalAllowableValues(); + if (!is_null($this->container['interval']) && !in_array($this->container['interval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interval', must be one of '%s'", + $this->container['interval'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets statistics + * + * @return string[] + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param string[] $statistics List of statistics to query for. + * + * @return self + */ + public function setStatistics($statistics) + { + $allowedValues = $this->getStatisticsAllowableValues(); + if (array_diff($statistics, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'statistics', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($statistics)) { + throw new \InvalidArgumentException('non-nullable statistics cannot be null'); + } + + $this->container['statistics'] = $statistics; + + return $this; + } + + /** + * Gets timeframe + * + * @return \KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributesTimeframe + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributesTimeframe $timeframe timeframe + * + * @return self + */ + public function setTimeframe($timeframe) + { + + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + + $this->container['timeframe'] = $timeframe; + + return $this; + } + + /** + * Gets interval + * + * @return string + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string $interval The interval used to aggregate data within the series request. If hourly is used, the timeframe cannot be longer than 7 days. If daily is used, the timeframe cannot be longer than 60 days. If monthly is used, the timeframe cannot be longer than 52 weeks. + * + * @return self + */ + public function setInterval($interval) + { + $allowedValues = $this->getIntervalAllowableValues(); + if (!in_array($interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interval', must be one of '%s'", + $interval, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($interval)) { + throw new \InvalidArgumentException('non-nullable interval cannot be null'); + } + + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets filter + * + * @return string|null + */ + public function getFilter() + { + return $this->container['filter']; + } + + /** + * Sets filter + * + * @param string|null $filter API filter string used to filter the query. Allowed filters are segment_id. Allowed operators are equals, any. Only one filter can be used per attribute. Max of 100 messages per ANY filter. + * + * @return self + */ + public function setFilter($filter) + { + + if (is_null($filter)) { + 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; + + 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/SegmentValuesReportEnum.php b/lib/Model/SegmentValuesReportEnum.php new file mode 100644 index 0000000..aff1e78 --- /dev/null +++ b/lib/Model/SegmentValuesReportEnum.php @@ -0,0 +1,60 @@ + + */ +class SegmentValuesRequestDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentValuesRequestDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObject' + ]; + + /** + * 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\SegmentValuesRequestDTOResourceObject + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObject $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/SegmentValuesRequestDTOResourceObject.php b/lib/Model/SegmentValuesRequestDTOResourceObject.php new file mode 100644 index 0000000..f77320e --- /dev/null +++ b/lib/Model/SegmentValuesRequestDTOResourceObject.php @@ -0,0 +1,444 @@ + + */ +class SegmentValuesRequestDTOResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentValuesRequestDTOResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\SegmentValuesReportEnum', + 'attributes' => '\KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + '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', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + '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('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\SegmentValuesReportEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\SegmentValuesReportEnum $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 attributes + * + * @return \KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributes $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/SegmentValuesRequestDTOResourceObjectAttributes.php b/lib/Model/SegmentValuesRequestDTOResourceObjectAttributes.php new file mode 100644 index 0000000..575b20e --- /dev/null +++ b/lib/Model/SegmentValuesRequestDTOResourceObjectAttributes.php @@ -0,0 +1,515 @@ + + */ +class SegmentValuesRequestDTOResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentValuesRequestDTOResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'statistics' => 'string[]', + 'timeframe' => '\KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributesTimeframe', + 'filter' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'statistics' => null, + 'timeframe' => null, + 'filter' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'statistics' => false, + 'timeframe' => false, + 'filter' => 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 = [ + 'statistics' => 'statistics', + 'timeframe' => 'timeframe', + 'filter' => 'filter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'statistics' => 'setStatistics', + 'timeframe' => 'setTimeframe', + 'filter' => 'setFilter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'statistics' => 'getStatistics', + 'timeframe' => 'getTimeframe', + 'filter' => 'getFilter' + ]; + + /** + * 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; + } + + public const STATISTICS_MEMBERS_ADDED = 'members_added'; + public const STATISTICS_MEMBERS_REMOVED = 'members_removed'; + public const STATISTICS_NET_MEMBERS_CHANGED = 'net_members_changed'; + public const STATISTICS_TOTAL_MEMBERS = 'total_members'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatisticsAllowableValues() + { + return [ + self::STATISTICS_MEMBERS_ADDED, + self::STATISTICS_MEMBERS_REMOVED, + self::STATISTICS_NET_MEMBERS_CHANGED, + self::STATISTICS_TOTAL_MEMBERS, + ]; + } + + /** + * 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('statistics', $data ?? [], null); + $this->setIfExists('timeframe', $data ?? [], null); + $this->setIfExists('filter', $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['statistics'] === null) { + $invalidProperties[] = "'statistics' can't be null"; + } + if ($this->container['timeframe'] === null) { + $invalidProperties[] = "'timeframe' 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 statistics + * + * @return string[] + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param string[] $statistics List of statistics to query for. + * + * @return self + */ + public function setStatistics($statistics) + { + $allowedValues = $this->getStatisticsAllowableValues(); + if (array_diff($statistics, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'statistics', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($statistics)) { + throw new \InvalidArgumentException('non-nullable statistics cannot be null'); + } + + $this->container['statistics'] = $statistics; + + return $this; + } + + /** + * Gets timeframe + * + * @return \KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributesTimeframe + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param \KlaviyoAPI\Model\SegmentValuesRequestDTOResourceObjectAttributesTimeframe $timeframe timeframe + * + * @return self + */ + public function setTimeframe($timeframe) + { + + if (is_null($timeframe)) { + throw new \InvalidArgumentException('non-nullable timeframe cannot be null'); + } + + $this->container['timeframe'] = $timeframe; + + return $this; + } + + /** + * Gets filter + * + * @return string|null + */ + public function getFilter() + { + return $this->container['filter']; + } + + /** + * Sets filter + * + * @param string|null $filter API filter string used to filter the query. Allowed filters are segment_id. Allowed operators are equals, any. Only one filter can be used per attribute. Max of 100 messages per ANY filter. + * + * @return self + */ + public function setFilter($filter) + { + + if (is_null($filter)) { + 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; + + 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/SegmentValuesRequestDTOResourceObjectAttributesTimeframe.php b/lib/Model/SegmentValuesRequestDTOResourceObjectAttributesTimeframe.php new file mode 100644 index 0000000..ee20517 --- /dev/null +++ b/lib/Model/SegmentValuesRequestDTOResourceObjectAttributesTimeframe.php @@ -0,0 +1,542 @@ + + */ +class SegmentValuesRequestDTOResourceObjectAttributesTimeframe implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentValuesRequestDTOResourceObject_attributes_timeframe'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string', + 'start' => '\DateTime', + 'end' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => null, + 'start' => 'date-time', + 'end' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'key' => false, + 'start' => false, + 'end' => 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 = [ + 'key' => 'key', + 'start' => 'start', + 'end' => 'end' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'start' => 'setStart', + 'end' => 'setEnd' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'start' => 'getStart', + 'end' => 'getEnd' + ]; + + /** + * 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; + } + + public const KEY_LAST_12_MONTHS = 'last_12_months'; + public const KEY_LAST_30_DAYS = 'last_30_days'; + public const KEY_LAST_365_DAYS = 'last_365_days'; + public const KEY_LAST_3_MONTHS = 'last_3_months'; + public const KEY_LAST_7_DAYS = 'last_7_days'; + public const KEY_LAST_90_DAYS = 'last_90_days'; + public const KEY_LAST_MONTH = 'last_month'; + public const KEY_LAST_WEEK = 'last_week'; + public const KEY_LAST_YEAR = 'last_year'; + public const KEY_THIS_MONTH = 'this_month'; + public const KEY_THIS_WEEK = 'this_week'; + public const KEY_THIS_YEAR = 'this_year'; + public const KEY_TODAY = 'today'; + public const KEY_YESTERDAY = 'yesterday'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKeyAllowableValues() + { + return [ + self::KEY_LAST_12_MONTHS, + self::KEY_LAST_30_DAYS, + self::KEY_LAST_365_DAYS, + self::KEY_LAST_3_MONTHS, + self::KEY_LAST_7_DAYS, + self::KEY_LAST_90_DAYS, + self::KEY_LAST_MONTH, + self::KEY_LAST_WEEK, + self::KEY_LAST_YEAR, + self::KEY_THIS_MONTH, + self::KEY_THIS_WEEK, + self::KEY_THIS_YEAR, + self::KEY_TODAY, + self::KEY_YESTERDAY, + ]; + } + + /** + * 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('key', $data ?? [], null); + $this->setIfExists('start', $data ?? [], null); + $this->setIfExists('end', $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['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + $allowedValues = $this->getKeyAllowableValues(); + if (!is_null($this->container['key']) && !in_array($this->container['key'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'key', must be one of '%s'", + $this->container['key'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['start'] === null) { + $invalidProperties[] = "'start' can't be null"; + } + if ($this->container['end'] === null) { + $invalidProperties[] = "'end' 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 key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key Pre-defined key that represents a set timeframe + * + * @return self + */ + public function setKey($key) + { + $allowedValues = $this->getKeyAllowableValues(); + if (!in_array($key, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'key', must be one of '%s'", + $key, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets start + * + * @return \DateTime + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param \DateTime $start start + * + * @return self + */ + public function setStart($start) + { + + if (is_null($start)) { + throw new \InvalidArgumentException('non-nullable start cannot be null'); + } + + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets end + * + * @return \DateTime + */ + public function getEnd() + { + return $this->container['end']; + } + + /** + * Sets end + * + * @param \DateTime $end end + * + * @return self + */ + public function setEnd($end) + { + + if (is_null($end)) { + throw new \InvalidArgumentException('non-nullable end cannot be null'); + } + + $this->container['end'] = $end; + + 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/SendStrategySubObject.php b/lib/Model/SendStrategySubObject.php index cfe9761..f9ad25d 100644 --- a/lib/Model/SendStrategySubObject.php +++ b/lib/Model/SendStrategySubObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ServerBISSubscriptionCreateQuery.php b/lib/Model/ServerBISSubscriptionCreateQuery.php index 5723b80..febd766 100644 --- a/lib/Model/ServerBISSubscriptionCreateQuery.php +++ b/lib/Model/ServerBISSubscriptionCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ServerBISSubscriptionCreateQueryResourceObject.php b/lib/Model/ServerBISSubscriptionCreateQueryResourceObject.php index 4bd7e80..9a59bbe 100644 --- a/lib/Model/ServerBISSubscriptionCreateQueryResourceObject.php +++ b/lib/Model/ServerBISSubscriptionCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php index 3e06782..ca37874 100644 --- a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php +++ b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributesProfile.php b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributesProfile.php index 8f5150d..7519f3d 100644 --- a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributesProfile.php +++ b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectAttributesProfile.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationships.php b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationships.php index 5a6d028..0706735 100644 --- a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationships.php +++ b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariant.php b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariant.php index ddc1257..09303e6 100644 --- a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariant.php +++ b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariant.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariantData.php b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariantData.php index 12febc2..329e11a 100644 --- a/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariantData.php +++ b/lib/Model/ServerBISSubscriptionCreateQueryResourceObjectRelationshipsVariantData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SftpEnum.php b/lib/Model/SftpEnum.php index f5c829c..1156325 100644 --- a/lib/Model/SftpEnum.php +++ b/lib/Model/SftpEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SftpMethodFilter.php b/lib/Model/SftpMethodFilter.php index 637e1d0..c75370d 100644 --- a/lib/Model/SftpMethodFilter.php +++ b/lib/Model/SftpMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ShopifyEnum.php b/lib/Model/ShopifyEnum.php index c6565a2..36a23a9 100644 --- a/lib/Model/ShopifyEnum.php +++ b/lib/Model/ShopifyEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ShopifyIntegrationFilter.php b/lib/Model/ShopifyIntegrationFilter.php index dbf14fb..e261cd5 100644 --- a/lib/Model/ShopifyIntegrationFilter.php +++ b/lib/Model/ShopifyIntegrationFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/ShopifyIntegrationMethodFilter.php b/lib/Model/ShopifyIntegrationMethodFilter.php index 18530aa..07cad58 100644 --- a/lib/Model/ShopifyIntegrationMethodFilter.php +++ b/lib/Model/ShopifyIntegrationMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SmsEnum.php b/lib/Model/SmsEnum.php index 8a11199..5d1a8d9 100644 --- a/lib/Model/SmsEnum.php +++ b/lib/Model/SmsEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SpamComplaintEnum.php b/lib/Model/SpamComplaintEnum.php index efa7644..4a44023 100644 --- a/lib/Model/SpamComplaintEnum.php +++ b/lib/Model/SpamComplaintEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SpamComplaintMethodFilter.php b/lib/Model/SpamComplaintMethodFilter.php index 6dd4853..996dec2 100644 --- a/lib/Model/SpamComplaintMethodFilter.php +++ b/lib/Model/SpamComplaintMethodFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StaticDateFilter.php b/lib/Model/StaticDateFilter.php index 99bc8bc..0c3191a 100644 --- a/lib/Model/StaticDateFilter.php +++ b/lib/Model/StaticDateFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StaticDateRangeFilter.php b/lib/Model/StaticDateRangeFilter.php index 42234d8..b801fbf 100644 --- a/lib/Model/StaticDateRangeFilter.php +++ b/lib/Model/StaticDateRangeFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StaticEnum.php b/lib/Model/StaticEnum.php new file mode 100644 index 0000000..01e0db6 --- /dev/null +++ b/lib/Model/StaticEnum.php @@ -0,0 +1,60 @@ + + */ +class StaticTrackingParam implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StaticTrackingParam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\StaticEnum', + 'value' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => false, + 'name' => 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', + 'value' => 'value', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue', + 'name' => 'getName' + ]; + + /** + * 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('value', $data ?? [], null); + $this->setIfExists('name', $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['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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\StaticEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\StaticEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the tracking param + * + * @return self + */ + public function setName($name) + { + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + $this->container['name'] = $name; + + 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/StatusDateEnum.php b/lib/Model/StatusDateEnum.php index c1ec23c..468bcdd 100644 --- a/lib/Model/StatusDateEnum.php +++ b/lib/Model/StatusDateEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StatusDateFilter.php b/lib/Model/StatusDateFilter.php index 64db272..71e309b 100644 --- a/lib/Model/StatusDateFilter.php +++ b/lib/Model/StatusDateFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StatusDateFilterFilter.php b/lib/Model/StatusDateFilterFilter.php index e22e21b..8f48ccd 100644 --- a/lib/Model/StatusDateFilterFilter.php +++ b/lib/Model/StatusDateFilterFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StringArrayOperatorFilter.php b/lib/Model/StringArrayOperatorFilter.php index eb39cfa..6f01ea8 100644 --- a/lib/Model/StringArrayOperatorFilter.php +++ b/lib/Model/StringArrayOperatorFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StringEnum.php b/lib/Model/StringEnum.php index 4f1b24a..bd44bc9 100644 --- a/lib/Model/StringEnum.php +++ b/lib/Model/StringEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StringOperatorFilter.php b/lib/Model/StringOperatorFilter.php index 747ba51..9b8eecc 100644 --- a/lib/Model/StringOperatorFilter.php +++ b/lib/Model/StringOperatorFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/StringPhoneOperatorArrayFilter.php b/lib/Model/StringPhoneOperatorArrayFilter.php index b17bd0e..998ed09 100644 --- a/lib/Model/StringPhoneOperatorArrayFilter.php +++ b/lib/Model/StringPhoneOperatorArrayFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscribedEnum.php b/lib/Model/SubscribedEnum.php index 241f107..bf68722 100644 --- a/lib/Model/SubscribedEnum.php +++ b/lib/Model/SubscribedEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionChannels.php b/lib/Model/SubscriptionChannels.php index fe951d0..6c96915 100644 --- a/lib/Model/SubscriptionChannels.php +++ b/lib/Model/SubscriptionChannels.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionCreateJobCreateQuery.php b/lib/Model/SubscriptionCreateJobCreateQuery.php index 341b29d..0e4e671 100644 --- a/lib/Model/SubscriptionCreateJobCreateQuery.php +++ b/lib/Model/SubscriptionCreateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionCreateJobCreateQueryResourceObject.php b/lib/Model/SubscriptionCreateJobCreateQueryResourceObject.php index 9fc4337..cb65823 100644 --- a/lib/Model/SubscriptionCreateJobCreateQueryResourceObject.php +++ b/lib/Model/SubscriptionCreateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php index e2b26b0..a3be284 100644 --- a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributesProfiles.php b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributesProfiles.php index 5b34368..955dd89 100644 --- a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributesProfiles.php +++ b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectAttributesProfiles.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationships.php b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationships.php index 5249e8b..56eaae7 100644 --- a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationships.php +++ b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsList.php b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsList.php index e555ff8..e414379 100644 --- a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsList.php +++ b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsList.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsListData.php b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsListData.php index 09d0ae6..917e718 100644 --- a/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsListData.php +++ b/lib/Model/SubscriptionCreateJobCreateQueryResourceObjectRelationshipsListData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionDeleteJobCreateQuery.php b/lib/Model/SubscriptionDeleteJobCreateQuery.php index a041b6c..4f7fa3d 100644 --- a/lib/Model/SubscriptionDeleteJobCreateQuery.php +++ b/lib/Model/SubscriptionDeleteJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObject.php b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObject.php index 9367f78..82d3298 100644 --- a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObject.php +++ b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributes.php b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributes.php index f028d1f..52a3452 100644 --- a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributesProfiles.php b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributesProfiles.php index 8e2fc6c..42b16e4 100644 --- a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributesProfiles.php +++ b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectAttributesProfiles.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationships.php b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationships.php index e683cbb..d634e88 100644 --- a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationships.php +++ b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsList.php b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsList.php index 2154f24..99c45dc 100644 --- a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsList.php +++ b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsList.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsListData.php b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsListData.php index 3785980..5898485 100644 --- a/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsListData.php +++ b/lib/Model/SubscriptionDeleteJobCreateQueryResourceObjectRelationshipsListData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/MarketingSubscriptionParameters.php b/lib/Model/SubscriptionParameters.php similarity index 96% rename from lib/Model/MarketingSubscriptionParameters.php rename to lib/Model/SubscriptionParameters.php index 4eeec07..a414e5e 100644 --- a/lib/Model/MarketingSubscriptionParameters.php +++ b/lib/Model/SubscriptionParameters.php @@ -1,6 +1,6 @@ */ -class MarketingSubscriptionParameters implements ModelInterface, ArrayAccess, \JsonSerializable +class SubscriptionParameters implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class MarketingSubscriptionParameters implements ModelInterface, ArrayAccess, \J * * @var string */ - protected static $openAPIModelName = 'MarketingSubscriptionParameters'; + protected static $openAPIModelName = 'SubscriptionParameters'; /** * Array of property to type mappings. Used for (de)serialization @@ -325,7 +325,7 @@ public function getConsent() /** * Sets consent * - * @param string $consent The Consent status to subscribe to for the \"Marketing\" type. Currently supports \"SUBSCRIBED\". + * @param string $consent The Consent status to be set as part of the subscribe call. Currently supports \"SUBSCRIBED\". * * @return self */ diff --git a/lib/Model/SuppressionCreateJobCreateQuery.php b/lib/Model/SuppressionCreateJobCreateQuery.php index 0a528a1..779b5a7 100644 --- a/lib/Model/SuppressionCreateJobCreateQuery.php +++ b/lib/Model/SuppressionCreateJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php index 50c7a44..6583511 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php index 412a0d8..15c81d2 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles.php index 6f263d2..d2bf61b 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectAttributesProfiles.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php index be956dd..a7444f0 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php index 93d89f4..b48fb91 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsList.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php index 467f9f9..00bc72f 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsListData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php index ad7d7d3..7d83ebb 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegment.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php index f44e24d..0fdbac0 100644 --- a/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php +++ b/lib/Model/SuppressionCreateJobCreateQueryResourceObjectRelationshipsSegmentData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQuery.php b/lib/Model/SuppressionDeleteJobCreateQuery.php index ef1d470..74a361d 100644 --- a/lib/Model/SuppressionDeleteJobCreateQuery.php +++ b/lib/Model/SuppressionDeleteJobCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php index af0654d..77856a2 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php index f192b2e..a1b0e81 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles.php index 6c521a3..4dded2f 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectAttributesProfiles.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php index c31c48b..39869b8 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php index 0d021c4..c316d0f 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsList.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php index 9da3166..6fd8fb3 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsListData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php index 1a13239..69accef 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegment.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php index 59b2b9a..fec33c5 100644 --- a/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php +++ b/lib/Model/SuppressionDeleteJobCreateQueryResourceObjectRelationshipsSegmentData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCampaignOp.php b/lib/Model/TagCampaignOp.php index 0400481..93ec8ef 100644 --- a/lib/Model/TagCampaignOp.php +++ b/lib/Model/TagCampaignOp.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCampaignOpDataInner.php b/lib/Model/TagCampaignOpDataInner.php index 7ed683b..d49bf2e 100644 --- a/lib/Model/TagCampaignOpDataInner.php +++ b/lib/Model/TagCampaignOpDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCreateQuery.php b/lib/Model/TagCreateQuery.php index 3e6045a..8466cc0 100644 --- a/lib/Model/TagCreateQuery.php +++ b/lib/Model/TagCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCreateQueryResourceObject.php b/lib/Model/TagCreateQueryResourceObject.php index 00aaa1b..3c03d68 100644 --- a/lib/Model/TagCreateQueryResourceObject.php +++ b/lib/Model/TagCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCreateQueryResourceObjectAttributes.php b/lib/Model/TagCreateQueryResourceObjectAttributes.php index a665a74..dd4eadc 100644 --- a/lib/Model/TagCreateQueryResourceObjectAttributes.php +++ b/lib/Model/TagCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCreateQueryResourceObjectRelationships.php b/lib/Model/TagCreateQueryResourceObjectRelationships.php index 01ab630..0f91a02 100644 --- a/lib/Model/TagCreateQueryResourceObjectRelationships.php +++ b/lib/Model/TagCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroup.php b/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroup.php index cc3aa9f..1e8ede1 100644 --- a/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroup.php +++ b/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroup.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroupData.php b/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroupData.php index b8b5184..99040ab 100644 --- a/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroupData.php +++ b/lib/Model/TagCreateQueryResourceObjectRelationshipsTagGroupData.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagEnum.php b/lib/Model/TagEnum.php index 8be06a6..9012e31 100644 --- a/lib/Model/TagEnum.php +++ b/lib/Model/TagEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagFlowOp.php b/lib/Model/TagFlowOp.php index 007d420..f4dde59 100644 --- a/lib/Model/TagFlowOp.php +++ b/lib/Model/TagFlowOp.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagFlowOpDataInner.php b/lib/Model/TagFlowOpDataInner.php index b671eda..eb5908d 100644 --- a/lib/Model/TagFlowOpDataInner.php +++ b/lib/Model/TagFlowOpDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagGroupCreateQuery.php b/lib/Model/TagGroupCreateQuery.php index 32a3616..80cb547 100644 --- a/lib/Model/TagGroupCreateQuery.php +++ b/lib/Model/TagGroupCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagGroupCreateQueryResourceObject.php b/lib/Model/TagGroupCreateQueryResourceObject.php index 2079d40..ba2e056 100644 --- a/lib/Model/TagGroupCreateQueryResourceObject.php +++ b/lib/Model/TagGroupCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php b/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php index 7fe89bf..5776a02 100644 --- a/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php +++ b/lib/Model/TagGroupCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagGroupEnum.php b/lib/Model/TagGroupEnum.php index f63c136..c85abb9 100644 --- a/lib/Model/TagGroupEnum.php +++ b/lib/Model/TagGroupEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagGroupUpdateQuery.php b/lib/Model/TagGroupUpdateQuery.php index 3fd51db..b89bf8f 100644 --- a/lib/Model/TagGroupUpdateQuery.php +++ b/lib/Model/TagGroupUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagGroupUpdateQueryResourceObject.php b/lib/Model/TagGroupUpdateQueryResourceObject.php index 804afcb..e63588a 100644 --- a/lib/Model/TagGroupUpdateQueryResourceObject.php +++ b/lib/Model/TagGroupUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php b/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php index f5d5de6..030eb1d 100644 --- a/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/TagGroupUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagListOp.php b/lib/Model/TagListOp.php index 3f13ed0..bc1c002 100644 --- a/lib/Model/TagListOp.php +++ b/lib/Model/TagListOp.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagListOpDataInner.php b/lib/Model/TagListOpDataInner.php index 52ac2f7..a9e048f 100644 --- a/lib/Model/TagListOpDataInner.php +++ b/lib/Model/TagListOpDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagSegmentOp.php b/lib/Model/TagSegmentOp.php index 6e80881..82b832a 100644 --- a/lib/Model/TagSegmentOp.php +++ b/lib/Model/TagSegmentOp.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagSegmentOpDataInner.php b/lib/Model/TagSegmentOpDataInner.php index 1e1b32a..91b30a2 100644 --- a/lib/Model/TagSegmentOpDataInner.php +++ b/lib/Model/TagSegmentOpDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagUpdateQuery.php b/lib/Model/TagUpdateQuery.php index 990f54d..70fdac3 100644 --- a/lib/Model/TagUpdateQuery.php +++ b/lib/Model/TagUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TagUpdateQueryResourceObject.php b/lib/Model/TagUpdateQueryResourceObject.php index 6d150dd..2b7111a 100644 --- a/lib/Model/TagUpdateQueryResourceObject.php +++ b/lib/Model/TagUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateCloneQuery.php b/lib/Model/TemplateCloneQuery.php index 6447a29..6685ecd 100644 --- a/lib/Model/TemplateCloneQuery.php +++ b/lib/Model/TemplateCloneQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateCloneQueryResourceObject.php b/lib/Model/TemplateCloneQueryResourceObject.php index ac29631..78090a2 100644 --- a/lib/Model/TemplateCloneQueryResourceObject.php +++ b/lib/Model/TemplateCloneQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateCloneQueryResourceObjectAttributes.php b/lib/Model/TemplateCloneQueryResourceObjectAttributes.php index 9657dfd..ebf336b 100644 --- a/lib/Model/TemplateCloneQueryResourceObjectAttributes.php +++ b/lib/Model/TemplateCloneQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateCreateQuery.php b/lib/Model/TemplateCreateQuery.php index 19300c6..6a24be0 100644 --- a/lib/Model/TemplateCreateQuery.php +++ b/lib/Model/TemplateCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateCreateQueryResourceObject.php b/lib/Model/TemplateCreateQueryResourceObject.php index f4b4234..49a03a7 100644 --- a/lib/Model/TemplateCreateQueryResourceObject.php +++ b/lib/Model/TemplateCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateCreateQueryResourceObjectAttributes.php b/lib/Model/TemplateCreateQueryResourceObjectAttributes.php index 64fb118..1d58ee9 100644 --- a/lib/Model/TemplateCreateQueryResourceObjectAttributes.php +++ b/lib/Model/TemplateCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateEnum.php b/lib/Model/TemplateEnum.php index 4c70af6..bdd798f 100644 --- a/lib/Model/TemplateEnum.php +++ b/lib/Model/TemplateEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateRenderQuery.php b/lib/Model/TemplateRenderQuery.php index bd54b06..4631dc4 100644 --- a/lib/Model/TemplateRenderQuery.php +++ b/lib/Model/TemplateRenderQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateRenderQueryResourceObject.php b/lib/Model/TemplateRenderQueryResourceObject.php index cef0a9d..e999a38 100644 --- a/lib/Model/TemplateRenderQueryResourceObject.php +++ b/lib/Model/TemplateRenderQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateRenderQueryResourceObjectAttributes.php b/lib/Model/TemplateRenderQueryResourceObjectAttributes.php index d44c45f..f2bbd90 100644 --- a/lib/Model/TemplateRenderQueryResourceObjectAttributes.php +++ b/lib/Model/TemplateRenderQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/TemplateUniversalContentEnum.php b/lib/Model/TemplateUniversalContentEnum.php new file mode 100644 index 0000000..6b9eab7 --- /dev/null +++ b/lib/Model/TemplateUniversalContentEnum.php @@ -0,0 +1,60 @@ + + */ +class TextBlock implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TextBlock'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content_type' => '\KlaviyoAPI\Model\BlockEnum', + 'type' => '\KlaviyoAPI\Model\TextEnum', + 'data' => '\KlaviyoAPI\Model\TextBlockData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content_type' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'content_type' => false, + 'type' => false, + '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 = [ + 'content_type' => 'content_type', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content_type' => 'setContentType', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content_type' => 'getContentType', + 'type' => 'getType', + '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('content_type', $data ?? [], null); + $this->setIfExists('type', $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['content_type'] === null) { + $invalidProperties[] = "'content_type' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 content_type + * + * @return \KlaviyoAPI\Model\BlockEnum + */ + public function getContentType() + { + return $this->container['content_type']; + } + + /** + * Sets content_type + * + * @param \KlaviyoAPI\Model\BlockEnum $content_type content_type + * + * @return self + */ + public function setContentType($content_type) + { + + if (is_null($content_type)) { + throw new \InvalidArgumentException('non-nullable content_type cannot be null'); + } + + $this->container['content_type'] = $content_type; + + return $this; + } + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\TextEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\TextEnum $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 data + * + * @return \KlaviyoAPI\Model\TextBlockData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\TextBlockData $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/TextBlockData.php b/lib/Model/TextBlockData.php new file mode 100644 index 0000000..d7bdc8a --- /dev/null +++ b/lib/Model/TextBlockData.php @@ -0,0 +1,483 @@ + + */ +class TextBlockData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TextBlockData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content' => 'string', + 'display_options' => '\KlaviyoAPI\Model\BlockDisplayOptions', + 'styles' => '\KlaviyoAPI\Model\TextBlockStyles' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null, + 'display_options' => null, + 'styles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'content' => false, + 'display_options' => false, + 'styles' => 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 = [ + 'content' => 'content', + 'display_options' => 'display_options', + 'styles' => 'styles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'display_options' => 'setDisplayOptions', + 'styles' => 'setStyles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'display_options' => 'getDisplayOptions', + 'styles' => 'getStyles' + ]; + + /** + * 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('content', $data ?? [], null); + $this->setIfExists('display_options', $data ?? [], null); + $this->setIfExists('styles', $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['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if ($this->container['display_options'] === null) { + $invalidProperties[] = "'display_options' can't be null"; + } + if ($this->container['styles'] === null) { + $invalidProperties[] = "'styles' 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 content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content content + * + * @return self + */ + public function setContent($content) + { + + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets display_options + * + * @return \KlaviyoAPI\Model\BlockDisplayOptions + */ + public function getDisplayOptions() + { + return $this->container['display_options']; + } + + /** + * Sets display_options + * + * @param \KlaviyoAPI\Model\BlockDisplayOptions $display_options display_options + * + * @return self + */ + public function setDisplayOptions($display_options) + { + + if (is_null($display_options)) { + throw new \InvalidArgumentException('non-nullable display_options cannot be null'); + } + + $this->container['display_options'] = $display_options; + + return $this; + } + + /** + * Gets styles + * + * @return \KlaviyoAPI\Model\TextBlockStyles + */ + public function getStyles() + { + return $this->container['styles']; + } + + /** + * Sets styles + * + * @param \KlaviyoAPI\Model\TextBlockStyles $styles styles + * + * @return self + */ + public function setStyles($styles) + { + + if (is_null($styles)) { + throw new \InvalidArgumentException('non-nullable styles cannot be null'); + } + + $this->container['styles'] = $styles; + + 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/TextBlockStyles.php b/lib/Model/TextBlockStyles.php new file mode 100644 index 0000000..3d76c51 --- /dev/null +++ b/lib/Model/TextBlockStyles.php @@ -0,0 +1,1595 @@ + + */ +class TextBlockStyles implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TextBlockStyles'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'block_background_color' => 'string', + 'block_border_color' => 'string', + 'block_border_style' => 'string', + 'block_border_width' => 'int', + 'block_padding_bottom' => 'int', + 'block_padding_left' => 'int', + 'block_padding_right' => 'int', + 'block_padding_top' => 'int', + 'color' => 'string', + 'extra_css_class' => 'string', + 'font_family' => 'string', + 'font_size' => 'int', + 'font_style' => 'string', + 'font_weight' => 'string', + 'inner_padding_bottom' => 'int', + 'inner_padding_left' => 'int', + 'inner_padding_right' => 'int', + 'inner_padding_top' => 'int', + 'mobile_stretch_content' => 'bool', + 'background_color' => 'string', + 'letter_spacing' => 'int', + 'line_height' => 'float', + 'text_align' => 'string', + 'text_decoration' => 'string', + 'text_table_layout' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'block_background_color' => null, + 'block_border_color' => null, + 'block_border_style' => null, + 'block_border_width' => null, + 'block_padding_bottom' => null, + 'block_padding_left' => null, + 'block_padding_right' => null, + 'block_padding_top' => null, + 'color' => null, + 'extra_css_class' => null, + 'font_family' => null, + 'font_size' => null, + 'font_style' => null, + 'font_weight' => null, + 'inner_padding_bottom' => null, + 'inner_padding_left' => null, + 'inner_padding_right' => null, + 'inner_padding_top' => null, + 'mobile_stretch_content' => null, + 'background_color' => null, + 'letter_spacing' => null, + 'line_height' => null, + 'text_align' => null, + 'text_decoration' => null, + 'text_table_layout' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'block_background_color' => true, + 'block_border_color' => true, + 'block_border_style' => true, + 'block_border_width' => true, + 'block_padding_bottom' => true, + 'block_padding_left' => true, + 'block_padding_right' => true, + 'block_padding_top' => true, + 'color' => true, + 'extra_css_class' => true, + 'font_family' => true, + 'font_size' => true, + 'font_style' => true, + 'font_weight' => true, + 'inner_padding_bottom' => true, + 'inner_padding_left' => true, + 'inner_padding_right' => true, + 'inner_padding_top' => true, + 'mobile_stretch_content' => true, + 'background_color' => true, + 'letter_spacing' => true, + 'line_height' => true, + 'text_align' => true, + 'text_decoration' => true, + 'text_table_layout' => 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 = [ + 'block_background_color' => 'block_background_color', + 'block_border_color' => 'block_border_color', + 'block_border_style' => 'block_border_style', + 'block_border_width' => 'block_border_width', + 'block_padding_bottom' => 'block_padding_bottom', + 'block_padding_left' => 'block_padding_left', + 'block_padding_right' => 'block_padding_right', + 'block_padding_top' => 'block_padding_top', + 'color' => 'color', + 'extra_css_class' => 'extra_css_class', + 'font_family' => 'font_family', + 'font_size' => 'font_size', + 'font_style' => 'font_style', + 'font_weight' => 'font_weight', + 'inner_padding_bottom' => 'inner_padding_bottom', + 'inner_padding_left' => 'inner_padding_left', + 'inner_padding_right' => 'inner_padding_right', + 'inner_padding_top' => 'inner_padding_top', + 'mobile_stretch_content' => 'mobile_stretch_content', + 'background_color' => 'background_color', + 'letter_spacing' => 'letter_spacing', + 'line_height' => 'line_height', + 'text_align' => 'text_align', + 'text_decoration' => 'text_decoration', + 'text_table_layout' => 'text_table_layout' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'block_background_color' => 'setBlockBackgroundColor', + 'block_border_color' => 'setBlockBorderColor', + 'block_border_style' => 'setBlockBorderStyle', + 'block_border_width' => 'setBlockBorderWidth', + 'block_padding_bottom' => 'setBlockPaddingBottom', + 'block_padding_left' => 'setBlockPaddingLeft', + 'block_padding_right' => 'setBlockPaddingRight', + 'block_padding_top' => 'setBlockPaddingTop', + 'color' => 'setColor', + 'extra_css_class' => 'setExtraCssClass', + 'font_family' => 'setFontFamily', + 'font_size' => 'setFontSize', + 'font_style' => 'setFontStyle', + 'font_weight' => 'setFontWeight', + 'inner_padding_bottom' => 'setInnerPaddingBottom', + 'inner_padding_left' => 'setInnerPaddingLeft', + 'inner_padding_right' => 'setInnerPaddingRight', + 'inner_padding_top' => 'setInnerPaddingTop', + 'mobile_stretch_content' => 'setMobileStretchContent', + 'background_color' => 'setBackgroundColor', + 'letter_spacing' => 'setLetterSpacing', + 'line_height' => 'setLineHeight', + 'text_align' => 'setTextAlign', + 'text_decoration' => 'setTextDecoration', + 'text_table_layout' => 'setTextTableLayout' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'block_background_color' => 'getBlockBackgroundColor', + 'block_border_color' => 'getBlockBorderColor', + 'block_border_style' => 'getBlockBorderStyle', + 'block_border_width' => 'getBlockBorderWidth', + 'block_padding_bottom' => 'getBlockPaddingBottom', + 'block_padding_left' => 'getBlockPaddingLeft', + 'block_padding_right' => 'getBlockPaddingRight', + 'block_padding_top' => 'getBlockPaddingTop', + 'color' => 'getColor', + 'extra_css_class' => 'getExtraCssClass', + 'font_family' => 'getFontFamily', + 'font_size' => 'getFontSize', + 'font_style' => 'getFontStyle', + 'font_weight' => 'getFontWeight', + 'inner_padding_bottom' => 'getInnerPaddingBottom', + 'inner_padding_left' => 'getInnerPaddingLeft', + 'inner_padding_right' => 'getInnerPaddingRight', + 'inner_padding_top' => 'getInnerPaddingTop', + 'mobile_stretch_content' => 'getMobileStretchContent', + 'background_color' => 'getBackgroundColor', + 'letter_spacing' => 'getLetterSpacing', + 'line_height' => 'getLineHeight', + 'text_align' => 'getTextAlign', + 'text_decoration' => 'getTextDecoration', + 'text_table_layout' => 'getTextTableLayout' + ]; + + /** + * 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; + } + + public const BLOCK_BORDER_STYLE_DASHED = 'dashed'; + public const BLOCK_BORDER_STYLE_DOTTED = 'dotted'; + public const BLOCK_BORDER_STYLE_GROOVE = 'groove'; + public const BLOCK_BORDER_STYLE_INSET = 'inset'; + public const BLOCK_BORDER_STYLE_NONE = 'none'; + public const BLOCK_BORDER_STYLE_OUTSET = 'outset'; + public const BLOCK_BORDER_STYLE_RIDGE = 'ridge'; + public const BLOCK_BORDER_STYLE_SOLID = 'solid'; + public const FONT_STYLE_ITALIC = 'italic'; + public const FONT_STYLE_NORMAL = 'normal'; + public const TEXT_ALIGN_CENTER = 'center'; + public const TEXT_ALIGN_LEFT = 'left'; + public const TEXT_ALIGN_RIGHT = 'right'; + public const TEXT_TABLE_LAYOUT_AUTO = 'auto'; + public const TEXT_TABLE_LAYOUT_FIXED = 'fixed'; + public const TEXT_TABLE_LAYOUT_INHERIT = 'inherit'; + public const TEXT_TABLE_LAYOUT_INITIAL = 'initial'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBlockBorderStyleAllowableValues() + { + return [ + self::BLOCK_BORDER_STYLE_DASHED, + self::BLOCK_BORDER_STYLE_DOTTED, + self::BLOCK_BORDER_STYLE_GROOVE, + self::BLOCK_BORDER_STYLE_INSET, + self::BLOCK_BORDER_STYLE_NONE, + self::BLOCK_BORDER_STYLE_OUTSET, + self::BLOCK_BORDER_STYLE_RIDGE, + self::BLOCK_BORDER_STYLE_SOLID, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFontStyleAllowableValues() + { + return [ + self::FONT_STYLE_ITALIC, + self::FONT_STYLE_NORMAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTextAlignAllowableValues() + { + return [ + self::TEXT_ALIGN_CENTER, + self::TEXT_ALIGN_LEFT, + self::TEXT_ALIGN_RIGHT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTextTableLayoutAllowableValues() + { + return [ + self::TEXT_TABLE_LAYOUT_AUTO, + self::TEXT_TABLE_LAYOUT_FIXED, + self::TEXT_TABLE_LAYOUT_INHERIT, + self::TEXT_TABLE_LAYOUT_INITIAL, + ]; + } + + /** + * 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('block_background_color', $data ?? [], null); + $this->setIfExists('block_border_color', $data ?? [], null); + $this->setIfExists('block_border_style', $data ?? [], null); + $this->setIfExists('block_border_width', $data ?? [], null); + $this->setIfExists('block_padding_bottom', $data ?? [], null); + $this->setIfExists('block_padding_left', $data ?? [], null); + $this->setIfExists('block_padding_right', $data ?? [], null); + $this->setIfExists('block_padding_top', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('extra_css_class', $data ?? [], null); + $this->setIfExists('font_family', $data ?? [], null); + $this->setIfExists('font_size', $data ?? [], null); + $this->setIfExists('font_style', $data ?? [], null); + $this->setIfExists('font_weight', $data ?? [], null); + $this->setIfExists('inner_padding_bottom', $data ?? [], null); + $this->setIfExists('inner_padding_left', $data ?? [], null); + $this->setIfExists('inner_padding_right', $data ?? [], null); + $this->setIfExists('inner_padding_top', $data ?? [], null); + $this->setIfExists('mobile_stretch_content', $data ?? [], null); + $this->setIfExists('background_color', $data ?? [], null); + $this->setIfExists('letter_spacing', $data ?? [], null); + $this->setIfExists('line_height', $data ?? [], null); + $this->setIfExists('text_align', $data ?? [], null); + $this->setIfExists('text_decoration', $data ?? [], null); + $this->setIfExists('text_table_layout', $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 = []; + + $allowedValues = $this->getBlockBorderStyleAllowableValues(); + if (!is_null($this->container['block_border_style']) && !in_array($this->container['block_border_style'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'block_border_style', must be one of '%s'", + $this->container['block_border_style'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getFontStyleAllowableValues(); + if (!is_null($this->container['font_style']) && !in_array($this->container['font_style'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'font_style', must be one of '%s'", + $this->container['font_style'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTextAlignAllowableValues(); + if (!is_null($this->container['text_align']) && !in_array($this->container['text_align'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'text_align', must be one of '%s'", + $this->container['text_align'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTextTableLayoutAllowableValues(); + if (!is_null($this->container['text_table_layout']) && !in_array($this->container['text_table_layout'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'text_table_layout', must be one of '%s'", + $this->container['text_table_layout'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets block_background_color + * + * @return string|null + */ + public function getBlockBackgroundColor() + { + return $this->container['block_background_color']; + } + + /** + * Sets block_background_color + * + * @param string|null $block_background_color block_background_color + * + * @return self + */ + public function setBlockBackgroundColor($block_background_color) + { + + if (is_null($block_background_color)) { + array_push($this->openAPINullablesSetToNull, 'block_background_color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_background_color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_background_color'] = $block_background_color; + + return $this; + } + + /** + * Gets block_border_color + * + * @return string|null + */ + public function getBlockBorderColor() + { + return $this->container['block_border_color']; + } + + /** + * Sets block_border_color + * + * @param string|null $block_border_color block_border_color + * + * @return self + */ + public function setBlockBorderColor($block_border_color) + { + + if (is_null($block_border_color)) { + array_push($this->openAPINullablesSetToNull, 'block_border_color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_border_color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_border_color'] = $block_border_color; + + return $this; + } + + /** + * Gets block_border_style + * + * @return string|null + */ + public function getBlockBorderStyle() + { + return $this->container['block_border_style']; + } + + /** + * Sets block_border_style + * + * @param string|null $block_border_style Border style. + * + * @return self + */ + public function setBlockBorderStyle($block_border_style) + { + $allowedValues = $this->getBlockBorderStyleAllowableValues(); + if (!is_null($block_border_style) && !in_array($block_border_style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'block_border_style', must be one of '%s'", + $block_border_style, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($block_border_style)) { + array_push($this->openAPINullablesSetToNull, 'block_border_style'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_border_style', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_border_style'] = $block_border_style; + + return $this; + } + + /** + * Gets block_border_width + * + * @return int|null + */ + public function getBlockBorderWidth() + { + return $this->container['block_border_width']; + } + + /** + * Sets block_border_width + * + * @param int|null $block_border_width block_border_width + * + * @return self + */ + public function setBlockBorderWidth($block_border_width) + { + + if (is_null($block_border_width)) { + array_push($this->openAPINullablesSetToNull, 'block_border_width'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_border_width', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_border_width'] = $block_border_width; + + return $this; + } + + /** + * Gets block_padding_bottom + * + * @return int|null + */ + public function getBlockPaddingBottom() + { + return $this->container['block_padding_bottom']; + } + + /** + * Sets block_padding_bottom + * + * @param int|null $block_padding_bottom block_padding_bottom + * + * @return self + */ + public function setBlockPaddingBottom($block_padding_bottom) + { + + if (is_null($block_padding_bottom)) { + array_push($this->openAPINullablesSetToNull, 'block_padding_bottom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_padding_bottom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_padding_bottom'] = $block_padding_bottom; + + return $this; + } + + /** + * Gets block_padding_left + * + * @return int|null + */ + public function getBlockPaddingLeft() + { + return $this->container['block_padding_left']; + } + + /** + * Sets block_padding_left + * + * @param int|null $block_padding_left block_padding_left + * + * @return self + */ + public function setBlockPaddingLeft($block_padding_left) + { + + if (is_null($block_padding_left)) { + array_push($this->openAPINullablesSetToNull, 'block_padding_left'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_padding_left', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_padding_left'] = $block_padding_left; + + return $this; + } + + /** + * Gets block_padding_right + * + * @return int|null + */ + public function getBlockPaddingRight() + { + return $this->container['block_padding_right']; + } + + /** + * Sets block_padding_right + * + * @param int|null $block_padding_right block_padding_right + * + * @return self + */ + public function setBlockPaddingRight($block_padding_right) + { + + if (is_null($block_padding_right)) { + array_push($this->openAPINullablesSetToNull, 'block_padding_right'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_padding_right', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_padding_right'] = $block_padding_right; + + return $this; + } + + /** + * Gets block_padding_top + * + * @return int|null + */ + public function getBlockPaddingTop() + { + return $this->container['block_padding_top']; + } + + /** + * Sets block_padding_top + * + * @param int|null $block_padding_top block_padding_top + * + * @return self + */ + public function setBlockPaddingTop($block_padding_top) + { + + if (is_null($block_padding_top)) { + array_push($this->openAPINullablesSetToNull, 'block_padding_top'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('block_padding_top', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['block_padding_top'] = $block_padding_top; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color color + * + * @return self + */ + public function setColor($color) + { + + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets extra_css_class + * + * @return string|null + */ + public function getExtraCssClass() + { + return $this->container['extra_css_class']; + } + + /** + * Sets extra_css_class + * + * @param string|null $extra_css_class extra_css_class + * + * @return self + */ + public function setExtraCssClass($extra_css_class) + { + + if (is_null($extra_css_class)) { + array_push($this->openAPINullablesSetToNull, 'extra_css_class'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('extra_css_class', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['extra_css_class'] = $extra_css_class; + + return $this; + } + + /** + * Gets font_family + * + * @return string|null + */ + public function getFontFamily() + { + return $this->container['font_family']; + } + + /** + * Sets font_family + * + * @param string|null $font_family font_family + * + * @return self + */ + public function setFontFamily($font_family) + { + + if (is_null($font_family)) { + array_push($this->openAPINullablesSetToNull, 'font_family'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('font_family', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['font_family'] = $font_family; + + return $this; + } + + /** + * Gets font_size + * + * @return int|null + */ + public function getFontSize() + { + return $this->container['font_size']; + } + + /** + * Sets font_size + * + * @param int|null $font_size font_size + * + * @return self + */ + public function setFontSize($font_size) + { + + if (is_null($font_size)) { + array_push($this->openAPINullablesSetToNull, 'font_size'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('font_size', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['font_size'] = $font_size; + + return $this; + } + + /** + * Gets font_style + * + * @return string|null + */ + public function getFontStyle() + { + return $this->container['font_style']; + } + + /** + * Sets font_style + * + * @param string|null $font_style Font style. + * + * @return self + */ + public function setFontStyle($font_style) + { + $allowedValues = $this->getFontStyleAllowableValues(); + if (!is_null($font_style) && !in_array($font_style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'font_style', must be one of '%s'", + $font_style, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($font_style)) { + array_push($this->openAPINullablesSetToNull, 'font_style'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('font_style', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['font_style'] = $font_style; + + return $this; + } + + /** + * Gets font_weight + * + * @return string|null + */ + public function getFontWeight() + { + return $this->container['font_weight']; + } + + /** + * Sets font_weight + * + * @param string|null $font_weight font_weight + * + * @return self + */ + public function setFontWeight($font_weight) + { + + if (is_null($font_weight)) { + array_push($this->openAPINullablesSetToNull, 'font_weight'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('font_weight', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['font_weight'] = $font_weight; + + return $this; + } + + /** + * Gets inner_padding_bottom + * + * @return int|null + */ + public function getInnerPaddingBottom() + { + return $this->container['inner_padding_bottom']; + } + + /** + * Sets inner_padding_bottom + * + * @param int|null $inner_padding_bottom inner_padding_bottom + * + * @return self + */ + public function setInnerPaddingBottom($inner_padding_bottom) + { + + if (is_null($inner_padding_bottom)) { + array_push($this->openAPINullablesSetToNull, 'inner_padding_bottom'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inner_padding_bottom', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['inner_padding_bottom'] = $inner_padding_bottom; + + return $this; + } + + /** + * Gets inner_padding_left + * + * @return int|null + */ + public function getInnerPaddingLeft() + { + return $this->container['inner_padding_left']; + } + + /** + * Sets inner_padding_left + * + * @param int|null $inner_padding_left inner_padding_left + * + * @return self + */ + public function setInnerPaddingLeft($inner_padding_left) + { + + if (is_null($inner_padding_left)) { + array_push($this->openAPINullablesSetToNull, 'inner_padding_left'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inner_padding_left', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['inner_padding_left'] = $inner_padding_left; + + return $this; + } + + /** + * Gets inner_padding_right + * + * @return int|null + */ + public function getInnerPaddingRight() + { + return $this->container['inner_padding_right']; + } + + /** + * Sets inner_padding_right + * + * @param int|null $inner_padding_right inner_padding_right + * + * @return self + */ + public function setInnerPaddingRight($inner_padding_right) + { + + if (is_null($inner_padding_right)) { + array_push($this->openAPINullablesSetToNull, 'inner_padding_right'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inner_padding_right', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['inner_padding_right'] = $inner_padding_right; + + return $this; + } + + /** + * Gets inner_padding_top + * + * @return int|null + */ + public function getInnerPaddingTop() + { + return $this->container['inner_padding_top']; + } + + /** + * Sets inner_padding_top + * + * @param int|null $inner_padding_top inner_padding_top + * + * @return self + */ + public function setInnerPaddingTop($inner_padding_top) + { + + if (is_null($inner_padding_top)) { + array_push($this->openAPINullablesSetToNull, 'inner_padding_top'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('inner_padding_top', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['inner_padding_top'] = $inner_padding_top; + + return $this; + } + + /** + * Gets mobile_stretch_content + * + * @return bool|null + */ + public function getMobileStretchContent() + { + return $this->container['mobile_stretch_content']; + } + + /** + * Sets mobile_stretch_content + * + * @param bool|null $mobile_stretch_content mobile_stretch_content + * + * @return self + */ + public function setMobileStretchContent($mobile_stretch_content) + { + + if (is_null($mobile_stretch_content)) { + array_push($this->openAPINullablesSetToNull, 'mobile_stretch_content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mobile_stretch_content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['mobile_stretch_content'] = $mobile_stretch_content; + + return $this; + } + + /** + * Gets background_color + * + * @return string|null + */ + public function getBackgroundColor() + { + return $this->container['background_color']; + } + + /** + * Sets background_color + * + * @param string|null $background_color background_color + * + * @return self + */ + public function setBackgroundColor($background_color) + { + + if (is_null($background_color)) { + array_push($this->openAPINullablesSetToNull, 'background_color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('background_color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['background_color'] = $background_color; + + return $this; + } + + /** + * Gets letter_spacing + * + * @return int|null + */ + public function getLetterSpacing() + { + return $this->container['letter_spacing']; + } + + /** + * Sets letter_spacing + * + * @param int|null $letter_spacing letter_spacing + * + * @return self + */ + public function setLetterSpacing($letter_spacing) + { + + if (is_null($letter_spacing)) { + array_push($this->openAPINullablesSetToNull, 'letter_spacing'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('letter_spacing', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['letter_spacing'] = $letter_spacing; + + return $this; + } + + /** + * Gets line_height + * + * @return float|null + */ + public function getLineHeight() + { + return $this->container['line_height']; + } + + /** + * Sets line_height + * + * @param float|null $line_height line_height + * + * @return self + */ + public function setLineHeight($line_height) + { + + if (is_null($line_height)) { + array_push($this->openAPINullablesSetToNull, 'line_height'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('line_height', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['line_height'] = $line_height; + + return $this; + } + + /** + * Gets text_align + * + * @return string|null + */ + public function getTextAlign() + { + return $this->container['text_align']; + } + + /** + * Sets text_align + * + * @param string|null $text_align Text Alignment. + * + * @return self + */ + public function setTextAlign($text_align) + { + $allowedValues = $this->getTextAlignAllowableValues(); + if (!is_null($text_align) && !in_array($text_align, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'text_align', must be one of '%s'", + $text_align, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($text_align)) { + array_push($this->openAPINullablesSetToNull, 'text_align'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('text_align', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['text_align'] = $text_align; + + return $this; + } + + /** + * Gets text_decoration + * + * @return string|null + */ + public function getTextDecoration() + { + return $this->container['text_decoration']; + } + + /** + * Sets text_decoration + * + * @param string|null $text_decoration text_decoration + * + * @return self + */ + public function setTextDecoration($text_decoration) + { + + if (is_null($text_decoration)) { + array_push($this->openAPINullablesSetToNull, 'text_decoration'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('text_decoration', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['text_decoration'] = $text_decoration; + + return $this; + } + + /** + * Gets text_table_layout + * + * @return string|null + */ + public function getTextTableLayout() + { + return $this->container['text_table_layout']; + } + + /** + * Sets text_table_layout + * + * @param string|null $text_table_layout Text table layout. + * + * @return self + */ + public function setTextTableLayout($text_table_layout) + { + $allowedValues = $this->getTextTableLayoutAllowableValues(); + if (!is_null($text_table_layout) && !in_array($text_table_layout, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'text_table_layout', must be one of '%s'", + $text_table_layout, + implode("', '", $allowedValues) + ) + ); + } + + if (is_null($text_table_layout)) { + array_push($this->openAPINullablesSetToNull, 'text_table_layout'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('text_table_layout', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['text_table_layout'] = $text_table_layout; + + 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/TextEnum.php b/lib/Model/TextEnum.php new file mode 100644 index 0000000..36a9fbd --- /dev/null +++ b/lib/Model/TextEnum.php @@ -0,0 +1,60 @@ + + */ +class TrackingParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TrackingParamDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'flow' => '\KlaviyoAPI\Model\TrackingParamDTOFlow', + 'campaign' => '\KlaviyoAPI\Model\TrackingParamDTOCampaign' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'flow' => null, + 'campaign' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'flow' => true, + 'campaign' => 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 = [ + 'flow' => 'flow', + 'campaign' => 'campaign' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'flow' => 'setFlow', + 'campaign' => 'setCampaign' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'flow' => 'getFlow', + 'campaign' => 'getCampaign' + ]; + + /** + * 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('flow', $data ?? [], null); + $this->setIfExists('campaign', $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 flow + * + * @return \KlaviyoAPI\Model\TrackingParamDTOFlow|null + */ + public function getFlow() + { + return $this->container['flow']; + } + + /** + * Sets flow + * + * @param \KlaviyoAPI\Model\TrackingParamDTOFlow|null $flow flow + * + * @return self + */ + public function setFlow($flow) + { + + if (is_null($flow)) { + array_push($this->openAPINullablesSetToNull, 'flow'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('flow', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['flow'] = $flow; + + return $this; + } + + /** + * Gets campaign + * + * @return \KlaviyoAPI\Model\TrackingParamDTOCampaign|null + */ + public function getCampaign() + { + return $this->container['campaign']; + } + + /** + * Sets campaign + * + * @param \KlaviyoAPI\Model\TrackingParamDTOCampaign|null $campaign campaign + * + * @return self + */ + public function setCampaign($campaign) + { + + if (is_null($campaign)) { + array_push($this->openAPINullablesSetToNull, 'campaign'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('campaign', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['campaign'] = $campaign; + + 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/TrackingParamDTOCampaign.php b/lib/Model/TrackingParamDTOCampaign.php new file mode 100644 index 0000000..8a6aff1 --- /dev/null +++ b/lib/Model/TrackingParamDTOCampaign.php @@ -0,0 +1,445 @@ + + */ +class TrackingParamDTOCampaign implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TrackingParamDTO_campaign'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\StaticEnum', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * 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('value', $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['value'] === null) { + $invalidProperties[] = "'value' 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\StaticEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\StaticEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|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/TrackingParamDTOFlow.php b/lib/Model/TrackingParamDTOFlow.php new file mode 100644 index 0000000..4ba129b --- /dev/null +++ b/lib/Model/TrackingParamDTOFlow.php @@ -0,0 +1,445 @@ + + */ +class TrackingParamDTOFlow implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TrackingParamDTO_flow'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\StaticEnum', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * 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('value', $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['value'] === null) { + $invalidProperties[] = "'value' 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\StaticEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\StaticEnum $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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The value of the tracking parameter + * + * @return self + */ + public function setValue($value) + { + + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|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/TrackingSettingEnum.php b/lib/Model/TrackingSettingEnum.php new file mode 100644 index 0000000..c985356 --- /dev/null +++ b/lib/Model/TrackingSettingEnum.php @@ -0,0 +1,60 @@ + + */ +class TrackingSettingPartialUpdateQuery implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TrackingSettingPartialUpdateQuery'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\TrackingSettingPartialUpdateQueryResourceObject' + ]; + + /** + * 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\TrackingSettingPartialUpdateQueryResourceObject + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\TrackingSettingPartialUpdateQueryResourceObject $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/TrackingSettingPartialUpdateQueryResourceObject.php b/lib/Model/TrackingSettingPartialUpdateQueryResourceObject.php new file mode 100644 index 0000000..1822ba7 --- /dev/null +++ b/lib/Model/TrackingSettingPartialUpdateQueryResourceObject.php @@ -0,0 +1,483 @@ + + */ +class TrackingSettingPartialUpdateQueryResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TrackingSettingPartialUpdateQueryResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\TrackingSettingEnum', + 'id' => 'string', + 'attributes' => '\KlaviyoAPI\Model\TrackingSettingPartialUpdateQueryResourceObjectAttributes' + ]; + + /** + * 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' => false, + '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['id'] === null) { + $invalidProperties[] = "'id' 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\TrackingSettingEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\TrackingSettingEnum $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 id of the tracking setting (account ID). + * + * @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; + } + + /** + * Gets attributes + * + * @return \KlaviyoAPI\Model\TrackingSettingPartialUpdateQueryResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\TrackingSettingPartialUpdateQueryResourceObjectAttributes $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/TrackingSettingPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/TrackingSettingPartialUpdateQueryResourceObjectAttributes.php new file mode 100644 index 0000000..4037b61 --- /dev/null +++ b/lib/Model/TrackingSettingPartialUpdateQueryResourceObjectAttributes.php @@ -0,0 +1,632 @@ + + */ +class TrackingSettingPartialUpdateQueryResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TrackingSettingPartialUpdateQueryResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'auto_add_parameters' => 'bool', + 'utm_source' => '\KlaviyoAPI\Model\TrackingParamDTO', + 'utm_medium' => '\KlaviyoAPI\Model\TrackingParamDTO', + 'utm_campaign' => '\KlaviyoAPI\Model\TrackingParamDTO', + 'utm_id' => '\KlaviyoAPI\Model\TrackingParamDTO', + 'utm_term' => '\KlaviyoAPI\Model\TrackingParamDTO', + 'custom_parameters' => '\KlaviyoAPI\Model\CustomTrackingParamDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'auto_add_parameters' => null, + 'utm_source' => null, + 'utm_medium' => null, + 'utm_campaign' => null, + 'utm_id' => null, + 'utm_term' => null, + 'custom_parameters' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'auto_add_parameters' => true, + 'utm_source' => false, + 'utm_medium' => false, + 'utm_campaign' => false, + 'utm_id' => false, + 'utm_term' => false, + 'custom_parameters' => 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 = [ + 'auto_add_parameters' => 'auto_add_parameters', + 'utm_source' => 'utm_source', + 'utm_medium' => 'utm_medium', + 'utm_campaign' => 'utm_campaign', + 'utm_id' => 'utm_id', + 'utm_term' => 'utm_term', + 'custom_parameters' => 'custom_parameters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'auto_add_parameters' => 'setAutoAddParameters', + 'utm_source' => 'setUtmSource', + 'utm_medium' => 'setUtmMedium', + 'utm_campaign' => 'setUtmCampaign', + 'utm_id' => 'setUtmId', + 'utm_term' => 'setUtmTerm', + 'custom_parameters' => 'setCustomParameters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'auto_add_parameters' => 'getAutoAddParameters', + 'utm_source' => 'getUtmSource', + 'utm_medium' => 'getUtmMedium', + 'utm_campaign' => 'getUtmCampaign', + 'utm_id' => 'getUtmId', + 'utm_term' => 'getUtmTerm', + 'custom_parameters' => 'getCustomParameters' + ]; + + /** + * 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('auto_add_parameters', $data ?? [], null); + $this->setIfExists('utm_source', $data ?? [], null); + $this->setIfExists('utm_medium', $data ?? [], null); + $this->setIfExists('utm_campaign', $data ?? [], null); + $this->setIfExists('utm_id', $data ?? [], null); + $this->setIfExists('utm_term', $data ?? [], null); + $this->setIfExists('custom_parameters', $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 auto_add_parameters + * + * @return bool|null + */ + public function getAutoAddParameters() + { + return $this->container['auto_add_parameters']; + } + + /** + * Sets auto_add_parameters + * + * @param bool|null $auto_add_parameters Whether tracking parameters are automatically added to campaigns and flows. + * + * @return self + */ + public function setAutoAddParameters($auto_add_parameters) + { + + if (is_null($auto_add_parameters)) { + array_push($this->openAPINullablesSetToNull, 'auto_add_parameters'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auto_add_parameters', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['auto_add_parameters'] = $auto_add_parameters; + + return $this; + } + + /** + * Gets utm_source + * + * @return \KlaviyoAPI\Model\TrackingParamDTO|null + */ + public function getUtmSource() + { + return $this->container['utm_source']; + } + + /** + * Sets utm_source + * + * @param \KlaviyoAPI\Model\TrackingParamDTO|null $utm_source utm_source + * + * @return self + */ + public function setUtmSource($utm_source) + { + + if (is_null($utm_source)) { + throw new \InvalidArgumentException('non-nullable utm_source cannot be null'); + } + + $this->container['utm_source'] = $utm_source; + + return $this; + } + + /** + * Gets utm_medium + * + * @return \KlaviyoAPI\Model\TrackingParamDTO|null + */ + public function getUtmMedium() + { + return $this->container['utm_medium']; + } + + /** + * Sets utm_medium + * + * @param \KlaviyoAPI\Model\TrackingParamDTO|null $utm_medium utm_medium + * + * @return self + */ + public function setUtmMedium($utm_medium) + { + + if (is_null($utm_medium)) { + throw new \InvalidArgumentException('non-nullable utm_medium cannot be null'); + } + + $this->container['utm_medium'] = $utm_medium; + + return $this; + } + + /** + * Gets utm_campaign + * + * @return \KlaviyoAPI\Model\TrackingParamDTO|null + */ + public function getUtmCampaign() + { + return $this->container['utm_campaign']; + } + + /** + * Sets utm_campaign + * + * @param \KlaviyoAPI\Model\TrackingParamDTO|null $utm_campaign utm_campaign + * + * @return self + */ + public function setUtmCampaign($utm_campaign) + { + + if (is_null($utm_campaign)) { + throw new \InvalidArgumentException('non-nullable utm_campaign cannot be null'); + } + + $this->container['utm_campaign'] = $utm_campaign; + + return $this; + } + + /** + * Gets utm_id + * + * @return \KlaviyoAPI\Model\TrackingParamDTO|null + */ + public function getUtmId() + { + return $this->container['utm_id']; + } + + /** + * Sets utm_id + * + * @param \KlaviyoAPI\Model\TrackingParamDTO|null $utm_id utm_id + * + * @return self + */ + public function setUtmId($utm_id) + { + + if (is_null($utm_id)) { + throw new \InvalidArgumentException('non-nullable utm_id cannot be null'); + } + + $this->container['utm_id'] = $utm_id; + + return $this; + } + + /** + * Gets utm_term + * + * @return \KlaviyoAPI\Model\TrackingParamDTO|null + */ + public function getUtmTerm() + { + return $this->container['utm_term']; + } + + /** + * Sets utm_term + * + * @param \KlaviyoAPI\Model\TrackingParamDTO|null $utm_term utm_term + * + * @return self + */ + public function setUtmTerm($utm_term) + { + + if (is_null($utm_term)) { + throw new \InvalidArgumentException('non-nullable utm_term cannot be null'); + } + + $this->container['utm_term'] = $utm_term; + + return $this; + } + + /** + * Gets custom_parameters + * + * @return \KlaviyoAPI\Model\CustomTrackingParamDTO[]|null + */ + public function getCustomParameters() + { + return $this->container['custom_parameters']; + } + + /** + * Sets custom_parameters + * + * @param \KlaviyoAPI\Model\CustomTrackingParamDTO[]|null $custom_parameters List of custom tracking parameters. + * + * @return self + */ + public function setCustomParameters($custom_parameters) + { + + if (is_null($custom_parameters)) { + array_push($this->openAPINullablesSetToNull, 'custom_parameters'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_parameters', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['custom_parameters'] = $custom_parameters; + + 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/UnionPositiveNumericFilter.php b/lib/Model/UnionPositiveNumericFilter.php index 5eee564..ac96f4a 100644 --- a/lib/Model/UnionPositiveNumericFilter.php +++ b/lib/Model/UnionPositiveNumericFilter.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/UnionPositiveNumericFilterOperator.php b/lib/Model/UnionPositiveNumericFilterOperator.php index 6177b70..436b4c8 100644 --- a/lib/Model/UnionPositiveNumericFilterOperator.php +++ b/lib/Model/UnionPositiveNumericFilterOperator.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/UniversalContentCreateQuery.php b/lib/Model/UniversalContentCreateQuery.php new file mode 100644 index 0000000..d11e2a8 --- /dev/null +++ b/lib/Model/UniversalContentCreateQuery.php @@ -0,0 +1,405 @@ + + */ +class UniversalContentCreateQuery implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentCreateQuery'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\UniversalContentCreateQueryResourceObject' + ]; + + /** + * 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\UniversalContentCreateQueryResourceObject + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\UniversalContentCreateQueryResourceObject $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/UniversalContentCreateQueryResourceObject.php b/lib/Model/UniversalContentCreateQueryResourceObject.php new file mode 100644 index 0000000..64a3a61 --- /dev/null +++ b/lib/Model/UniversalContentCreateQueryResourceObject.php @@ -0,0 +1,444 @@ + + */ +class UniversalContentCreateQueryResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentCreateQueryResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\TemplateUniversalContentEnum', + 'attributes' => '\KlaviyoAPI\Model\UniversalContentCreateQueryResourceObjectAttributes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + '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', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + '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('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\TemplateUniversalContentEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\TemplateUniversalContentEnum $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 attributes + * + * @return \KlaviyoAPI\Model\UniversalContentCreateQueryResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\UniversalContentCreateQueryResourceObjectAttributes $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/UniversalContentCreateQueryResourceObjectAttributes.php b/lib/Model/UniversalContentCreateQueryResourceObjectAttributes.php new file mode 100644 index 0000000..ed39069 --- /dev/null +++ b/lib/Model/UniversalContentCreateQueryResourceObjectAttributes.php @@ -0,0 +1,444 @@ + + */ +class UniversalContentCreateQueryResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentCreateQueryResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'definition' => '\KlaviyoAPI\Model\UniversalContentCreateQueryResourceObjectAttributesDefinition' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'definition' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'definition' => 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 = [ + 'name' => 'name', + 'definition' => 'definition' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'definition' => 'setDefinition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'definition' => 'getDefinition' + ]; + + /** + * 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('name', $data ?? [], null); + $this->setIfExists('definition', $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['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['definition'] === null) { + $invalidProperties[] = "'definition' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name for this universal content + * + * @return self + */ + public function setName($name) + { + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets definition + * + * @return \KlaviyoAPI\Model\UniversalContentCreateQueryResourceObjectAttributesDefinition + */ + public function getDefinition() + { + return $this->container['definition']; + } + + /** + * Sets definition + * + * @param \KlaviyoAPI\Model\UniversalContentCreateQueryResourceObjectAttributesDefinition $definition definition + * + * @return self + */ + public function setDefinition($definition) + { + + if (is_null($definition)) { + throw new \InvalidArgumentException('non-nullable definition cannot be null'); + } + + $this->container['definition'] = $definition; + + 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/UniversalContentCreateQueryResourceObjectAttributesDefinition.php b/lib/Model/UniversalContentCreateQueryResourceObjectAttributesDefinition.php new file mode 100644 index 0000000..f3eee3d --- /dev/null +++ b/lib/Model/UniversalContentCreateQueryResourceObjectAttributesDefinition.php @@ -0,0 +1,483 @@ + + */ +class UniversalContentCreateQueryResourceObjectAttributesDefinition implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentCreateQueryResourceObject_attributes_definition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content_type' => '\KlaviyoAPI\Model\BlockEnum', + 'type' => '\KlaviyoAPI\Model\TextEnum', + 'data' => '\KlaviyoAPI\Model\TextBlockData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content_type' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'content_type' => false, + 'type' => false, + '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 = [ + 'content_type' => 'content_type', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content_type' => 'setContentType', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content_type' => 'getContentType', + 'type' => 'getType', + '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('content_type', $data ?? [], null); + $this->setIfExists('type', $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['content_type'] === null) { + $invalidProperties[] = "'content_type' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 content_type + * + * @return \KlaviyoAPI\Model\BlockEnum + */ + public function getContentType() + { + return $this->container['content_type']; + } + + /** + * Sets content_type + * + * @param \KlaviyoAPI\Model\BlockEnum $content_type content_type + * + * @return self + */ + public function setContentType($content_type) + { + + if (is_null($content_type)) { + throw new \InvalidArgumentException('non-nullable content_type cannot be null'); + } + + $this->container['content_type'] = $content_type; + + return $this; + } + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\TextEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\TextEnum $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 data + * + * @return \KlaviyoAPI\Model\TextBlockData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\TextBlockData $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/UniversalContentPartialUpdateQuery.php b/lib/Model/UniversalContentPartialUpdateQuery.php new file mode 100644 index 0000000..c535905 --- /dev/null +++ b/lib/Model/UniversalContentPartialUpdateQuery.php @@ -0,0 +1,405 @@ + + */ +class UniversalContentPartialUpdateQuery implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentPartialUpdateQuery'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObject' + ]; + + /** + * 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\UniversalContentPartialUpdateQueryResourceObject + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObject $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/UniversalContentPartialUpdateQueryResourceObject.php b/lib/Model/UniversalContentPartialUpdateQueryResourceObject.php new file mode 100644 index 0000000..6021231 --- /dev/null +++ b/lib/Model/UniversalContentPartialUpdateQueryResourceObject.php @@ -0,0 +1,483 @@ + + */ +class UniversalContentPartialUpdateQueryResourceObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentPartialUpdateQueryResourceObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\KlaviyoAPI\Model\TemplateUniversalContentEnum', + 'id' => 'string', + 'attributes' => '\KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObjectAttributes' + ]; + + /** + * 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' => false, + '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['id'] === null) { + $invalidProperties[] = "'id' 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\TemplateUniversalContentEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\TemplateUniversalContentEnum $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 ID of the template universal content + * + * @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; + } + + /** + * Gets attributes + * + * @return \KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObjectAttributes + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObjectAttributes $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/UniversalContentPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/UniversalContentPartialUpdateQueryResourceObjectAttributes.php new file mode 100644 index 0000000..c094a6b --- /dev/null +++ b/lib/Model/UniversalContentPartialUpdateQueryResourceObjectAttributes.php @@ -0,0 +1,452 @@ + + */ +class UniversalContentPartialUpdateQueryResourceObjectAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentPartialUpdateQueryResourceObject_attributes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'definition' => '\KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'definition' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true, + 'definition' => 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 = [ + 'name' => 'name', + 'definition' => 'definition' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'definition' => 'setDefinition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'definition' => 'getDefinition' + ]; + + /** + * 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('name', $data ?? [], null); + $this->setIfExists('definition', $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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name for this template universal content + * + * @return self + */ + public function setName($name) + { + + if (is_null($name)) { + 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; + + return $this; + } + + /** + * Gets definition + * + * @return \KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition|null + */ + public function getDefinition() + { + return $this->container['definition']; + } + + /** + * Sets definition + * + * @param \KlaviyoAPI\Model\UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition|null $definition definition + * + * @return self + */ + public function setDefinition($definition) + { + + if (is_null($definition)) { + array_push($this->openAPINullablesSetToNull, 'definition'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('definition', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['definition'] = $definition; + + 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/UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition.php b/lib/Model/UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition.php new file mode 100644 index 0000000..4504603 --- /dev/null +++ b/lib/Model/UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition.php @@ -0,0 +1,483 @@ + + */ +class UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalContentPartialUpdateQueryResourceObject_attributes_definition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content_type' => '\KlaviyoAPI\Model\BlockEnum', + 'type' => '\KlaviyoAPI\Model\TextEnum', + 'data' => '\KlaviyoAPI\Model\TextBlockData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content_type' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'content_type' => false, + 'type' => false, + '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 = [ + 'content_type' => 'content_type', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content_type' => 'setContentType', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content_type' => 'getContentType', + 'type' => 'getType', + '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('content_type', $data ?? [], null); + $this->setIfExists('type', $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['content_type'] === null) { + $invalidProperties[] = "'content_type' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 content_type + * + * @return \KlaviyoAPI\Model\BlockEnum + */ + public function getContentType() + { + return $this->container['content_type']; + } + + /** + * Sets content_type + * + * @param \KlaviyoAPI\Model\BlockEnum $content_type content_type + * + * @return self + */ + public function setContentType($content_type) + { + + if (is_null($content_type)) { + throw new \InvalidArgumentException('non-nullable content_type cannot be null'); + } + + $this->container['content_type'] = $content_type; + + return $this; + } + + /** + * Gets type + * + * @return \KlaviyoAPI\Model\TextEnum + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \KlaviyoAPI\Model\TextEnum $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 data + * + * @return \KlaviyoAPI\Model\TextBlockData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \KlaviyoAPI\Model\TextBlockData $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/UnsubscribedEnum.php b/lib/Model/UnsubscribedEnum.php index d199484..7fe90f1 100644 --- a/lib/Model/UnsubscribedEnum.php +++ b/lib/Model/UnsubscribedEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookCreateQuery.php b/lib/Model/WebhookCreateQuery.php index 801e3d1..58dcfb0 100644 --- a/lib/Model/WebhookCreateQuery.php +++ b/lib/Model/WebhookCreateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookCreateQueryResourceObject.php b/lib/Model/WebhookCreateQueryResourceObject.php index 77f982a..7b852db 100644 --- a/lib/Model/WebhookCreateQueryResourceObject.php +++ b/lib/Model/WebhookCreateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookCreateQueryResourceObjectAttributes.php b/lib/Model/WebhookCreateQueryResourceObjectAttributes.php index 64614a6..8d75df4 100644 --- a/lib/Model/WebhookCreateQueryResourceObjectAttributes.php +++ b/lib/Model/WebhookCreateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookCreateQueryResourceObjectRelationships.php b/lib/Model/WebhookCreateQueryResourceObjectRelationships.php index 9466b0b..9dd2131 100644 --- a/lib/Model/WebhookCreateQueryResourceObjectRelationships.php +++ b/lib/Model/WebhookCreateQueryResourceObjectRelationships.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopics.php b/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopics.php index 5e2c8a5..7f7bcf9 100644 --- a/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopics.php +++ b/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopics.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopicsDataInner.php b/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopicsDataInner.php index 369eeff..2b51e0f 100644 --- a/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopicsDataInner.php +++ b/lib/Model/WebhookCreateQueryResourceObjectRelationshipsWebhookTopicsDataInner.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookEnum.php b/lib/Model/WebhookEnum.php index b33f3e1..d645965 100644 --- a/lib/Model/WebhookEnum.php +++ b/lib/Model/WebhookEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookPartialUpdateQuery.php b/lib/Model/WebhookPartialUpdateQuery.php index fb36dda..104d50a 100644 --- a/lib/Model/WebhookPartialUpdateQuery.php +++ b/lib/Model/WebhookPartialUpdateQuery.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookPartialUpdateQueryResourceObject.php b/lib/Model/WebhookPartialUpdateQueryResourceObject.php index f581f80..5062a4e 100644 --- a/lib/Model/WebhookPartialUpdateQueryResourceObject.php +++ b/lib/Model/WebhookPartialUpdateQueryResourceObject.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookPartialUpdateQueryResourceObjectAttributes.php b/lib/Model/WebhookPartialUpdateQueryResourceObjectAttributes.php index 74a6d6b..aabbc15 100644 --- a/lib/Model/WebhookPartialUpdateQueryResourceObjectAttributes.php +++ b/lib/Model/WebhookPartialUpdateQueryResourceObjectAttributes.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/Model/WebhookTopicEnum.php b/lib/Model/WebhookTopicEnum.php index f73a41c..35f234b 100644 --- a/lib/Model/WebhookTopicEnum.php +++ b/lib/Model/WebhookTopicEnum.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0 diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 8dcc884..ad918f9 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -15,7 +15,7 @@ * * The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. * - * The version of the OpenAPI document: 2024-07-15 + * The version of the OpenAPI document: 2024-10-15 * Contact: developers@klaviyo.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.1.0