diff --git a/README.md b/README.md index 02309f2c..a22403ad 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: -- Package version: 8.0.0 +- Package version: 9.0.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen ## Requirements @@ -197,6 +197,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**deleteAudienceV2**](docs/Api/IntegrationApi.md#deleteaudiencev2) | **DELETE** /v2/audiences/{audienceId} | Delete audience *IntegrationApi* | [**deleteCouponReservation**](docs/Api/IntegrationApi.md#deletecouponreservation) | **DELETE** /v1/coupon_reservations/{couponValue} | Delete coupon reservations *IntegrationApi* | [**deleteCustomerData**](docs/Api/IntegrationApi.md#deletecustomerdata) | **DELETE** /v1/customer_data/{integrationId} | Delete customer's personal data +*IntegrationApi* | [**generateLoyaltyCard**](docs/Api/IntegrationApi.md#generateloyaltycard) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards | Generate loyalty card *IntegrationApi* | [**getCustomerInventory**](docs/Api/IntegrationApi.md#getcustomerinventory) | **GET** /v1/customer_profiles/{integrationId}/inventory | List customer data *IntegrationApi* | [**getCustomerSession**](docs/Api/IntegrationApi.md#getcustomersession) | **GET** /v2/customer_sessions/{customerSessionId} | Get customer session *IntegrationApi* | [**getLoyaltyBalances**](docs/Api/IntegrationApi.md#getloyaltybalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances | Get customer's loyalty points @@ -217,7 +218,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**updateCustomerProfileV2**](docs/Api/IntegrationApi.md#updatecustomerprofilev2) | **PUT** /v2/customer_profiles/{integrationId} | Update customer profile *IntegrationApi* | [**updateCustomerProfilesV2**](docs/Api/IntegrationApi.md#updatecustomerprofilesv2) | **PUT** /v2/customer_profiles | Update multiple customer profiles *IntegrationApi* | [**updateCustomerSessionV2**](docs/Api/IntegrationApi.md#updatecustomersessionv2) | **PUT** /v2/customer_sessions/{customerSessionId} | Update customer session -*ManagementApi* | [**activateUserByEmail**](docs/Api/ManagementApi.md#activateuserbyemail) | **POST** /v1/users/activate | Activate user by email address +*ManagementApi* | [**activateUserByEmail**](docs/Api/ManagementApi.md#activateuserbyemail) | **POST** /v1/users/activate | Enable user by email address *ManagementApi* | [**addLoyaltyCardPoints**](docs/Api/ManagementApi.md#addloyaltycardpoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/add_points | Add points to card *ManagementApi* | [**addLoyaltyPoints**](docs/Api/ManagementApi.md#addloyaltypoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/add_points | Add points to customer profile *ManagementApi* | [**copyCampaignToApplications**](docs/Api/ManagementApi.md#copycampaigntoapplications) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/copy | Copy the campaign into the specified Application @@ -225,17 +226,19 @@ Class | Method | HTTP request | Description *ManagementApi* | [**createAchievement**](docs/Api/ManagementApi.md#createachievement) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements | Create achievement *ManagementApi* | [**createAdditionalCost**](docs/Api/ManagementApi.md#createadditionalcost) | **POST** /v1/additional_costs | Create additional cost *ManagementApi* | [**createAttribute**](docs/Api/ManagementApi.md#createattribute) | **POST** /v1/attributes | Create custom attribute +*ManagementApi* | [**createBatchLoyaltyCards**](docs/Api/ManagementApi.md#createbatchloyaltycards) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards/batch | Create loyalty cards *ManagementApi* | [**createCampaignFromTemplate**](docs/Api/ManagementApi.md#createcampaignfromtemplate) | **POST** /v1/applications/{applicationId}/create_campaign_from_template | Create campaign from campaign template *ManagementApi* | [**createCollection**](docs/Api/ManagementApi.md#createcollection) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/collections | Create campaign-level collection *ManagementApi* | [**createCoupons**](docs/Api/ManagementApi.md#createcoupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Create coupons *ManagementApi* | [**createCouponsAsync**](docs/Api/ManagementApi.md#createcouponsasync) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async | Create coupons asynchronously +*ManagementApi* | [**createCouponsDeletionJob**](docs/Api/ManagementApi.md#createcouponsdeletionjob) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_deletion_jobs | Creates a coupon deletion job *ManagementApi* | [**createCouponsForMultipleRecipients**](docs/Api/ManagementApi.md#createcouponsformultiplerecipients) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients | Create coupons for multiple recipients *ManagementApi* | [**createInviteEmail**](docs/Api/ManagementApi.md#createinviteemail) | **POST** /v1/invite_emails | Resend invitation email *ManagementApi* | [**createInviteV2**](docs/Api/ManagementApi.md#createinvitev2) | **POST** /v2/invites | Invite user *ManagementApi* | [**createPasswordRecoveryEmail**](docs/Api/ManagementApi.md#createpasswordrecoveryemail) | **POST** /v1/password_recovery_emails | Request a password reset *ManagementApi* | [**createSession**](docs/Api/ManagementApi.md#createsession) | **POST** /v1/sessions | Create session *ManagementApi* | [**createStore**](docs/Api/ManagementApi.md#createstore) | **POST** /v1/applications/{applicationId}/stores | Create store -*ManagementApi* | [**deactivateUserByEmail**](docs/Api/ManagementApi.md#deactivateuserbyemail) | **POST** /v1/users/deactivate | Deactivate user by email address +*ManagementApi* | [**deactivateUserByEmail**](docs/Api/ManagementApi.md#deactivateuserbyemail) | **POST** /v1/users/deactivate | Disable user by email address *ManagementApi* | [**deductLoyaltyCardPoints**](docs/Api/ManagementApi.md#deductloyaltycardpoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points | Deduct points from card *ManagementApi* | [**deleteAccountCollection**](docs/Api/ManagementApi.md#deleteaccountcollection) | **DELETE** /v1/collections/{collectionId} | Delete account-level collection *ManagementApi* | [**deleteAchievement**](docs/Api/ManagementApi.md#deleteachievement) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Delete achievement @@ -249,9 +252,11 @@ Class | Method | HTTP request | Description *ManagementApi* | [**deleteUser**](docs/Api/ManagementApi.md#deleteuser) | **DELETE** /v1/users/{userId} | Delete user *ManagementApi* | [**deleteUserByEmail**](docs/Api/ManagementApi.md#deleteuserbyemail) | **POST** /v1/users/delete | Delete user by email address *ManagementApi* | [**destroySession**](docs/Api/ManagementApi.md#destroysession) | **DELETE** /v1/sessions | Destroy session +*ManagementApi* | [**disconnectCampaignStores**](docs/Api/ManagementApi.md#disconnectcampaignstores) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/stores | Disconnect stores *ManagementApi* | [**exportAccountCollectionItems**](docs/Api/ManagementApi.md#exportaccountcollectionitems) | **GET** /v1/collections/{collectionId}/export | Export account-level collection's items *ManagementApi* | [**exportAchievements**](docs/Api/ManagementApi.md#exportachievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export | Export achievement customer data *ManagementApi* | [**exportAudiencesMemberships**](docs/Api/ManagementApi.md#exportaudiencesmemberships) | **GET** /v1/audiences/{audienceId}/memberships/export | Export audience members +*ManagementApi* | [**exportCampaignStores**](docs/Api/ManagementApi.md#exportcampaignstores) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/export | Export stores *ManagementApi* | [**exportCollectionItems**](docs/Api/ManagementApi.md#exportcollectionitems) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export | Export campaign-level collection's items *ManagementApi* | [**exportCoupons**](docs/Api/ManagementApi.md#exportcoupons) | **GET** /v1/applications/{applicationId}/export_coupons | Export coupons *ManagementApi* | [**exportCustomerSessions**](docs/Api/ManagementApi.md#exportcustomersessions) | **GET** /v1/applications/{applicationId}/export_customer_sessions | Export customer sessions @@ -261,6 +266,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**exportLoyaltyBalances**](docs/Api/ManagementApi.md#exportloyaltybalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances | Export customer loyalty balances *ManagementApi* | [**exportLoyaltyCardBalances**](docs/Api/ManagementApi.md#exportloyaltycardbalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_card_balances | Export all card transaction logs *ManagementApi* | [**exportLoyaltyCardLedger**](docs/Api/ManagementApi.md#exportloyaltycardledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log | Export card's ledger log +*ManagementApi* | [**exportLoyaltyCards**](docs/Api/ManagementApi.md#exportloyaltycards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/export | Export loyalty cards *ManagementApi* | [**exportLoyaltyLedger**](docs/Api/ManagementApi.md#exportloyaltyledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log | Export customer's transaction logs *ManagementApi* | [**exportPoolGiveaways**](docs/Api/ManagementApi.md#exportpoolgiveaways) | **GET** /v1/giveaways/pools/{poolId}/export | Export giveaway codes of a giveaway pool *ManagementApi* | [**exportReferrals**](docs/Api/ManagementApi.md#exportreferrals) | **GET** /v1/applications/{applicationId}/export_referrals | Export referrals @@ -330,6 +336,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**importAccountCollection**](docs/Api/ManagementApi.md#importaccountcollection) | **POST** /v1/collections/{collectionId}/import | Import data into existing account-level collection *ManagementApi* | [**importAllowedList**](docs/Api/ManagementApi.md#importallowedlist) | **POST** /v1/attributes/{attributeId}/allowed_list/import | Import allowed values for attribute *ManagementApi* | [**importAudiencesMemberships**](docs/Api/ManagementApi.md#importaudiencesmemberships) | **POST** /v1/audiences/{audienceId}/memberships/import | Import audience members +*ManagementApi* | [**importCampaignStores**](docs/Api/ManagementApi.md#importcampaignstores) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/import | Import stores *ManagementApi* | [**importCollection**](docs/Api/ManagementApi.md#importcollection) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import | Import data into existing campaign-level collection *ManagementApi* | [**importCoupons**](docs/Api/ManagementApi.md#importcoupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons | Import coupons *ManagementApi* | [**importLoyaltyCards**](docs/Api/ManagementApi.md#importloyaltycards) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_cards | Import loyalty cards @@ -346,11 +353,21 @@ Class | Method | HTTP request | Description *ManagementApi* | [**listCollectionsInApplication**](docs/Api/ManagementApi.md#listcollectionsinapplication) | **GET** /v1/applications/{applicationId}/collections | List collections in Application *ManagementApi* | [**listStores**](docs/Api/ManagementApi.md#liststores) | **GET** /v1/applications/{applicationId}/stores | List stores *ManagementApi* | [**notificationActivation**](docs/Api/ManagementApi.md#notificationactivation) | **PUT** /v1/notifications/{notificationId}/activation | Activate or deactivate notification +*ManagementApi* | [**oktaEventHandlerChallenge**](docs/Api/ManagementApi.md#oktaeventhandlerchallenge) | **GET** /v1/provisioning/okta | Validate Okta API ownership *ManagementApi* | [**postAddedDeductedPointsNotification**](docs/Api/ManagementApi.md#postaddeddeductedpointsnotification) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_points | Create notification about added or deducted loyalty points *ManagementApi* | [**postCatalogsStrikethroughNotification**](docs/Api/ManagementApi.md#postcatalogsstrikethroughnotification) | **POST** /v1/applications/{applicationId}/catalogs/notifications/strikethrough | Create strikethrough notification *ManagementApi* | [**postPendingPointsNotification**](docs/Api/ManagementApi.md#postpendingpointsnotification) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/notifications/pending_points | Create notification about pending loyalty points *ManagementApi* | [**removeLoyaltyPoints**](docs/Api/ManagementApi.md#removeloyaltypoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points | Deduct points from customer profile *ManagementApi* | [**resetPassword**](docs/Api/ManagementApi.md#resetpassword) | **POST** /v1/reset_password | Reset password +*ManagementApi* | [**scimCreateUser**](docs/Api/ManagementApi.md#scimcreateuser) | **POST** /v1/provisioning/scim/Users | Create SCIM user +*ManagementApi* | [**scimDeleteUser**](docs/Api/ManagementApi.md#scimdeleteuser) | **DELETE** /v1/provisioning/scim/Users/{userId} | Delete SCIM user +*ManagementApi* | [**scimGetResourceTypes**](docs/Api/ManagementApi.md#scimgetresourcetypes) | **GET** /v1/provisioning/scim/ResourceTypes | List supported SCIM resource types +*ManagementApi* | [**scimGetSchemas**](docs/Api/ManagementApi.md#scimgetschemas) | **GET** /v1/provisioning/scim/Schemas | List supported SCIM schemas +*ManagementApi* | [**scimGetServiceProviderConfig**](docs/Api/ManagementApi.md#scimgetserviceproviderconfig) | **GET** /v1/provisioning/scim/ServiceProviderConfig | Get SCIM service provider configuration +*ManagementApi* | [**scimGetUser**](docs/Api/ManagementApi.md#scimgetuser) | **GET** /v1/provisioning/scim/Users/{userId} | Get SCIM user +*ManagementApi* | [**scimGetUsers**](docs/Api/ManagementApi.md#scimgetusers) | **GET** /v1/provisioning/scim/Users | List SCIM users +*ManagementApi* | [**scimPatchUser**](docs/Api/ManagementApi.md#scimpatchuser) | **PATCH** /v1/provisioning/scim/Users/{userId} | Update SCIM user attributes +*ManagementApi* | [**scimReplaceUserAttributes**](docs/Api/ManagementApi.md#scimreplaceuserattributes) | **PUT** /v1/provisioning/scim/Users/{userId} | Update SCIM user *ManagementApi* | [**searchCouponsAdvancedApplicationWideWithoutTotalCount**](docs/Api/ManagementApi.md#searchcouponsadvancedapplicationwidewithouttotalcount) | **POST** /v1/applications/{applicationId}/coupons_search_advanced/no_total | List coupons that match the given attributes (without total count) *ManagementApi* | [**searchCouponsAdvancedWithoutTotalCount**](docs/Api/ManagementApi.md#searchcouponsadvancedwithouttotalcount) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total | List coupons that match the given attributes in campaign (without total count) *ManagementApi* | [**transferLoyaltyCard**](docs/Api/ManagementApi.md#transferloyaltycard) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transfer | Transfer card data @@ -398,21 +415,17 @@ Class | Method | HTTP request | Description - [AddedDeductedPointsNotificationPolicy](docs/Model/AddedDeductedPointsNotificationPolicy.md) - [AdditionalCampaignProperties](docs/Model/AdditionalCampaignProperties.md) - [AdditionalCost](docs/Model/AdditionalCost.md) + - [AnalyticsDataPoint](docs/Model/AnalyticsDataPoint.md) + - [AnalyticsDataPointWithTrend](docs/Model/AnalyticsDataPointWithTrend.md) + - [AnalyticsDataPointWithTrendAndInfluencedRate](docs/Model/AnalyticsDataPointWithTrendAndInfluencedRate.md) + - [AnalyticsDataPointWithTrendAndUplift](docs/Model/AnalyticsDataPointWithTrendAndUplift.md) - [Application](docs/Model/Application.md) - [ApplicationAPIKey](docs/Model/ApplicationAPIKey.md) - [ApplicationAnalyticsDataPoint](docs/Model/ApplicationAnalyticsDataPoint.md) - - [ApplicationAnalyticsDataPointAvgItemsPerSession](docs/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.md) - - [ApplicationAnalyticsDataPointAvgSessionValue](docs/Model/ApplicationAnalyticsDataPointAvgSessionValue.md) - - [ApplicationAnalyticsDataPointSessionsCount](docs/Model/ApplicationAnalyticsDataPointSessionsCount.md) - - [ApplicationAnalyticsDataPointTotalRevenue](docs/Model/ApplicationAnalyticsDataPointTotalRevenue.md) - [ApplicationApiHealth](docs/Model/ApplicationApiHealth.md) + - [ApplicationCIF](docs/Model/ApplicationCIF.md) + - [ApplicationCIFExpression](docs/Model/ApplicationCIFExpression.md) - [ApplicationCampaignAnalytics](docs/Model/ApplicationCampaignAnalytics.md) - - [ApplicationCampaignAnalyticsAvgItemsPerSession](docs/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.md) - - [ApplicationCampaignAnalyticsAvgSessionValue](docs/Model/ApplicationCampaignAnalyticsAvgSessionValue.md) - - [ApplicationCampaignAnalyticsCouponsCount](docs/Model/ApplicationCampaignAnalyticsCouponsCount.md) - - [ApplicationCampaignAnalyticsSessionsCount](docs/Model/ApplicationCampaignAnalyticsSessionsCount.md) - - [ApplicationCampaignAnalyticsTotalDiscounts](docs/Model/ApplicationCampaignAnalyticsTotalDiscounts.md) - - [ApplicationCampaignAnalyticsTotalRevenue](docs/Model/ApplicationCampaignAnalyticsTotalRevenue.md) - [ApplicationCampaignStats](docs/Model/ApplicationCampaignStats.md) - [ApplicationCustomer](docs/Model/ApplicationCustomer.md) - [ApplicationCustomerEntity](docs/Model/ApplicationCustomerEntity.md) @@ -424,6 +437,7 @@ Class | Method | HTTP request | Description - [ApplicationSessionEntity](docs/Model/ApplicationSessionEntity.md) - [ApplicationStoreEntity](docs/Model/ApplicationStoreEntity.md) - [AsyncCouponCreationResponse](docs/Model/AsyncCouponCreationResponse.md) + - [AsyncCouponDeletionJobResponse](docs/Model/AsyncCouponDeletionJobResponse.md) - [Attribute](docs/Model/Attribute.md) - [AttributesMandatory](docs/Model/AttributesMandatory.md) - [AttributesSettings](docs/Model/AttributesSettings.md) @@ -449,6 +463,7 @@ Class | Method | HTTP request | Description - [CampaignAnalytics](docs/Model/CampaignAnalytics.md) - [CampaignBudget](docs/Model/CampaignBudget.md) - [CampaignCollection](docs/Model/CampaignCollection.md) + - [CampaignCollectionEditedNotification](docs/Model/CampaignCollectionEditedNotification.md) - [CampaignCollectionWithoutPayload](docs/Model/CampaignCollectionWithoutPayload.md) - [CampaignCopy](docs/Model/CampaignCopy.md) - [CampaignCreatedNotification](docs/Model/CampaignCreatedNotification.md) @@ -469,9 +484,12 @@ Class | Method | HTTP request | Description - [CampaignSetLeafNode](docs/Model/CampaignSetLeafNode.md) - [CampaignSetNode](docs/Model/CampaignSetNode.md) - [CampaignStateChangedNotification](docs/Model/CampaignStateChangedNotification.md) + - [CampaignStoreBudget](docs/Model/CampaignStoreBudget.md) - [CampaignTemplate](docs/Model/CampaignTemplate.md) - [CampaignTemplateCollection](docs/Model/CampaignTemplateCollection.md) - [CampaignTemplateParams](docs/Model/CampaignTemplateParams.md) + - [CampaignVersions](docs/Model/CampaignVersions.md) + - [CardAddedDeductedPointsNotificationPolicy](docs/Model/CardAddedDeductedPointsNotificationPolicy.md) - [CardExpiringPointsNotificationPolicy](docs/Model/CardExpiringPointsNotificationPolicy.md) - [CardExpiringPointsNotificationTrigger](docs/Model/CardExpiringPointsNotificationTrigger.md) - [CardLedgerPointsEntryIntegrationAPI](docs/Model/CardLedgerPointsEntryIntegrationAPI.md) @@ -495,6 +513,8 @@ Class | Method | HTTP request | Description - [CouponConstraints](docs/Model/CouponConstraints.md) - [CouponCreatedEffectProps](docs/Model/CouponCreatedEffectProps.md) - [CouponCreationJob](docs/Model/CouponCreationJob.md) + - [CouponDeletionFilters](docs/Model/CouponDeletionFilters.md) + - [CouponDeletionJob](docs/Model/CouponDeletionJob.md) - [CouponLimitConfigs](docs/Model/CouponLimitConfigs.md) - [CouponRejectionReason](docs/Model/CouponRejectionReason.md) - [CouponReservations](docs/Model/CouponReservations.md) @@ -548,6 +568,12 @@ Class | Method | HTTP request | Description - [FeaturesFeed](docs/Model/FeaturesFeed.md) - [FuncArgDef](docs/Model/FuncArgDef.md) - [FunctionDef](docs/Model/FunctionDef.md) + - [GenerateCampaignDescription](docs/Model/GenerateCampaignDescription.md) + - [GenerateCampaignTags](docs/Model/GenerateCampaignTags.md) + - [GenerateItemFilterDescription](docs/Model/GenerateItemFilterDescription.md) + - [GenerateLoyaltyCard](docs/Model/GenerateLoyaltyCard.md) + - [GenerateRuleTitle](docs/Model/GenerateRuleTitle.md) + - [GenerateRuleTitleRule](docs/Model/GenerateRuleTitleRule.md) - [GetIntegrationCouponRequest](docs/Model/GetIntegrationCouponRequest.md) - [Giveaway](docs/Model/Giveaway.md) - [GiveawaysPool](docs/Model/GiveawaysPool.md) @@ -627,9 +653,13 @@ Class | Method | HTTP request | Description - [LoginParams](docs/Model/LoginParams.md) - [Loyalty](docs/Model/Loyalty.md) - [LoyaltyBalance](docs/Model/LoyaltyBalance.md) + - [LoyaltyBalanceWithTier](docs/Model/LoyaltyBalanceWithTier.md) - [LoyaltyBalances](docs/Model/LoyaltyBalances.md) + - [LoyaltyBalancesWithTiers](docs/Model/LoyaltyBalancesWithTiers.md) - [LoyaltyCard](docs/Model/LoyaltyCard.md) - [LoyaltyCardBalances](docs/Model/LoyaltyCardBalances.md) + - [LoyaltyCardBatch](docs/Model/LoyaltyCardBatch.md) + - [LoyaltyCardBatchResponse](docs/Model/LoyaltyCardBatchResponse.md) - [LoyaltyCardProfileRegistration](docs/Model/LoyaltyCardProfileRegistration.md) - [LoyaltyCardRegistration](docs/Model/LoyaltyCardRegistration.md) - [LoyaltyDashboardData](docs/Model/LoyaltyDashboardData.md) @@ -642,7 +672,6 @@ Class | Method | HTTP request | Description - [LoyaltyProgramBalance](docs/Model/LoyaltyProgramBalance.md) - [LoyaltyProgramEntity](docs/Model/LoyaltyProgramEntity.md) - [LoyaltyProgramLedgers](docs/Model/LoyaltyProgramLedgers.md) - - [LoyaltyProgramSubledgers](docs/Model/LoyaltyProgramSubledgers.md) - [LoyaltyProgramTransaction](docs/Model/LoyaltyProgramTransaction.md) - [LoyaltySubLedger](docs/Model/LoyaltySubLedger.md) - [LoyaltyTier](docs/Model/LoyaltyTier.md) @@ -667,8 +696,11 @@ Class | Method | HTTP request | Description - [NewAccount](docs/Model/NewAccount.md) - [NewAccountSignUp](docs/Model/NewAccountSignUp.md) - [NewAdditionalCost](docs/Model/NewAdditionalCost.md) + - [NewAppWideCouponDeletionJob](docs/Model/NewAppWideCouponDeletionJob.md) - [NewApplication](docs/Model/NewApplication.md) - [NewApplicationAPIKey](docs/Model/NewApplicationAPIKey.md) + - [NewApplicationCIF](docs/Model/NewApplicationCIF.md) + - [NewApplicationCIFExpression](docs/Model/NewApplicationCIFExpression.md) - [NewAttribute](docs/Model/NewAttribute.md) - [NewAudience](docs/Model/NewAudience.md) - [NewBaseNotification](docs/Model/NewBaseNotification.md) @@ -681,6 +713,7 @@ Class | Method | HTTP request | Description - [NewCatalog](docs/Model/NewCatalog.md) - [NewCollection](docs/Model/NewCollection.md) - [NewCouponCreationJob](docs/Model/NewCouponCreationJob.md) + - [NewCouponDeletionJob](docs/Model/NewCouponDeletionJob.md) - [NewCoupons](docs/Model/NewCoupons.md) - [NewCouponsForMultipleRecipients](docs/Model/NewCouponsForMultipleRecipients.md) - [NewCustomEffect](docs/Model/NewCustomEffect.md) @@ -707,6 +740,7 @@ Class | Method | HTTP request | Description - [NewReferral](docs/Model/NewReferral.md) - [NewReferralsForMultipleAdvocates](docs/Model/NewReferralsForMultipleAdvocates.md) - [NewReturn](docs/Model/NewReturn.md) + - [NewRevisionVersion](docs/Model/NewRevisionVersion.md) - [NewRole](docs/Model/NewRole.md) - [NewRoleV2](docs/Model/NewRoleV2.md) - [NewRuleset](docs/Model/NewRuleset.md) @@ -719,6 +753,10 @@ Class | Method | HTTP request | Description - [NotificationActivation](docs/Model/NotificationActivation.md) - [NotificationListItem](docs/Model/NotificationListItem.md) - [NotificationTest](docs/Model/NotificationTest.md) + - [OktaEvent](docs/Model/OktaEvent.md) + - [OktaEventPayload](docs/Model/OktaEventPayload.md) + - [OktaEventPayloadData](docs/Model/OktaEventPayloadData.md) + - [OktaEventTarget](docs/Model/OktaEventTarget.md) - [OneTimeCode](docs/Model/OneTimeCode.md) - [OutgoingIntegrationBrazePolicy](docs/Model/OutgoingIntegrationBrazePolicy.md) - [OutgoingIntegrationCleverTapPolicy](docs/Model/OutgoingIntegrationCleverTapPolicy.md) @@ -736,6 +774,7 @@ Class | Method | HTTP request | Description - [Picklist](docs/Model/Picklist.md) - [Product](docs/Model/Product.md) - [ProfileAudiencesChanges](docs/Model/ProfileAudiencesChanges.md) + - [ProjectedTier](docs/Model/ProjectedTier.md) - [RedeemReferralEffectProps](docs/Model/RedeemReferralEffectProps.md) - [Referral](docs/Model/Referral.md) - [ReferralConstraints](docs/Model/ReferralConstraints.md) @@ -750,6 +789,9 @@ Class | Method | HTTP request | Description - [ReserveCouponEffectProps](docs/Model/ReserveCouponEffectProps.md) - [ReturnIntegrationRequest](docs/Model/ReturnIntegrationRequest.md) - [ReturnedCartItem](docs/Model/ReturnedCartItem.md) + - [Revision](docs/Model/Revision.md) + - [RevisionActivation](docs/Model/RevisionActivation.md) + - [RevisionVersion](docs/Model/RevisionVersion.md) - [Role](docs/Model/Role.md) - [RoleAssign](docs/Model/RoleAssign.md) - [RoleMembership](docs/Model/RoleMembership.md) @@ -763,6 +805,7 @@ Class | Method | HTTP request | Description - [RollbackCouponEffectProps](docs/Model/RollbackCouponEffectProps.md) - [RollbackDeductedLoyaltyPointsEffectProps](docs/Model/RollbackDeductedLoyaltyPointsEffectProps.md) - [RollbackDiscountEffectProps](docs/Model/RollbackDiscountEffectProps.md) + - [RollbackIncreasedAchievementProgressEffectProps](docs/Model/RollbackIncreasedAchievementProgressEffectProps.md) - [RollbackReferralEffectProps](docs/Model/RollbackReferralEffectProps.md) - [Rule](docs/Model/Rule.md) - [RuleFailureReason](docs/Model/RuleFailureReason.md) @@ -772,6 +815,22 @@ Class | Method | HTTP request | Description - [SamlConnectionInternal](docs/Model/SamlConnectionInternal.md) - [SamlConnectionMetadata](docs/Model/SamlConnectionMetadata.md) - [SamlLoginEndpoint](docs/Model/SamlLoginEndpoint.md) + - [ScimBaseUser](docs/Model/ScimBaseUser.md) + - [ScimBaseUserName](docs/Model/ScimBaseUserName.md) + - [ScimNewUser](docs/Model/ScimNewUser.md) + - [ScimPatchOperation](docs/Model/ScimPatchOperation.md) + - [ScimPatchRequest](docs/Model/ScimPatchRequest.md) + - [ScimResource](docs/Model/ScimResource.md) + - [ScimResourceTypesListResponse](docs/Model/ScimResourceTypesListResponse.md) + - [ScimSchemaResource](docs/Model/ScimSchemaResource.md) + - [ScimSchemasListResponse](docs/Model/ScimSchemasListResponse.md) + - [ScimServiceProviderConfigResponse](docs/Model/ScimServiceProviderConfigResponse.md) + - [ScimServiceProviderConfigResponseBulk](docs/Model/ScimServiceProviderConfigResponseBulk.md) + - [ScimServiceProviderConfigResponseChangePassword](docs/Model/ScimServiceProviderConfigResponseChangePassword.md) + - [ScimServiceProviderConfigResponseFilter](docs/Model/ScimServiceProviderConfigResponseFilter.md) + - [ScimServiceProviderConfigResponsePatch](docs/Model/ScimServiceProviderConfigResponsePatch.md) + - [ScimUser](docs/Model/ScimUser.md) + - [ScimUsersListResponse](docs/Model/ScimUsersListResponse.md) - [Session](docs/Model/Session.md) - [SetDiscountEffectProps](docs/Model/SetDiscountEffectProps.md) - [SetDiscountPerAdditionalCostEffectProps](docs/Model/SetDiscountPerAdditionalCostEffectProps.md) @@ -806,6 +865,7 @@ Class | Method | HTTP request | Description - [UpdateAchievement](docs/Model/UpdateAchievement.md) - [UpdateApplication](docs/Model/UpdateApplication.md) - [UpdateApplicationAPIKey](docs/Model/UpdateApplicationAPIKey.md) + - [UpdateApplicationCIF](docs/Model/UpdateApplicationCIF.md) - [UpdateAttributeEffectProps](docs/Model/UpdateAttributeEffectProps.md) - [UpdateAudience](docs/Model/UpdateAudience.md) - [UpdateCampaign](docs/Model/UpdateCampaign.md) diff --git a/composer.json b/composer.json index d3f91141..988ab784 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "talon-one/talon-one-client", "type": "library", - "version": "8.0.0", + "version": "9.0.0", "description": "Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`", "keywords": [ "talon-one", diff --git a/docs/Api/IntegrationApi.md b/docs/Api/IntegrationApi.md index dd4f0c00..89861e7e 100644 --- a/docs/Api/IntegrationApi.md +++ b/docs/Api/IntegrationApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**deleteAudienceV2**](IntegrationApi.md#deleteAudienceV2) | **DELETE** /v2/audiences/{audienceId} | Delete audience [**deleteCouponReservation**](IntegrationApi.md#deleteCouponReservation) | **DELETE** /v1/coupon_reservations/{couponValue} | Delete coupon reservations [**deleteCustomerData**](IntegrationApi.md#deleteCustomerData) | **DELETE** /v1/customer_data/{integrationId} | Delete customer's personal data +[**generateLoyaltyCard**](IntegrationApi.md#generateLoyaltyCard) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards | Generate loyalty card [**getCustomerInventory**](IntegrationApi.md#getCustomerInventory) | **GET** /v1/customer_profiles/{integrationId}/inventory | List customer data [**getCustomerSession**](IntegrationApi.md#getCustomerSession) | **GET** /v2/customer_sessions/{customerSessionId} | Get customer session [**getLoyaltyBalances**](IntegrationApi.md#getLoyaltyBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances | Get customer's loyalty points @@ -541,6 +542,71 @@ void (empty response body) [[Back to README]](../../README.md) +## generateLoyaltyCard + +> \TalonOne\Client\Model\LoyaltyCard generateLoyaltyCard($loyaltyProgramId, $body) + +Generate loyalty card + +Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. **Note:** - The number of customer profiles linked to the loyalty card cannot exceed the loyalty program's `usersPerCardLimit`. To find the program's limit, use the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) endpoint. - If the loyalty program has a defined code format, it will be used for the loyalty card identifier. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\IntegrationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$loyaltyProgramId = 56; // int | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. +$body = new \TalonOne\Client\Model\GenerateLoyaltyCard(); // \TalonOne\Client\Model\GenerateLoyaltyCard | body + +try { + $result = $apiInstance->generateLoyaltyCard($loyaltyProgramId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IntegrationApi->generateLoyaltyCard: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyaltyProgramId** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **body** | [**\TalonOne\Client\Model\GenerateLoyaltyCard**](../Model/GenerateLoyaltyCard.md)| body | + +### Return type + +[**\TalonOne\Client\Model\LoyaltyCard**](../Model/LoyaltyCard.md) + +### Authorization + +[api_key_v1](../../README.md#api_key_v1) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## getCustomerInventory > \TalonOne\Client\Model\CustomerInventory getCustomerInventory($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways, $achievements) @@ -681,7 +747,7 @@ Name | Type | Description | Notes ## getLoyaltyBalances -> \TalonOne\Client\Model\LoyaltyBalances getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate, $subledgerId) +> \TalonOne\Client\Model\LoyaltyBalancesWithTiers getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate, $subledgerId, $includeTiers, $includeProjectedTier) Get customer's loyalty points @@ -710,9 +776,11 @@ $loyaltyProgramId = 56; // int | Identifier of the profile-based loyalty program $integrationId = 'integrationId_example'; // string | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. $endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. $subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. +$includeTiers = false; // bool | Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. +$includeProjectedTier = false; // bool | Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer’s active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. try { - $result = $apiInstance->getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate, $subledgerId); + $result = $apiInstance->getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate, $subledgerId, $includeTiers, $includeProjectedTier); print_r($result); } catch (Exception $e) { echo 'Exception when calling IntegrationApi->getLoyaltyBalances: ', $e->getMessage(), PHP_EOL; @@ -729,10 +797,12 @@ Name | Type | Description | Notes **integrationId** | **string**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | **endDate** | **\DateTime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] + **includeTiers** | **bool**| Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. | [optional] [default to false] + **includeProjectedTier** | **bool**| Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer’s active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. | [optional] [default to false] ### Return type -[**\TalonOne\Client\Model\LoyaltyBalances**](../Model/LoyaltyBalances.md) +[**\TalonOne\Client\Model\LoyaltyBalancesWithTiers**](../Model/LoyaltyBalancesWithTiers.md) ### Authorization @@ -1383,7 +1453,7 @@ Name | Type | Description | Notes Sync cart item catalog -Perform one or more of the following actions for a given cart item catalog: - Adding an item to the catalog. - Adding several items to the catalog. - Editing the attributes of an item in the catalog. - Editing the attributes of several items in the catalog. - Removing an item from the catalog. - Removing several items from the catalog. You can add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding several items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Editing the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Editing the attributes of several items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing several items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
+Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding multiple items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Updating the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Updating the attributes of multiple items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing multiple items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
### Example @@ -1863,7 +1933,7 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi( ); $customerSessionId = 'customerSessionId_example'; // string | The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. $body = new \TalonOne\Client\Model\IntegrationRequest(); // \TalonOne\Client\Model\IntegrationRequest | body -$dry = True; // bool | Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint will **only** consider the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). +$dry = True; // bool | Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). $now = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). **Note:** - It must be an RFC3339 timestamp string. - It can **only** be a date in the future. - It can **only** be used if the `dry` parameter in the query is set to `true`. try { @@ -1882,7 +1952,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **customerSessionId** | **string**| The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. | **body** | [**\TalonOne\Client\Model\IntegrationRequest**](../Model/IntegrationRequest.md)| body | - **dry** | **bool**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint will **only** consider the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). | [optional] + **dry** | **bool**| Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). | [optional] **now** | **\DateTime**| A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). **Note:** - It must be an RFC3339 timestamp string. - It can **only** be a date in the future. - It can **only** be used if the `dry` parameter in the query is set to `true`. | [optional] ### Return type diff --git a/docs/Api/ManagementApi.md b/docs/Api/ManagementApi.md index 7d977b29..4202eea3 100644 --- a/docs/Api/ManagementApi.md +++ b/docs/Api/ManagementApi.md @@ -4,7 +4,7 @@ All URIs are relative to *https://yourbaseurl.talon.one* Method | HTTP request | Description ------------- | ------------- | ------------- -[**activateUserByEmail**](ManagementApi.md#activateUserByEmail) | **POST** /v1/users/activate | Activate user by email address +[**activateUserByEmail**](ManagementApi.md#activateUserByEmail) | **POST** /v1/users/activate | Enable user by email address [**addLoyaltyCardPoints**](ManagementApi.md#addLoyaltyCardPoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/add_points | Add points to card [**addLoyaltyPoints**](ManagementApi.md#addLoyaltyPoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/add_points | Add points to customer profile [**copyCampaignToApplications**](ManagementApi.md#copyCampaignToApplications) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/copy | Copy the campaign into the specified Application @@ -12,17 +12,19 @@ Method | HTTP request | Description [**createAchievement**](ManagementApi.md#createAchievement) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements | Create achievement [**createAdditionalCost**](ManagementApi.md#createAdditionalCost) | **POST** /v1/additional_costs | Create additional cost [**createAttribute**](ManagementApi.md#createAttribute) | **POST** /v1/attributes | Create custom attribute +[**createBatchLoyaltyCards**](ManagementApi.md#createBatchLoyaltyCards) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards/batch | Create loyalty cards [**createCampaignFromTemplate**](ManagementApi.md#createCampaignFromTemplate) | **POST** /v1/applications/{applicationId}/create_campaign_from_template | Create campaign from campaign template [**createCollection**](ManagementApi.md#createCollection) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/collections | Create campaign-level collection [**createCoupons**](ManagementApi.md#createCoupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Create coupons [**createCouponsAsync**](ManagementApi.md#createCouponsAsync) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async | Create coupons asynchronously +[**createCouponsDeletionJob**](ManagementApi.md#createCouponsDeletionJob) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_deletion_jobs | Creates a coupon deletion job [**createCouponsForMultipleRecipients**](ManagementApi.md#createCouponsForMultipleRecipients) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients | Create coupons for multiple recipients [**createInviteEmail**](ManagementApi.md#createInviteEmail) | **POST** /v1/invite_emails | Resend invitation email [**createInviteV2**](ManagementApi.md#createInviteV2) | **POST** /v2/invites | Invite user [**createPasswordRecoveryEmail**](ManagementApi.md#createPasswordRecoveryEmail) | **POST** /v1/password_recovery_emails | Request a password reset [**createSession**](ManagementApi.md#createSession) | **POST** /v1/sessions | Create session [**createStore**](ManagementApi.md#createStore) | **POST** /v1/applications/{applicationId}/stores | Create store -[**deactivateUserByEmail**](ManagementApi.md#deactivateUserByEmail) | **POST** /v1/users/deactivate | Deactivate user by email address +[**deactivateUserByEmail**](ManagementApi.md#deactivateUserByEmail) | **POST** /v1/users/deactivate | Disable user by email address [**deductLoyaltyCardPoints**](ManagementApi.md#deductLoyaltyCardPoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points | Deduct points from card [**deleteAccountCollection**](ManagementApi.md#deleteAccountCollection) | **DELETE** /v1/collections/{collectionId} | Delete account-level collection [**deleteAchievement**](ManagementApi.md#deleteAchievement) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Delete achievement @@ -36,9 +38,11 @@ Method | HTTP request | Description [**deleteUser**](ManagementApi.md#deleteUser) | **DELETE** /v1/users/{userId} | Delete user [**deleteUserByEmail**](ManagementApi.md#deleteUserByEmail) | **POST** /v1/users/delete | Delete user by email address [**destroySession**](ManagementApi.md#destroySession) | **DELETE** /v1/sessions | Destroy session +[**disconnectCampaignStores**](ManagementApi.md#disconnectCampaignStores) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/stores | Disconnect stores [**exportAccountCollectionItems**](ManagementApi.md#exportAccountCollectionItems) | **GET** /v1/collections/{collectionId}/export | Export account-level collection's items [**exportAchievements**](ManagementApi.md#exportAchievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export | Export achievement customer data [**exportAudiencesMemberships**](ManagementApi.md#exportAudiencesMemberships) | **GET** /v1/audiences/{audienceId}/memberships/export | Export audience members +[**exportCampaignStores**](ManagementApi.md#exportCampaignStores) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/export | Export stores [**exportCollectionItems**](ManagementApi.md#exportCollectionItems) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export | Export campaign-level collection's items [**exportCoupons**](ManagementApi.md#exportCoupons) | **GET** /v1/applications/{applicationId}/export_coupons | Export coupons [**exportCustomerSessions**](ManagementApi.md#exportCustomerSessions) | **GET** /v1/applications/{applicationId}/export_customer_sessions | Export customer sessions @@ -48,6 +52,7 @@ Method | HTTP request | Description [**exportLoyaltyBalances**](ManagementApi.md#exportLoyaltyBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances | Export customer loyalty balances [**exportLoyaltyCardBalances**](ManagementApi.md#exportLoyaltyCardBalances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/export_card_balances | Export all card transaction logs [**exportLoyaltyCardLedger**](ManagementApi.md#exportLoyaltyCardLedger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log | Export card's ledger log +[**exportLoyaltyCards**](ManagementApi.md#exportLoyaltyCards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/export | Export loyalty cards [**exportLoyaltyLedger**](ManagementApi.md#exportLoyaltyLedger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log | Export customer's transaction logs [**exportPoolGiveaways**](ManagementApi.md#exportPoolGiveaways) | **GET** /v1/giveaways/pools/{poolId}/export | Export giveaway codes of a giveaway pool [**exportReferrals**](ManagementApi.md#exportReferrals) | **GET** /v1/applications/{applicationId}/export_referrals | Export referrals @@ -117,6 +122,7 @@ Method | HTTP request | Description [**importAccountCollection**](ManagementApi.md#importAccountCollection) | **POST** /v1/collections/{collectionId}/import | Import data into existing account-level collection [**importAllowedList**](ManagementApi.md#importAllowedList) | **POST** /v1/attributes/{attributeId}/allowed_list/import | Import allowed values for attribute [**importAudiencesMemberships**](ManagementApi.md#importAudiencesMemberships) | **POST** /v1/audiences/{audienceId}/memberships/import | Import audience members +[**importCampaignStores**](ManagementApi.md#importCampaignStores) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/stores/import | Import stores [**importCollection**](ManagementApi.md#importCollection) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import | Import data into existing campaign-level collection [**importCoupons**](ManagementApi.md#importCoupons) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons | Import coupons [**importLoyaltyCards**](ManagementApi.md#importLoyaltyCards) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_cards | Import loyalty cards @@ -133,11 +139,21 @@ Method | HTTP request | Description [**listCollectionsInApplication**](ManagementApi.md#listCollectionsInApplication) | **GET** /v1/applications/{applicationId}/collections | List collections in Application [**listStores**](ManagementApi.md#listStores) | **GET** /v1/applications/{applicationId}/stores | List stores [**notificationActivation**](ManagementApi.md#notificationActivation) | **PUT** /v1/notifications/{notificationId}/activation | Activate or deactivate notification +[**oktaEventHandlerChallenge**](ManagementApi.md#oktaEventHandlerChallenge) | **GET** /v1/provisioning/okta | Validate Okta API ownership [**postAddedDeductedPointsNotification**](ManagementApi.md#postAddedDeductedPointsNotification) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_points | Create notification about added or deducted loyalty points [**postCatalogsStrikethroughNotification**](ManagementApi.md#postCatalogsStrikethroughNotification) | **POST** /v1/applications/{applicationId}/catalogs/notifications/strikethrough | Create strikethrough notification [**postPendingPointsNotification**](ManagementApi.md#postPendingPointsNotification) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/notifications/pending_points | Create notification about pending loyalty points [**removeLoyaltyPoints**](ManagementApi.md#removeLoyaltyPoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points | Deduct points from customer profile [**resetPassword**](ManagementApi.md#resetPassword) | **POST** /v1/reset_password | Reset password +[**scimCreateUser**](ManagementApi.md#scimCreateUser) | **POST** /v1/provisioning/scim/Users | Create SCIM user +[**scimDeleteUser**](ManagementApi.md#scimDeleteUser) | **DELETE** /v1/provisioning/scim/Users/{userId} | Delete SCIM user +[**scimGetResourceTypes**](ManagementApi.md#scimGetResourceTypes) | **GET** /v1/provisioning/scim/ResourceTypes | List supported SCIM resource types +[**scimGetSchemas**](ManagementApi.md#scimGetSchemas) | **GET** /v1/provisioning/scim/Schemas | List supported SCIM schemas +[**scimGetServiceProviderConfig**](ManagementApi.md#scimGetServiceProviderConfig) | **GET** /v1/provisioning/scim/ServiceProviderConfig | Get SCIM service provider configuration +[**scimGetUser**](ManagementApi.md#scimGetUser) | **GET** /v1/provisioning/scim/Users/{userId} | Get SCIM user +[**scimGetUsers**](ManagementApi.md#scimGetUsers) | **GET** /v1/provisioning/scim/Users | List SCIM users +[**scimPatchUser**](ManagementApi.md#scimPatchUser) | **PATCH** /v1/provisioning/scim/Users/{userId} | Update SCIM user attributes +[**scimReplaceUserAttributes**](ManagementApi.md#scimReplaceUserAttributes) | **PUT** /v1/provisioning/scim/Users/{userId} | Update SCIM user [**searchCouponsAdvancedApplicationWideWithoutTotalCount**](ManagementApi.md#searchCouponsAdvancedApplicationWideWithoutTotalCount) | **POST** /v1/applications/{applicationId}/coupons_search_advanced/no_total | List coupons that match the given attributes (without total count) [**searchCouponsAdvancedWithoutTotalCount**](ManagementApi.md#searchCouponsAdvancedWithoutTotalCount) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total | List coupons that match the given attributes in campaign (without total count) [**transferLoyaltyCard**](ManagementApi.md#transferLoyaltyCard) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transfer | Transfer card data @@ -161,9 +177,9 @@ Method | HTTP request | Description > activateUserByEmail($body) -Activate user by email address +Enable user by email address -Activate a deactivated user by their email address. +Enable a [disabled user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. ### Example @@ -714,6 +730,76 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## createBatchLoyaltyCards + +> \TalonOne\Client\Model\LoyaltyCardBatchResponse createBatchLoyaltyCards($loyaltyProgramId, $body) + +Create loyalty cards + +Create a batch of loyalty cards in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). Customers can use loyalty cards to collect and spend loyalty points. **Important:** - The specified card-based loyalty program must have a defined card code format that is used to generate the loyalty card codes. - Trying to create more than 20,000 loyalty cards in a single request returns an error message with a `400` status code. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$loyaltyProgramId = 56; // int | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. +$body = new \TalonOne\Client\Model\LoyaltyCardBatch(); // \TalonOne\Client\Model\LoyaltyCardBatch | body + +try { + $result = $apiInstance->createBatchLoyaltyCards($loyaltyProgramId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->createBatchLoyaltyCards: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyaltyProgramId** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **body** | [**\TalonOne\Client\Model\LoyaltyCardBatch**](../Model/LoyaltyCardBatch.md)| body | + +### Return type + +[**\TalonOne\Client\Model\LoyaltyCardBatchResponse**](../Model/LoyaltyCardBatchResponse.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## createCampaignFromTemplate > \TalonOne\Client\Model\CreateTemplateCampaignResponse createCampaignFromTemplate($applicationId, $body) @@ -1002,6 +1088,78 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## createCouponsDeletionJob + +> \TalonOne\Client\Model\AsyncCouponDeletionJobResponse createCouponsDeletionJob($applicationId, $campaignId, $body) + +Creates a coupon deletion job + +This endpoint handles creating a job to delete coupons asynchronously. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$campaignId = 56; // int | The ID of the campaign. It is displayed in your Talon.One deployment URL. +$body = new \TalonOne\Client\Model\NewCouponDeletionJob(); // \TalonOne\Client\Model\NewCouponDeletionJob | body + +try { + $result = $apiInstance->createCouponsDeletionJob($applicationId, $campaignId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->createCouponsDeletionJob: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **campaignId** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | + **body** | [**\TalonOne\Client\Model\NewCouponDeletionJob**](../Model/NewCouponDeletionJob.md)| body | + +### Return type + +[**\TalonOne\Client\Model\AsyncCouponDeletionJobResponse**](../Model/AsyncCouponDeletionJobResponse.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## createCouponsForMultipleRecipients > \TalonOne\Client\Model\InlineResponse2008 createCouponsForMultipleRecipients($applicationId, $campaignId, $body, $silent) @@ -1422,9 +1580,9 @@ Name | Type | Description | Notes > deactivateUserByEmail($body) -Deactivate user by email address +Disable user by email address -Deactivate a specific user by their email address. +[Disable a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#disabling-a-user) by their email address. ### Example @@ -1942,10 +2100,10 @@ $campaignId = 56; // int | The ID of the campaign. It is displayed in your Talon $value = 'value_example'; // string | Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. $createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. $createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. -$startsAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. -$startsBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. -$expiresAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. -$expiresBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$startsAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$startsBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$expiresAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$expiresBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. $valid = 'valid_example'; // string | - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. $batchId = 'batchId_example'; // string | Filter results by batches of coupons $usable = 'usable_example'; // string | - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. @@ -1971,10 +2129,10 @@ Name | Type | Description | Notes **value** | **string**| Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. | [optional] **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] **createdAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **startsAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **startsBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **expiresAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **expiresBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **startsAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **startsBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **expiresAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **expiresBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] **valid** | **string**| - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. | [optional] **batchId** | **string**| Filter results by batches of coupons | [optional] **usable** | **string**| - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. | [optional] @@ -2282,7 +2440,7 @@ void (empty response body) Delete user by email address -Delete a specific user by their email address. +[Delete a specific user](https://docs.talon.one/docs/product/account/account-settings/managing-users#deleting-a-user) by their email address. ### Example @@ -2406,6 +2564,75 @@ void (empty response body) [[Back to README]](../../README.md) +## disconnectCampaignStores + +> disconnectCampaignStores($applicationId, $campaignId) + +Disconnect stores + +Disconnect the stores linked to a specific campaign. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$campaignId = 56; // int | The ID of the campaign. It is displayed in your Talon.One deployment URL. + +try { + $apiInstance->disconnectCampaignStores($applicationId, $campaignId); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->disconnectCampaignStores: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **campaignId** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | + +### Return type + +void (empty response body) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## exportAccountCollectionItems > string exportAccountCollectionItems($collectionId) @@ -2614,6 +2841,76 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## exportCampaignStores + +> string exportCampaignStores($applicationId, $campaignId) + +Export stores + +Download a CSV file containing the stores linked to a specific campaign. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following column: - `store_integration_id`: The identifier of the store. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$campaignId = 56; // int | The ID of the campaign. It is displayed in your Talon.One deployment URL. + +try { + $result = $apiInstance->exportCampaignStores($applicationId, $campaignId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportCampaignStores: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **campaignId** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | + +### Return type + +**string** + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/csv + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## exportCollectionItems > string exportCollectionItems($applicationId, $campaignId, $collectionId) @@ -2731,7 +3028,7 @@ $recipientIntegrationId = 'recipientIntegrationId_example'; // string | Filter r $batchId = 'batchId_example'; // string | Filter results by batches of coupons $exactMatch = false; // bool | Filter results to an exact case-insensitive matching against the coupon code. $dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. -$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. +$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. $valuesOnly = false; // bool | Filter results to only return the coupon codes (`value` column) without the associated coupon data. try { @@ -2761,7 +3058,7 @@ Name | Type | Description | Notes **batchId** | **string**| Filter results by batches of coupons | [optional] **exactMatch** | **bool**| Filter results to an exact case-insensitive matching against the coupon code. | [optional] [default to false] **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] - **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. | [optional] + **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] **valuesOnly** | **bool**| Filter results to only return the coupon codes (`value` column) without the associated coupon data. | [optional] [default to false] ### Return type @@ -2866,7 +3163,7 @@ Name | Type | Description | Notes Export customers' tier data -Download a CSV file containing the tier information for customers of the specified loyalty program. The generated file contains the following columns: - `programid`: The identifier of the loyalty program. It is displayed in your Talon.One deployment URL. - `subledgerid`: The ID of the subledger associated with the loyalty program. This column is empty if the loyalty program has no subledger. In this case, refer to the export file name to get the ID of the loyalty program. - `customerprofileid`: The ID used to integrate customer profiles with the loyalty program. - `tiername`: The name of the tier. - `startdate`: The tier start date in RFC3339. - `expirydate`: The tier expiry date in RFC3339. You can filter the results by providing the following optional input parameters: - `subledgerId` (optional): Filter results by subledger ID. If no value is provided, all subledger data for the specified loyalty program will be exported. - `tierName` (optional): Filter results by tier name. If no value is provided, all tier data for the specified loyalty program will be exported. +Download a CSV file containing the tier information for customers of the specified loyalty program. The generated file contains the following columns: - `programid`: The identifier of the loyalty program. It is displayed in your Talon.One deployment URL. - `subledgerid`: The ID of the subledger associated with the loyalty program. This column is empty if the loyalty program has no subledger. In this case, refer to the export file name to get the ID of the loyalty program. - `customerprofileid`: The ID used to integrate customer profiles with the loyalty program. - `tiername`: The name of the tier. - `startdate`: The tier start date in RFC3339. - `expirydate`: The tier expiry date in RFC3339. You can filter the results by providing the following optional input parameters: - `subledgerIds` (optional): Filter results by an array of subledger IDs. If no value is provided, all subledger data for the specified loyalty program will be exported. - `tierNames` (optional): Filter results by an array of tier names. If no value is provided, all tier data for the specified loyalty program will be exported. ### Example @@ -2966,8 +3263,8 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. $campaignId = 3.4; // float | Filter results by campaign. -$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. -$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. +$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. $dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. try { @@ -2986,8 +3283,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | **campaignId** | **float**| Filter results by campaign. | [optional] - **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] - **createdAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **createdAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] ### Return type @@ -3294,13 +3591,83 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## exportLoyaltyLedger +## exportLoyaltyCards + +> string exportLoyaltyCards($loyaltyProgramId, $batchId) + +Export loyalty cards + +Download a CSV file containing the loyalty cards from a specified loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `identifier`: The unique identifier of the loyalty card. - `created`: The date and time the loyalty card was created. - `status`: The status of the loyalty card. - `userpercardlimit`: The maximum number of customer profiles that can be linked to the card. - `customerprofileids`: Integration IDs of the customer profiles linked to the card. - `blockreason`: The reason for transferring and blocking the loyalty card. - `generated`: An indicator of whether the loyalty card was generated. - `batchid`: The ID of the batch the loyalty card is in. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$loyaltyProgramId = 56; // int | Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. +$batchId = 'batchId_example'; // string | Filter results by loyalty card batch ID. + +try { + $result = $apiInstance->exportLoyaltyCards($loyaltyProgramId, $batchId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportLoyaltyCards: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyaltyProgramId** | **int**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **batchId** | **string**| Filter results by loyalty card batch ID. | [optional] + +### Return type + +**string** + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/csv + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## exportLoyaltyLedger > string exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat) Export customer's transaction logs -Download a CSV file containing a customer's transaction logs in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `customerprofileid`: The ID of the profile. - `customersessionid`: The ID of the customer session. - `rulesetid`: The ID of the rule set. - `rulename`: The name of the rule. - `programid`: The ID of the loyalty program. - `type`: The type of the loyalty program. - `name`: The name of the loyalty program. - `subledgerid`: The ID of the subledger, when applicable. - `startdate`: The start date of the program. - `expirydate`: The expiration date of the program. - `id`: The ID of the transaction. - `created`: The timestamp of the creation of the loyalty program. - `amount`: The number of points in that transaction. - `archived`: Whether the session related to the transaction is archived. - `campaignid`: The ID of the campaign. +Download a CSV file containing a customer's transaction logs in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `customerprofileid`: The ID of the profile. - `customersessionid`: The ID of the customer session. - `rulesetid`: The ID of the rule set. - `rulename`: The name of the rule. - `programid`: The ID of the loyalty program. - `type`: The transaction type, such as `addition` or `subtraction`. - `name`: The reason for the transaction. - `subledgerid`: The ID of the subledger, when applicable. - `startdate`: The start date of the program. - `expirydate`: The expiration date of the program. - `id`: The ID of the transaction. - `created`: The timestamp of the creation of the loyalty program. - `amount`: The number of points in that transaction. - `archived`: Whether the session related to the transaction is archived. - `campaignid`: The ID of the campaign. ### Example @@ -5489,7 +5856,7 @@ $body = new \TalonOne\Client\Model\CampaignSearch(); // \TalonOne\Client\Model\C $pageSize = 1000; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. $sort = 'sort_example'; // string | The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. -$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. +$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. try { $result = $apiInstance->getCampaignByAttributes($applicationId, $body, $pageSize, $skip, $sort, $campaignState); @@ -5510,7 +5877,7 @@ Name | Type | Description | Notes **pageSize** | **int**| The number of items in the response. | [optional] [default to 1000] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] **sort** | **string**| The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. | [optional] - **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. | [optional] + **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] ### Return type @@ -5786,7 +6153,7 @@ $applicationId = 56; // int | The ID of the Application. It is displayed in your $pageSize = 1000; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. $sort = 'sort_example'; // string | The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. -$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. +$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. $name = 'name_example'; // string | Filter results performing case-insensitive matching against the name of the campaign. $tags = 'tags_example'; // string | Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values $createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. @@ -5813,7 +6180,7 @@ Name | Type | Description | Notes **pageSize** | **int**| The number of items in the response. | [optional] [default to 1000] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] **sort** | **string**| The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. | [optional] - **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. | [optional] + **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] **name** | **string**| Filter results performing case-insensitive matching against the name of the campaign. | [optional] **tags** | **string**| Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values | [optional] **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] @@ -6074,7 +6441,7 @@ Name | Type | Description | Notes ## getCouponsWithoutTotalCount -> \TalonOne\Client\Model\InlineResponse2009 getCouponsWithoutTotalCount($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch) +> \TalonOne\Client\Model\InlineResponse2009 getCouponsWithoutTotalCount($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $redeemed, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $expiresBefore, $expiresAfter, $startsBefore, $startsAfter, $valuesOnly) List coupons @@ -6114,13 +6481,19 @@ $createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filt $createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. $valid = 'valid_example'; // string | Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. $usable = 'usable_example'; // string | Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. +$redeemed = 'redeemed_example'; // string | - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. $referralId = 56; // int | Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. $recipientIntegrationId = 'recipientIntegrationId_example'; // string | Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field $batchId = 'batchId_example'; // string | Filter results by batches of coupons $exactMatch = false; // bool | Filter results to an exact case-insensitive matching against the coupon code +$expiresBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$expiresAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$startsBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$startsAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$valuesOnly = false; // bool | Filter results to only return the coupon codes (`value` column) without the associated coupon data. try { - $result = $apiInstance->getCouponsWithoutTotalCount($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); + $result = $apiInstance->getCouponsWithoutTotalCount($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $redeemed, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $expiresBefore, $expiresAfter, $startsBefore, $startsAfter, $valuesOnly); print_r($result); } catch (Exception $e) { echo 'Exception when calling ManagementApi->getCouponsWithoutTotalCount: ', $e->getMessage(), PHP_EOL; @@ -6143,10 +6516,16 @@ Name | Type | Description | Notes **createdAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] **valid** | **string**| Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. | [optional] **usable** | **string**| Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. | [optional] + **redeemed** | **string**| - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. | [optional] **referralId** | **int**| Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. | [optional] **recipientIntegrationId** | **string**| Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field | [optional] **batchId** | **string**| Filter results by batches of coupons | [optional] **exactMatch** | **bool**| Filter results to an exact case-insensitive matching against the coupon code | [optional] [default to false] + **expiresBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **expiresAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **startsBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **startsAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **valuesOnly** | **bool**| Filter results to only return the coupon codes (`value` column) without the associated coupon data. | [optional] [default to false] ### Return type @@ -7002,7 +7381,7 @@ Name | Type | Description | Notes ## getLoyaltyCards -> \TalonOne\Client\Model\InlineResponse20015 getLoyaltyCards($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId) +> \TalonOne\Client\Model\InlineResponse20015 getLoyaltyCards($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId, $batchId) List loyalty cards @@ -7036,11 +7415,12 @@ $loyaltyProgramId = 56; // int | Identifier of the card-based loyalty program co $pageSize = 1000; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. $sort = 'sort_example'; // string | The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. -$identifier = 'identifier_example'; // string | Optional query parameter to search cards by identifier. -$profileId = 56; // int | Filter by the profile ID. +$identifier = 'identifier_example'; // string | The card code by which to filter loyalty cards in the response. +$profileId = 56; // int | Filter results by customer profile ID. +$batchId = 'batchId_example'; // string | Filter results by loyalty card batch ID. try { - $result = $apiInstance->getLoyaltyCards($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); + $result = $apiInstance->getLoyaltyCards($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId, $batchId); print_r($result); } catch (Exception $e) { echo 'Exception when calling ManagementApi->getLoyaltyCards: ', $e->getMessage(), PHP_EOL; @@ -7057,8 +7437,9 @@ Name | Type | Description | Notes **pageSize** | **int**| The number of items in the response. | [optional] [default to 1000] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] **sort** | **string**| The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. | [optional] - **identifier** | **string**| Optional query parameter to search cards by identifier. | [optional] - **profileId** | **int**| Filter by the profile ID. | [optional] + **identifier** | **string**| The card code by which to filter loyalty cards in the response. | [optional] + **profileId** | **int**| Filter results by customer profile ID. | [optional] + **batchId** | **string**| Filter results by loyalty card batch ID. | [optional] ### Return type @@ -8212,7 +8593,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationIds = 'applicationIds_example'; // string | Filter by one or more Application IDs, separated by a comma. +$applicationIds = 'applicationIds_example'; // string | Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. $sort = 'sort_example'; // string | The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. $pageSize = 1000; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. @@ -8235,7 +8616,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationIds** | **string**| Filter by one or more Application IDs, separated by a comma. | [optional] + **applicationIds** | **string**| Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. | [optional] **sort** | **string**| The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. | [optional] **pageSize** | **int**| The number of items in the response. | [optional] [default to 1000] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] @@ -8472,6 +8853,78 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## importCampaignStores + +> \TalonOne\Client\Model\Import importCampaignStores($applicationId, $campaignId, $upFile) + +Import stores + +Upload a CSV file containing the stores you want to link to a specific campaign. Send the file as multipart data. The CSV file **must** only contain the following column: - `store_integration_id`: The identifier of the store. The import **replaces** the previous list of stores linked to the campaign. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$campaignId = 56; // int | The ID of the campaign. It is displayed in your Talon.One deployment URL. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. + +try { + $result = $apiInstance->importCampaignStores($applicationId, $campaignId, $upFile); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->importCampaignStores: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **campaignId** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | + **upFile** | **string**| The file containing the data that is being imported. | [optional] + +### Return type + +[**\TalonOne\Client\Model\Import**](../Model/Import.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## importCollection > \TalonOne\Client\Model\Import importCollection($applicationId, $campaignId, $collectionId, $upFile) @@ -8696,7 +9149,7 @@ Name | Type | Description | Notes Import customers into loyalty tiers -Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. **Important:** This endpoint only works with loyalty programs with advanced tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. **Note:** We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` +Upload a CSV file containing existing customers to be assigned to existing tiers. Send the file as multipart data. **Important:** This endpoint only works with loyalty programs with advanced tiers (with expiration and downgrade policy) feature enabled. The CSV file should contain the following columns: - `subledgerid` (optional): The ID of the subledger. If this field is empty, the main ledger will be used. - `customerprofileid`: The integration ID of the customer profile to whom the tier should be assigned. - `tiername`: The name of an existing tier to assign to the customer. - `expirydate`: The expiration date of the tier when the tier is reevaluated. It should be a future date. About customer assignment to a tier: - If the customer isn't already in a tier, the customer is assigned to the specified tier during the tier import. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. **Note:** We recommend not using this endpoint to update the tier of a customer. To update a customer's tier, you can [add](/management-api#tag/Loyalty/operation/addLoyaltyPoints) or [deduct](/management-api#tag/Loyalty/operation/removeLoyaltyPoints) their loyalty points. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv subledgerid,customerprofileid,tiername,expirydate SUB1,alexa,Gold,2024-03-21T07:32:14Z ,george,Silver,2025-04-16T21:12:37Z SUB2,avocado,Bronze,2026-05-03T11:47:01Z ``` ### Example @@ -8978,7 +9431,7 @@ Name | Type | Description | Notes Invite user from identity provider -Invite a user from an external identity provider to Talon.One by sending an invitation to their email address. +[Invite a user](https://docs.talon.one/docs/product/account/account-settings/managing-users#inviting-a-user) from an external identity provider to Talon.One by sending an invitation to their email address. ### Example @@ -9644,6 +10097,69 @@ void (empty response body) [[Back to README]](../../README.md) +## oktaEventHandlerChallenge + +> oktaEventHandlerChallenge() + +Validate Okta API ownership + +Validate the ownership of the API through a challenge-response mechanism. This challenger endpoint is used by Okta to confirm that communication between Talon.One and Okta is correctly configured and accessible for provisioning and deprovisioning of Talon.One users, and that only Talon.One can receive and respond to events from Okta. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->oktaEventHandlerChallenge(); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->oktaEventHandlerChallenge: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## postAddedDeductedPointsNotification > \TalonOne\Client\Model\BaseNotification postAddedDeductedPointsNotification($loyaltyProgramId, $body) @@ -9993,6 +10509,605 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## scimCreateUser + +> \TalonOne\Client\Model\ScimUser scimCreateUser($body) + +Create SCIM user + +Create a new Talon.One user using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \TalonOne\Client\Model\ScimNewUser(); // \TalonOne\Client\Model\ScimNewUser | body + +try { + $result = $apiInstance->scimCreateUser($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimCreateUser: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\TalonOne\Client\Model\ScimNewUser**](../Model/ScimNewUser.md)| body | + +### Return type + +[**\TalonOne\Client\Model\ScimUser**](../Model/ScimUser.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimDeleteUser + +> scimDeleteUser($userId) + +Delete SCIM user + +Delete a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$userId = 56; // int | The ID of the user. + +try { + $apiInstance->scimDeleteUser($userId); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimDeleteUser: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **int**| The ID of the user. | + +### Return type + +void (empty response body) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimGetResourceTypes + +> \TalonOne\Client\Model\ScimResourceTypesListResponse scimGetResourceTypes() + +List supported SCIM resource types + +Retrieve a list of resource types supported by the SCIM provisioning protocol. Resource types define the various kinds of resources that can be managed via the SCIM API, such as users, groups, or custom-defined resources. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->scimGetResourceTypes(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimGetResourceTypes: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\TalonOne\Client\Model\ScimResourceTypesListResponse**](../Model/ScimResourceTypesListResponse.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimGetSchemas + +> \TalonOne\Client\Model\ScimSchemasListResponse scimGetSchemas() + +List supported SCIM schemas + +Retrieve a list of schemas supported by the SCIM provisioning protocol. Schemas define the structure and attributes of the different resources that can be managed via the SCIM API, such as users, groups, and any custom-defined resources. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->scimGetSchemas(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimGetSchemas: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\TalonOne\Client\Model\ScimSchemasListResponse**](../Model/ScimSchemasListResponse.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimGetServiceProviderConfig + +> \TalonOne\Client\Model\ScimServiceProviderConfigResponse scimGetServiceProviderConfig() + +Get SCIM service provider configuration + +Retrieve the configuration settings of the SCIM service provider. It provides details about the features and capabilities supported by the SCIM API, such as the different operation settings. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->scimGetServiceProviderConfig(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimGetServiceProviderConfig: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\TalonOne\Client\Model\ScimServiceProviderConfigResponse**](../Model/ScimServiceProviderConfigResponse.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimGetUser + +> \TalonOne\Client\Model\ScimUser scimGetUser($userId) + +Get SCIM user + +Retrieve data for a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$userId = 56; // int | The ID of the user. + +try { + $result = $apiInstance->scimGetUser($userId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimGetUser: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **int**| The ID of the user. | + +### Return type + +[**\TalonOne\Client\Model\ScimUser**](../Model/ScimUser.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimGetUsers + +> \TalonOne\Client\Model\ScimUsersListResponse scimGetUsers() + +List SCIM users + +Retrieve a paginated list of users that have been provisioned using the SCIM protocol with an identity provider, for example, Microsoft Entra ID. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->scimGetUsers(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimGetUsers: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\TalonOne\Client\Model\ScimUsersListResponse**](../Model/ScimUsersListResponse.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimPatchUser + +> \TalonOne\Client\Model\ScimUser scimPatchUser($userId, $body) + +Update SCIM user attributes + +Update certain attributes of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint allows for selective adding, removing, or replacing specific attributes while leaving other attributes unchanged. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$userId = 56; // int | The ID of the user. +$body = new \TalonOne\Client\Model\ScimPatchRequest(); // \TalonOne\Client\Model\ScimPatchRequest | body + +try { + $result = $apiInstance->scimPatchUser($userId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimPatchUser: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **int**| The ID of the user. | + **body** | [**\TalonOne\Client\Model\ScimPatchRequest**](../Model/ScimPatchRequest.md)| body | + +### Return type + +[**\TalonOne\Client\Model\ScimUser**](../Model/ScimUser.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## scimReplaceUserAttributes + +> \TalonOne\Client\Model\ScimUser scimReplaceUserAttributes($userId, $body) + +Update SCIM user + +Update the details of a specific Talon.One user created using the SCIM provisioning protocol with an identity provider, for example, Microsoft Entra ID. This endpoint replaces all attributes of the specific user with the attributes provided in the request payload. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$userId = 56; // int | The ID of the user. +$body = new \TalonOne\Client\Model\ScimNewUser(); // \TalonOne\Client\Model\ScimNewUser | body + +try { + $result = $apiInstance->scimReplaceUserAttributes($userId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->scimReplaceUserAttributes: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **int**| The ID of the user. | + **body** | [**\TalonOne\Client\Model\ScimNewUser**](../Model/ScimNewUser.md)| body | + +### Return type + +[**\TalonOne\Client\Model\ScimUser**](../Model/ScimUser.md) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## searchCouponsAdvancedApplicationWideWithoutTotalCount > \TalonOne\Client\Model\InlineResponse2009 searchCouponsAdvancedApplicationWideWithoutTotalCount($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState) @@ -10039,7 +11154,7 @@ $referralId = 56; // int | Filter the results by matching them with the ID of a $recipientIntegrationId = 'recipientIntegrationId_example'; // string | Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field $batchId = 'batchId_example'; // string | Filter results by batches of coupons $exactMatch = false; // bool | Filter results to an exact case-insensitive matching against the coupon code -$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. +$campaignState = 'campaignState_example'; // string | Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. try { $result = $apiInstance->searchCouponsAdvancedApplicationWideWithoutTotalCount($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState); @@ -10069,7 +11184,7 @@ Name | Type | Description | Notes **recipientIntegrationId** | **string**| Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field | [optional] **batchId** | **string**| Filter results by batches of coupons | [optional] **exactMatch** | **bool**| Filter results to an exact case-insensitive matching against the coupon code | [optional] [default to false] - **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. | [optional] + **campaignState** | **string**| Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. | [optional] ### Return type @@ -10692,7 +11807,7 @@ Name | Type | Description | Notes Update coupon -Update the specified coupon.

Important

With this PUT endpoint only, any property you do not explicitly set in your request will be set to null.

+Update the specified coupon.

Important

With this PUT endpoint alone, if you do not explicitly set a value for the startDate, expiryDate, and recipientIntegrationId properties in your request, it is automatically set to null.

### Example diff --git a/docs/Model/AchievementProgress.md b/docs/Model/AchievementProgress.md index f50b3508..ab4b017c 100644 --- a/docs/Model/AchievementProgress.md +++ b/docs/Model/AchievementProgress.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **achievementId** | **int** | The internal ID of the achievement. | **name** | **string** | The internal name of the achievement used in API requests. | **title** | **string** | The display name of the achievement in the Campaign Manager. | +**description** | **string** | The description of the achievement in the Campaign Manager. | **campaignId** | **int** | The ID of the campaign the achievement belongs to. | **status** | **string** | The status of the achievement. | **target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | [optional] diff --git a/docs/Model/AdditionalCampaignProperties.md b/docs/Model/AdditionalCampaignProperties.md index 92ca3e4c..ca8e02d7 100644 --- a/docs/Model/AdditionalCampaignProperties.md +++ b/docs/Model/AdditionalCampaignProperties.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **updatedBy** | **string** | Name of the user who last updated this campaign if available. | [optional] **templateId** | **int** | The ID of the Campaign Template this Campaign was created from. | [optional] **frontendState** | **string** | A campaign state described exactly as in the Campaign Manager. | +**storesImported** | **bool** | Indicates whether the linked stores were imported via a CSV file. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CampaignSetIDs.md b/docs/Model/AnalyticsDataPoint.md similarity index 77% rename from docs/Model/CampaignSetIDs.md rename to docs/Model/AnalyticsDataPoint.md index 4c109670..c58eec05 100644 --- a/docs/Model/CampaignSetIDs.md +++ b/docs/Model/AnalyticsDataPoint.md @@ -1,10 +1,11 @@ -# # CampaignSetIDs +# # AnalyticsDataPoint ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**campaignId** | **int** | ID of the campaign | [optional] +**total** | **float** | | +**influenced** | **float** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationCampaignAnalyticsCouponsCount.md b/docs/Model/AnalyticsDataPointWithTrend.md similarity index 69% rename from docs/Model/ApplicationCampaignAnalyticsCouponsCount.md rename to docs/Model/AnalyticsDataPointWithTrend.md index e6adca87..deddbb4c 100644 --- a/docs/Model/ApplicationCampaignAnalyticsCouponsCount.md +++ b/docs/Model/AnalyticsDataPointWithTrend.md @@ -1,11 +1,11 @@ -# # ApplicationCampaignAnalyticsCouponsCount +# # AnalyticsDataPointWithTrend ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **float** | | [optional] -**trend** | **float** | | [optional] +**value** | **float** | | +**trend** | **float** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.md b/docs/Model/AnalyticsDataPointWithTrendAndInfluencedRate.md similarity index 66% rename from docs/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.md rename to docs/Model/AnalyticsDataPointWithTrendAndInfluencedRate.md index c50b6d80..ba31e9ee 100644 --- a/docs/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.md +++ b/docs/Model/AnalyticsDataPointWithTrendAndInfluencedRate.md @@ -1,11 +1,12 @@ -# # ApplicationAnalyticsDataPointAvgItemsPerSession +# # AnalyticsDataPointWithTrendAndInfluencedRate ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **float** | | [optional] -**influenced** | **float** | | [optional] +**value** | **float** | | +**influencedRate** | **float** | | +**trend** | **float** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalyticsDataPointWithTrendAndUplift.md b/docs/Model/AnalyticsDataPointWithTrendAndUplift.md new file mode 100644 index 00000000..cf49f7fd --- /dev/null +++ b/docs/Model/AnalyticsDataPointWithTrendAndUplift.md @@ -0,0 +1,13 @@ +# # AnalyticsDataPointWithTrendAndUplift + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | | +**uplift** | **float** | | +**trend** | **float** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Application.md b/docs/Model/Application.md index 85bc8215..69fc9546 100644 --- a/docs/Model/Application.md +++ b/docs/Model/Application.md @@ -23,6 +23,8 @@ Name | Type | Description | Notes **enablePartialDiscounts** | **bool** | Indicates if this Application supports partial discounts. | [optional] **defaultDiscountAdditionalCostPerItemScope** | **string** | The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. | [optional] **defaultEvaluationGroupId** | **int** | The ID of the default campaign evaluation group to which new campaigns will be added unless a different group is selected when creating the campaign. | [optional] +**defaultCartItemFilterId** | **int** | The ID of the default Cart-Item-Filter for this application. | [optional] +**enableCampaignStateManagement** | **bool** | Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. | [optional] **loyaltyPrograms** | [**\TalonOne\Client\Model\LoyaltyProgram[]**](LoyaltyProgram.md) | An array containing all the loyalty programs to which this application is subscribed. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationAnalyticsDataPoint.md b/docs/Model/ApplicationAnalyticsDataPoint.md index af25794e..4d0c7d3e 100644 --- a/docs/Model/ApplicationAnalyticsDataPoint.md +++ b/docs/Model/ApplicationAnalyticsDataPoint.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**startTime** | [**\DateTime**](\DateTime.md) | The start of the aggregation time frame in UTC. | [optional] -**endTime** | [**\DateTime**](\DateTime.md) | The end of the aggregation time frame in UTC. | [optional] -**totalRevenue** | [**\TalonOne\Client\Model\ApplicationAnalyticsDataPointTotalRevenue**](ApplicationAnalyticsDataPointTotalRevenue.md) | | [optional] -**sessionsCount** | [**\TalonOne\Client\Model\ApplicationAnalyticsDataPointSessionsCount**](ApplicationAnalyticsDataPointSessionsCount.md) | | [optional] -**avgItemsPerSession** | [**\TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgItemsPerSession**](ApplicationAnalyticsDataPointAvgItemsPerSession.md) | | [optional] -**avgSessionValue** | [**\TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgSessionValue**](ApplicationAnalyticsDataPointAvgSessionValue.md) | | [optional] +**startTime** | [**\DateTime**](\DateTime.md) | The start of the aggregation time frame in UTC. | +**endTime** | [**\DateTime**](\DateTime.md) | The end of the aggregation time frame in UTC. | +**totalRevenue** | [**\TalonOne\Client\Model\AnalyticsDataPoint**](AnalyticsDataPoint.md) | | [optional] +**sessionsCount** | [**\TalonOne\Client\Model\AnalyticsDataPoint**](AnalyticsDataPoint.md) | | [optional] +**avgItemsPerSession** | [**\TalonOne\Client\Model\AnalyticsDataPoint**](AnalyticsDataPoint.md) | | [optional] +**avgSessionValue** | [**\TalonOne\Client\Model\AnalyticsDataPoint**](AnalyticsDataPoint.md) | | [optional] **totalDiscounts** | **float** | The total value of discounts given for cart items in influenced sessions. | [optional] **couponsCount** | **float** | The number of times a coupon was successfully redeemed in influenced sessions. | [optional] diff --git a/docs/Model/ApplicationCIF.md b/docs/Model/ApplicationCIF.md new file mode 100644 index 00000000..8dfcdbe8 --- /dev/null +++ b/docs/Model/ApplicationCIF.md @@ -0,0 +1,19 @@ +# # ApplicationCIF + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Internal ID of this entity. | +**created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | +**name** | **string** | The name of the Application cart item filter used in API requests. | +**description** | **string** | A short description of the Application cart item filter. | [optional] +**activeExpressionId** | **int** | The ID of the expression that the Application cart item filter uses. | [optional] +**modifiedBy** | **int** | The ID of the user who last updated the Application cart item filter. | [optional] +**createdBy** | **int** | The ID of the user who created the Application cart item filter. | [optional] +**modified** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent update to the Application cart item filter. | [optional] +**applicationId** | **int** | The ID of the application that owns this entity. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/NotificationWebhook.md b/docs/Model/ApplicationCIFExpression.md similarity index 58% rename from docs/Model/NotificationWebhook.md rename to docs/Model/ApplicationCIFExpression.md index f944d003..99731179 100644 --- a/docs/Model/NotificationWebhook.md +++ b/docs/Model/ApplicationCIFExpression.md @@ -1,4 +1,4 @@ -# # NotificationWebhook +# # ApplicationCIFExpression ## Properties @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Internal ID of this entity. | **created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | -**modified** | [**\DateTime**](\DateTime.md) | The time this entity was last modified. | +**cartItemFilterId** | **int** | The ID of the Application cart item filter. | [optional] +**createdBy** | **int** | The ID of the user who created the Application cart item filter. | [optional] +**expression** | **object[]** | Arbitrary additional JSON data associated with the Application cart item filter. | [optional] **applicationId** | **int** | The ID of the application that owns this entity. | -**url** | **string** | API URL for the given webhook-based notification. | -**headers** | **string[]** | List of API HTTP headers for the given webhook-based notification. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationCampaignAnalytics.md b/docs/Model/ApplicationCampaignAnalytics.md index 9ca07946..7df0deab 100644 --- a/docs/Model/ApplicationCampaignAnalytics.md +++ b/docs/Model/ApplicationCampaignAnalytics.md @@ -4,21 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**startTime** | [**\DateTime**](\DateTime.md) | The start of the aggregation time frame in UTC. | [optional] -**endTime** | [**\DateTime**](\DateTime.md) | The end of the aggregation time frame in UTC. | [optional] -**campaignId** | **int** | The ID of the campaign. | [optional] -**campaignName** | **string** | The name of the campaign. | [optional] -**campaignTags** | **string[]** | A list of tags for the campaign. | [optional] -**campaignState** | **string** | The state of the campaign. **Note:** A disabled or archived campaign is not evaluated for rules or coupons. | [optional] [default to 'enabled'] -**campaignActiveRulesetId** | **int** | The [ID of the ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. | [optional] -**campaignStartTime** | [**\DateTime**](\DateTime.md) | Date and time when the campaign becomes active. | [optional] -**campaignEndTime** | [**\DateTime**](\DateTime.md) | Date and time when the campaign becomes inactive. | [optional] -**totalRevenue** | [**\TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalRevenue**](ApplicationCampaignAnalyticsTotalRevenue.md) | | [optional] -**sessionsCount** | [**\TalonOne\Client\Model\ApplicationCampaignAnalyticsSessionsCount**](ApplicationCampaignAnalyticsSessionsCount.md) | | [optional] -**avgItemsPerSession** | [**\TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgItemsPerSession**](ApplicationCampaignAnalyticsAvgItemsPerSession.md) | | [optional] -**avgSessionValue** | [**\TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgSessionValue**](ApplicationCampaignAnalyticsAvgSessionValue.md) | | [optional] -**totalDiscounts** | [**\TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalDiscounts**](ApplicationCampaignAnalyticsTotalDiscounts.md) | | [optional] -**couponsCount** | [**\TalonOne\Client\Model\ApplicationCampaignAnalyticsCouponsCount**](ApplicationCampaignAnalyticsCouponsCount.md) | | [optional] +**startTime** | [**\DateTime**](\DateTime.md) | The start of the aggregation time frame in UTC. | +**endTime** | [**\DateTime**](\DateTime.md) | The end of the aggregation time frame in UTC. | +**campaignId** | **int** | The ID of the campaign. | +**campaignName** | **string** | The name of the campaign. | +**campaignTags** | **string[]** | A list of tags for the campaign. | +**campaignState** | **string** | The state of the campaign. **Note:** A disabled or archived campaign is not evaluated for rules or coupons. | +**totalRevenue** | [**\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate**](AnalyticsDataPointWithTrendAndInfluencedRate.md) | | [optional] +**sessionsCount** | [**\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate**](AnalyticsDataPointWithTrendAndInfluencedRate.md) | | [optional] +**avgItemsPerSession** | [**\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift**](AnalyticsDataPointWithTrendAndUplift.md) | | [optional] +**avgSessionValue** | [**\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift**](AnalyticsDataPointWithTrendAndUplift.md) | | [optional] +**totalDiscounts** | [**\TalonOne\Client\Model\AnalyticsDataPointWithTrend**](AnalyticsDataPointWithTrend.md) | | [optional] +**couponsCount** | [**\TalonOne\Client\Model\AnalyticsDataPointWithTrend**](AnalyticsDataPointWithTrend.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.md b/docs/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.md deleted file mode 100644 index f92588e3..00000000 --- a/docs/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.md +++ /dev/null @@ -1,13 +0,0 @@ -# # ApplicationCampaignAnalyticsAvgItemsPerSession - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **float** | | [optional] -**uplift** | **float** | | [optional] -**trend** | **float** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ApplicationCampaignAnalyticsAvgSessionValue.md b/docs/Model/ApplicationCampaignAnalyticsAvgSessionValue.md deleted file mode 100644 index 43afda69..00000000 --- a/docs/Model/ApplicationCampaignAnalyticsAvgSessionValue.md +++ /dev/null @@ -1,13 +0,0 @@ -# # ApplicationCampaignAnalyticsAvgSessionValue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **float** | | [optional] -**uplift** | **float** | | [optional] -**trend** | **float** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ApplicationCampaignAnalyticsSessionsCount.md b/docs/Model/ApplicationCampaignAnalyticsSessionsCount.md deleted file mode 100644 index 78c864a2..00000000 --- a/docs/Model/ApplicationCampaignAnalyticsSessionsCount.md +++ /dev/null @@ -1,13 +0,0 @@ -# # ApplicationCampaignAnalyticsSessionsCount - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **float** | | [optional] -**influenceRate** | **float** | | [optional] -**trend** | **float** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ApplicationCampaignAnalyticsTotalRevenue.md b/docs/Model/ApplicationCampaignAnalyticsTotalRevenue.md deleted file mode 100644 index 7b03cb01..00000000 --- a/docs/Model/ApplicationCampaignAnalyticsTotalRevenue.md +++ /dev/null @@ -1,13 +0,0 @@ -# # ApplicationCampaignAnalyticsTotalRevenue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **float** | | [optional] -**influenceRate** | **float** | | [optional] -**trend** | **float** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ApplicationCampaignStats.md b/docs/Model/ApplicationCampaignStats.md index 35d37ff9..a6f3dd6d 100644 --- a/docs/Model/ApplicationCampaignStats.md +++ b/docs/Model/ApplicationCampaignStats.md @@ -4,7 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**draft** | **int** | Number of draft campaigns. | **disabled** | **int** | Number of disabled campaigns. | **scheduled** | **int** | Number of scheduled campaigns. | **running** | **int** | Number of running campaigns. | diff --git a/docs/Model/AccountDashboardStatisticApiCalls.md b/docs/Model/AsyncCouponDeletionJobResponse.md similarity index 59% rename from docs/Model/AccountDashboardStatisticApiCalls.md rename to docs/Model/AsyncCouponDeletionJobResponse.md index 3dc305ed..b6223e2c 100644 --- a/docs/Model/AccountDashboardStatisticApiCalls.md +++ b/docs/Model/AsyncCouponDeletionJobResponse.md @@ -1,11 +1,10 @@ -# # AccountDashboardStatisticApiCalls +# # AsyncCouponDeletionJobResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **float** | Total number of API calls received. | -**datetime** | [**\DateTime**](\DateTime.md) | Values aggregated for the specified date. | +**id** | **int** | Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseCampaignForNotification.md b/docs/Model/BaseCampaignForNotification.md deleted file mode 100644 index 6ef55f29..00000000 --- a/docs/Model/BaseCampaignForNotification.md +++ /dev/null @@ -1,26 +0,0 @@ -# # BaseCampaignForNotification - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | A user-facing name for this campaign. | -**description** | **string** | A detailed description of the campaign. | [optional] -**startTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become active. | [optional] -**endTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become inactive. | [optional] -**attributes** | [**object**](.md) | Arbitrary properties associated with this campaign. | [optional] -**state** | **string** | A disabled or archived campaign is not evaluated for rules or coupons. | [default to 'enabled'] -**activeRulesetId** | **int** | [ID of Ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. | [optional] -**tags** | **string[]** | A list of tags for the campaign. | -**features** | **string[]** | The features enabled in this campaign. | -**couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**referralSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. | -**campaignGroups** | **int[]** | The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. | [optional] -**evaluationGroupId** | **int** | The ID of the campaign evaluation group the campaign belongs to. | [optional] -**type** | **string** | The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. | [optional] [default to 'advanced'] -**linkedStoreIds** | **int[]** | A list of store IDs that are linked to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/BaseLoyaltyProgram.md b/docs/Model/BaseLoyaltyProgram.md index 6cccb5be..a1f15d7b 100644 --- a/docs/Model/BaseLoyaltyProgram.md +++ b/docs/Model/BaseLoyaltyProgram.md @@ -12,10 +12,12 @@ Name | Type | Description | Notes **allowSubledger** | **bool** | Indicates if this program supports subledgers inside the program. | [optional] **usersPerCardLimit** | **int** | The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. | [optional] **sandbox** | **bool** | Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type. | [optional] -**tiersExpirationPolicy** | **string** | The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. | [optional] -**tiersExpireIn** | **string** | The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] -**tiersDowngradePolicy** | **string** | Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. | [optional] **programJoinPolicy** | **string** | The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. | [optional] +**tiersExpirationPolicy** | **string** | The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. | [optional] +**tierCycleStartDate** | [**\DateTime**](\DateTime.md) | Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. | [optional] +**tiersExpireIn** | **string** | The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] +**tiersDowngradePolicy** | **string** | The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. | [optional] +**cardCodeSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseNotification.md b/docs/Model/BaseNotification.md index 50fbe2a0..3ee30491 100644 --- a/docs/Model/BaseNotification.md +++ b/docs/Model/BaseNotification.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | [**object**](.md) | | +**policy** | [**object**](.md) | Indicates which notification properties to apply. | **enabled** | **bool** | Indicates whether the notification is activated. | [optional] [default to true] **webhook** | [**\TalonOne\Client\Model\BaseNotificationWebhook**](BaseNotificationWebhook.md) | | **id** | **int** | Unique ID for this entity. | diff --git a/docs/Model/BaseNotificationEntity.md b/docs/Model/BaseNotificationEntity.md index 83f5014c..01bdb8b0 100644 --- a/docs/Model/BaseNotificationEntity.md +++ b/docs/Model/BaseNotificationEntity.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | [**object**](.md) | | +**policy** | [**object**](.md) | Indicates which notification properties to apply. | **enabled** | **bool** | Indicates whether the notification is activated. | [optional] [default to true] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Campaign.md b/docs/Model/Campaign.md index 93cd5b3c..b9f4ce43 100644 --- a/docs/Model/Campaign.md +++ b/docs/Model/Campaign.md @@ -45,6 +45,13 @@ Name | Type | Description | Notes **updatedBy** | **string** | Name of the user who last updated this campaign if available. | [optional] **templateId** | **int** | The ID of the Campaign Template this Campaign was created from. | [optional] **frontendState** | **string** | A campaign state described exactly as in the Campaign Manager. | +**storesImported** | **bool** | Indicates whether the linked stores were imported via a CSV file. | +**activeRevisionId** | **int** | ID of the revision that was last activated on this campaign. | [optional] +**activeRevisionVersionId** | **int** | ID of the revision version that is active on the campaign. | [optional] +**version** | **int** | Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. | [optional] +**currentRevisionId** | **int** | ID of the revision currently being modified for the campaign. | [optional] +**currentRevisionVersionId** | **int** | ID of the latest version applied on the current revision. | [optional] +**stageRevision** | **bool** | Flag for determining whether we use current revision when sending requests with staging API key. | [optional] [default to false] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CampaignCollectionEditedNotification.md b/docs/Model/CampaignCollectionEditedNotification.md new file mode 100644 index 00000000..42dd8184 --- /dev/null +++ b/docs/Model/CampaignCollectionEditedNotification.md @@ -0,0 +1,13 @@ +# # CampaignCollectionEditedNotification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaign** | [**\TalonOne\Client\Model\Campaign**](Campaign.md) | | +**ruleset** | [**\TalonOne\Client\Model\Ruleset**](Ruleset.md) | | [optional] +**collection** | [**\TalonOne\Client\Model\CollectionWithoutPayload**](CollectionWithoutPayload.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/CampaignForNotification.md b/docs/Model/CampaignForNotification.md deleted file mode 100644 index 0554f3ab..00000000 --- a/docs/Model/CampaignForNotification.md +++ /dev/null @@ -1,51 +0,0 @@ -# # CampaignForNotification - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | Unique ID for this entity. | -**created** | [**\DateTime**](\DateTime.md) | The exact moment this entity was created. | -**applicationId** | **int** | The ID of the application that owns this entity. | -**userId** | **int** | The ID of the user associated with this entity. | -**name** | **string** | A user-facing name for this campaign. | -**description** | **string** | A detailed description of the campaign. | -**startTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become active. | [optional] -**endTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become inactive. | [optional] -**attributes** | [**object**](.md) | Arbitrary properties associated with this campaign. | [optional] -**state** | **string** | A disabled or archived campaign is not evaluated for rules or coupons. | [default to 'enabled'] -**activeRulesetId** | **int** | [ID of Ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. | [optional] -**tags** | **string[]** | A list of tags for the campaign. | -**features** | **string[]** | The features enabled in this campaign. | -**couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**referralSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. | -**campaignGroups** | **int[]** | The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. | [optional] -**evaluationGroupId** | **int** | The ID of the campaign evaluation group the campaign belongs to. | [optional] -**type** | **string** | The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. | [default to 'advanced'] -**linkedStoreIds** | **int[]** | A list of store IDs that are linked to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. | [optional] -**budgets** | [**\TalonOne\Client\Model\CampaignBudget[]**](CampaignBudget.md) | A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. | -**couponRedemptionCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. | [optional] -**referralRedemptionCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. | [optional] -**discountCount** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. | [optional] -**discountEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. | [optional] -**couponCreationCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. | [optional] -**customEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. | [optional] -**referralCreationCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. | [optional] -**addFreeItemEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. | [optional] -**awardedGiveawaysCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. | [optional] -**createdLoyaltyPointsCount** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. | [optional] -**createdLoyaltyPointsEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. | [optional] -**redeemedLoyaltyPointsCount** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. | [optional] -**redeemedLoyaltyPointsEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. | [optional] -**callApiEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. | [optional] -**reservecouponEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. | [optional] -**lastActivity** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent event received by this campaign. | [optional] -**updated** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. | [optional] -**createdBy** | **string** | Name of the user who created this campaign if available. | [optional] -**updatedBy** | **string** | Name of the user who last updated this campaign if available. | [optional] -**templateId** | **int** | The ID of the Campaign Template this Campaign was created from. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CampaignNotificationPolicy.md b/docs/Model/CampaignNotificationPolicy.md index 408a15fb..d826eb05 100644 --- a/docs/Model/CampaignNotificationPolicy.md +++ b/docs/Model/CampaignNotificationPolicy.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Notification name. | +**batchingEnabled** | **bool** | Indicates whether batching is activated. | [optional] [default to true] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CampaignPrioritiesChangedNotification.md b/docs/Model/CampaignPrioritiesChangedNotification.md deleted file mode 100644 index dddfe744..00000000 --- a/docs/Model/CampaignPrioritiesChangedNotification.md +++ /dev/null @@ -1,13 +0,0 @@ -# # CampaignPrioritiesChangedNotification - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**applicationId** | **int** | The ID of the Application whose campaigns' priorities changed. | -**oldPriorities** | [**\TalonOne\Client\Model\CampaignSet**](CampaignSet.md) | | [optional] -**priorities** | [**\TalonOne\Client\Model\CampaignSet**](CampaignSet.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CampaignPrioritiesV2.md b/docs/Model/CampaignPrioritiesV2.md deleted file mode 100644 index 1148e6f9..00000000 --- a/docs/Model/CampaignPrioritiesV2.md +++ /dev/null @@ -1,13 +0,0 @@ -# # CampaignPrioritiesV2 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**exclusive** | [**\TalonOne\Client\Model\CampaignSetIDs[]**](CampaignSetIDs.md) | | [optional] -**stackable** | [**\TalonOne\Client\Model\CampaignSetIDs[]**](CampaignSetIDs.md) | | [optional] -**universal** | [**\TalonOne\Client\Model\CampaignSetIDs[]**](CampaignSetIDs.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CampaignStateChangedNotification.md b/docs/Model/CampaignStateChangedNotification.md index a513b60a..d77e3e3b 100644 --- a/docs/Model/CampaignStateChangedNotification.md +++ b/docs/Model/CampaignStateChangedNotification.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **campaign** | [**\TalonOne\Client\Model\Campaign**](Campaign.md) | | -**oldState** | **string** | The campaign's old state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'draft', 'archived'] | -**newState** | **string** | The campaign's new state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'draft', 'archived'] | +**oldState** | **string** | The campaign's old state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] | +**newState** | **string** | The campaign's new state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] | **ruleset** | [**\TalonOne\Client\Model\Ruleset**](Ruleset.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CampaignStateNotification.md b/docs/Model/CampaignStateNotification.md deleted file mode 100644 index 1494655a..00000000 --- a/docs/Model/CampaignStateNotification.md +++ /dev/null @@ -1,52 +0,0 @@ -# # CampaignStateNotification - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | Unique ID for this entity. | -**created** | [**\DateTime**](\DateTime.md) | The exact moment this entity was created. | -**applicationId** | **int** | The ID of the application that owns this entity. | -**userId** | **int** | The ID of the user associated with this entity. | -**name** | **string** | A user-facing name for this campaign. | -**description** | **string** | A detailed description of the campaign. | -**startTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become active. | [optional] -**endTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become inactive. | [optional] -**attributes** | [**object**](.md) | Arbitrary properties associated with this campaign. | [optional] -**state** | **string** | A disabled or archived campaign is not evaluated for rules or coupons. | [default to 'enabled'] -**activeRulesetId** | **int** | [ID of Ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. | [optional] -**tags** | **string[]** | A list of tags for the campaign. | -**features** | **string[]** | The features enabled in this campaign. | -**couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**referralSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] -**limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. | -**campaignGroups** | **int[]** | The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. | [optional] -**evaluationGroupId** | **int** | The ID of the campaign evaluation group the campaign belongs to. | [optional] -**type** | **string** | The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. | [default to 'advanced'] -**linkedStoreIds** | **int[]** | A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. | [optional] -**budgets** | [**\TalonOne\Client\Model\CampaignBudget[]**](CampaignBudget.md) | A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. | -**couponRedemptionCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. | [optional] -**referralRedemptionCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. | [optional] -**discountCount** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. | [optional] -**discountEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. | [optional] -**couponCreationCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. | [optional] -**customEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. | [optional] -**referralCreationCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. | [optional] -**addFreeItemEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. | [optional] -**awardedGiveawaysCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. | [optional] -**createdLoyaltyPointsCount** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. | [optional] -**createdLoyaltyPointsEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. | [optional] -**redeemedLoyaltyPointsCount** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. | [optional] -**redeemedLoyaltyPointsEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. | [optional] -**callApiEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. | [optional] -**reservecouponEffectCount** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. | [optional] -**lastActivity** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent event received by this campaign. | [optional] -**updated** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. | [optional] -**createdBy** | **string** | Name of the user who created this campaign if available. | [optional] -**updatedBy** | **string** | Name of the user who last updated this campaign if available. | [optional] -**templateId** | **int** | The ID of the Campaign Template this Campaign was created from. | [optional] -**frontendState** | **string** | A campaign state described exactly as in the Campaign Manager. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/CampaignSetV2.md b/docs/Model/CampaignStoreBudget.md similarity index 59% rename from docs/Model/CampaignSetV2.md rename to docs/Model/CampaignStoreBudget.md index 1f3c31a6..785308c4 100644 --- a/docs/Model/CampaignSetV2.md +++ b/docs/Model/CampaignStoreBudget.md @@ -1,4 +1,4 @@ -# # CampaignSetV2 +# # CampaignStoreBudget ## Properties @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Internal ID of this entity. | **created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | -**applicationId** | **int** | The ID of the application that owns this entity. | -**version** | **int** | Version of the campaign set. | -**set** | [**\TalonOne\Client\Model\CampaignPrioritiesV2**](CampaignPrioritiesV2.md) | | +**campaignId** | **int** | The ID of the campaign that owns this entity. | +**storeId** | **int** | The ID of the store. | +**limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | The set of budget limits for stores linked to the campaign. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CampaignVersions.md b/docs/Model/CampaignVersions.md new file mode 100644 index 00000000..82a7ca39 --- /dev/null +++ b/docs/Model/CampaignVersions.md @@ -0,0 +1,16 @@ +# # CampaignVersions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activeRevisionId** | **int** | ID of the revision that was last activated on this campaign. | [optional] +**activeRevisionVersionId** | **int** | ID of the revision version that is active on the campaign. | [optional] +**version** | **int** | Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. | [optional] +**currentRevisionId** | **int** | ID of the revision currently being modified for the campaign. | [optional] +**currentRevisionVersionId** | **int** | ID of the latest version applied on the current revision. | [optional] +**stageRevision** | **bool** | Flag for determining whether we use current revision when sending requests with staging API key. | [optional] [default to false] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ApplicationCampaignAnalyticsTotalDiscounts.md b/docs/Model/CardAddedDeductedPointsNotificationPolicy.md similarity index 69% rename from docs/Model/ApplicationCampaignAnalyticsTotalDiscounts.md rename to docs/Model/CardAddedDeductedPointsNotificationPolicy.md index 4163b0e8..3bdce1fa 100644 --- a/docs/Model/ApplicationCampaignAnalyticsTotalDiscounts.md +++ b/docs/Model/CardAddedDeductedPointsNotificationPolicy.md @@ -1,11 +1,11 @@ -# # ApplicationCampaignAnalyticsTotalDiscounts +# # CardAddedDeductedPointsNotificationPolicy ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **float** | | [optional] -**trend** | **float** | | [optional] +**name** | **string** | Notification name. | +**scopes** | **string[]** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CartItem.md b/docs/Model/CartItem.md index 67012ef5..def6628d 100644 --- a/docs/Model/CartItem.md +++ b/docs/Model/CartItem.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **width** | **float** | Width of item in mm. | [optional] **length** | **float** | Length of item in mm. | [optional] **position** | **float** | Position of the Cart Item in the Cart (calculated internally). | [optional] -**attributes** | [**object**](.md) | Use this property to set a value for the attributes of your choice. [Attributes](https://docs.talon.one/docs/dev/concepts/attributes) represent any information to attach to this cart item. Custom _cart item_ attributes must be created in the Campaign Manager before you set them with this property. | [optional] +**attributes** | [**object**](.md) | Use this property to set a value for the attributes of your choice. [Attributes](https://docs.talon.one/docs/dev/concepts/attributes) represent any information to attach to this cart item. Custom _cart item_ attributes must be created in the Campaign Manager before you set them with this property. **Note:** Any previously defined attributes that you do not include in the array will be removed. | [optional] **additionalCosts** | [**map[string,\TalonOne\Client\Model\AdditionalCost]**](AdditionalCost.md) | Use this property to set a value for the additional costs of this item, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). | [optional] **catalogItemID** | **int** | The [catalog item ID](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs/#synchronizing-a-cart-item-catalog). | [optional] diff --git a/docs/Model/CodeGeneratorSettings.md b/docs/Model/CodeGeneratorSettings.md index 14ec52f9..dd5d4945 100644 --- a/docs/Model/CodeGeneratorSettings.md +++ b/docs/Model/CodeGeneratorSettings.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **validCharacters** | **string[]** | List of characters used to generate the random parts of a code. | -**couponPattern** | **string** | The pattern used to generate coupon codes. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. | +**couponPattern** | **string** | The pattern used to generate codes, such as coupon codes, referral codes, and loyalty cards. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Coupon.md b/docs/Model/Coupon.md index 88246daf..b61c759c 100644 --- a/docs/Model/Coupon.md +++ b/docs/Model/Coupon.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. | [optional] **usageCounter** | **int** | The number of times the coupon has been successfully redeemed. | **discountCounter** | **float** | The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon. | [optional] diff --git a/docs/Model/CouponConstraints.md b/docs/Model/CouponConstraints.md index 98e4a5c6..608898df 100644 --- a/docs/Model/CouponConstraints.md +++ b/docs/Model/CouponConstraints.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CouponCreationJob.md b/docs/Model/CouponCreationJob.md index 746bb841..29c9789e 100644 --- a/docs/Model/CouponCreationJob.md +++ b/docs/Model/CouponCreationJob.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **numberOfCoupons** | **int** | The number of new coupon codes to generate for the campaign. | **couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] **attributes** | [**object**](.md) | Arbitrary properties associated with coupons. | diff --git a/docs/Model/CouponDeletionFilters.md b/docs/Model/CouponDeletionFilters.md new file mode 100644 index 00000000..2af56383 --- /dev/null +++ b/docs/Model/CouponDeletionFilters.md @@ -0,0 +1,24 @@ +# # CouponDeletionFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdBefore** | [**\DateTime**](\DateTime.md) | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] +**createdAfter** | [**\DateTime**](\DateTime.md) | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] +**startsAfter** | [**\DateTime**](\DateTime.md) | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] +**startsBefore** | [**\DateTime**](\DateTime.md) | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] +**valid** | **string** | - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which the start date is null or in the past and the expiration date is null or in the future. - `validFuture`: Matches coupons in which the start date is set and in the future. | [optional] +**usable** | **bool** | - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. | [optional] +**redeemed** | **bool** | - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. **Note:** This field cannot be used in conjunction with the `usable` query parameter. | [optional] +**recipientIntegrationId** | **string** | Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. | [optional] +**exactMatch** | **bool** | Filter results to an exact case-insensitive matching against the coupon code | [optional] [default to false] +**value** | **string** | Filter results by the coupon code | [optional] [default to 'false'] +**batchId** | **string** | Filter results by batches of coupons | [optional] +**referralId** | **int** | Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. | [optional] +**expiresAfter** | [**\DateTime**](\DateTime.md) | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] +**expiresBefore** | [**\DateTime**](\DateTime.md) | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/CouponDeletionJob.md b/docs/Model/CouponDeletionJob.md new file mode 100644 index 00000000..781a4f53 --- /dev/null +++ b/docs/Model/CouponDeletionJob.md @@ -0,0 +1,22 @@ +# # CouponDeletionJob + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Internal ID of this entity. | +**created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | +**applicationId** | **int** | The ID of the application that owns this entity. | +**accountId** | **int** | The ID of the account that owns this entity. | +**filters** | [**\TalonOne\Client\Model\CouponDeletionFilters**](CouponDeletionFilters.md) | | +**status** | **string** | The current status of this request. Possible values: - `not_ready` - `pending` - `completed` - `failed` | +**deletedAmount** | **int** | The number of coupon codes that were already deleted for this request. | [optional] +**failCount** | **int** | The number of times this job failed. | +**errors** | **string[]** | An array of individual problems encountered during the request. | +**createdBy** | **int** | ID of the user who created this effect. | +**communicated** | **bool** | Indicates whether the user that created this job was notified of its final state. | +**campaignIDs** | **int[]** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/CustomerSessionV2.md b/docs/Model/CustomerSessionV2.md index d8ce8088..f4cc496d 100644 --- a/docs/Model/CustomerSessionV2.md +++ b/docs/Model/CustomerSessionV2.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **profileId** | **string** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | **storeIntegrationId** | **string** | The integration ID of the store. You choose this ID when you create a store. | [optional] **evaluableCampaignIds** | **int[]** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] -**couponCodes** | **string[]** | Any coupon codes entered. **Important**: If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. | [optional] -**referralCode** | **string** | Any referral code entered. **Important**: If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. | [optional] +**couponCodes** | **string[]** | Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, provide `\"couponCodes\": null` or omit the parameter entirely. | [optional] +**referralCode** | **string** | Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, provide `\"referralCode\": null` or omit the parameter entirely. | [optional] **loyaltyCards** | **string[]** | Identifier of a loyalty card. | [optional] **state** | **string** | Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. Either: - `closed` → `cancelled` (**only** via [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2)) or - `closed` → `partially_returned` (**only** via [Return cart items](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/returnCartItems)) - `closed` → `open` (**only** via [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)) 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). | [default to 'open'] **cartItems** | [**\TalonOne\Client\Model\CartItem[]**](CartItem.md) | The items to add to this session. **Do not exceed 1000 items** and ensure the sum of all cart item's `quantity` **does not exceed 10.000** per request. | diff --git a/docs/Model/Effect.md b/docs/Model/Effect.md index 1c8a1042..90e3045e 100644 --- a/docs/Model/Effect.md +++ b/docs/Model/Effect.md @@ -12,6 +12,10 @@ Name | Type | Description | Notes **triggeredByCoupon** | **int** | The ID of the coupon that was being evaluated when this effect was triggered. | [optional] **triggeredForCatalogItem** | **int** | The ID of the catalog item that was being evaluated when this effect was triggered. | [optional] **conditionIndex** | **int** | The index of the condition that was triggered. | [optional] +**evaluationGroupID** | **int** | The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). | [optional] +**evaluationGroupMode** | **string** | The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). | [optional] +**campaignRevisionId** | **int** | The revision ID of the campaign that was used when triggering the effect. | [optional] +**campaignRevisionVersionId** | **int** | The revision version ID of the campaign that was used when triggering the effect. | [optional] **props** | [**object**](.md) | The properties of the effect. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EffectEntity.md b/docs/Model/EffectEntity.md index c5c4abb3..9845c25a 100644 --- a/docs/Model/EffectEntity.md +++ b/docs/Model/EffectEntity.md @@ -12,6 +12,10 @@ Name | Type | Description | Notes **triggeredByCoupon** | **int** | The ID of the coupon that was being evaluated when this effect was triggered. | [optional] **triggeredForCatalogItem** | **int** | The ID of the catalog item that was being evaluated when this effect was triggered. | [optional] **conditionIndex** | **int** | The index of the condition that was triggered. | [optional] +**evaluationGroupID** | **int** | The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). | [optional] +**evaluationGroupMode** | **string** | The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). | [optional] +**campaignRevisionId** | **int** | The revision ID of the campaign that was used when triggering the effect. | [optional] +**campaignRevisionVersionId** | **int** | The revision version ID of the campaign that was used when triggering the effect. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Environment.md b/docs/Model/Environment.md index e068c37a..6c72f370 100644 --- a/docs/Model/Environment.md +++ b/docs/Model/Environment.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **additionalCosts** | [**\TalonOne\Client\Model\AccountAdditionalCost[]**](AccountAdditionalCost.md) | The additional costs that the application is subscribed to. | [optional] **audiences** | [**\TalonOne\Client\Model\Audience[]**](Audience.md) | The audiences contained in the account which the application belongs to. | [optional] **collections** | [**\TalonOne\Client\Model\Collection[]**](Collection.md) | The account-level collections that the application is subscribed to. | [optional] +**applicationCartItemFilters** | [**\TalonOne\Client\Model\ApplicationCIF[]**](ApplicationCIF.md) | The cart item filters belonging to the Application. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Event.md b/docs/Model/Event.md index d435ff6e..7d977bdf 100644 --- a/docs/Model/Event.md +++ b/docs/Model/Event.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **attributes** | [**object**](.md) | Arbitrary additional JSON data associated with the event. | **sessionId** | **string** | The ID of the session that this event occurred in. | [optional] **effects** | **object[]** | An array of effects generated by the rules of the enabled campaigns of the Application. You decide how to apply them in your system. See the list of [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects). | -**ledgerEntries** | [**\TalonOne\Client\Model\LedgerEntry[]**](LedgerEntry.md) | Ledger entries for the event. | +**ledgerEntries** | [**\TalonOne\Client\Model\LedgerEntry[]**](LedgerEntry.md) | Ledger entries for the event. | [optional] **meta** | [**\TalonOne\Client\Model\Meta**](Meta.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FeedNotification.md b/docs/Model/FeedNotification.md deleted file mode 100644 index 03b3df44..00000000 --- a/docs/Model/FeedNotification.md +++ /dev/null @@ -1,16 +0,0 @@ -# # FeedNotification - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**title** | **string** | Title of the feed notification. | -**created** | [**\DateTime**](\DateTime.md) | Timestamp of the moment this feed notification was created. | -**updated** | [**\DateTime**](\DateTime.md) | Timestamp of the moment this feed notification was last updated. | -**articleUrl** | **string** | URL to the feed notification in the help center. | -**type** | **string** | The type of the feed notification. | -**body** | **string** | Body of the feed notification. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ApplicationAnalyticsDataPointTotalRevenue.md b/docs/Model/GenerateCampaignDescription.md similarity index 67% rename from docs/Model/ApplicationAnalyticsDataPointTotalRevenue.md rename to docs/Model/GenerateCampaignDescription.md index 1cd78b5b..4daccf7a 100644 --- a/docs/Model/ApplicationAnalyticsDataPointTotalRevenue.md +++ b/docs/Model/GenerateCampaignDescription.md @@ -1,11 +1,11 @@ -# # ApplicationAnalyticsDataPointTotalRevenue +# # GenerateCampaignDescription ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **float** | | [optional] -**influenced** | **float** | | [optional] +**campaignID** | **int** | ID of the campaign. | +**currency** | **string** | Currency for the campaign. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FrontendState.md b/docs/Model/GenerateCampaignTags.md similarity index 79% rename from docs/Model/FrontendState.md rename to docs/Model/GenerateCampaignTags.md index c108dd73..00fbd549 100644 --- a/docs/Model/FrontendState.md +++ b/docs/Model/GenerateCampaignTags.md @@ -1,9 +1,10 @@ -# # FrontendState +# # GenerateCampaignTags ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**campaignID** | **int** | ID of the campaign. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GenerateItemFilterDescription.md b/docs/Model/GenerateItemFilterDescription.md new file mode 100644 index 00000000..6919680d --- /dev/null +++ b/docs/Model/GenerateItemFilterDescription.md @@ -0,0 +1,11 @@ +# # GenerateItemFilterDescription + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**itemFilter** | **object[]** | An array of item filter Talang expressions. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/GenerateLoyaltyCard.md b/docs/Model/GenerateLoyaltyCard.md new file mode 100644 index 00000000..543dbf0b --- /dev/null +++ b/docs/Model/GenerateLoyaltyCard.md @@ -0,0 +1,12 @@ +# # GenerateLoyaltyCard + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Status of the loyalty card. | [optional] [default to 'active'] +**customerProfileIds** | **string[]** | Integration IDs of the customer profiles linked to the card. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/GenerateRuleTitle.md b/docs/Model/GenerateRuleTitle.md new file mode 100644 index 00000000..33ecaa76 --- /dev/null +++ b/docs/Model/GenerateRuleTitle.md @@ -0,0 +1,12 @@ +# # GenerateRuleTitle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rule** | [**\TalonOne\Client\Model\GenerateRuleTitleRule**](GenerateRuleTitleRule.md) | | +**currency** | **string** | Currency for the campaign. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/GenerateRuleTitleRule.md b/docs/Model/GenerateRuleTitleRule.md new file mode 100644 index 00000000..1caafc8a --- /dev/null +++ b/docs/Model/GenerateRuleTitleRule.md @@ -0,0 +1,12 @@ +# # GenerateRuleTitleRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**effects** | **object[]** | An array of effectful Talang expressions in arrays that will be evaluated when a rule matches. | [optional] +**condition** | **object[]** | A Talang expression that will be evaluated in the context of the given event. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/IncreaseAchievementProgressEffectProps.md b/docs/Model/IncreaseAchievementProgressEffectProps.md index 9186655d..699b3cfa 100644 --- a/docs/Model/IncreaseAchievementProgressEffectProps.md +++ b/docs/Model/IncreaseAchievementProgressEffectProps.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **progressTrackerId** | **int** | The internal ID of the achievement progress tracker. | [optional] **delta** | **float** | The value by which the customer's current progress in the achievement is increased. | **value** | **float** | The current progress of the customer in the achievement. | -**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | +**target** | **float** | The target value to complete the achievement. | **isJustCompleted** | **bool** | Indicates if the customer has completed the achievement in the current session. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IntegrationCoupon.md b/docs/Model/IntegrationCoupon.md index 0ffdb796..d164acea 100644 --- a/docs/Model/IntegrationCoupon.md +++ b/docs/Model/IntegrationCoupon.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. | [optional] **usageCounter** | **int** | The number of times the coupon has been successfully redeemed. | **discountCounter** | **float** | The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon. | [optional] diff --git a/docs/Model/InventoryCoupon.md b/docs/Model/InventoryCoupon.md index c69f582b..e90fe086 100644 --- a/docs/Model/InventoryCoupon.md +++ b/docs/Model/InventoryCoupon.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. | [optional] **usageCounter** | **int** | The number of times the coupon has been successfully redeemed. | **discountCounter** | **float** | The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon. | [optional] diff --git a/docs/Model/InventoryReferral.md b/docs/Model/InventoryReferral.md index f17ec5d1..fbc2a8af 100644 --- a/docs/Model/InventoryReferral.md +++ b/docs/Model/InventoryReferral.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **int** | Internal ID of this entity. | **created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the referral code becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted. | [optional] **usageLimit** | **int** | The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply. | **campaignId** | **int** | ID of the campaign from which the referral received the referral code. | **advocateProfileIntegrationId** | **string** | The Integration ID of the Advocate's Profile. | diff --git a/docs/Model/LoyaltyBalanceWithTier.md b/docs/Model/LoyaltyBalanceWithTier.md new file mode 100644 index 00000000..d4399af2 --- /dev/null +++ b/docs/Model/LoyaltyBalanceWithTier.md @@ -0,0 +1,18 @@ +# # LoyaltyBalanceWithTier + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activePoints** | **float** | Total amount of points awarded to this customer and available to spend. | [optional] +**pendingPoints** | **float** | Total amount of points awarded to this customer but not available until their start date. | [optional] +**spentPoints** | **float** | Total amount of points already spent by this customer. | [optional] +**expiredPoints** | **float** | Total amount of points awarded but never redeemed. They cannot be used anymore. | [optional] +**currentTier** | [**\TalonOne\Client\Model\Tier**](Tier.md) | | [optional] +**projectedTier** | [**\TalonOne\Client\Model\ProjectedTier**](ProjectedTier.md) | | [optional] +**pointsToNextTier** | **float** | The number of points required to move up a tier. | [optional] +**nextTierName** | **string** | The name of the tier consecutive to the current tier. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/LoyaltyBalancesWithTiers.md b/docs/Model/LoyaltyBalancesWithTiers.md new file mode 100644 index 00000000..2a149798 --- /dev/null +++ b/docs/Model/LoyaltyBalancesWithTiers.md @@ -0,0 +1,12 @@ +# # LoyaltyBalancesWithTiers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance** | [**\TalonOne\Client\Model\LoyaltyBalanceWithTier**](LoyaltyBalanceWithTier.md) | | [optional] +**subledgerBalances** | [**map[string,\TalonOne\Client\Model\LoyaltyBalanceWithTier]**](LoyaltyBalanceWithTier.md) | Map of the loyalty balances of the subledgers of a ledger. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/LoyaltyCard.md b/docs/Model/LoyaltyCard.md index 614c9161..cf0e0e33 100644 --- a/docs/Model/LoyaltyCard.md +++ b/docs/Model/LoyaltyCard.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes **id** | **int** | Internal ID of this entity. | **created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | **programID** | **int** | The ID of the loyalty program that owns this entity. | -**status** | **string** | Status of the loyalty card. Can be one of: ['active', 'inactive'] | +**status** | **string** | Status of the loyalty card. Can be `active` or `inactive`. | +**blockReason** | **string** | Reason for transferring and blocking the loyalty card. | [optional] **identifier** | **string** | The alphanumeric identifier of the loyalty card. | **usersPerCardLimit** | **int** | The max amount of customer profiles that can be linked to the card. 0 means unlimited. | **profiles** | [**\TalonOne\Client\Model\LoyaltyCardProfileRegistration[]**](LoyaltyCardProfileRegistration.md) | Integration IDs of the customers profiles linked to the card. | [optional] @@ -16,6 +17,7 @@ Name | Type | Description | Notes **modified** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent update of the loyalty card. | [optional] **oldCardIdentifier** | **string** | The alphanumeric identifier of the loyalty card. | [optional] **newCardIdentifier** | **string** | The alphanumeric identifier of the loyalty card. | [optional] +**batchId** | **string** | The ID of the batch in which the loyalty card was created. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoyaltyCardBatch.md b/docs/Model/LoyaltyCardBatch.md new file mode 100644 index 00000000..e870063e --- /dev/null +++ b/docs/Model/LoyaltyCardBatch.md @@ -0,0 +1,13 @@ +# # LoyaltyCardBatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**numberOfCards** | **int** | Number of loyalty cards in the batch. | +**batchId** | **string** | ID of the loyalty card batch. | [optional] +**status** | **string** | Status of the loyalty cards in the batch. | [optional] [default to 'active'] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/LoyaltyCardBatchResponse.md b/docs/Model/LoyaltyCardBatchResponse.md new file mode 100644 index 00000000..0433b611 --- /dev/null +++ b/docs/Model/LoyaltyCardBatchResponse.md @@ -0,0 +1,12 @@ +# # LoyaltyCardBatchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**numberOfCardsGenerated** | **int** | Number of loyalty cards in the batch. | +**batchId** | **string** | ID of the loyalty card batch. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/LoyaltyProgram.md b/docs/Model/LoyaltyProgram.md index ba32a732..de3f6df6 100644 --- a/docs/Model/LoyaltyProgram.md +++ b/docs/Model/LoyaltyProgram.md @@ -14,18 +14,22 @@ Name | Type | Description | Notes **allowSubledger** | **bool** | Indicates if this program supports subledgers inside the program. | **usersPerCardLimit** | **int** | The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. | [optional] **sandbox** | **bool** | Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type. | -**tiersExpirationPolicy** | **string** | The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. | [optional] -**tiersExpireIn** | **string** | The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] -**tiersDowngradePolicy** | **string** | Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. | [optional] **programJoinPolicy** | **string** | The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. | [optional] +**tiersExpirationPolicy** | **string** | The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. | [optional] +**tierCycleStartDate** | [**\DateTime**](\DateTime.md) | Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. | [optional] +**tiersExpireIn** | **string** | The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] +**tiersDowngradePolicy** | **string** | The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. | [optional] +**cardCodeSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] **accountID** | **int** | The ID of the Talon.One account that owns this program. | **name** | **string** | The internal name for the Loyalty Program. This is an immutable value. | **tiers** | [**\TalonOne\Client\Model\LoyaltyTier[]**](LoyaltyTier.md) | The tiers in this loyalty program. | [optional] **timezone** | **string** | A string containing an IANA timezone descriptor. | **cardBased** | **bool** | Defines the type of loyalty program: - `true`: the program is a card-based. - `false`: the program is profile-based. | [default to false] **canUpdateTiers** | **bool** | `True` if the tier definitions can be updated. | [optional] [default to false] -**canUpdateJoinPolicy** | **bool** | Indicates whether the program join policy can be updated. The join policy can be updated when this value is set to `true`. | [optional] +**canUpdateJoinPolicy** | **bool** | `True` if the program join policy can be updated. | [optional] +**canUpdateTierExpirationPolicy** | **bool** | `True` if the tier expiration policy can be updated. | [optional] **canUpgradeToAdvancedTiers** | **bool** | `True` if the program can be upgraded to use the `tiersExpireIn` and `tiersDowngradePolicy` properties. | [optional] [default to false] +**canUpdateSubledgers** | **bool** | `True` if the `allowSubledger` property can be updated in the loyalty program. | [optional] [default to false] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoyaltyProgramSubledgers.md b/docs/Model/LoyaltyProgramSubledgers.md deleted file mode 100644 index 54ffebd6..00000000 --- a/docs/Model/LoyaltyProgramSubledgers.md +++ /dev/null @@ -1,12 +0,0 @@ -# # LoyaltyProgramSubledgers - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**loyaltyProgramId** | **int** | The internal ID of the loyalty program. | -**subledgerIds** | **string[]** | The list of subledger IDs. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/LoyaltyStatistics.md b/docs/Model/LoyaltyStatistics.md deleted file mode 100644 index a0f8a8ae..00000000 --- a/docs/Model/LoyaltyStatistics.md +++ /dev/null @@ -1,19 +0,0 @@ -# # LoyaltyStatistics - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**date** | [**\DateTime**](\DateTime.md) | Date at which data point was collected. | -**totalActivePoints** | **float** | Total of active points for this loyalty program. | -**totalPendingPoints** | **float** | Total of pending points for this loyalty program. | -**totalSpentPoints** | **float** | Total of spent points for this loyalty program. | -**totalExpiredPoints** | **float** | Total of expired points for this loyalty program. | -**totalMembers** | **float** | Number of loyalty program members. | -**newMembers** | **float** | Number of members who joined on this day. | -**spentPoints** | [**\TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown**](LoyaltyDashboardPointsBreakdown.md) | | -**earnedPoints** | [**\TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown**](LoyaltyDashboardPointsBreakdown.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/MessageLogResponse.md b/docs/Model/MessageLogResponse.md index d4d1ebb9..89780360 100644 --- a/docs/Model/MessageLogResponse.md +++ b/docs/Model/MessageLogResponse.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**createdAt** | [**\DateTime**](\DateTime.md) | Timestamp when the response was received. | -**response** | **string** | Raw response data. | -**status** | **int** | HTTP status code of the response. | +**createdAt** | [**\DateTime**](\DateTime.md) | Timestamp when the response was received. | [optional] +**response** | **string** | Raw response data. | [optional] +**status** | **int** | HTTP status code of the response. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationAnalyticsDataPointAvgSessionValue.md b/docs/Model/NewAppWideCouponDeletionJob.md similarity index 63% rename from docs/Model/ApplicationAnalyticsDataPointAvgSessionValue.md rename to docs/Model/NewAppWideCouponDeletionJob.md index bf3dac8a..60ae9a78 100644 --- a/docs/Model/ApplicationAnalyticsDataPointAvgSessionValue.md +++ b/docs/Model/NewAppWideCouponDeletionJob.md @@ -1,11 +1,11 @@ -# # ApplicationAnalyticsDataPointAvgSessionValue +# # NewAppWideCouponDeletionJob ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **float** | | [optional] -**influenced** | **float** | | [optional] +**filters** | [**\TalonOne\Client\Model\CouponDeletionFilters**](CouponDeletionFilters.md) | | +**campaignids** | **int[]** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewApplication.md b/docs/Model/NewApplication.md index 4e9081cf..14a2131a 100644 --- a/docs/Model/NewApplication.md +++ b/docs/Model/NewApplication.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **enablePartialDiscounts** | **bool** | Indicates if this Application supports partial discounts. | [optional] **defaultDiscountAdditionalCostPerItemScope** | **string** | The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. | [optional] **key** | **string** | Hex key for HMAC-signing API calls as coming from this application (16 hex digits). | [optional] +**enableCampaignStateManagement** | **bool** | Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewApplicationCIF.md b/docs/Model/NewApplicationCIF.md new file mode 100644 index 00000000..eddff505 --- /dev/null +++ b/docs/Model/NewApplicationCIF.md @@ -0,0 +1,16 @@ +# # NewApplicationCIF + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the Application cart item filter used in API requests. | +**description** | **string** | A short description of the Application cart item filter. | [optional] +**activeExpressionId** | **int** | The ID of the expression that the Application cart item filter uses. | [optional] +**modifiedBy** | **int** | The ID of the user who last updated the Application cart item filter. | [optional] +**createdBy** | **int** | The ID of the user who created the Application cart item filter. | [optional] +**modified** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent update to the Application cart item filter. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/NewApplicationCIFExpression.md b/docs/Model/NewApplicationCIFExpression.md new file mode 100644 index 00000000..3596b2d1 --- /dev/null +++ b/docs/Model/NewApplicationCIFExpression.md @@ -0,0 +1,13 @@ +# # NewApplicationCIFExpression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cartItemFilterId** | **int** | The ID of the Application cart item filter. | [optional] +**createdBy** | **int** | The ID of the user who created the Application cart item filter. | [optional] +**expression** | **object[]** | Arbitrary additional JSON data associated with the Application cart item filter. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/NewBaseNotification.md b/docs/Model/NewBaseNotification.md index 6f324fbc..b037a40a 100644 --- a/docs/Model/NewBaseNotification.md +++ b/docs/Model/NewBaseNotification.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | [**object**](.md) | | +**policy** | [**object**](.md) | Indicates which notification properties to apply. | **enabled** | **bool** | Indicates whether the notification is activated. | [optional] [default to true] **webhook** | [**\TalonOne\Client\Model\NewNotificationWebhook**](NewNotificationWebhook.md) | | diff --git a/docs/Model/NewCampaignSetV2.md b/docs/Model/NewCampaignSetV2.md deleted file mode 100644 index 76a65083..00000000 --- a/docs/Model/NewCampaignSetV2.md +++ /dev/null @@ -1,13 +0,0 @@ -# # NewCampaignSetV2 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**applicationId** | **int** | The ID of the application that owns this entity. | -**version** | **int** | Version of the campaign set. | -**set** | [**\TalonOne\Client\Model\CampaignPrioritiesV2**](CampaignPrioritiesV2.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/NewCouponCreationJob.md b/docs/Model/NewCouponCreationJob.md index b13caf39..aed879d8 100644 --- a/docs/Model/NewCouponCreationJob.md +++ b/docs/Model/NewCouponCreationJob.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **numberOfCoupons** | **int** | The number of new coupon codes to generate for the campaign. | **couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] **attributes** | [**object**](.md) | Arbitrary properties associated with coupons. | diff --git a/docs/Model/NewCouponDeletionJob.md b/docs/Model/NewCouponDeletionJob.md new file mode 100644 index 00000000..3adeff78 --- /dev/null +++ b/docs/Model/NewCouponDeletionJob.md @@ -0,0 +1,11 @@ +# # NewCouponDeletionJob + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**\TalonOne\Client\Model\CouponDeletionFilters**](CouponDeletionFilters.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/NewCoupons.md b/docs/Model/NewCoupons.md index 0c6b4d2c..9062ec58 100644 --- a/docs/Model/NewCoupons.md +++ b/docs/Model/NewCoupons.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. | [optional] **numberOfCoupons** | **int** | The number of new coupon codes to generate for the campaign. Must be at least 1. | **uniquePrefix** | **string** | **DEPRECATED** To create more than 20,000 coupons in one request, use [Create coupons asynchronously](https://docs.talon.one/management-api#operation/createCouponsAsync) endpoint. | [optional] diff --git a/docs/Model/NewCouponsForMultipleRecipients.md b/docs/Model/NewCouponsForMultipleRecipients.md index 1f1ea66f..96ce1f17 100644 --- a/docs/Model/NewCouponsForMultipleRecipients.md +++ b/docs/Model/NewCouponsForMultipleRecipients.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **attributes** | [**object**](.md) | Arbitrary properties associated with this item. | [optional] **recipientsIntegrationIds** | **string[]** | The integration IDs for recipients. | **validCharacters** | **string[]** | List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression. | [optional] diff --git a/docs/Model/NewCustomerSessionV2.md b/docs/Model/NewCustomerSessionV2.md index 1b84efd7..7a0af7f0 100644 --- a/docs/Model/NewCustomerSessionV2.md +++ b/docs/Model/NewCustomerSessionV2.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes **profileId** | **string** | ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`. | [optional] **storeIntegrationId** | **string** | The integration ID of the store. You choose this ID when you create a store. | [optional] **evaluableCampaignIds** | **int[]** | When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them. | [optional] -**couponCodes** | **string[]** | Any coupon codes entered. **Important**: If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. | [optional] -**referralCode** | **string** | Any referral code entered. **Important**: If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. | [optional] +**couponCodes** | **string[]** | Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, provide `\"couponCodes\": null` or omit the parameter entirely. | [optional] +**referralCode** | **string** | Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, provide `\"referralCode\": null` or omit the parameter entirely. | [optional] **loyaltyCards** | **string[]** | Identifier of a loyalty card. | [optional] **state** | **string** | Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. Either: - `closed` → `cancelled` (**only** via [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2)) or - `closed` → `partially_returned` (**only** via [Return cart items](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/returnCartItems)) - `closed` → `open` (**only** via [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)) 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). | [optional] [default to 'open'] **cartItems** | [**\TalonOne\Client\Model\CartItem[]**](CartItem.md) | The items to add to this session. **Do not exceed 1000 items** and ensure the sum of all cart item's `quantity` **does not exceed 10.000** per request. | [optional] diff --git a/docs/Model/NewLoyaltyProgram.md b/docs/Model/NewLoyaltyProgram.md index 65a46fd6..299d6149 100644 --- a/docs/Model/NewLoyaltyProgram.md +++ b/docs/Model/NewLoyaltyProgram.md @@ -12,10 +12,12 @@ Name | Type | Description | Notes **allowSubledger** | **bool** | Indicates if this program supports subledgers inside the program. | **usersPerCardLimit** | **int** | The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. | [optional] **sandbox** | **bool** | Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type. | -**tiersExpirationPolicy** | **string** | The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. | [optional] -**tiersExpireIn** | **string** | The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] -**tiersDowngradePolicy** | **string** | Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. | [optional] **programJoinPolicy** | **string** | The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. | [optional] +**tiersExpirationPolicy** | **string** | The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. | [optional] +**tierCycleStartDate** | [**\DateTime**](\DateTime.md) | Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. | [optional] +**tiersExpireIn** | **string** | The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] +**tiersDowngradePolicy** | **string** | The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. | [optional] +**cardCodeSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] **name** | **string** | The internal name for the Loyalty Program. This is an immutable value. | **tiers** | [**\TalonOne\Client\Model\NewLoyaltyTier[]**](NewLoyaltyTier.md) | The tiers in this loyalty program. | [optional] **timezone** | **string** | A string containing an IANA timezone descriptor. | diff --git a/docs/Model/NewOutgoingIntegrationWebhook.md b/docs/Model/NewOutgoingIntegrationWebhook.md index 49b533c2..d9d2d2db 100644 --- a/docs/Model/NewOutgoingIntegrationWebhook.md +++ b/docs/Model/NewOutgoingIntegrationWebhook.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | Webhook title. | +**description** | **string** | A description of the webhook. | [optional] **applicationIds** | **int[]** | IDs of the Applications to which a webhook must be linked. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewReferral.md b/docs/Model/NewReferral.md index dca249ce..4b533aba 100644 --- a/docs/Model/NewReferral.md +++ b/docs/Model/NewReferral.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the referral code becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted. | [optional] **usageLimit** | **int** | The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply. | [optional] **campaignId** | **int** | ID of the campaign from which the referral received the referral code. | **advocateProfileIntegrationId** | **string** | The Integration ID of the Advocate's Profile. | diff --git a/docs/Model/NewReferralsForMultipleAdvocates.md b/docs/Model/NewReferralsForMultipleAdvocates.md index f6a372a9..f3151345 100644 --- a/docs/Model/NewReferralsForMultipleAdvocates.md +++ b/docs/Model/NewReferralsForMultipleAdvocates.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the referral code becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted. | [optional] **usageLimit** | **int** | The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply. | **campaignId** | **int** | The ID of the campaign from which the referral received the referral code. | **advocateProfileIntegrationIds** | **string[]** | An array containing all the respective advocate profiles. | diff --git a/docs/Model/NewRevisionVersion.md b/docs/Model/NewRevisionVersion.md new file mode 100644 index 00000000..2b0745a0 --- /dev/null +++ b/docs/Model/NewRevisionVersion.md @@ -0,0 +1,21 @@ +# # NewRevisionVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | A user-facing name for this campaign. | [optional] +**startTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become active. | [optional] +**endTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become inactive. | [optional] +**attributes** | [**object**](.md) | Arbitrary properties associated with this campaign. | [optional] +**description** | **string** | A detailed description of the campaign. | [optional] +**activeRulesetId** | **int** | The ID of the ruleset this campaign template will use. | [optional] +**tags** | **string[]** | A list of tags for the campaign template. | [optional] +**couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] +**referralSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] +**limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | The set of limits that will operate for this campaign version. | [optional] +**features** | **string[]** | A list of features for the campaign template. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/NewWebhook.md b/docs/Model/NewWebhook.md index 11773692..748a2fe8 100644 --- a/docs/Model/NewWebhook.md +++ b/docs/Model/NewWebhook.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **applicationIds** | **int[]** | The IDs of the Applications that are related to this entity. | **title** | **string** | Name or title for this webhook. | +**description** | **string** | A description of the webhook. | [optional] **verb** | **string** | API method for this webhook. | **url** | **string** | API URL (supports templating using parameters) for this webhook. | **headers** | **string[]** | List of API HTTP headers for this webhook. | diff --git a/docs/Model/ApplicationAnalyticsDataPointSessionsCount.md b/docs/Model/OktaEvent.md similarity index 63% rename from docs/Model/ApplicationAnalyticsDataPointSessionsCount.md rename to docs/Model/OktaEvent.md index a5adba19..f6f21638 100644 --- a/docs/Model/ApplicationAnalyticsDataPointSessionsCount.md +++ b/docs/Model/OktaEvent.md @@ -1,11 +1,11 @@ -# # ApplicationAnalyticsDataPointSessionsCount +# # OktaEvent ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **float** | | [optional] -**influenced** | **float** | | [optional] +**eventType** | **string** | Event type defining an action. | +**target** | [**\TalonOne\Client\Model\OktaEventTarget[]**](OktaEventTarget.md) | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OktaEventPayload.md b/docs/Model/OktaEventPayload.md new file mode 100644 index 00000000..d399f049 --- /dev/null +++ b/docs/Model/OktaEventPayload.md @@ -0,0 +1,11 @@ +# # OktaEventPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\TalonOne\Client\Model\OktaEventPayloadData**](OktaEventPayloadData.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/OktaEventPayloadData.md b/docs/Model/OktaEventPayloadData.md new file mode 100644 index 00000000..38e285e8 --- /dev/null +++ b/docs/Model/OktaEventPayloadData.md @@ -0,0 +1,11 @@ +# # OktaEventPayloadData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**\TalonOne\Client\Model\OktaEvent[]**](OktaEvent.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/OktaEventTarget.md b/docs/Model/OktaEventTarget.md new file mode 100644 index 00000000..9c0a9d6c --- /dev/null +++ b/docs/Model/OktaEventTarget.md @@ -0,0 +1,13 @@ +# # OktaEventTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | Type of the event target. | +**alternateId** | **string** | Identifier of the event target, depending on its type. | +**displayName** | **string** | Display name of the event target. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/OutgoingIntegrationWebhookTemplate.md b/docs/Model/OutgoingIntegrationWebhookTemplate.md deleted file mode 100644 index b51fbf56..00000000 --- a/docs/Model/OutgoingIntegrationWebhookTemplate.md +++ /dev/null @@ -1,16 +0,0 @@ -# # OutgoingIntegrationWebhookTemplate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | Unique Id for this entity. | -**integrationType** | **int** | Unique Id of outgoing integration type. | -**title** | **string** | Title of the webhook template. | -**description** | **string** | General description for the specific outgoing integration webhook template. | -**payload** | **string** | API payload (supports templating using parameters) for this webhook template. | -**method** | **string** | API method for this webhook. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/OutgoingIntegrationWebhookTemplates.md b/docs/Model/OutgoingIntegrationWebhookTemplates.md deleted file mode 100644 index c01eda78..00000000 --- a/docs/Model/OutgoingIntegrationWebhookTemplates.md +++ /dev/null @@ -1,11 +0,0 @@ -# # OutgoingIntegrationWebhookTemplates - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**\TalonOne\Client\Model\OutgoingIntegrationWebhookTemplate[]**](OutgoingIntegrationWebhookTemplate.md) | The list of webhook templates for a given outgoing integration type. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/PriorityPosition.md b/docs/Model/PriorityPosition.md deleted file mode 100644 index 1ec8c367..00000000 --- a/docs/Model/PriorityPosition.md +++ /dev/null @@ -1,12 +0,0 @@ -# # PriorityPosition - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**set** | **string** | The name of the priority set where the campaign is located. | [default to 'universal'] -**position** | **int** | The position of the campaign in the priority order starting from 1. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/ProjectedTier.md b/docs/Model/ProjectedTier.md new file mode 100644 index 00000000..b6b81078 --- /dev/null +++ b/docs/Model/ProjectedTier.md @@ -0,0 +1,13 @@ +# # ProjectedTier + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**projectedActivePoints** | **float** | The active points of the customer when their current tier expires. | +**stayInTierPoints** | **float** | The number of points the customer needs to stay in the current tier. **Note**: This is included in the response when the customer is projected to be downgraded. | [optional] +**projectedTierName** | **string** | The name of the tier the user will enter once their current tier expires. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Referral.md b/docs/Model/Referral.md index 6dbc9975..03907408 100644 --- a/docs/Model/Referral.md +++ b/docs/Model/Referral.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **int** | Internal ID of this entity. | **created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the referral code becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted. | [optional] **usageLimit** | **int** | The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply. | **campaignId** | **int** | ID of the campaign from which the referral received the referral code. | **advocateProfileIntegrationId** | **string** | The Integration ID of the Advocate's Profile. | diff --git a/docs/Model/ReferralConstraints.md b/docs/Model/ReferralConstraints.md index 5f13e59a..c51f26cf 100644 --- a/docs/Model/ReferralConstraints.md +++ b/docs/Model/ReferralConstraints.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the referral code becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted. | [optional] **usageLimit** | **int** | The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RejectCouponEffectProps.md b/docs/Model/RejectCouponEffectProps.md index f74f4829..ff308338 100644 --- a/docs/Model/RejectCouponEffectProps.md +++ b/docs/Model/RejectCouponEffectProps.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **conditionIndex** | **int** | The index of the condition that caused the rejection of the coupon. | [optional] **effectIndex** | **int** | The index of the effect that caused the rejection of the coupon. | [optional] **details** | **string** | More details about the failure. | [optional] +**campaignExclusionReason** | **string** | The reason why the campaign was not applied. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RejectReferralEffectProps.md b/docs/Model/RejectReferralEffectProps.md index 75ecdca5..671b1c9a 100644 --- a/docs/Model/RejectReferralEffectProps.md +++ b/docs/Model/RejectReferralEffectProps.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **conditionIndex** | **int** | The index of the condition that caused the rejection of the referral. | [optional] **effectIndex** | **int** | The index of the effect that caused the rejection of the referral. | [optional] **details** | **string** | More details about the failure. | [optional] +**campaignExclusionReason** | **string** | The reason why the campaign was not applied. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Revision.md b/docs/Model/Revision.md new file mode 100644 index 00000000..0dbcb860 --- /dev/null +++ b/docs/Model/Revision.md @@ -0,0 +1,20 @@ +# # Revision + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. | +**activateAt** | [**\DateTime**](\DateTime.md) | | [optional] +**accountId** | **int** | | +**applicationId** | **int** | | +**campaignId** | **int** | | +**created** | [**\DateTime**](\DateTime.md) | | +**createdBy** | **int** | | +**activatedAt** | [**\DateTime**](\DateTime.md) | | [optional] +**activatedBy** | **int** | | [optional] +**currentVersion** | [**\TalonOne\Client\Model\RevisionVersion**](RevisionVersion.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/RevisionActivation.md b/docs/Model/RevisionActivation.md new file mode 100644 index 00000000..0152bb7a --- /dev/null +++ b/docs/Model/RevisionActivation.md @@ -0,0 +1,11 @@ +# # RevisionActivation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activateAt** | [**\DateTime**](\DateTime.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/RevisionVersion.md b/docs/Model/RevisionVersion.md new file mode 100644 index 00000000..dabd5bae --- /dev/null +++ b/docs/Model/RevisionVersion.md @@ -0,0 +1,29 @@ +# # RevisionVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. | +**accountId** | **int** | | +**applicationId** | **int** | | +**campaignId** | **int** | | +**created** | [**\DateTime**](\DateTime.md) | | +**createdBy** | **int** | | +**revisionId** | **int** | | +**version** | **int** | | +**name** | **string** | A user-facing name for this campaign. | [optional] +**startTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become active. | [optional] +**endTime** | [**\DateTime**](\DateTime.md) | Timestamp when the campaign will become inactive. | [optional] +**attributes** | [**object**](.md) | Arbitrary properties associated with this campaign. | [optional] +**description** | **string** | A detailed description of the campaign. | [optional] +**activeRulesetId** | **int** | The ID of the ruleset this campaign template will use. | [optional] +**tags** | **string[]** | A list of tags for the campaign template. | [optional] +**couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] +**referralSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] +**limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | The set of limits that will operate for this campaign version. | [optional] +**features** | **string[]** | A list of features for the campaign template. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/RollbackIncreasedAchievementProgressEffectProps.md b/docs/Model/RollbackIncreasedAchievementProgressEffectProps.md new file mode 100644 index 00000000..c18d9bfe --- /dev/null +++ b/docs/Model/RollbackIncreasedAchievementProgressEffectProps.md @@ -0,0 +1,16 @@ +# # RollbackIncreasedAchievementProgressEffectProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**achievementId** | **int** | The internal ID of the achievement. | +**achievementName** | **string** | The name of the achievement. | +**progressTrackerId** | **int** | The internal ID of the achievement progress tracker. | +**decreaseProgressBy** | **float** | The value by which the customer's current progress in the achievement is decreased. | +**currentProgress** | **float** | The current progress of the customer in the achievement. | +**target** | **float** | The target value to complete the achievement. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/RuleFailureReason.md b/docs/Model/RuleFailureReason.md index 0fbb289c..7a99a5bc 100644 --- a/docs/Model/RuleFailureReason.md +++ b/docs/Model/RuleFailureReason.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **conditionIndex** | **int** | The index of the condition that failed. | [optional] **effectIndex** | **int** | The index of the effect that failed. | [optional] **details** | **string** | More details about the failure. | [optional] +**evaluationGroupID** | **int** | The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). | [optional] +**evaluationGroupMode** | **string** | The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign- | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SSOConfig.md b/docs/Model/SSOConfig.md index 07d3bc40..45b4c547 100644 --- a/docs/Model/SSOConfig.md +++ b/docs/Model/SSOConfig.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enforced** | **bool** | An indication of whether single sign-on is enforced for the account. When enforced, users cannot use their email and password to sign in to Talon.One. It is not possible to change this to `false` after it is set to `true`. | +**newAcsUrl** | **string** | Assertion Consumer Service (ACS) URL for setting up a new SAML connection with an identity provider like Okta or Microsoft Entra ID. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ScimBaseUser.md b/docs/Model/ScimBaseUser.md new file mode 100644 index 00000000..e1e77fc9 --- /dev/null +++ b/docs/Model/ScimBaseUser.md @@ -0,0 +1,14 @@ +# # ScimBaseUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | Status of the user. | [optional] +**displayName** | **string** | Display name of the user. | [optional] +**userName** | **string** | Unique identifier of the user. This is usually an email address. | [optional] +**name** | [**\TalonOne\Client\Model\ScimBaseUserName**](ScimBaseUserName.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimBaseUserName.md b/docs/Model/ScimBaseUserName.md new file mode 100644 index 00000000..95c16a14 --- /dev/null +++ b/docs/Model/ScimBaseUserName.md @@ -0,0 +1,11 @@ +# # ScimBaseUserName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**formatted** | **string** | The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimNewUser.md b/docs/Model/ScimNewUser.md new file mode 100644 index 00000000..b3f83cf0 --- /dev/null +++ b/docs/Model/ScimNewUser.md @@ -0,0 +1,14 @@ +# # ScimNewUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | Status of the user. | [optional] +**displayName** | **string** | Display name of the user. | [optional] +**userName** | **string** | Unique identifier of the user. This is usually an email address. | [optional] +**name** | [**\TalonOne\Client\Model\ScimBaseUserName**](ScimBaseUserName.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimPatchOperation.md b/docs/Model/ScimPatchOperation.md new file mode 100644 index 00000000..15323812 --- /dev/null +++ b/docs/Model/ScimPatchOperation.md @@ -0,0 +1,13 @@ +# # ScimPatchOperation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**op** | **string** | The method that should be used in the operation. | +**path** | **string** | The path specifying the attribute that should be updated. | [optional] +**value** | **string** | The value that should be updated. Required if `op` is `add` or `replace`. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimPatchRequest.md b/docs/Model/ScimPatchRequest.md new file mode 100644 index 00000000..e3d65162 --- /dev/null +++ b/docs/Model/ScimPatchRequest.md @@ -0,0 +1,12 @@ +# # ScimPatchRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**schemas** | **string[]** | SCIM schema for the given resource. | [optional] +**operations** | [**\TalonOne\Client\Model\ScimPatchOperation[]**](ScimPatchOperation.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimResource.md b/docs/Model/ScimResource.md new file mode 100644 index 00000000..5fed5998 --- /dev/null +++ b/docs/Model/ScimResource.md @@ -0,0 +1,13 @@ +# # ScimResource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | ID of the resource. | [optional] +**name** | **string** | Name of the resource. | [optional] +**description** | **string** | Human-readable description of the resource. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimResourceTypesListResponse.md b/docs/Model/ScimResourceTypesListResponse.md new file mode 100644 index 00000000..07855f62 --- /dev/null +++ b/docs/Model/ScimResourceTypesListResponse.md @@ -0,0 +1,11 @@ +# # ScimResourceTypesListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resources** | [**\TalonOne\Client\Model\ScimResource[]**](ScimResource.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimSchemaResource.md b/docs/Model/ScimSchemaResource.md new file mode 100644 index 00000000..c88d96b4 --- /dev/null +++ b/docs/Model/ScimSchemaResource.md @@ -0,0 +1,14 @@ +# # ScimSchemaResource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | ID of the resource. | [optional] +**name** | **string** | Name of the resource. | [optional] +**description** | **string** | Human-readable description of the schema resource. | [optional] +**attributes** | **object[]** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimSchemasListResponse.md b/docs/Model/ScimSchemasListResponse.md new file mode 100644 index 00000000..dce87f60 --- /dev/null +++ b/docs/Model/ScimSchemasListResponse.md @@ -0,0 +1,13 @@ +# # ScimSchemasListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resources** | [**\TalonOne\Client\Model\ScimSchemaResource[]**](ScimSchemaResource.md) | | +**schemas** | **string[]** | SCIM schema for the given resource. | [optional] +**totalResults** | **int** | Number of total results in the response. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimServiceProviderConfigResponse.md b/docs/Model/ScimServiceProviderConfigResponse.md new file mode 100644 index 00000000..5c64c5eb --- /dev/null +++ b/docs/Model/ScimServiceProviderConfigResponse.md @@ -0,0 +1,16 @@ +# # ScimServiceProviderConfigResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bulk** | [**\TalonOne\Client\Model\ScimServiceProviderConfigResponseBulk**](ScimServiceProviderConfigResponseBulk.md) | | [optional] +**changePassword** | [**\TalonOne\Client\Model\ScimServiceProviderConfigResponseChangePassword**](ScimServiceProviderConfigResponseChangePassword.md) | | [optional] +**documentationUri** | **string** | The URI that points to the SCIM service provider's documentation, providing further details about the service's capabilities and usage. | [optional] +**filter** | [**\TalonOne\Client\Model\ScimServiceProviderConfigResponseFilter**](ScimServiceProviderConfigResponseFilter.md) | | [optional] +**patch** | [**\TalonOne\Client\Model\ScimServiceProviderConfigResponsePatch**](ScimServiceProviderConfigResponsePatch.md) | | [optional] +**schemas** | **string[]** | A list of SCIM schemas that define the structure and data types supported by the service provider. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimServiceProviderConfigResponseBulk.md b/docs/Model/ScimServiceProviderConfigResponseBulk.md new file mode 100644 index 00000000..6a95e8c5 --- /dev/null +++ b/docs/Model/ScimServiceProviderConfigResponseBulk.md @@ -0,0 +1,13 @@ +# # ScimServiceProviderConfigResponseBulk + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maxOperations** | **int** | The maximum number of individual operations that can be included in a single bulk request. | [optional] +**maxPayloadSize** | **int** | The maximum size, in bytes, of the entire payload for a bulk operation request. | [optional] +**supported** | **bool** | Indicates whether the SCIM service provider supports bulk operations. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimServiceProviderConfigResponseChangePassword.md b/docs/Model/ScimServiceProviderConfigResponseChangePassword.md new file mode 100644 index 00000000..29441f70 --- /dev/null +++ b/docs/Model/ScimServiceProviderConfigResponseChangePassword.md @@ -0,0 +1,11 @@ +# # ScimServiceProviderConfigResponseChangePassword + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**supported** | **bool** | Indicates whether the service provider supports password changes via the SCIM API. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/RoleV2PermissionsRoles.md b/docs/Model/ScimServiceProviderConfigResponseFilter.md similarity index 50% rename from docs/Model/RoleV2PermissionsRoles.md rename to docs/Model/ScimServiceProviderConfigResponseFilter.md index b51c329d..216b7330 100644 --- a/docs/Model/RoleV2PermissionsRoles.md +++ b/docs/Model/ScimServiceProviderConfigResponseFilter.md @@ -1,12 +1,11 @@ -# # RoleV2PermissionsRoles +# # ScimServiceProviderConfigResponseFilter ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**applications** | [**map[string,\TalonOne\Client\Model\RoleV2ApplicationDetails]**](RoleV2ApplicationDetails.md) | | [optional] -**loyaltyPrograms** | **map[string,string]** | | [optional] -**campaignAccessGroups** | **map[string,string]** | | [optional] +**maxResults** | **int** | The maximum number of resources that can be returned in a single filtered query response. | [optional] +**supported** | **bool** | Indicates whether the SCIM service provider supports filtering operations. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ScimServiceProviderConfigResponsePatch.md b/docs/Model/ScimServiceProviderConfigResponsePatch.md new file mode 100644 index 00000000..5b3ace02 --- /dev/null +++ b/docs/Model/ScimServiceProviderConfigResponsePatch.md @@ -0,0 +1,11 @@ +# # ScimServiceProviderConfigResponsePatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**supported** | **bool** | Indicates whether the service provider supports patch operations for modifying resources. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimUser.md b/docs/Model/ScimUser.md new file mode 100644 index 00000000..e289b2dd --- /dev/null +++ b/docs/Model/ScimUser.md @@ -0,0 +1,15 @@ +# # ScimUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | Status of the user. | [optional] +**displayName** | **string** | Display name of the user. | [optional] +**userName** | **string** | Unique identifier of the user. This is usually an email address. | [optional] +**name** | [**\TalonOne\Client\Model\ScimBaseUserName**](ScimBaseUserName.md) | | [optional] +**id** | **string** | ID of the user. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ScimUsersListResponse.md b/docs/Model/ScimUsersListResponse.md new file mode 100644 index 00000000..1b3973da --- /dev/null +++ b/docs/Model/ScimUsersListResponse.md @@ -0,0 +1,13 @@ +# # ScimUsersListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resources** | [**\TalonOne\Client\Model\ScimUser[]**](ScimUser.md) | | +**schemas** | **string[]** | SCIM schema for the given resource. | [optional] +**totalResults** | **int** | Number of total results in the response. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Tier.md b/docs/Model/Tier.md index 3aa9e115..bd058a4c 100644 --- a/docs/Model/Tier.md +++ b/docs/Model/Tier.md @@ -6,8 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The internal ID of the tier. | **name** | **string** | The name of the tier. | +**startDate** | [**\DateTime**](\DateTime.md) | Date and time when the customer moved to this tier. This value uses the loyalty program's time zone setting. | [optional] **expiryDate** | [**\DateTime**](\DateTime.md) | Date when tier level expires in the RFC3339 format (in the Loyalty Program's timezone). | [optional] -**downgradePolicy** | **string** | Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. | [optional] +**downgradePolicy** | **string** | The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransferLoyaltyCard.md b/docs/Model/TransferLoyaltyCard.md index c0d64b1f..73f25928 100644 --- a/docs/Model/TransferLoyaltyCard.md +++ b/docs/Model/TransferLoyaltyCard.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **newCardIdentifier** | **string** | The alphanumeric identifier of the loyalty card. | +**blockReason** | **string** | Reason for transferring and blocking the loyalty card. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateApplication.md b/docs/Model/UpdateApplication.md index 35d08a2d..70a6cd4b 100644 --- a/docs/Model/UpdateApplication.md +++ b/docs/Model/UpdateApplication.md @@ -19,6 +19,8 @@ Name | Type | Description | Notes **enablePartialDiscounts** | **bool** | Indicates if this Application supports partial discounts. | [optional] **defaultDiscountAdditionalCostPerItemScope** | **string** | The default scope to apply `setDiscountPerItem` effects on if no scope was provided with the effect. | [optional] **defaultEvaluationGroupId** | **int** | The ID of the default campaign evaluation group to which new campaigns will be added unless a different group is selected when creating the campaign. | [optional] +**defaultCartItemFilterId** | **int** | The ID of the default Cart-Item-Filter for this application. | [optional] +**enableCampaignStateManagement** | **bool** | Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateApplicationCIF.md b/docs/Model/UpdateApplicationCIF.md new file mode 100644 index 00000000..71d9394f --- /dev/null +++ b/docs/Model/UpdateApplicationCIF.md @@ -0,0 +1,14 @@ +# # UpdateApplicationCIF + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | A short description of the Application cart item filter. | [optional] +**activeExpressionId** | **int** | The ID of the expression that the Application cart item filter uses. | [optional] +**modifiedBy** | **int** | The ID of the user who last updated the Application cart item filter. | [optional] +**modified** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent update to the Application cart item filter. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/UpdateCampaign.md b/docs/Model/UpdateCampaign.md index 5ee4a464..90263c75 100644 --- a/docs/Model/UpdateCampaign.md +++ b/docs/Model/UpdateCampaign.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **campaignGroups** | **int[]** | The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/account-settings/managing-campaign-groups) this campaign belongs to. | [optional] **evaluationGroupId** | **int** | The ID of the campaign evaluation group the campaign belongs to. | [optional] **type** | **string** | The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. | [optional] [default to 'advanced'] -**linkedStoreIds** | **int[]** | A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. | [optional] +**linkedStoreIds** | **int[]** | A list of store IDs that you want to link to the campaign. **Note:** - Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. - If you linked stores to the campaign by uploading a CSV file, you cannot use this property and it should be empty. - Use of this property is limited to 50 stores. To link more than 50 stores, upload them via a CSV file. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateCoupon.md b/docs/Model/UpdateCoupon.md index d61dd30b..3c37625b 100644 --- a/docs/Model/UpdateCoupon.md +++ b/docs/Model/UpdateCoupon.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **limits** | [**\TalonOne\Client\Model\LimitConfig[]**](LimitConfig.md) | Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured. | [optional] **recipientIntegrationId** | **string** | The integration ID for this coupon's beneficiary's profile. | [optional] **attributes** | [**object**](.md) | Arbitrary properties associated with this item. | [optional] diff --git a/docs/Model/UpdateCouponBatch.md b/docs/Model/UpdateCouponBatch.md index 62694762..9d967192 100644 --- a/docs/Model/UpdateCouponBatch.md +++ b/docs/Model/UpdateCouponBatch.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **discountLimit** | **float** | The total discount value that the code can give. Typically used to represent a gift card value. | [optional] **reservationLimit** | **int** | The number of reservations that can be made with this coupon code. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the coupon becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the coupon. Coupon never expires if this is omitted. | [optional] **attributes** | [**object**](.md) | Optional property to set the value of custom coupon attributes. They are defined in the Campaign Manager, see [Managing attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes). Coupon attributes can also be set to _mandatory_ in your Application [settings](https://docs.talon.one/docs/product/applications/using-attributes#making-attributes-mandatory). If your Application uses mandatory attributes, you must use this property to set their value. | [optional] **batchID** | **string** | The ID of the batch the coupon(s) belong to. | [optional] diff --git a/docs/Model/UpdateLoyaltyCard.md b/docs/Model/UpdateLoyaltyCard.md index 412902b9..15311d6a 100644 --- a/docs/Model/UpdateLoyaltyCard.md +++ b/docs/Model/UpdateLoyaltyCard.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | Status of the loyalty card. Can be one of: ['active', 'inactive'] | +**status** | **string** | Status of the loyalty card. Can be `active` or `inactive`. | +**blockReason** | **string** | Reason for transferring and blocking the loyalty card. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateLoyaltyProgram.md b/docs/Model/UpdateLoyaltyProgram.md index 67ba7160..45ac6f41 100644 --- a/docs/Model/UpdateLoyaltyProgram.md +++ b/docs/Model/UpdateLoyaltyProgram.md @@ -12,10 +12,12 @@ Name | Type | Description | Notes **allowSubledger** | **bool** | Indicates if this program supports subledgers inside the program. | [optional] **usersPerCardLimit** | **int** | The max amount of user profiles with whom a card can be shared. This can be set to 0 for no limit. This property is only used when `cardBased` is `true`. | [optional] **sandbox** | **bool** | Indicates if this program is a live or sandbox program. Programs of a given type can only be connected to Applications of the same type. | [optional] -**tiersExpirationPolicy** | **string** | The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. | [optional] -**tiersExpireIn** | **string** | The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] -**tiersDowngradePolicy** | **string** | Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. | [optional] **programJoinPolicy** | **string** | The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. | [optional] +**tiersExpirationPolicy** | **string** | The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. | [optional] +**tierCycleStartDate** | [**\DateTime**](\DateTime.md) | Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. | [optional] +**tiersExpireIn** | **string** | The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. | [optional] +**tiersDowngradePolicy** | **string** | The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. | [optional] +**cardCodeSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] **tiers** | [**\TalonOne\Client\Model\NewLoyaltyTier[]**](NewLoyaltyTier.md) | The tiers in this loyalty program. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateReferral.md b/docs/Model/UpdateReferral.md index c4a0f04c..602d4463 100644 --- a/docs/Model/UpdateReferral.md +++ b/docs/Model/UpdateReferral.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **friendProfileIntegrationId** | **string** | An optional Integration ID of the Friend's Profile. | [optional] **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the referral code becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted. | [optional] **usageLimit** | **int** | The number of times a referral code can be used. This can be set to 0 for no limit, but any campaign usage limits will still apply. | [optional] **attributes** | [**object**](.md) | Arbitrary properties associated with this item. | [optional] diff --git a/docs/Model/UpdateReferralBatch.md b/docs/Model/UpdateReferralBatch.md index 5a86fc87..bc8ea1e6 100644 --- a/docs/Model/UpdateReferralBatch.md +++ b/docs/Model/UpdateReferralBatch.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **attributes** | [**object**](.md) | Arbitrary properties associated with this item. | [optional] **batchID** | **string** | The id of the batch the referral belongs to. | **startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the referral code becomes valid. | [optional] -**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. | [optional] +**expiryDate** | [**\DateTime**](\DateTime.md) | Expiration date of the referral code. Referral never expires if this is omitted. | [optional] **usageLimit** | **int** | The number of times a referral code can be used. This can be set to 0 for no limit, but any campaign usage limits will still apply. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserLatestFeedTimestamp.md b/docs/Model/UpdateUserLatestFeedTimestamp.md deleted file mode 100644 index 3de452b1..00000000 --- a/docs/Model/UpdateUserLatestFeedTimestamp.md +++ /dev/null @@ -1,11 +0,0 @@ -# # UpdateUserLatestFeedTimestamp - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**newLatestFeedTimestamp** | [**\DateTime**](\DateTime.md) | New timestamp to update for the current user. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/User.md b/docs/Model/User.md index c6cae69d..4b9a768b 100644 --- a/docs/Model/User.md +++ b/docs/Model/User.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **lastSignedIn** | [**\DateTime**](\DateTime.md) | Timestamp when the user last signed in to Talon.One. | [optional] **lastAccessed** | [**\DateTime**](\DateTime.md) | Timestamp of the user's last activity after signing in to Talon.One. | [optional] **latestFeedTimestamp** | [**\DateTime**](\DateTime.md) | Timestamp when the user was notified for feed. | [optional] +**additionalAttributes** | [**object**](.md) | Additional user attributes, created and used by external identity providers. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserFeedNotifications.md b/docs/Model/UserFeedNotifications.md deleted file mode 100644 index 3ddab9f2..00000000 --- a/docs/Model/UserFeedNotifications.md +++ /dev/null @@ -1,12 +0,0 @@ -# # UserFeedNotifications - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lastUpdate** | [**\DateTime**](\DateTime.md) | Timestamp of the last request for this list. | -**notifications** | [**\TalonOne\Client\Model\FeedNotification[]**](FeedNotification.md) | List of all notifications to notify the user about. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/docs/Model/Webhook.md b/docs/Model/Webhook.md index cd26a4dc..69072bd3 100644 --- a/docs/Model/Webhook.md +++ b/docs/Model/Webhook.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **modified** | [**\DateTime**](\DateTime.md) | The time this entity was last modified. | **applicationIds** | **int[]** | The IDs of the Applications that are related to this entity. The IDs of the Applications that are related to this entity. | **title** | **string** | Name or title for this webhook. | +**description** | **string** | A description of the webhook. | [optional] **verb** | **string** | API method for this webhook. | **url** | **string** | API URL (supports templating using parameters) for this webhook. | **headers** | **string[]** | List of API HTTP headers for this webhook. | diff --git a/docs/Model/WebhookWithOutgoingIntegrationDetails.md b/docs/Model/WebhookWithOutgoingIntegrationDetails.md index d1c0d790..88039797 100644 --- a/docs/Model/WebhookWithOutgoingIntegrationDetails.md +++ b/docs/Model/WebhookWithOutgoingIntegrationDetails.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **modified** | [**\DateTime**](\DateTime.md) | The time this entity was last modified. | **applicationIds** | **int[]** | The IDs of the Applications that are related to this entity. The IDs of the Applications that are related to this entity. | **title** | **string** | Name or title for this webhook. | +**description** | **string** | A description of the webhook. | [optional] **verb** | **string** | API method for this webhook. | **url** | **string** | API URL (supports templating using parameters) for this webhook. | **headers** | **string[]** | List of API HTTP headers for this webhook. | diff --git a/lib/Api/IntegrationApi.php b/lib/Api/IntegrationApi.php index 5daf3160..6d7eb514 100644 --- a/lib/Api/IntegrationApi.php +++ b/lib/Api/IntegrationApi.php @@ -2452,6 +2452,338 @@ protected function deleteCustomerDataRequest($integrationId) ); } + /** + * Operation generateLoyaltyCard + * + * Generate loyalty card + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\GenerateLoyaltyCard $body body (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function generateLoyaltyCard($loyaltyProgramId, $body) + { + list($response) = $this->generateLoyaltyCardWithHttpInfo($loyaltyProgramId, $body); + return $response; + } + + /** + * Operation generateLoyaltyCardWithHttpInfo + * + * Generate loyalty card + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\GenerateLoyaltyCard $body body (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function generateLoyaltyCardWithHttpInfo($loyaltyProgramId, $body) + { + $request = $this->generateLoyaltyCardRequest($loyaltyProgramId, $body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\LoyaltyCard' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyCard', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\LoyaltyCard', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation generateLoyaltyCardAsync + * + * Generate loyalty card + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\GenerateLoyaltyCard $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateLoyaltyCardAsync($loyaltyProgramId, $body) + { + return $this->generateLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateLoyaltyCardAsyncWithHttpInfo + * + * Generate loyalty card + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\GenerateLoyaltyCard $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $body) + { + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $request = $this->generateLoyaltyCardRequest($loyaltyProgramId, $body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateLoyaltyCard' + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\GenerateLoyaltyCard $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function generateLoyaltyCardRequest($loyaltyProgramId, $body) + { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling generateLoyaltyCard' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling generateLoyaltyCard' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getCustomerInventory * @@ -3169,14 +3501,16 @@ protected function getCustomerSessionRequest($customerSessionId) * @param string $integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $includeTiers Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. (optional, default to false) + * @param bool $includeProjectedTier Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer’s active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\LoyaltyBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\LoyaltyBalancesWithTiers|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) + public function getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null, $includeTiers = false, $includeProjectedTier = false) { - list($response) = $this->getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate, $subledgerId); + list($response) = $this->getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate, $subledgerId, $includeTiers, $includeProjectedTier); return $response; } @@ -3189,14 +3523,16 @@ public function getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate = * @param string $integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $includeTiers Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. (optional, default to false) + * @param bool $includeProjectedTier Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer’s active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\LoyaltyBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\LoyaltyBalancesWithTiers|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) + public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null, $includeTiers = false, $includeProjectedTier = false) { - $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate, $subledgerId); + $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate, $subledgerId, $includeTiers, $includeProjectedTier); try { $options = $this->createHttpClientOption(); @@ -3229,14 +3565,14 @@ public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyBalances' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyBalancesWithTiers' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyBalances', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyBalancesWithTiers', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3278,7 +3614,7 @@ public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyBalances'; + $returnType = '\TalonOne\Client\Model\LoyaltyBalancesWithTiers'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3297,7 +3633,7 @@ public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyBalances', + '\TalonOne\Client\Model\LoyaltyBalancesWithTiers', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3340,13 +3676,15 @@ public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId * @param string $integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $includeTiers Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. (optional, default to false) + * @param bool $includeProjectedTier Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer’s active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyBalancesAsync($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) + public function getLoyaltyBalancesAsync($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null, $includeTiers = false, $includeProjectedTier = false) { - return $this->getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate, $subledgerId) + return $this->getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate, $subledgerId, $includeTiers, $includeProjectedTier) ->then( function ($response) { return $response[0]; @@ -3363,14 +3701,16 @@ function ($response) { * @param string $integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $includeTiers Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. (optional, default to false) + * @param bool $includeProjectedTier Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer’s active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) + public function getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null, $includeTiers = false, $includeProjectedTier = false) { - $returnType = '\TalonOne\Client\Model\LoyaltyBalances'; - $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate, $subledgerId); + $returnType = '\TalonOne\Client\Model\LoyaltyBalancesWithTiers'; + $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate, $subledgerId, $includeTiers, $includeProjectedTier); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3413,11 +3753,13 @@ function ($exception) { * @param string $integrationId The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $includeTiers Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. (optional, default to false) + * @param bool $includeProjectedTier Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer’s active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) + protected function getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null, $includeTiers = false, $includeProjectedTier = false) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { @@ -3453,6 +3795,20 @@ protected function getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, if ($subledgerId !== null) { $queryParams['subledgerId'] = $subledgerId; } + // query params + if (is_array($includeTiers)) { + $includeTiers = ObjectSerializer::serializeCollection($includeTiers, '', true); + } + if ($includeTiers !== null) { + $queryParams['includeTiers'] = $includeTiers; + } + // query params + if (is_array($includeProjectedTier)) { + $includeProjectedTier = ObjectSerializer::serializeCollection($includeProjectedTier, '', true); + } + if ($includeProjectedTier !== null) { + $queryParams['includeProjectedTier'] = $includeProjectedTier; + } // path params @@ -9263,7 +9619,7 @@ protected function updateCustomerProfilesV2Request($body, $silent = 'yes') * * @param string $customerSessionId The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) * @param \TalonOne\Client\Model\IntegrationRequest $body body (required) - * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint will **only** consider the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) + * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) * @param \DateTime $now A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). **Note:** - It must be an RFC3339 timestamp string. - It can **only** be a date in the future. - It can **only** be used if the `dry` parameter in the query is set to `true`. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -9283,7 +9639,7 @@ public function updateCustomerSessionV2($customerSessionId, $body, $dry = null, * * @param string $customerSessionId The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) * @param \TalonOne\Client\Model\IntegrationRequest $body body (required) - * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint will **only** consider the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) + * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) * @param \DateTime $now A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). **Note:** - It must be an RFC3339 timestamp string. - It can **only** be a date in the future. - It can **only** be used if the `dry` parameter in the query is set to `true`. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -9434,7 +9790,7 @@ public function updateCustomerSessionV2WithHttpInfo($customerSessionId, $body, $ * * @param string $customerSessionId The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) * @param \TalonOne\Client\Model\IntegrationRequest $body body (required) - * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint will **only** consider the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) + * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) * @param \DateTime $now A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). **Note:** - It must be an RFC3339 timestamp string. - It can **only** be a date in the future. - It can **only** be used if the `dry` parameter in the query is set to `true`. (optional) * * @throws \InvalidArgumentException @@ -9457,7 +9813,7 @@ function ($response) { * * @param string $customerSessionId The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) * @param \TalonOne\Client\Model\IntegrationRequest $body body (required) - * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint will **only** consider the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) + * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) * @param \DateTime $now A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). **Note:** - It must be an RFC3339 timestamp string. - It can **only** be a date in the future. - It can **only** be used if the `dry` parameter in the query is set to `true`. (optional) * * @throws \InvalidArgumentException @@ -9507,7 +9863,7 @@ function ($exception) { * * @param string $customerSessionId The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) * @param \TalonOne\Client\Model\IntegrationRequest $body body (required) - * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint will **only** consider the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) + * @param bool $dry Indicates whether to persist the changes. Changes are ignored when `dry=true`. When set to `true`: - The endpoint considers **only** the payload that you pass when **closing** the session. When you do not use the `dry` parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the `evaluableCampaignIds` body property to select specific campaigns to run. [See the docs](https://docs.talon.one/docs/dev/integration-api/dry-requests). (optional) * @param \DateTime $now A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). **Note:** - It must be an RFC3339 timestamp string. - It can **only** be a date in the future. - It can **only** be used if the `dry` parameter in the query is set to `true`. (optional) * * @throws \InvalidArgumentException diff --git a/lib/Api/ManagementApi.php b/lib/Api/ManagementApi.php index cf2ccbde..a80146ad 100644 --- a/lib/Api/ManagementApi.php +++ b/lib/Api/ManagementApi.php @@ -118,7 +118,7 @@ public function getConfig() /** * Operation activateUserByEmail * - * Activate user by email address + * Enable user by email address * * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) * @@ -134,7 +134,7 @@ public function activateUserByEmail($body) /** * Operation activateUserByEmailWithHttpInfo * - * Activate user by email address + * Enable user by email address * * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) * @@ -186,7 +186,7 @@ public function activateUserByEmailWithHttpInfo($body) /** * Operation activateUserByEmailAsync * - * Activate user by email address + * Enable user by email address * * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) * @@ -206,7 +206,7 @@ function ($response) { /** * Operation activateUserByEmailAsyncWithHttpInfo * - * Activate user by email address + * Enable user by email address * * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) * @@ -2500,38 +2500,38 @@ protected function createAttributeRequest($body) } /** - * Operation createCampaignFromTemplate + * Operation createBatchLoyaltyCards * - * Create campaign from campaign template + * Create loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\LoyaltyCardBatch $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\CreateTemplateCampaignResponse + * @return \TalonOne\Client\Model\LoyaltyCardBatchResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function createCampaignFromTemplate($applicationId, $body) + public function createBatchLoyaltyCards($loyaltyProgramId, $body) { - list($response) = $this->createCampaignFromTemplateWithHttpInfo($applicationId, $body); + list($response) = $this->createBatchLoyaltyCardsWithHttpInfo($loyaltyProgramId, $body); return $response; } /** - * Operation createCampaignFromTemplateWithHttpInfo + * Operation createBatchLoyaltyCardsWithHttpInfo * - * Create campaign from campaign template + * Create loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\LoyaltyCardBatch $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\CreateTemplateCampaignResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\LoyaltyCardBatchResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) + public function createBatchLoyaltyCardsWithHttpInfo($loyaltyProgramId, $body) { - $request = $this->createCampaignFromTemplateRequest($applicationId, $body); + $request = $this->createBatchLoyaltyCardsRequest($loyaltyProgramId, $body); try { $options = $this->createHttpClientOption(); @@ -2563,21 +2563,57 @@ public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) $responseBody = $response->getBody(); switch($statusCode) { - case 201: - if ('\TalonOne\Client\Model\CreateTemplateCampaignResponse' === '\SplFileObject') { + case 200: + if ('\TalonOne\Client\Model\LoyaltyCardBatchResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CreateTemplateCampaignResponse', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyCardBatchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CreateTemplateCampaignResponse'; + $returnType = '\TalonOne\Client\Model\LoyaltyCardBatchResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2593,10 +2629,34 @@ public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CreateTemplateCampaignResponse', + '\TalonOne\Client\Model\LoyaltyCardBatchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2607,19 +2667,19 @@ public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) } /** - * Operation createCampaignFromTemplateAsync + * Operation createBatchLoyaltyCardsAsync * - * Create campaign from campaign template + * Create loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\LoyaltyCardBatch $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignFromTemplateAsync($applicationId, $body) + public function createBatchLoyaltyCardsAsync($loyaltyProgramId, $body) { - return $this->createCampaignFromTemplateAsyncWithHttpInfo($applicationId, $body) + return $this->createBatchLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $body) ->then( function ($response) { return $response[0]; @@ -2628,20 +2688,20 @@ function ($response) { } /** - * Operation createCampaignFromTemplateAsyncWithHttpInfo + * Operation createBatchLoyaltyCardsAsyncWithHttpInfo * - * Create campaign from campaign template + * Create loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\LoyaltyCardBatch $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignFromTemplateAsyncWithHttpInfo($applicationId, $body) + public function createBatchLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $body) { - $returnType = '\TalonOne\Client\Model\CreateTemplateCampaignResponse'; - $request = $this->createCampaignFromTemplateRequest($applicationId, $body); + $returnType = '\TalonOne\Client\Model\LoyaltyCardBatchResponse'; + $request = $this->createBatchLoyaltyCardsRequest($loyaltyProgramId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2678,30 +2738,30 @@ function ($exception) { } /** - * Create request for operation 'createCampaignFromTemplate' + * Create request for operation 'createBatchLoyaltyCards' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\LoyaltyCardBatch $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createCampaignFromTemplateRequest($applicationId, $body) + protected function createBatchLoyaltyCardsRequest($loyaltyProgramId, $body) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling createCampaignFromTemplate' + 'Missing the required parameter $loyaltyProgramId when calling createBatchLoyaltyCards' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createCampaignFromTemplate' + 'Missing the required parameter $body when calling createBatchLoyaltyCards' ); } - $resourcePath = '/v1/applications/{applicationId}/create_campaign_from_template'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/batch'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2711,10 +2771,10 @@ protected function createCampaignFromTemplateRequest($applicationId, $body) // path params - if ($applicationId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -2797,40 +2857,38 @@ protected function createCampaignFromTemplateRequest($applicationId, $body) } /** - * Operation createCollection + * Operation createCampaignFromTemplate * - * Create campaign-level collection + * Create campaign from campaign template * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Collection + * @return \TalonOne\Client\Model\CreateTemplateCampaignResponse */ - public function createCollection($applicationId, $campaignId, $body) + public function createCampaignFromTemplate($applicationId, $body) { - list($response) = $this->createCollectionWithHttpInfo($applicationId, $campaignId, $body); + list($response) = $this->createCampaignFromTemplateWithHttpInfo($applicationId, $body); return $response; } /** - * Operation createCollectionWithHttpInfo + * Operation createCampaignFromTemplateWithHttpInfo * - * Create campaign-level collection + * Create campaign from campaign template * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Collection, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\CreateTemplateCampaignResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createCollectionWithHttpInfo($applicationId, $campaignId, $body) + public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) { - $request = $this->createCollectionRequest($applicationId, $campaignId, $body); + $request = $this->createCampaignFromTemplateRequest($applicationId, $body); try { $options = $this->createHttpClientOption(); @@ -2863,20 +2921,20 @@ public function createCollectionWithHttpInfo($applicationId, $campaignId, $body) $responseBody = $response->getBody(); switch($statusCode) { case 201: - if ('\TalonOne\Client\Model\Collection' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CreateTemplateCampaignResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Collection', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CreateTemplateCampaignResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Collection'; + $returnType = '\TalonOne\Client\Model\CreateTemplateCampaignResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2895,7 +2953,7 @@ public function createCollectionWithHttpInfo($applicationId, $campaignId, $body) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Collection', + '\TalonOne\Client\Model\CreateTemplateCampaignResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2906,20 +2964,19 @@ public function createCollectionWithHttpInfo($applicationId, $campaignId, $body) } /** - * Operation createCollectionAsync + * Operation createCampaignFromTemplateAsync * - * Create campaign-level collection + * Create campaign from campaign template * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCollectionAsync($applicationId, $campaignId, $body) + public function createCampaignFromTemplateAsync($applicationId, $body) { - return $this->createCollectionAsyncWithHttpInfo($applicationId, $campaignId, $body) + return $this->createCampaignFromTemplateAsyncWithHttpInfo($applicationId, $body) ->then( function ($response) { return $response[0]; @@ -2928,21 +2985,20 @@ function ($response) { } /** - * Operation createCollectionAsyncWithHttpInfo + * Operation createCampaignFromTemplateAsyncWithHttpInfo * - * Create campaign-level collection + * Create campaign from campaign template * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCollectionAsyncWithHttpInfo($applicationId, $campaignId, $body) + public function createCampaignFromTemplateAsyncWithHttpInfo($applicationId, $body) { - $returnType = '\TalonOne\Client\Model\Collection'; - $request = $this->createCollectionRequest($applicationId, $campaignId, $body); + $returnType = '\TalonOne\Client\Model\CreateTemplateCampaignResponse'; + $request = $this->createCampaignFromTemplateRequest($applicationId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2979,37 +3035,30 @@ function ($exception) { } /** - * Create request for operation 'createCollection' + * Create request for operation 'createCampaignFromTemplate' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\CreateTemplateCampaign $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createCollectionRequest($applicationId, $campaignId, $body) + protected function createCampaignFromTemplateRequest($applicationId, $body) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling createCollection' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling createCollection' + 'Missing the required parameter $applicationId when calling createCampaignFromTemplate' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createCollection' + 'Missing the required parameter $body when calling createCampaignFromTemplate' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections'; + $resourcePath = '/v1/applications/{applicationId}/create_campaign_from_template'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3026,14 +3075,6 @@ protected function createCollectionRequest($applicationId, $campaignId, $body) $resourcePath ); } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -3113,42 +3154,40 @@ protected function createCollectionRequest($applicationId, $campaignId, $body) } /** - * Operation createCoupons + * Operation createCollection * - * Create coupons + * Create campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCoupons $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2008 + * @return \TalonOne\Client\Model\Collection */ - public function createCoupons($applicationId, $campaignId, $body, $silent = 'yes') + public function createCollection($applicationId, $campaignId, $body) { - list($response) = $this->createCouponsWithHttpInfo($applicationId, $campaignId, $body, $silent); + list($response) = $this->createCollectionWithHttpInfo($applicationId, $campaignId, $body); return $response; } /** - * Operation createCouponsWithHttpInfo + * Operation createCollectionWithHttpInfo * - * Create coupons + * Create campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCoupons $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse2008, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Collection, HTTP status code, HTTP response headers (array of strings) */ - public function createCouponsWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') + public function createCollectionWithHttpInfo($applicationId, $campaignId, $body) { - $request = $this->createCouponsRequest($applicationId, $campaignId, $body, $silent); + $request = $this->createCollectionRequest($applicationId, $campaignId, $body); try { $options = $this->createHttpClientOption(); @@ -3180,21 +3219,21 @@ public function createCouponsWithHttpInfo($applicationId, $campaignId, $body, $s $responseBody = $response->getBody(); switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\InlineResponse2008' === '\SplFileObject') { + case 201: + if ('\TalonOne\Client\Model\Collection' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2008', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Collection', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2008'; + $returnType = '\TalonOne\Client\Model\Collection'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3210,10 +3249,10 @@ public function createCouponsWithHttpInfo($applicationId, $campaignId, $body, $s } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2008', + '\TalonOne\Client\Model\Collection', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3224,21 +3263,20 @@ public function createCouponsWithHttpInfo($applicationId, $campaignId, $body, $s } /** - * Operation createCouponsAsync + * Operation createCollectionAsync * - * Create coupons + * Create campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCoupons $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponsAsync($applicationId, $campaignId, $body, $silent = 'yes') + public function createCollectionAsync($applicationId, $campaignId, $body) { - return $this->createCouponsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent) + return $this->createCollectionAsyncWithHttpInfo($applicationId, $campaignId, $body) ->then( function ($response) { return $response[0]; @@ -3247,22 +3285,21 @@ function ($response) { } /** - * Operation createCouponsAsyncWithHttpInfo + * Operation createCollectionAsyncWithHttpInfo * - * Create coupons + * Create campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCoupons $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') + public function createCollectionAsyncWithHttpInfo($applicationId, $campaignId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse2008'; - $request = $this->createCouponsRequest($applicationId, $campaignId, $body, $silent); + $returnType = '\TalonOne\Client\Model\Collection'; + $request = $this->createCollectionRequest($applicationId, $campaignId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3299,51 +3336,43 @@ function ($exception) { } /** - * Create request for operation 'createCoupons' + * Create request for operation 'createCollection' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCoupons $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCampaignCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createCouponsRequest($applicationId, $campaignId, $body, $silent = 'yes') + protected function createCollectionRequest($applicationId, $campaignId, $body) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling createCoupons' + 'Missing the required parameter $applicationId when calling createCollection' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling createCoupons' + 'Missing the required parameter $campaignId when calling createCollection' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createCoupons' + 'Missing the required parameter $body when calling createCollection' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($silent)) { - $silent = ObjectSerializer::serializeCollection($silent, '', true); - } - if ($silent !== null) { - $queryParams['silent'] = $silent; - } // path params @@ -3441,40 +3470,42 @@ protected function createCouponsRequest($applicationId, $campaignId, $body, $sil } /** - * Operation createCouponsAsynchronously + * Operation createCoupons * - * Create coupons asynchronously + * Create coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) + * @param \TalonOne\Client\Model\NewCoupons $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\AsyncCouponCreationResponse + * @return \TalonOne\Client\Model\InlineResponse2008 */ - public function createCouponsAsynchronously($applicationId, $campaignId, $body) + public function createCoupons($applicationId, $campaignId, $body, $silent = 'yes') { - list($response) = $this->createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaignId, $body); + list($response) = $this->createCouponsWithHttpInfo($applicationId, $campaignId, $body, $silent); return $response; } /** - * Operation createCouponsAsynchronouslyWithHttpInfo + * Operation createCouponsWithHttpInfo * - * Create coupons asynchronously + * Create coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) + * @param \TalonOne\Client\Model\NewCoupons $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\AsyncCouponCreationResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse2008, HTTP status code, HTTP response headers (array of strings) */ - public function createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaignId, $body) + public function createCouponsWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') { - $request = $this->createCouponsAsynchronouslyRequest($applicationId, $campaignId, $body); + $request = $this->createCouponsRequest($applicationId, $campaignId, $body, $silent); try { $options = $this->createHttpClientOption(); @@ -3507,20 +3538,20 @@ public function createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaig $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\AsyncCouponCreationResponse' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2008' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AsyncCouponCreationResponse', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2008', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\AsyncCouponCreationResponse'; + $returnType = '\TalonOne\Client\Model\InlineResponse2008'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3539,7 +3570,7 @@ public function createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaig case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\AsyncCouponCreationResponse', + '\TalonOne\Client\Model\InlineResponse2008', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3550,20 +3581,21 @@ public function createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaig } /** - * Operation createCouponsAsynchronouslyAsync + * Operation createCouponsAsync * - * Create coupons asynchronously + * Create coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) + * @param \TalonOne\Client\Model\NewCoupons $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponsAsynchronouslyAsync($applicationId, $campaignId, $body) + public function createCouponsAsync($applicationId, $campaignId, $body, $silent = 'yes') { - return $this->createCouponsAsynchronouslyAsyncWithHttpInfo($applicationId, $campaignId, $body) + return $this->createCouponsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent) ->then( function ($response) { return $response[0]; @@ -3572,21 +3604,22 @@ function ($response) { } /** - * Operation createCouponsAsynchronouslyAsyncWithHttpInfo + * Operation createCouponsAsyncWithHttpInfo * - * Create coupons asynchronously + * Create coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) + * @param \TalonOne\Client\Model\NewCoupons $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponsAsynchronouslyAsyncWithHttpInfo($applicationId, $campaignId, $body) + public function createCouponsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') { - $returnType = '\TalonOne\Client\Model\AsyncCouponCreationResponse'; - $request = $this->createCouponsAsynchronouslyRequest($applicationId, $campaignId, $body); + $returnType = '\TalonOne\Client\Model\InlineResponse2008'; + $request = $this->createCouponsRequest($applicationId, $campaignId, $body, $silent); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3623,43 +3656,51 @@ function ($exception) { } /** - * Create request for operation 'createCouponsAsync' + * Create request for operation 'createCoupons' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) + * @param \TalonOne\Client\Model\NewCoupons $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createCouponsAsyncRequest($applicationId, $campaignId, $body) + protected function createCouponsRequest($applicationId, $campaignId, $body, $silent = 'yes') { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling createCouponsAsync' + 'Missing the required parameter $applicationId when calling createCoupons' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling createCouponsAsync' + 'Missing the required parameter $campaignId when calling createCoupons' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createCouponsAsync' + 'Missing the required parameter $body when calling createCoupons' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($silent)) { + $silent = ObjectSerializer::serializeCollection($silent, '', true); + } + if ($silent !== null) { + $queryParams['silent'] = $silent; + } // path params @@ -3757,42 +3798,40 @@ protected function createCouponsAsyncRequest($applicationId, $campaignId, $body) } /** - * Operation createCouponsForMultipleRecipients + * Operation createCouponsAsynchronously * - * Create coupons for multiple recipients + * Create coupons asynchronously * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2008 + * @return \TalonOne\Client\Model\AsyncCouponCreationResponse */ - public function createCouponsForMultipleRecipients($applicationId, $campaignId, $body, $silent = 'yes') + public function createCouponsAsynchronously($applicationId, $campaignId, $body) { - list($response) = $this->createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $campaignId, $body, $silent); + list($response) = $this->createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaignId, $body); return $response; } /** - * Operation createCouponsForMultipleRecipientsWithHttpInfo + * Operation createCouponsAsynchronouslyWithHttpInfo * - * Create coupons for multiple recipients + * Create coupons asynchronously * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse2008, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\AsyncCouponCreationResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') + public function createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaignId, $body) { - $request = $this->createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent); + $request = $this->createCouponsAsyncRequest($applicationId, $campaignId, $body); try { $options = $this->createHttpClientOption(); @@ -3825,20 +3864,20 @@ public function createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2008' === '\SplFileObject') { + if ('\TalonOne\Client\Model\AsyncCouponCreationResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2008', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AsyncCouponCreationResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2008'; + $returnType = '\TalonOne\Client\Model\AsyncCouponCreationResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3857,7 +3896,7 @@ public function createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2008', + '\TalonOne\Client\Model\AsyncCouponCreationResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3868,21 +3907,20 @@ public function createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $ } /** - * Operation createCouponsForMultipleRecipientsAsync + * Operation createCouponsAsynchronouslyAsync * - * Create coupons for multiple recipients + * Create coupons asynchronously * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponsForMultipleRecipientsAsync($applicationId, $campaignId, $body, $silent = 'yes') + public function createCouponsAsynchronouslyAsync($applicationId, $campaignId, $body) { - return $this->createCouponsForMultipleRecipientsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent) + return $this->createCouponsAsynchronouslyAsyncWithHttpInfo($applicationId, $campaignId, $body) ->then( function ($response) { return $response[0]; @@ -3891,22 +3929,21 @@ function ($response) { } /** - * Operation createCouponsForMultipleRecipientsAsyncWithHttpInfo + * Operation createCouponsAsynchronouslyAsyncWithHttpInfo * - * Create coupons for multiple recipients + * Create coupons asynchronously * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCouponsForMultipleRecipientsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') + public function createCouponsAsynchronouslyAsyncWithHttpInfo($applicationId, $campaignId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse2008'; - $request = $this->createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent); + $returnType = '\TalonOne\Client\Model\AsyncCouponCreationResponse'; + $request = $this->createCouponsAsyncRequest($applicationId, $campaignId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3943,51 +3980,43 @@ function ($exception) { } /** - * Create request for operation 'createCouponsForMultipleRecipients' + * Create request for operation 'createCouponsAsync' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) - * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') + * @param \TalonOne\Client\Model\NewCouponCreationJob $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent = 'yes') + protected function createCouponsAsyncRequest($applicationId, $campaignId, $body) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling createCouponsForMultipleRecipients' + 'Missing the required parameter $applicationId when calling createCouponsAsync' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling createCouponsForMultipleRecipients' + 'Missing the required parameter $campaignId when calling createCouponsAsync' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createCouponsForMultipleRecipients' + 'Missing the required parameter $body when calling createCouponsAsync' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($silent)) { - $silent = ObjectSerializer::serializeCollection($silent, '', true); - } - if ($silent !== null) { - $queryParams['silent'] = $silent; - } // path params @@ -4085,36 +4114,40 @@ protected function createCouponsForMultipleRecipientsRequest($applicationId, $ca } /** - * Operation createInviteEmail + * Operation createCouponsDeletionJob * - * Resend invitation email + * Creates a coupon deletion job * - * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponDeletionJob $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\NewInviteEmail + * @return \TalonOne\Client\Model\AsyncCouponDeletionJobResponse */ - public function createInviteEmail($body) + public function createCouponsDeletionJob($applicationId, $campaignId, $body) { - list($response) = $this->createInviteEmailWithHttpInfo($body); + list($response) = $this->createCouponsDeletionJobWithHttpInfo($applicationId, $campaignId, $body); return $response; } /** - * Operation createInviteEmailWithHttpInfo + * Operation createCouponsDeletionJobWithHttpInfo * - * Resend invitation email + * Creates a coupon deletion job * - * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponDeletionJob $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\NewInviteEmail, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\AsyncCouponDeletionJobResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createInviteEmailWithHttpInfo($body) + public function createCouponsDeletionJobWithHttpInfo($applicationId, $campaignId, $body) { - $request = $this->createInviteEmailRequest($body); + $request = $this->createCouponsDeletionJobRequest($applicationId, $campaignId, $body); try { $options = $this->createHttpClientOption(); @@ -4146,21 +4179,21 @@ public function createInviteEmailWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { - case 201: - if ('\TalonOne\Client\Model\NewInviteEmail' === '\SplFileObject') { + case 202: + if ('\TalonOne\Client\Model\AsyncCouponDeletionJobResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\NewInviteEmail', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AsyncCouponDeletionJobResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\NewInviteEmail'; + $returnType = '\TalonOne\Client\Model\AsyncCouponDeletionJobResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4176,10 +4209,10 @@ public function createInviteEmailWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\NewInviteEmail', + '\TalonOne\Client\Model\AsyncCouponDeletionJobResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4190,18 +4223,20 @@ public function createInviteEmailWithHttpInfo($body) } /** - * Operation createInviteEmailAsync + * Operation createCouponsDeletionJobAsync * - * Resend invitation email + * Creates a coupon deletion job * - * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponDeletionJob $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createInviteEmailAsync($body) + public function createCouponsDeletionJobAsync($applicationId, $campaignId, $body) { - return $this->createInviteEmailAsyncWithHttpInfo($body) + return $this->createCouponsDeletionJobAsyncWithHttpInfo($applicationId, $campaignId, $body) ->then( function ($response) { return $response[0]; @@ -4210,19 +4245,21 @@ function ($response) { } /** - * Operation createInviteEmailAsyncWithHttpInfo + * Operation createCouponsDeletionJobAsyncWithHttpInfo * - * Resend invitation email + * Creates a coupon deletion job * - * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponDeletionJob $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createInviteEmailAsyncWithHttpInfo($body) + public function createCouponsDeletionJobAsyncWithHttpInfo($applicationId, $campaignId, $body) { - $returnType = '\TalonOne\Client\Model\NewInviteEmail'; - $request = $this->createInviteEmailRequest($body); + $returnType = '\TalonOne\Client\Model\AsyncCouponDeletionJobResponse'; + $request = $this->createCouponsDeletionJobRequest($applicationId, $campaignId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4259,23 +4296,37 @@ function ($exception) { } /** - * Create request for operation 'createInviteEmail' + * Create request for operation 'createCouponsDeletionJob' * - * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponDeletionJob $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createInviteEmailRequest($body) + protected function createCouponsDeletionJobRequest($applicationId, $campaignId, $body) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling createCouponsDeletionJob' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling createCouponsDeletionJob' + ); + } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createInviteEmail' + 'Missing the required parameter $body when calling createCouponsDeletionJob' ); } - $resourcePath = '/v1/invite_emails'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_deletion_jobs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4284,6 +4335,22 @@ protected function createInviteEmailRequest($body) + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -4363,36 +4430,42 @@ protected function createInviteEmailRequest($body) } /** - * Operation createInviteV2 + * Operation createCouponsForMultipleRecipients * - * Invite user + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewInvitation $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\User + * @return \TalonOne\Client\Model\InlineResponse2008 */ - public function createInviteV2($body) + public function createCouponsForMultipleRecipients($applicationId, $campaignId, $body, $silent = 'yes') { - list($response) = $this->createInviteV2WithHttpInfo($body); + list($response) = $this->createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $campaignId, $body, $silent); return $response; } /** - * Operation createInviteV2WithHttpInfo + * Operation createCouponsForMultipleRecipientsWithHttpInfo * - * Invite user + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewInvitation $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\User, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse2008, HTTP status code, HTTP response headers (array of strings) */ - public function createInviteV2WithHttpInfo($body) + public function createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') { - $request = $this->createInviteV2Request($body); + $request = $this->createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent); try { $options = $this->createHttpClientOption(); @@ -4424,21 +4497,21 @@ public function createInviteV2WithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { - case 201: - if ('\TalonOne\Client\Model\User' === '\SplFileObject') { + case 200: + if ('\TalonOne\Client\Model\InlineResponse2008' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\User', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2008', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\User'; + $returnType = '\TalonOne\Client\Model\InlineResponse2008'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4454,10 +4527,10 @@ public function createInviteV2WithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\User', + '\TalonOne\Client\Model\InlineResponse2008', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4468,18 +4541,21 @@ public function createInviteV2WithHttpInfo($body) } /** - * Operation createInviteV2Async + * Operation createCouponsForMultipleRecipientsAsync * - * Invite user + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewInvitation $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createInviteV2Async($body) + public function createCouponsForMultipleRecipientsAsync($applicationId, $campaignId, $body, $silent = 'yes') { - return $this->createInviteV2AsyncWithHttpInfo($body) + return $this->createCouponsForMultipleRecipientsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent) ->then( function ($response) { return $response[0]; @@ -4488,19 +4564,22 @@ function ($response) { } /** - * Operation createInviteV2AsyncWithHttpInfo + * Operation createCouponsForMultipleRecipientsAsyncWithHttpInfo * - * Invite user + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewInvitation $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createInviteV2AsyncWithHttpInfo($body) + public function createCouponsForMultipleRecipientsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') { - $returnType = '\TalonOne\Client\Model\User'; - $request = $this->createInviteV2Request($body); + $returnType = '\TalonOne\Client\Model\InlineResponse2008'; + $request = $this->createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4537,31 +4616,69 @@ function ($exception) { } /** - * Create request for operation 'createInviteV2' + * Create request for operation 'createCouponsForMultipleRecipients' * - * @param \TalonOne\Client\Model\NewInvitation $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewCouponsForMultipleRecipients $body body (required) + * @param string $silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (optional, default to 'yes') * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createInviteV2Request($body) + protected function createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent = 'yes') { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling createCouponsForMultipleRecipients' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling createCouponsForMultipleRecipients' + ); + } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createInviteV2' + 'Missing the required parameter $body when calling createCouponsForMultipleRecipients' ); } - $resourcePath = '/v2/invites'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($silent)) { + $silent = ObjectSerializer::serializeCollection($silent, '', true); + } + if ($silent !== null) { + $queryParams['silent'] = $silent; + } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -4641,36 +4758,36 @@ protected function createInviteV2Request($body) } /** - * Operation createPasswordRecoveryEmail + * Operation createInviteEmail * - * Request a password reset + * Resend invitation email * - * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\NewPasswordEmail + * @return \TalonOne\Client\Model\NewInviteEmail */ - public function createPasswordRecoveryEmail($body) + public function createInviteEmail($body) { - list($response) = $this->createPasswordRecoveryEmailWithHttpInfo($body); + list($response) = $this->createInviteEmailWithHttpInfo($body); return $response; } /** - * Operation createPasswordRecoveryEmailWithHttpInfo + * Operation createInviteEmailWithHttpInfo * - * Request a password reset + * Resend invitation email * - * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\NewPasswordEmail, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\NewInviteEmail, HTTP status code, HTTP response headers (array of strings) */ - public function createPasswordRecoveryEmailWithHttpInfo($body) + public function createInviteEmailWithHttpInfo($body) { - $request = $this->createPasswordRecoveryEmailRequest($body); + $request = $this->createInviteEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -4702,21 +4819,21 @@ public function createPasswordRecoveryEmailWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { - case 204: - if ('\TalonOne\Client\Model\NewPasswordEmail' === '\SplFileObject') { + case 201: + if ('\TalonOne\Client\Model\NewInviteEmail' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\NewPasswordEmail', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\NewInviteEmail', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; + $returnType = '\TalonOne\Client\Model\NewInviteEmail'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4732,10 +4849,10 @@ public function createPasswordRecoveryEmailWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { - case 204: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\NewPasswordEmail', + '\TalonOne\Client\Model\NewInviteEmail', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4746,18 +4863,18 @@ public function createPasswordRecoveryEmailWithHttpInfo($body) } /** - * Operation createPasswordRecoveryEmailAsync + * Operation createInviteEmailAsync * - * Request a password reset + * Resend invitation email * - * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPasswordRecoveryEmailAsync($body) + public function createInviteEmailAsync($body) { - return $this->createPasswordRecoveryEmailAsyncWithHttpInfo($body) + return $this->createInviteEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -4766,19 +4883,19 @@ function ($response) { } /** - * Operation createPasswordRecoveryEmailAsyncWithHttpInfo + * Operation createInviteEmailAsyncWithHttpInfo * - * Request a password reset + * Resend invitation email * - * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPasswordRecoveryEmailAsyncWithHttpInfo($body) + public function createInviteEmailAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; - $request = $this->createPasswordRecoveryEmailRequest($body); + $returnType = '\TalonOne\Client\Model\NewInviteEmail'; + $request = $this->createInviteEmailRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4815,23 +4932,23 @@ function ($exception) { } /** - * Create request for operation 'createPasswordRecoveryEmail' + * Create request for operation 'createInviteEmail' * - * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createPasswordRecoveryEmailRequest($body) + protected function createInviteEmailRequest($body) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createPasswordRecoveryEmail' + 'Missing the required parameter $body when calling createInviteEmail' ); } - $resourcePath = '/v1/password_recovery_emails'; + $resourcePath = '/v1/invite_emails'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4919,36 +5036,36 @@ protected function createPasswordRecoveryEmailRequest($body) } /** - * Operation createSession + * Operation createInviteV2 * - * Create session + * Invite user * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInvitation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Session + * @return \TalonOne\Client\Model\User */ - public function createSession($body) + public function createInviteV2($body) { - list($response) = $this->createSessionWithHttpInfo($body); + list($response) = $this->createInviteV2WithHttpInfo($body); return $response; } /** - * Operation createSessionWithHttpInfo + * Operation createInviteV2WithHttpInfo * - * Create session + * Invite user * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInvitation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Session, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ - public function createSessionWithHttpInfo($body) + public function createInviteV2WithHttpInfo($body) { - $request = $this->createSessionRequest($body); + $request = $this->createInviteV2Request($body); try { $options = $this->createHttpClientOption(); @@ -4981,20 +5098,20 @@ public function createSessionWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { case 201: - if ('\TalonOne\Client\Model\Session' === '\SplFileObject') { + if ('\TalonOne\Client\Model\User' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Session', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\User', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Session'; + $returnType = '\TalonOne\Client\Model\User'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5013,7 +5130,7 @@ public function createSessionWithHttpInfo($body) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Session', + '\TalonOne\Client\Model\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5024,18 +5141,18 @@ public function createSessionWithHttpInfo($body) } /** - * Operation createSessionAsync + * Operation createInviteV2Async * - * Create session + * Invite user * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSessionAsync($body) + public function createInviteV2Async($body) { - return $this->createSessionAsyncWithHttpInfo($body) + return $this->createInviteV2AsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -5044,19 +5161,19 @@ function ($response) { } /** - * Operation createSessionAsyncWithHttpInfo + * Operation createInviteV2AsyncWithHttpInfo * - * Create session + * Invite user * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSessionAsyncWithHttpInfo($body) + public function createInviteV2AsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\Session'; - $request = $this->createSessionRequest($body); + $returnType = '\TalonOne\Client\Model\User'; + $request = $this->createInviteV2Request($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5093,23 +5210,23 @@ function ($exception) { } /** - * Create request for operation 'createSession' + * Create request for operation 'createInviteV2' * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createSessionRequest($body) + protected function createInviteV2Request($body) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createSession' + 'Missing the required parameter $body when calling createInviteV2' ); } - $resourcePath = '/v1/sessions'; + $resourcePath = '/v2/invites'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5197,38 +5314,36 @@ protected function createSessionRequest($body) } /** - * Operation createStore + * Operation createPasswordRecoveryEmail * - * Create store + * Request a password reset * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewStore $body body (required) + * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\NewPasswordEmail */ - public function createStore($applicationId, $body) + public function createPasswordRecoveryEmail($body) { - list($response) = $this->createStoreWithHttpInfo($applicationId, $body); + list($response) = $this->createPasswordRecoveryEmailWithHttpInfo($body); return $response; } /** - * Operation createStoreWithHttpInfo + * Operation createPasswordRecoveryEmailWithHttpInfo * - * Create store + * Request a password reset * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewStore $body body (required) + * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\NewPasswordEmail, HTTP status code, HTTP response headers (array of strings) */ - public function createStoreWithHttpInfo($applicationId, $body) + public function createPasswordRecoveryEmailWithHttpInfo($body) { - $request = $this->createStoreRequest($applicationId, $body); + $request = $this->createPasswordRecoveryEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -5260,45 +5375,21 @@ public function createStoreWithHttpInfo($applicationId, $body) $responseBody = $response->getBody(); switch($statusCode) { - case 201: - if ('\TalonOne\Client\Model\Store' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Store', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + case 204: + if ('\TalonOne\Client\Model\NewPasswordEmail' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\NewPasswordEmail', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Store'; + $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5314,26 +5405,10 @@ public function createStoreWithHttpInfo($applicationId, $body) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\Store', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 409: + case 204: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\NewPasswordEmail', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5344,19 +5419,18 @@ public function createStoreWithHttpInfo($applicationId, $body) } /** - * Operation createStoreAsync + * Operation createPasswordRecoveryEmailAsync * - * Create store + * Request a password reset * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewStore $body body (required) + * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStoreAsync($applicationId, $body) + public function createPasswordRecoveryEmailAsync($body) { - return $this->createStoreAsyncWithHttpInfo($applicationId, $body) + return $this->createPasswordRecoveryEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -5365,20 +5439,19 @@ function ($response) { } /** - * Operation createStoreAsyncWithHttpInfo + * Operation createPasswordRecoveryEmailAsyncWithHttpInfo * - * Create store + * Request a password reset * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewStore $body body (required) + * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStoreAsyncWithHttpInfo($applicationId, $body) + public function createPasswordRecoveryEmailAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\Store'; - $request = $this->createStoreRequest($applicationId, $body); + $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; + $request = $this->createPasswordRecoveryEmailRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5415,30 +5488,23 @@ function ($exception) { } /** - * Create request for operation 'createStore' + * Create request for operation 'createPasswordRecoveryEmail' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewStore $body body (required) + * @param \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createStoreRequest($applicationId, $body) + protected function createPasswordRecoveryEmailRequest($body) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling createStore' - ); - } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createStore' + 'Missing the required parameter $body when calling createPasswordRecoveryEmail' ); } - $resourcePath = '/v1/applications/{applicationId}/stores'; + $resourcePath = '/v1/password_recovery_emails'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5447,14 +5513,6 @@ protected function createStoreRequest($applicationId, $body) - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -5534,35 +5592,36 @@ protected function createStoreRequest($applicationId, $body) } /** - * Operation deactivateUserByEmail + * Operation createSession * - * Deactivate user by email address + * Create session * - * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) + * @param \TalonOne\Client\Model\LoginParams $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\Session */ - public function deactivateUserByEmail($body) + public function createSession($body) { - $this->deactivateUserByEmailWithHttpInfo($body); + list($response) = $this->createSessionWithHttpInfo($body); + return $response; } /** - * Operation deactivateUserByEmailWithHttpInfo + * Operation createSessionWithHttpInfo * - * Deactivate user by email address + * Create session * - * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) + * @param \TalonOne\Client\Model\LoginParams $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Session, HTTP status code, HTTP response headers (array of strings) */ - public function deactivateUserByEmailWithHttpInfo($body) + public function createSessionWithHttpInfo($body) { - $request = $this->deactivateUserByEmailRequest($body); + $request = $this->createSessionRequest($body); try { $options = $this->createHttpClientOption(); @@ -5592,28 +5651,64 @@ public function deactivateUserByEmailWithHttpInfo($body) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 201: + if ('\TalonOne\Client\Model\Session' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Session', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Session'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Session', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deactivateUserByEmailAsync + * Operation createSessionAsync * - * Deactivate user by email address + * Create session * - * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) + * @param \TalonOne\Client\Model\LoginParams $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deactivateUserByEmailAsync($body) + public function createSessionAsync($body) { - return $this->deactivateUserByEmailAsyncWithHttpInfo($body) + return $this->createSessionAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -5622,25 +5717,36 @@ function ($response) { } /** - * Operation deactivateUserByEmailAsyncWithHttpInfo + * Operation createSessionAsyncWithHttpInfo * - * Deactivate user by email address + * Create session * - * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) + * @param \TalonOne\Client\Model\LoginParams $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deactivateUserByEmailAsyncWithHttpInfo($body) + public function createSessionAsyncWithHttpInfo($body) { - $returnType = ''; - $request = $this->deactivateUserByEmailRequest($body); + $returnType = '\TalonOne\Client\Model\Session'; + $request = $this->createSessionRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -5660,23 +5766,23 @@ function ($exception) { } /** - * Create request for operation 'deactivateUserByEmail' + * Create request for operation 'createSession' * - * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) + * @param \TalonOne\Client\Model\LoginParams $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deactivateUserByEmailRequest($body) + protected function createSessionRequest($body) { // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling deactivateUserByEmail' + 'Missing the required parameter $body when calling createSession' ); } - $resourcePath = '/v1/users/deactivate'; + $resourcePath = '/v1/sessions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5694,11 +5800,11 @@ protected function deactivateUserByEmailRequest($body) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], ['application/json'] ); } @@ -5764,39 +5870,38 @@ protected function deactivateUserByEmailRequest($body) } /** - * Operation deductLoyaltyCardPoints + * Operation createStore * - * Deduct points from card + * Create store * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewStore $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body) + public function createStore($applicationId, $body) { - $this->deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); + list($response) = $this->createStoreWithHttpInfo($applicationId, $body); + return $response; } /** - * Operation deductLoyaltyCardPointsWithHttpInfo + * Operation createStoreWithHttpInfo * - * Deduct points from card + * Create store * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewStore $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function createStoreWithHttpInfo($applicationId, $body) { - $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); + $request = $this->createStoreRequest($applicationId, $body); try { $options = $this->createHttpClientOption(); @@ -5826,27 +5931,79 @@ public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyC ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 201: + if ('\TalonOne\Client\Model\Store' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Store', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Store'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { - case 400: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\Store', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -5860,20 +6017,19 @@ public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyC } /** - * Operation deductLoyaltyCardPointsAsync + * Operation createStoreAsync * - * Deduct points from card + * Create store * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deductLoyaltyCardPointsAsync($loyaltyProgramId, $loyaltyCardId, $body) + public function createStoreAsync($applicationId, $body) { - return $this->deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + return $this->createStoreAsyncWithHttpInfo($applicationId, $body) ->then( function ($response) { return $response[0]; @@ -5882,27 +6038,37 @@ function ($response) { } /** - * Operation deductLoyaltyCardPointsAsyncWithHttpInfo + * Operation createStoreAsyncWithHttpInfo * - * Deduct points from card + * Create store * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function createStoreAsyncWithHttpInfo($applicationId, $body) { - $returnType = ''; - $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); + $returnType = '\TalonOne\Client\Model\Store'; + $request = $this->createStoreRequest($applicationId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -5922,41 +6088,30 @@ function ($exception) { } /** - * Create request for operation 'deductLoyaltyCardPoints' + * Create request for operation 'createStore' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body) + protected function createStoreRequest($applicationId, $body) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling deductLoyaltyCardPoints' - ); - } - // verify the required parameter 'loyaltyCardId' is set - if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling deductLoyaltyCardPoints' + 'Missing the required parameter $applicationId when calling createStore' ); } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.deductLoyaltyCardPoints, must be smaller than or equal to 108.'); - } - // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling deductLoyaltyCardPoints' + 'Missing the required parameter $body when calling createStore' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points'; + $resourcePath = '/v1/applications/{applicationId}/stores'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5966,18 +6121,10 @@ protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCar // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } - // path params - if ($loyaltyCardId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -6052,7 +6199,7 @@ protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCar $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6060,35 +6207,35 @@ protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCar } /** - * Operation deleteAccountCollection + * Operation deactivateUserByEmail * - * Delete account-level collection + * Disable user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteAccountCollection($collectionId) + public function deactivateUserByEmail($body) { - $this->deleteAccountCollectionWithHttpInfo($collectionId); + $this->deactivateUserByEmailWithHttpInfo($body); } /** - * Operation deleteAccountCollectionWithHttpInfo + * Operation deactivateUserByEmailWithHttpInfo * - * Delete account-level collection + * Disable user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteAccountCollectionWithHttpInfo($collectionId) + public function deactivateUserByEmailWithHttpInfo($body) { - $request = $this->deleteAccountCollectionRequest($collectionId); + $request = $this->deactivateUserByEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -6122,32 +6269,24 @@ public function deleteAccountCollectionWithHttpInfo($collectionId) } catch (ApiException $e) { switch ($e->getCode()) { - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation deleteAccountCollectionAsync + * Operation deactivateUserByEmailAsync * - * Delete account-level collection + * Disable user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccountCollectionAsync($collectionId) + public function deactivateUserByEmailAsync($body) { - return $this->deleteAccountCollectionAsyncWithHttpInfo($collectionId) + return $this->deactivateUserByEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -6156,19 +6295,19 @@ function ($response) { } /** - * Operation deleteAccountCollectionAsyncWithHttpInfo + * Operation deactivateUserByEmailAsyncWithHttpInfo * - * Delete account-level collection + * Disable user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccountCollectionAsyncWithHttpInfo($collectionId) + public function deactivateUserByEmailAsyncWithHttpInfo($body) { $returnType = ''; - $request = $this->deleteAccountCollectionRequest($collectionId); + $request = $this->deactivateUserByEmailRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6194,23 +6333,23 @@ function ($exception) { } /** - * Create request for operation 'deleteAccountCollection' + * Create request for operation 'deactivateUserByEmail' * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAccountCollectionRequest($collectionId) + protected function deactivateUserByEmailRequest($body) { - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling deleteAccountCollection' + 'Missing the required parameter $body when calling deactivateUserByEmail' ); } - $resourcePath = '/v1/collections/{collectionId}'; + $resourcePath = '/v1/users/deactivate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6219,26 +6358,21 @@ protected function deleteAccountCollectionRequest($collectionId) - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + [], + ['application/json'] ); } @@ -6295,7 +6429,7 @@ protected function deleteAccountCollectionRequest($collectionId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6303,39 +6437,39 @@ protected function deleteAccountCollectionRequest($collectionId) } /** - * Operation deleteAchievement + * Operation deductLoyaltyCardPoints * - * Delete achievement + * Deduct points from card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteAchievement($applicationId, $campaignId, $achievementId) + public function deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body) { - $this->deleteAchievementWithHttpInfo($applicationId, $campaignId, $achievementId); + $this->deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); } /** - * Operation deleteAchievementWithHttpInfo + * Operation deductLoyaltyCardPointsWithHttpInfo * - * Delete achievement + * Deduct points from card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteAchievementWithHttpInfo($applicationId, $campaignId, $achievementId) + public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { - $request = $this->deleteAchievementRequest($applicationId, $campaignId, $achievementId); + $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); try { $options = $this->createHttpClientOption(); @@ -6369,6 +6503,14 @@ public function deleteAchievementWithHttpInfo($applicationId, $campaignId, $achi } catch (ApiException $e) { switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6391,20 +6533,20 @@ public function deleteAchievementWithHttpInfo($applicationId, $campaignId, $achi } /** - * Operation deleteAchievementAsync + * Operation deductLoyaltyCardPointsAsync * - * Delete achievement + * Deduct points from card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAchievementAsync($applicationId, $campaignId, $achievementId) + public function deductLoyaltyCardPointsAsync($loyaltyProgramId, $loyaltyCardId, $body) { - return $this->deleteAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) + return $this->deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) ->then( function ($response) { return $response[0]; @@ -6413,21 +6555,21 @@ function ($response) { } /** - * Operation deleteAchievementAsyncWithHttpInfo + * Operation deductLoyaltyCardPointsAsyncWithHttpInfo * - * Delete achievement + * Deduct points from card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) + public function deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { $returnType = ''; - $request = $this->deleteAchievementRequest($applicationId, $campaignId, $achievementId); + $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6453,37 +6595,41 @@ function ($exception) { } /** - * Create request for operation 'deleteAchievement' + * Create request for operation 'deductLoyaltyCardPoints' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAchievementRequest($applicationId, $campaignId, $achievementId) + protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling deleteAchievement' + 'Missing the required parameter $loyaltyProgramId when calling deductLoyaltyCardPoints' ); } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'loyaltyCardId' is set + if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling deleteAchievement' + 'Missing the required parameter $loyaltyCardId when calling deductLoyaltyCardPoints' ); } - // verify the required parameter 'achievementId' is set - if ($achievementId === null || (is_array($achievementId) && count($achievementId) === 0)) { + if (strlen($loyaltyCardId) > 108) { + throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.deductLoyaltyCardPoints, must be smaller than or equal to 108.'); + } + + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $achievementId when calling deleteAchievement' + 'Missing the required parameter $body when calling deductLoyaltyCardPoints' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6493,32 +6639,27 @@ protected function deleteAchievementRequest($applicationId, $campaignId, $achiev // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } // path params - if ($achievementId !== null) { + if ($loyaltyCardId !== null) { $resourcePath = str_replace( - '{' . 'achievementId' . '}', - ObjectSerializer::toPathValue($achievementId), + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), $resourcePath ); } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -6527,7 +6668,7 @@ protected function deleteAchievementRequest($applicationId, $campaignId, $achiev } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -6584,7 +6725,7 @@ protected function deleteAchievementRequest($applicationId, $campaignId, $achiev $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6592,37 +6733,35 @@ protected function deleteAchievementRequest($applicationId, $campaignId, $achiev } /** - * Operation deleteCampaign + * Operation deleteAccountCollection * - * Delete campaign + * Delete account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteCampaign($applicationId, $campaignId) + public function deleteAccountCollection($collectionId) { - $this->deleteCampaignWithHttpInfo($applicationId, $campaignId); + $this->deleteAccountCollectionWithHttpInfo($collectionId); } /** - * Operation deleteCampaignWithHttpInfo + * Operation deleteAccountCollectionWithHttpInfo * - * Delete campaign + * Delete account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCampaignWithHttpInfo($applicationId, $campaignId) + public function deleteAccountCollectionWithHttpInfo($collectionId) { - $request = $this->deleteCampaignRequest($applicationId, $campaignId); + $request = $this->deleteAccountCollectionRequest($collectionId); try { $options = $this->createHttpClientOption(); @@ -6656,25 +6795,32 @@ public function deleteCampaignWithHttpInfo($applicationId, $campaignId) } catch (ApiException $e) { switch ($e->getCode()) { + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteCampaignAsync + * Operation deleteAccountCollectionAsync * - * Delete campaign + * Delete account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignAsync($applicationId, $campaignId) + public function deleteAccountCollectionAsync($collectionId) { - return $this->deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) + return $this->deleteAccountCollectionAsyncWithHttpInfo($collectionId) ->then( function ($response) { return $response[0]; @@ -6683,20 +6829,19 @@ function ($response) { } /** - * Operation deleteCampaignAsyncWithHttpInfo + * Operation deleteAccountCollectionAsyncWithHttpInfo * - * Delete campaign + * Delete account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) + public function deleteAccountCollectionAsyncWithHttpInfo($collectionId) { $returnType = ''; - $request = $this->deleteCampaignRequest($applicationId, $campaignId); + $request = $this->deleteAccountCollectionRequest($collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6722,30 +6867,23 @@ function ($exception) { } /** - * Create request for operation 'deleteCampaign' + * Create request for operation 'deleteAccountCollection' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteCampaignRequest($applicationId, $campaignId) + protected function deleteAccountCollectionRequest($collectionId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling deleteCampaign' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling deleteCampaign' + 'Missing the required parameter $collectionId when calling deleteAccountCollection' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; + $resourcePath = '/v1/collections/{collectionId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6755,18 +6893,10 @@ protected function deleteCampaignRequest($applicationId, $campaignId) // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($collectionId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -6776,11 +6906,11 @@ protected function deleteCampaignRequest($applicationId, $campaignId) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], [] ); } @@ -6846,39 +6976,39 @@ protected function deleteCampaignRequest($applicationId, $campaignId) } /** - * Operation deleteCollection + * Operation deleteAchievement * - * Delete campaign-level collection + * Delete achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteCollection($applicationId, $campaignId, $collectionId) + public function deleteAchievement($applicationId, $campaignId, $achievementId) { - $this->deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); + $this->deleteAchievementWithHttpInfo($applicationId, $campaignId, $achievementId); } /** - * Operation deleteCollectionWithHttpInfo + * Operation deleteAchievementWithHttpInfo * - * Delete campaign-level collection + * Delete achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) + public function deleteAchievementWithHttpInfo($applicationId, $campaignId, $achievementId) { - $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); + $request = $this->deleteAchievementRequest($applicationId, $campaignId, $achievementId); try { $options = $this->createHttpClientOption(); @@ -6920,26 +7050,34 @@ public function deleteCollectionWithHttpInfo($applicationId, $campaignId, $colle ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteCollectionAsync + * Operation deleteAchievementAsync * - * Delete campaign-level collection + * Delete achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCollectionAsync($applicationId, $campaignId, $collectionId) + public function deleteAchievementAsync($applicationId, $campaignId, $achievementId) { - return $this->deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + return $this->deleteAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) ->then( function ($response) { return $response[0]; @@ -6948,21 +7086,21 @@ function ($response) { } /** - * Operation deleteCollectionAsyncWithHttpInfo + * Operation deleteAchievementAsyncWithHttpInfo * - * Delete campaign-level collection + * Delete achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + public function deleteAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) { $returnType = ''; - $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); + $request = $this->deleteAchievementRequest($applicationId, $campaignId, $achievementId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6988,37 +7126,37 @@ function ($exception) { } /** - * Create request for operation 'deleteCollection' + * Create request for operation 'deleteAchievement' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteCollectionRequest($applicationId, $campaignId, $collectionId) + protected function deleteAchievementRequest($applicationId, $campaignId, $achievementId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling deleteCollection' + 'Missing the required parameter $applicationId when calling deleteAchievement' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling deleteCollection' + 'Missing the required parameter $campaignId when calling deleteAchievement' ); } - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'achievementId' is set + if ($achievementId === null || (is_array($achievementId) && count($achievementId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling deleteCollection' + 'Missing the required parameter $achievementId when calling deleteAchievement' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7044,10 +7182,10 @@ protected function deleteCollectionRequest($applicationId, $campaignId, $collect ); } // path params - if ($collectionId !== null) { + if ($achievementId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'achievementId' . '}', + ObjectSerializer::toPathValue($achievementId), $resourcePath ); } @@ -7127,39 +7265,37 @@ protected function deleteCollectionRequest($applicationId, $campaignId, $collect } /** - * Operation deleteCoupon + * Operation deleteCampaign * - * Delete coupon + * Delete campaign * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteCoupon($applicationId, $campaignId, $couponId) + public function deleteCampaign($applicationId, $campaignId) { - $this->deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId); + $this->deleteCampaignWithHttpInfo($applicationId, $campaignId); } /** - * Operation deleteCouponWithHttpInfo + * Operation deleteCampaignWithHttpInfo * - * Delete coupon + * Delete campaign * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId) + public function deleteCampaignWithHttpInfo($applicationId, $campaignId) { - $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); + $request = $this->deleteCampaignRequest($applicationId, $campaignId); try { $options = $this->createHttpClientOption(); @@ -7199,20 +7335,19 @@ public function deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId) } /** - * Operation deleteCouponAsync + * Operation deleteCampaignAsync * - * Delete coupon + * Delete campaign * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCouponAsync($applicationId, $campaignId, $couponId) + public function deleteCampaignAsync($applicationId, $campaignId) { - return $this->deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) + return $this->deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) ->then( function ($response) { return $response[0]; @@ -7221,21 +7356,20 @@ function ($response) { } /** - * Operation deleteCouponAsyncWithHttpInfo + * Operation deleteCampaignAsyncWithHttpInfo * - * Delete coupon + * Delete campaign * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) + public function deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) { $returnType = ''; - $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); + $request = $this->deleteCampaignRequest($applicationId, $campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7261,37 +7395,30 @@ function ($exception) { } /** - * Create request for operation 'deleteCoupon' + * Create request for operation 'deleteCampaign' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteCouponRequest($applicationId, $campaignId, $couponId) + protected function deleteCampaignRequest($applicationId, $campaignId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling deleteCoupon' + 'Missing the required parameter $applicationId when calling deleteCampaign' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling deleteCoupon' - ); - } - // verify the required parameter 'couponId' is set - if ($couponId === null || (is_array($couponId) && count($couponId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $couponId when calling deleteCoupon' + 'Missing the required parameter $campaignId when calling deleteCampaign' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7316,14 +7443,6 @@ protected function deleteCouponRequest($applicationId, $campaignId, $couponId) $resourcePath ); } - // path params - if ($couponId !== null) { - $resourcePath = str_replace( - '{' . 'couponId' . '}', - ObjectSerializer::toPathValue($couponId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -7400,63 +7519,39 @@ protected function deleteCouponRequest($applicationId, $campaignId, $couponId) } /** - * Operation deleteCoupons + * Operation deleteCollection * - * Delete coupons + * Delete campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteCoupons($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) + public function deleteCollection($applicationId, $campaignId, $collectionId) { - $this->deleteCouponsWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); + $this->deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); } /** - * Operation deleteCouponsWithHttpInfo + * Operation deleteCollectionWithHttpInfo * - * Delete coupons + * Delete campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCouponsWithHttpInfo($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) + public function deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) { - $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); + $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); try { $options = $this->createHttpClientOption(); @@ -7490,38 +7585,34 @@ public function deleteCouponsWithHttpInfo($applicationId, $campaignId, $value = } catch (ApiException $e) { switch ($e->getCode()) { + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteCouponsAsync + * Operation deleteCollectionAsync * - * Delete coupons + * Delete campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCouponsAsync($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) + public function deleteCollectionAsync($applicationId, $campaignId, $collectionId) { - return $this->deleteCouponsAsyncWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch) + return $this->deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) ->then( function ($response) { return $response[0]; @@ -7530,33 +7621,21 @@ function ($response) { } /** - * Operation deleteCouponsAsyncWithHttpInfo + * Operation deleteCollectionAsyncWithHttpInfo * - * Delete coupons + * Delete campaign-level collection * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCouponsAsyncWithHttpInfo($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) + public function deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) { $returnType = ''; - $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); + $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7582,140 +7661,43 @@ function ($exception) { } /** - * Create request for operation 'deleteCoupons' + * Create request for operation 'deleteCollection' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteCouponsRequest($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) + protected function deleteCollectionRequest($applicationId, $campaignId, $collectionId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling deleteCoupons' + 'Missing the required parameter $applicationId when calling deleteCollection' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling deleteCoupons' + 'Missing the required parameter $campaignId when calling deleteCollection' + ); + } + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collectionId when calling deleteCollection' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($value)) { - $value = ObjectSerializer::serializeCollection($value, '', true); - } - if ($value !== null) { - $queryParams['value'] = $value; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($startsAfter)) { - $startsAfter = ObjectSerializer::serializeCollection($startsAfter, '', true); - } - if ($startsAfter !== null) { - $queryParams['startsAfter'] = $startsAfter; - } - // query params - if (is_array($startsBefore)) { - $startsBefore = ObjectSerializer::serializeCollection($startsBefore, '', true); - } - if ($startsBefore !== null) { - $queryParams['startsBefore'] = $startsBefore; - } - // query params - if (is_array($expiresAfter)) { - $expiresAfter = ObjectSerializer::serializeCollection($expiresAfter, '', true); - } - if ($expiresAfter !== null) { - $queryParams['expiresAfter'] = $expiresAfter; - } - // query params - if (is_array($expiresBefore)) { - $expiresBefore = ObjectSerializer::serializeCollection($expiresBefore, '', true); - } - if ($expiresBefore !== null) { - $queryParams['expiresBefore'] = $expiresBefore; - } - // query params - if (is_array($valid)) { - $valid = ObjectSerializer::serializeCollection($valid, '', true); - } - if ($valid !== null) { - $queryParams['valid'] = $valid; - } - // query params - if (is_array($batchId)) { - $batchId = ObjectSerializer::serializeCollection($batchId, '', true); - } - if ($batchId !== null) { - $queryParams['batchId'] = $batchId; - } - // query params - if (is_array($usable)) { - $usable = ObjectSerializer::serializeCollection($usable, '', true); - } - if ($usable !== null) { - $queryParams['usable'] = $usable; - } - // query params - if (is_array($referralId)) { - $referralId = ObjectSerializer::serializeCollection($referralId, '', true); - } - if ($referralId !== null) { - $queryParams['referralId'] = $referralId; - } - // query params - if (is_array($recipientIntegrationId)) { - $recipientIntegrationId = ObjectSerializer::serializeCollection($recipientIntegrationId, '', true); - } - if ($recipientIntegrationId !== null) { - $queryParams['recipientIntegrationId'] = $recipientIntegrationId; - } - // query params - if (is_array($exactMatch)) { - $exactMatch = ObjectSerializer::serializeCollection($exactMatch, '', true); - } - if ($exactMatch !== null) { - $queryParams['exactMatch'] = $exactMatch; - } // path params @@ -7734,17 +7716,25 @@ protected function deleteCouponsRequest($applicationId, $campaignId, $value = nu $resourcePath ); } + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], [] ); } @@ -7810,37 +7800,39 @@ protected function deleteCouponsRequest($applicationId, $campaignId, $value = nu } /** - * Operation deleteLoyaltyCard + * Operation deleteCoupon * - * Delete loyalty card + * Delete coupon * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId) + public function deleteCoupon($applicationId, $campaignId, $couponId) { - $this->deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); + $this->deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId); } /** - * Operation deleteLoyaltyCardWithHttpInfo + * Operation deleteCouponWithHttpInfo * - * Delete loyalty card + * Delete coupon * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId) { - $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); try { $options = $this->createHttpClientOption(); @@ -7874,41 +7866,26 @@ public function deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) } catch (ApiException $e) { switch ($e->getCode()) { - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation deleteLoyaltyCardAsync + * Operation deleteCouponAsync * - * Delete loyalty card + * Delete coupon * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) + public function deleteCouponAsync($applicationId, $campaignId, $couponId) { - return $this->deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + return $this->deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) ->then( function ($response) { return $response[0]; @@ -7917,20 +7894,21 @@ function ($response) { } /** - * Operation deleteLoyaltyCardAsyncWithHttpInfo + * Operation deleteCouponAsyncWithHttpInfo * - * Delete loyalty card + * Delete coupon * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) { $returnType = ''; - $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7956,34 +7934,37 @@ function ($exception) { } /** - * Create request for operation 'deleteLoyaltyCard' + * Create request for operation 'deleteCoupon' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $couponId The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) + protected function deleteCouponRequest($applicationId, $campaignId, $couponId) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling deleteLoyaltyCard' + 'Missing the required parameter $applicationId when calling deleteCoupon' ); } - // verify the required parameter 'loyaltyCardId' is set - if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling deleteLoyaltyCard' + 'Missing the required parameter $campaignId when calling deleteCoupon' ); } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.deleteLoyaltyCard, must be smaller than or equal to 108.'); + // verify the required parameter 'couponId' is set + if ($couponId === null || (is_array($couponId) && count($couponId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $couponId when calling deleteCoupon' + ); } - - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7993,18 +7974,26 @@ protected function deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } // path params - if ($loyaltyCardId !== null) { + if ($campaignId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + // path params + if ($couponId !== null) { + $resourcePath = str_replace( + '{' . 'couponId' . '}', + ObjectSerializer::toPathValue($couponId), $resourcePath ); } @@ -8014,11 +8003,11 @@ protected function deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], [] ); } @@ -8084,39 +8073,63 @@ protected function deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) } /** - * Operation deleteReferral + * Operation deleteCoupons * - * Delete referral + * Delete coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $referralId The ID of the referral code. (required) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteReferral($applicationId, $campaignId, $referralId) + public function deleteCoupons($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) { - $this->deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId); + $this->deleteCouponsWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); } /** - * Operation deleteReferralWithHttpInfo + * Operation deleteCouponsWithHttpInfo * - * Delete referral + * Delete coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $referralId The ID of the referral code. (required) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId) + public function deleteCouponsWithHttpInfo($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) { - $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); + $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); try { $options = $this->createHttpClientOption(); @@ -8156,20 +8169,32 @@ public function deleteReferralWithHttpInfo($applicationId, $campaignId, $referra } /** - * Operation deleteReferralAsync + * Operation deleteCouponsAsync * - * Delete referral + * Delete coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $referralId The ID of the referral code. (required) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteReferralAsync($applicationId, $campaignId, $referralId) + public function deleteCouponsAsync($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) { - return $this->deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) + return $this->deleteCouponsAsyncWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch) ->then( function ($response) { return $response[0]; @@ -8178,21 +8203,33 @@ function ($response) { } /** - * Operation deleteReferralAsyncWithHttpInfo + * Operation deleteCouponsAsyncWithHttpInfo * - * Delete referral + * Delete coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $referralId The ID of the referral code. (required) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) + public function deleteCouponsAsyncWithHttpInfo($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) { $returnType = ''; - $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); + $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8218,43 +8255,140 @@ function ($exception) { } /** - * Create request for operation 'deleteReferral' + * Create request for operation 'deleteCoupons' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $referralId The ID of the referral code. (required) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches coupons in which start date is set and in the future. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param string $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteReferralRequest($applicationId, $campaignId, $referralId) + protected function deleteCouponsRequest($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling deleteReferral' + 'Missing the required parameter $applicationId when calling deleteCoupons' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling deleteReferral' - ); - } - // verify the required parameter 'referralId' is set - if ($referralId === null || (is_array($referralId) && count($referralId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $referralId when calling deleteReferral' + 'Missing the required parameter $campaignId when calling deleteCoupons' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($value)) { + $value = ObjectSerializer::serializeCollection($value, '', true); + } + if ($value !== null) { + $queryParams['value'] = $value; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($startsAfter)) { + $startsAfter = ObjectSerializer::serializeCollection($startsAfter, '', true); + } + if ($startsAfter !== null) { + $queryParams['startsAfter'] = $startsAfter; + } + // query params + if (is_array($startsBefore)) { + $startsBefore = ObjectSerializer::serializeCollection($startsBefore, '', true); + } + if ($startsBefore !== null) { + $queryParams['startsBefore'] = $startsBefore; + } + // query params + if (is_array($expiresAfter)) { + $expiresAfter = ObjectSerializer::serializeCollection($expiresAfter, '', true); + } + if ($expiresAfter !== null) { + $queryParams['expiresAfter'] = $expiresAfter; + } + // query params + if (is_array($expiresBefore)) { + $expiresBefore = ObjectSerializer::serializeCollection($expiresBefore, '', true); + } + if ($expiresBefore !== null) { + $queryParams['expiresBefore'] = $expiresBefore; + } + // query params + if (is_array($valid)) { + $valid = ObjectSerializer::serializeCollection($valid, '', true); + } + if ($valid !== null) { + $queryParams['valid'] = $valid; + } + // query params + if (is_array($batchId)) { + $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + } + if ($batchId !== null) { + $queryParams['batchId'] = $batchId; + } + // query params + if (is_array($usable)) { + $usable = ObjectSerializer::serializeCollection($usable, '', true); + } + if ($usable !== null) { + $queryParams['usable'] = $usable; + } + // query params + if (is_array($referralId)) { + $referralId = ObjectSerializer::serializeCollection($referralId, '', true); + } + if ($referralId !== null) { + $queryParams['referralId'] = $referralId; + } + // query params + if (is_array($recipientIntegrationId)) { + $recipientIntegrationId = ObjectSerializer::serializeCollection($recipientIntegrationId, '', true); + } + if ($recipientIntegrationId !== null) { + $queryParams['recipientIntegrationId'] = $recipientIntegrationId; + } + // query params + if (is_array($exactMatch)) { + $exactMatch = ObjectSerializer::serializeCollection($exactMatch, '', true); + } + if ($exactMatch !== null) { + $queryParams['exactMatch'] = $exactMatch; + } // path params @@ -8273,14 +8407,6 @@ protected function deleteReferralRequest($applicationId, $campaignId, $referralI $resourcePath ); } - // path params - if ($referralId !== null) { - $resourcePath = str_replace( - '{' . 'referralId' . '}', - ObjectSerializer::toPathValue($referralId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -8357,37 +8483,37 @@ protected function deleteReferralRequest($applicationId, $campaignId, $referralI } /** - * Operation deleteStore + * Operation deleteLoyaltyCard * - * Delete store + * Delete loyalty card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteStore($applicationId, $storeId) + public function deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId) { - $this->deleteStoreWithHttpInfo($applicationId, $storeId); + $this->deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); } /** - * Operation deleteStoreWithHttpInfo + * Operation deleteLoyaltyCardWithHttpInfo * - * Delete store + * Delete loyalty card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteStoreWithHttpInfo($applicationId, $storeId) + public function deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) { - $request = $this->deleteStoreRequest($applicationId, $storeId); + $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); try { $options = $this->createHttpClientOption(); @@ -8421,6 +8547,14 @@ public function deleteStoreWithHttpInfo($applicationId, $storeId) } catch (ApiException $e) { switch ($e->getCode()) { + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8435,19 +8569,19 @@ public function deleteStoreWithHttpInfo($applicationId, $storeId) } /** - * Operation deleteStoreAsync + * Operation deleteLoyaltyCardAsync * - * Delete store + * Delete loyalty card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteStoreAsync($applicationId, $storeId) + public function deleteLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) { - return $this->deleteStoreAsyncWithHttpInfo($applicationId, $storeId) + return $this->deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) ->then( function ($response) { return $response[0]; @@ -8456,20 +8590,20 @@ function ($response) { } /** - * Operation deleteStoreAsyncWithHttpInfo + * Operation deleteLoyaltyCardAsyncWithHttpInfo * - * Delete store + * Delete loyalty card * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteStoreAsyncWithHttpInfo($applicationId, $storeId) + public function deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) { $returnType = ''; - $request = $this->deleteStoreRequest($applicationId, $storeId); + $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8495,30 +8629,34 @@ function ($exception) { } /** - * Create request for operation 'deleteStore' + * Create request for operation 'deleteLoyaltyCard' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteStoreRequest($applicationId, $storeId) + protected function deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling deleteStore' + 'Missing the required parameter $loyaltyProgramId when calling deleteLoyaltyCard' ); } - // verify the required parameter 'storeId' is set - if ($storeId === null || (is_array($storeId) && count($storeId) === 0)) { + // verify the required parameter 'loyaltyCardId' is set + if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $storeId when calling deleteStore' + 'Missing the required parameter $loyaltyCardId when calling deleteLoyaltyCard' ); } + if (strlen($loyaltyCardId) > 108) { + throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.deleteLoyaltyCard, must be smaller than or equal to 108.'); + } - $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8528,18 +8666,18 @@ protected function deleteStoreRequest($applicationId, $storeId) // path params - if ($applicationId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } // path params - if ($storeId !== null) { + if ($loyaltyCardId !== null) { $resourcePath = str_replace( - '{' . 'storeId' . '}', - ObjectSerializer::toPathValue($storeId), + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), $resourcePath ); } @@ -8619,35 +8757,39 @@ protected function deleteStoreRequest($applicationId, $storeId) } /** - * Operation deleteUser + * Operation deleteReferral * - * Delete user + * Delete referral * - * @param int $userId The ID of the user. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $referralId The ID of the referral code. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteUser($userId) + public function deleteReferral($applicationId, $campaignId, $referralId) { - $this->deleteUserWithHttpInfo($userId); + $this->deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId); } /** - * Operation deleteUserWithHttpInfo + * Operation deleteReferralWithHttpInfo * - * Delete user + * Delete referral * - * @param int $userId The ID of the user. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $referralId The ID of the referral code. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteUserWithHttpInfo($userId) + public function deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId) { - $request = $this->deleteUserRequest($userId); + $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); try { $options = $this->createHttpClientOption(); @@ -8687,18 +8829,20 @@ public function deleteUserWithHttpInfo($userId) } /** - * Operation deleteUserAsync + * Operation deleteReferralAsync * - * Delete user + * Delete referral * - * @param int $userId The ID of the user. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $referralId The ID of the referral code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteUserAsync($userId) + public function deleteReferralAsync($applicationId, $campaignId, $referralId) { - return $this->deleteUserAsyncWithHttpInfo($userId) + return $this->deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) ->then( function ($response) { return $response[0]; @@ -8707,19 +8851,21 @@ function ($response) { } /** - * Operation deleteUserAsyncWithHttpInfo + * Operation deleteReferralAsyncWithHttpInfo * - * Delete user + * Delete referral * - * @param int $userId The ID of the user. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $referralId The ID of the referral code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteUserAsyncWithHttpInfo($userId) + public function deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) { $returnType = ''; - $request = $this->deleteUserRequest($userId); + $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8745,23 +8891,37 @@ function ($exception) { } /** - * Create request for operation 'deleteUser' + * Create request for operation 'deleteReferral' * - * @param int $userId The ID of the user. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $referralId The ID of the referral code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteUserRequest($userId) + protected function deleteReferralRequest($applicationId, $campaignId, $referralId) { - // verify the required parameter 'userId' is set - if ($userId === null || (is_array($userId) && count($userId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $userId when calling deleteUser' + 'Missing the required parameter $applicationId when calling deleteReferral' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling deleteReferral' + ); + } + // verify the required parameter 'referralId' is set + if ($referralId === null || (is_array($referralId) && count($referralId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $referralId when calling deleteReferral' ); } - $resourcePath = '/v1/users/{userId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8771,10 +8931,26 @@ protected function deleteUserRequest($userId) // path params - if ($userId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'userId' . '}', - ObjectSerializer::toPathValue($userId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + // path params + if ($referralId !== null) { + $resourcePath = str_replace( + '{' . 'referralId' . '}', + ObjectSerializer::toPathValue($referralId), $resourcePath ); } @@ -8854,35 +9030,37 @@ protected function deleteUserRequest($userId) } /** - * Operation deleteUserByEmail + * Operation deleteStore * - * Delete user by email address + * Delete store * - * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteUserByEmail($body) + public function deleteStore($applicationId, $storeId) { - $this->deleteUserByEmailWithHttpInfo($body); + $this->deleteStoreWithHttpInfo($applicationId, $storeId); } /** - * Operation deleteUserByEmailWithHttpInfo + * Operation deleteStoreWithHttpInfo * - * Delete user by email address + * Delete store * - * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteUserByEmailWithHttpInfo($body) + public function deleteStoreWithHttpInfo($applicationId, $storeId) { - $request = $this->deleteUserByEmailRequest($body); + $request = $this->deleteStoreRequest($applicationId, $storeId); try { $options = $this->createHttpClientOption(); @@ -8916,24 +9094,33 @@ public function deleteUserByEmailWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteUserByEmailAsync + * Operation deleteStoreAsync * - * Delete user by email address + * Delete store * - * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteUserByEmailAsync($body) + public function deleteStoreAsync($applicationId, $storeId) { - return $this->deleteUserByEmailAsyncWithHttpInfo($body) + return $this->deleteStoreAsyncWithHttpInfo($applicationId, $storeId) ->then( function ($response) { return $response[0]; @@ -8942,19 +9129,20 @@ function ($response) { } /** - * Operation deleteUserByEmailAsyncWithHttpInfo + * Operation deleteStoreAsyncWithHttpInfo * - * Delete user by email address + * Delete store * - * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteUserByEmailAsyncWithHttpInfo($body) + public function deleteStoreAsyncWithHttpInfo($applicationId, $storeId) { $returnType = ''; - $request = $this->deleteUserByEmailRequest($body); + $request = $this->deleteStoreRequest($applicationId, $storeId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8980,23 +9168,30 @@ function ($exception) { } /** - * Create request for operation 'deleteUserByEmail' + * Create request for operation 'deleteStore' * - * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteUserByEmailRequest($body) + protected function deleteStoreRequest($applicationId, $storeId) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling deleteUserByEmail' + 'Missing the required parameter $applicationId when calling deleteStore' + ); + } + // verify the required parameter 'storeId' is set + if ($storeId === null || (is_array($storeId) && count($storeId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $storeId when calling deleteStore' ); } - $resourcePath = '/v1/users/delete'; + $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9005,21 +9200,34 @@ protected function deleteUserByEmailRequest($body) + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($storeId !== null) { + $resourcePath = str_replace( + '{' . 'storeId' . '}', + ObjectSerializer::toPathValue($storeId), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] + ['application/json'], + [] ); } @@ -9076,7 +9284,7 @@ protected function deleteUserByEmailRequest($body) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -9084,33 +9292,35 @@ protected function deleteUserByEmailRequest($body) } /** - * Operation destroySession + * Operation deleteUser * - * Destroy session + * Delete user * + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function destroySession() + public function deleteUser($userId) { - $this->destroySessionWithHttpInfo(); + $this->deleteUserWithHttpInfo($userId); } /** - * Operation destroySessionWithHttpInfo + * Operation deleteUserWithHttpInfo * - * Destroy session + * Delete user * + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function destroySessionWithHttpInfo() + public function deleteUserWithHttpInfo($userId) { - $request = $this->destroySessionRequest(); + $request = $this->deleteUserRequest($userId); try { $options = $this->createHttpClientOption(); @@ -9150,17 +9360,18 @@ public function destroySessionWithHttpInfo() } /** - * Operation destroySessionAsync + * Operation deleteUserAsync * - * Destroy session + * Delete user * + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function destroySessionAsync() + public function deleteUserAsync($userId) { - return $this->destroySessionAsyncWithHttpInfo() + return $this->deleteUserAsyncWithHttpInfo($userId) ->then( function ($response) { return $response[0]; @@ -9169,18 +9380,19 @@ function ($response) { } /** - * Operation destroySessionAsyncWithHttpInfo + * Operation deleteUserAsyncWithHttpInfo * - * Destroy session + * Delete user * + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function destroySessionAsyncWithHttpInfo() + public function deleteUserAsyncWithHttpInfo($userId) { $returnType = ''; - $request = $this->destroySessionRequest(); + $request = $this->deleteUserRequest($userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9206,16 +9418,23 @@ function ($exception) { } /** - * Create request for operation 'destroySession' + * Create request for operation 'deleteUser' * + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function destroySessionRequest() + protected function deleteUserRequest($userId) { + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $userId when calling deleteUser' + ); + } - $resourcePath = '/v1/sessions'; + $resourcePath = '/v1/users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9224,6 +9443,14 @@ protected function destroySessionRequest() + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -9300,36 +9527,35 @@ protected function destroySessionRequest() } /** - * Operation exportAccountCollectionItems + * Operation deleteUserByEmail * - * Export account-level collection's items + * Delete user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return void */ - public function exportAccountCollectionItems($collectionId) + public function deleteUserByEmail($body) { - list($response) = $this->exportAccountCollectionItemsWithHttpInfo($collectionId); - return $response; + $this->deleteUserByEmailWithHttpInfo($body); } /** - * Operation exportAccountCollectionItemsWithHttpInfo + * Operation deleteUserByEmailWithHttpInfo * - * Export account-level collection's items + * Delete user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function exportAccountCollectionItemsWithHttpInfo($collectionId) + public function deleteUserByEmailWithHttpInfo($body) { - $request = $this->exportAccountCollectionItemsRequest($collectionId); + $request = $this->deleteUserByEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -9359,104 +9585,28 @@ public function exportAccountCollectionItemsWithHttpInfo($collectionId) ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('string' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, 'string', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'string'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'string', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation exportAccountCollectionItemsAsync + * Operation deleteUserByEmailAsync * - * Export account-level collection's items + * Delete user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAccountCollectionItemsAsync($collectionId) + public function deleteUserByEmailAsync($body) { - return $this->exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) + return $this->deleteUserByEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -9465,36 +9615,25 @@ function ($response) { } /** - * Operation exportAccountCollectionItemsAsyncWithHttpInfo + * Operation deleteUserByEmailAsyncWithHttpInfo * - * Export account-level collection's items + * Delete user by email address * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) + public function deleteUserByEmailAsyncWithHttpInfo($body) { - $returnType = 'string'; - $request = $this->exportAccountCollectionItemsRequest($collectionId); + $returnType = ''; + $request = $this->deleteUserByEmailRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -9514,23 +9653,23 @@ function ($exception) { } /** - * Create request for operation 'exportAccountCollectionItems' + * Create request for operation 'deleteUserByEmail' * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportAccountCollectionItemsRequest($collectionId) + protected function deleteUserByEmailRequest($body) { - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling exportAccountCollectionItems' + 'Missing the required parameter $body when calling deleteUserByEmail' ); } - $resourcePath = '/v1/collections/{collectionId}/export'; + $resourcePath = '/v1/users/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9539,26 +9678,21 @@ protected function exportAccountCollectionItemsRequest($collectionId) - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], - [] + [], + ['application/json'] ); } @@ -9615,7 +9749,7 @@ protected function exportAccountCollectionItemsRequest($collectionId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -9623,40 +9757,33 @@ protected function exportAccountCollectionItemsRequest($collectionId) } /** - * Operation exportAchievements + * Operation destroySession * - * Export achievement customer data + * Destroy session * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return void */ - public function exportAchievements($applicationId, $campaignId, $achievementId) + public function destroySession() { - list($response) = $this->exportAchievementsWithHttpInfo($applicationId, $campaignId, $achievementId); - return $response; + $this->destroySessionWithHttpInfo(); } /** - * Operation exportAchievementsWithHttpInfo + * Operation destroySessionWithHttpInfo * - * Export achievement customer data + * Destroy session * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function exportAchievementsWithHttpInfo($applicationId, $campaignId, $achievementId) + public function destroySessionWithHttpInfo() { - $request = $this->exportAchievementsRequest($applicationId, $campaignId, $achievementId); + $request = $this->destroySessionRequest(); try { $options = $this->createHttpClientOption(); @@ -9686,86 +9813,234 @@ public function exportAchievementsWithHttpInfo($applicationId, $campaignId, $ach ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('string' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + return [null, $statusCode, $response->getHeaders()]; - return [ - ObjectSerializer::deserialize($content, 'string', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + /** + * Operation destroySessionAsync + * + * Destroy session + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function destroySessionAsync() + { + return $this->destroySessionAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + /** + * Operation destroySessionAsyncWithHttpInfo + * + * Destroy session + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function destroySessionAsyncWithHttpInfo() + { + $returnType = ''; + $request = $this->destroySessionRequest(); - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'destroySession' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function destroySessionRequest() + { + + $resourcePath = '/v1/sessions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); - $returnType = 'string'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer } else { - $content = (string) $responseBody; + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); } + } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation disconnectCampaignStores + * + * Disconnect stores + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function disconnectCampaignStores($applicationId, $campaignId) + { + $this->disconnectCampaignStoresWithHttpInfo($applicationId, $campaignId); + } + + /** + * Operation disconnectCampaignStoresWithHttpInfo + * + * Disconnect stores + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function disconnectCampaignStoresWithHttpInfo($applicationId, $campaignId) + { + $request = $this->disconnectCampaignStoresRequest($applicationId, $campaignId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'string', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9792,20 +10067,19 @@ public function exportAchievementsWithHttpInfo($applicationId, $campaignId, $ach } /** - * Operation exportAchievementsAsync + * Operation disconnectCampaignStoresAsync * - * Export achievement customer data + * Disconnect stores * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAchievementsAsync($applicationId, $campaignId, $achievementId) + public function disconnectCampaignStoresAsync($applicationId, $campaignId) { - return $this->exportAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) + return $this->disconnectCampaignStoresAsyncWithHttpInfo($applicationId, $campaignId) ->then( function ($response) { return $response[0]; @@ -9814,38 +10088,26 @@ function ($response) { } /** - * Operation exportAchievementsAsyncWithHttpInfo + * Operation disconnectCampaignStoresAsyncWithHttpInfo * - * Export achievement customer data + * Disconnect stores * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) + public function disconnectCampaignStoresAsyncWithHttpInfo($applicationId, $campaignId) { - $returnType = 'string'; - $request = $this->exportAchievementsRequest($applicationId, $campaignId, $achievementId); + $returnType = ''; + $request = $this->disconnectCampaignStoresRequest($applicationId, $campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -9865,37 +10127,30 @@ function ($exception) { } /** - * Create request for operation 'exportAchievements' + * Create request for operation 'disconnectCampaignStores' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportAchievementsRequest($applicationId, $campaignId, $achievementId) + protected function disconnectCampaignStoresRequest($applicationId, $campaignId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling exportAchievements' + 'Missing the required parameter $applicationId when calling disconnectCampaignStores' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling exportAchievements' - ); - } - // verify the required parameter 'achievementId' is set - if ($achievementId === null || (is_array($achievementId) && count($achievementId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $achievementId when calling exportAchievements' + 'Missing the required parameter $campaignId when calling disconnectCampaignStores' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/stores'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9920,25 +10175,17 @@ protected function exportAchievementsRequest($applicationId, $campaignId, $achie $resourcePath ); } - // path params - if ($achievementId !== null) { - $resourcePath = str_replace( - '{' . 'achievementId' . '}', - ObjectSerializer::toPathValue($achievementId), - $resourcePath - ); - } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -9996,7 +10243,7 @@ protected function exportAchievementsRequest($applicationId, $campaignId, $achie $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10004,36 +10251,36 @@ protected function exportAchievementsRequest($applicationId, $campaignId, $achie } /** - * Operation exportAudiencesMemberships + * Operation exportAccountCollectionItems * - * Export audience members + * Export account-level collection's items * - * @param int $audienceId The ID of the audience. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportAudiencesMemberships($audienceId) + public function exportAccountCollectionItems($collectionId) { - list($response) = $this->exportAudiencesMembershipsWithHttpInfo($audienceId); + list($response) = $this->exportAccountCollectionItemsWithHttpInfo($collectionId); return $response; } /** - * Operation exportAudiencesMembershipsWithHttpInfo + * Operation exportAccountCollectionItemsWithHttpInfo * - * Export audience members + * Export account-level collection's items * - * @param int $audienceId The ID of the audience. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportAudiencesMembershipsWithHttpInfo($audienceId) + public function exportAccountCollectionItemsWithHttpInfo($collectionId) { - $request = $this->exportAudiencesMembershipsRequest($audienceId); + $request = $this->exportAccountCollectionItemsRequest($collectionId); try { $options = $this->createHttpClientOption(); @@ -10077,18 +10324,6 @@ public function exportAudiencesMembershipsWithHttpInfo($audienceId) $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; case 401: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10139,14 +10374,6 @@ public function exportAudiencesMembershipsWithHttpInfo($audienceId) ); $e->setResponseObject($data); break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10169,18 +10396,18 @@ public function exportAudiencesMembershipsWithHttpInfo($audienceId) } /** - * Operation exportAudiencesMembershipsAsync + * Operation exportAccountCollectionItemsAsync * - * Export audience members + * Export account-level collection's items * - * @param int $audienceId The ID of the audience. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAudiencesMembershipsAsync($audienceId) + public function exportAccountCollectionItemsAsync($collectionId) { - return $this->exportAudiencesMembershipsAsyncWithHttpInfo($audienceId) + return $this->exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) ->then( function ($response) { return $response[0]; @@ -10189,19 +10416,19 @@ function ($response) { } /** - * Operation exportAudiencesMembershipsAsyncWithHttpInfo + * Operation exportAccountCollectionItemsAsyncWithHttpInfo * - * Export audience members + * Export account-level collection's items * - * @param int $audienceId The ID of the audience. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAudiencesMembershipsAsyncWithHttpInfo($audienceId) + public function exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) { $returnType = 'string'; - $request = $this->exportAudiencesMembershipsRequest($audienceId); + $request = $this->exportAccountCollectionItemsRequest($collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10238,23 +10465,23 @@ function ($exception) { } /** - * Create request for operation 'exportAudiencesMemberships' + * Create request for operation 'exportAccountCollectionItems' * - * @param int $audienceId The ID of the audience. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportAudiencesMembershipsRequest($audienceId) + protected function exportAccountCollectionItemsRequest($collectionId) { - // verify the required parameter 'audienceId' is set - if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $audienceId when calling exportAudiencesMemberships' + 'Missing the required parameter $collectionId when calling exportAccountCollectionItems' ); } - $resourcePath = '/v1/audiences/{audienceId}/memberships/export'; + $resourcePath = '/v1/collections/{collectionId}/export'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10264,10 +10491,10 @@ protected function exportAudiencesMembershipsRequest($audienceId) // path params - if ($audienceId !== null) { + if ($collectionId !== null) { $resourcePath = str_replace( - '{' . 'audienceId' . '}', - ObjectSerializer::toPathValue($audienceId), + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -10347,40 +10574,40 @@ protected function exportAudiencesMembershipsRequest($audienceId) } /** - * Operation exportCollectionItems + * Operation exportAchievements * - * Export campaign-level collection's items + * Export achievement customer data * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportCollectionItems($applicationId, $campaignId, $collectionId) + public function exportAchievements($applicationId, $campaignId, $achievementId) { - list($response) = $this->exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId); + list($response) = $this->exportAchievementsWithHttpInfo($applicationId, $campaignId, $achievementId); return $response; } /** - * Operation exportCollectionItemsWithHttpInfo + * Operation exportAchievementsWithHttpInfo * - * Export campaign-level collection's items + * Export achievement customer data * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId) + public function exportAchievementsWithHttpInfo($applicationId, $campaignId, $achievementId) { - $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); + $request = $this->exportAchievementsRequest($applicationId, $campaignId, $achievementId); try { $options = $this->createHttpClientOption(); @@ -10424,6 +10651,18 @@ public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $ $response->getStatusCode(), $response->getHeaders() ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; case 401: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10474,6 +10713,14 @@ public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $ ); $e->setResponseObject($data); break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10496,20 +10743,20 @@ public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $ } /** - * Operation exportCollectionItemsAsync + * Operation exportAchievementsAsync * - * Export campaign-level collection's items + * Export achievement customer data * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCollectionItemsAsync($applicationId, $campaignId, $collectionId) + public function exportAchievementsAsync($applicationId, $campaignId, $achievementId) { - return $this->exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + return $this->exportAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) ->then( function ($response) { return $response[0]; @@ -10518,21 +10765,21 @@ function ($response) { } /** - * Operation exportCollectionItemsAsyncWithHttpInfo + * Operation exportAchievementsAsyncWithHttpInfo * - * Export campaign-level collection's items + * Export achievement customer data * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + public function exportAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) { $returnType = 'string'; - $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); + $request = $this->exportAchievementsRequest($applicationId, $campaignId, $achievementId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10569,37 +10816,37 @@ function ($exception) { } /** - * Create request for operation 'exportCollectionItems' + * Create request for operation 'exportAchievements' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportCollectionItemsRequest($applicationId, $campaignId, $collectionId) + protected function exportAchievementsRequest($applicationId, $campaignId, $achievementId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling exportCollectionItems' + 'Missing the required parameter $applicationId when calling exportAchievements' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling exportCollectionItems' + 'Missing the required parameter $campaignId when calling exportAchievements' ); } - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'achievementId' is set + if ($achievementId === null || (is_array($achievementId) && count($achievementId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling exportCollectionItems' + 'Missing the required parameter $achievementId when calling exportAchievements' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10625,10 +10872,10 @@ protected function exportCollectionItemsRequest($applicationId, $campaignId, $co ); } // path params - if ($collectionId !== null) { + if ($achievementId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'achievementId' . '}', + ObjectSerializer::toPathValue($achievementId), $resourcePath ); } @@ -10708,64 +10955,36 @@ protected function exportCollectionItemsRequest($applicationId, $campaignId, $co } /** - * Operation exportCoupons + * Operation exportAudiencesMemberships * - * Export coupons + * Export audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) + * @param int $audienceId The ID of the audience. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return string|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportCoupons($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) + public function exportAudiencesMemberships($audienceId) { - list($response) = $this->exportCouponsWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + list($response) = $this->exportAudiencesMembershipsWithHttpInfo($audienceId); return $response; } /** - * Operation exportCouponsWithHttpInfo + * Operation exportAudiencesMembershipsWithHttpInfo * - * Export coupons + * Export audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) + * @param int $audienceId The ID of the audience. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportCouponsWithHttpInfo($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) + public function exportAudiencesMembershipsWithHttpInfo($audienceId) { - $request = $this->exportCouponsRequest($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + $request = $this->exportAudiencesMembershipsRequest($audienceId); try { $options = $this->createHttpClientOption(); @@ -10809,6 +11028,42 @@ public function exportCouponsWithHttpInfo($applicationId, $campaignId = null, $s $response->getStatusCode(), $response->getHeaders() ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } $returnType = 'string'; @@ -10835,38 +11090,48 @@ public function exportCouponsWithHttpInfo($applicationId, $campaignId = null, $s ); $e->setResponseObject($data); break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation exportCouponsAsync + * Operation exportAudiencesMembershipsAsync * - * Export coupons + * Export audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCouponsAsync($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) + public function exportAudiencesMembershipsAsync($audienceId) { - return $this->exportCouponsAsyncWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly) + return $this->exportAudiencesMembershipsAsyncWithHttpInfo($audienceId) ->then( function ($response) { return $response[0]; @@ -10875,33 +11140,19 @@ function ($response) { } /** - * Operation exportCouponsAsyncWithHttpInfo + * Operation exportAudiencesMembershipsAsyncWithHttpInfo * - * Export coupons + * Export audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCouponsAsyncWithHttpInfo($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) + public function exportAudiencesMembershipsAsyncWithHttpInfo($audienceId) { $returnType = 'string'; - $request = $this->exportCouponsRequest($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + $request = $this->exportAudiencesMembershipsRequest($audienceId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10938,148 +11189,36 @@ function ($exception) { } /** - * Create request for operation 'exportCoupons' + * Create request for operation 'exportAudiencesMemberships' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportCouponsRequest($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) + protected function exportAudiencesMembershipsRequest($audienceId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'audienceId' is set + if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling exportCoupons' + 'Missing the required parameter $audienceId when calling exportAudiencesMemberships' ); } - $resourcePath = '/v1/applications/{applicationId}/export_coupons'; + $resourcePath = '/v1/audiences/{audienceId}/memberships/export'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); - } - if ($campaignId !== null) { - $queryParams['campaignId'] = $campaignId; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($value)) { - $value = ObjectSerializer::serializeCollection($value, '', true); - } - if ($value !== null) { - $queryParams['value'] = $value; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($valid)) { - $valid = ObjectSerializer::serializeCollection($valid, '', true); - } - if ($valid !== null) { - $queryParams['valid'] = $valid; - } - // query params - if (is_array($usable)) { - $usable = ObjectSerializer::serializeCollection($usable, '', true); - } - if ($usable !== null) { - $queryParams['usable'] = $usable; - } - // query params - if (is_array($referralId)) { - $referralId = ObjectSerializer::serializeCollection($referralId, '', true); - } - if ($referralId !== null) { - $queryParams['referralId'] = $referralId; - } - // query params - if (is_array($recipientIntegrationId)) { - $recipientIntegrationId = ObjectSerializer::serializeCollection($recipientIntegrationId, '', true); - } - if ($recipientIntegrationId !== null) { - $queryParams['recipientIntegrationId'] = $recipientIntegrationId; - } - // query params - if (is_array($batchId)) { - $batchId = ObjectSerializer::serializeCollection($batchId, '', true); - } - if ($batchId !== null) { - $queryParams['batchId'] = $batchId; - } - // query params - if (is_array($exactMatch)) { - $exactMatch = ObjectSerializer::serializeCollection($exactMatch, '', true); - } - if ($exactMatch !== null) { - $queryParams['exactMatch'] = $exactMatch; - } - // query params - if (is_array($dateFormat)) { - $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); - } - if ($dateFormat !== null) { - $queryParams['dateFormat'] = $dateFormat; - } - // query params - if (is_array($campaignState)) { - $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); - } - if ($campaignState !== null) { - $queryParams['campaignState'] = $campaignState; - } - // query params - if (is_array($valuesOnly)) { - $valuesOnly = ObjectSerializer::serializeCollection($valuesOnly, '', true); - } - if ($valuesOnly !== null) { - $queryParams['valuesOnly'] = $valuesOnly; - } // path params - if ($applicationId !== null) { + if ($audienceId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'audienceId' . '}', + ObjectSerializer::toPathValue($audienceId), $resourcePath ); } @@ -11159,46 +11298,38 @@ protected function exportCouponsRequest($applicationId, $campaignId = null, $sor } /** - * Operation exportCustomerSessions + * Operation exportCampaignStores * - * Export customer sessions + * Export stores * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $customerSessionState Filter results by state. (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return string|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportCustomerSessions($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function exportCampaignStores($applicationId, $campaignId) { - list($response) = $this->exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + list($response) = $this->exportCampaignStoresWithHttpInfo($applicationId, $campaignId); return $response; } /** - * Operation exportCustomerSessionsWithHttpInfo + * Operation exportCampaignStoresWithHttpInfo * - * Export customer sessions + * Export stores * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $customerSessionState Filter results by state. (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function exportCampaignStoresWithHttpInfo($applicationId, $campaignId) { - $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + $request = $this->exportCampaignStoresRequest($applicationId, $campaignId); try { $options = $this->createHttpClientOption(); @@ -11242,6 +11373,42 @@ public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefor $response->getStatusCode(), $response->getHeaders() ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } $returnType = 'string'; @@ -11268,29 +11435,49 @@ public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefor ); $e->setResponseObject($data); break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation exportCustomerSessionsAsync + * Operation exportCampaignStoresAsync * - * Export customer sessions + * Export stores * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $customerSessionState Filter results by state. (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCustomerSessionsAsync($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function exportCampaignStoresAsync($applicationId, $campaignId) { - return $this->exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState) + return $this->exportCampaignStoresAsyncWithHttpInfo($applicationId, $campaignId) ->then( function ($response) { return $response[0]; @@ -11299,24 +11486,20 @@ function ($response) { } /** - * Operation exportCustomerSessionsAsyncWithHttpInfo + * Operation exportCampaignStoresAsyncWithHttpInfo * - * Export customer sessions + * Export stores * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $customerSessionState Filter results by state. (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function exportCampaignStoresAsyncWithHttpInfo($applicationId, $campaignId) { $returnType = 'string'; - $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + $request = $this->exportCampaignStoresRequest($applicationId, $campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11353,69 +11536,36 @@ function ($exception) { } /** - * Create request for operation 'exportCustomerSessions' + * Create request for operation 'exportCampaignStores' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) - * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (optional) - * @param string $customerSessionState Filter results by state. (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportCustomerSessionsRequest($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + protected function exportCampaignStoresRequest($applicationId, $campaignId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling exportCustomerSessions' + 'Missing the required parameter $applicationId when calling exportCampaignStores' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling exportCampaignStores' ); } - $resourcePath = '/v1/applications/{applicationId}/export_customer_sessions'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/stores/export'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($profileIntegrationId)) { - $profileIntegrationId = ObjectSerializer::serializeCollection($profileIntegrationId, '', true); - } - if ($profileIntegrationId !== null) { - $queryParams['profileIntegrationId'] = $profileIntegrationId; - } - // query params - if (is_array($dateFormat)) { - $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); - } - if ($dateFormat !== null) { - $queryParams['dateFormat'] = $dateFormat; - } - // query params - if (is_array($customerSessionState)) { - $customerSessionState = ObjectSerializer::serializeCollection($customerSessionState, '', true); - } - if ($customerSessionState !== null) { - $queryParams['customerSessionState'] = $customerSessionState; - } // path params @@ -11426,6 +11576,14 @@ protected function exportCustomerSessionsRequest($applicationId, $createdBefore $resourcePath ); } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -11502,40 +11660,40 @@ protected function exportCustomerSessionsRequest($applicationId, $createdBefore } /** - * Operation exportCustomersTiers + * Operation exportCollectionItems * - * Export customers' tier data + * Export campaign-level collection's items * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) - * @param string[] $tierNames An array of tier names to filter the export by. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportCustomersTiers($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function exportCollectionItems($applicationId, $campaignId, $collectionId) { - list($response) = $this->exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames); + list($response) = $this->exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId); return $response; } /** - * Operation exportCustomersTiersWithHttpInfo + * Operation exportCollectionItemsWithHttpInfo * - * Export customers' tier data + * Export campaign-level collection's items * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) - * @param string[] $tierNames An array of tier names to filter the export by. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId) { - $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); + $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); try { $options = $this->createHttpClientOption(); @@ -11579,21 +11737,45 @@ public function exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerId $response->getStatusCode(), $response->getHeaders() ]; - } - - $returnType = 'string'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'string'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { @@ -11605,26 +11787,42 @@ public function exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerId ); $e->setResponseObject($data); break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation exportCustomersTiersAsync + * Operation exportCollectionItemsAsync * - * Export customers' tier data + * Export campaign-level collection's items * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) - * @param string[] $tierNames An array of tier names to filter the export by. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCustomersTiersAsync($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function exportCollectionItemsAsync($applicationId, $campaignId, $collectionId) { - return $this->exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames) + return $this->exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) ->then( function ($response) { return $response[0]; @@ -11633,21 +11831,21 @@ function ($response) { } /** - * Operation exportCustomersTiersAsyncWithHttpInfo + * Operation exportCollectionItemsAsyncWithHttpInfo * - * Export customers' tier data + * Export campaign-level collection's items * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) - * @param string[] $tierNames An array of tier names to filter the export by. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) { $returnType = 'string'; - $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); + $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11684,52 +11882,66 @@ function ($exception) { } /** - * Create request for operation 'exportCustomersTiers' + * Create request for operation 'exportCollectionItems' * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) - * @param string[] $tierNames An array of tier names to filter the export by. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + protected function exportCollectionItemsRequest($applicationId, $campaignId, $collectionId) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportCustomersTiers' + 'Missing the required parameter $applicationId when calling exportCollectionItems' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling exportCollectionItems' + ); + } + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collectionId when calling exportCollectionItems' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customers_tiers'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($subledgerIds)) { - $subledgerIds = ObjectSerializer::serializeCollection($subledgerIds, 'form', true); - } - if ($subledgerIds !== null) { - $queryParams['subledgerIds'] = $subledgerIds; - } - // query params - if (is_array($tierNames)) { - $tierNames = ObjectSerializer::serializeCollection($tierNames, 'form', true); - } - if ($tierNames !== null) { - $queryParams['tierNames'] = $tierNames; - } // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -11809,44 +12021,64 @@ protected function exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds } /** - * Operation exportEffects + * Operation exportCoupons * - * Export triggered effects + * Export coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param float $campaignId Filter results by campaign. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return string */ - public function exportEffects($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function exportCoupons($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) { - list($response) = $this->exportEffectsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + list($response) = $this->exportCouponsWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); return $response; } /** - * Operation exportEffectsWithHttpInfo + * Operation exportCouponsWithHttpInfo * - * Export triggered effects + * Export coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param float $campaignId Filter results by campaign. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function exportEffectsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function exportCouponsWithHttpInfo($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) { - $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + $request = $this->exportCouponsRequest($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); try { $options = $this->createHttpClientOption(); @@ -11922,22 +12154,32 @@ public function exportEffectsWithHttpInfo($applicationId, $campaignId = null, $c } /** - * Operation exportEffectsAsync + * Operation exportCouponsAsync * - * Export triggered effects + * Export coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param float $campaignId Filter results by campaign. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportEffectsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function exportCouponsAsync($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) { - return $this->exportEffectsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat) + return $this->exportCouponsAsyncWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly) ->then( function ($response) { return $response[0]; @@ -11946,23 +12188,33 @@ function ($response) { } /** - * Operation exportEffectsAsyncWithHttpInfo + * Operation exportCouponsAsyncWithHttpInfo * - * Export triggered effects + * Export coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param float $campaignId Filter results by campaign. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportEffectsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function exportCouponsAsyncWithHttpInfo($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) { $returnType = 'string'; - $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + $request = $this->exportCouponsRequest($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11999,27 +12251,37 @@ function ($exception) { } /** - * Create request for operation 'exportEffects' + * Create request for operation 'exportCoupons' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param float $campaignId Filter results by campaign. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field. (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code. (optional, default to false) * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportEffectsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + protected function exportCouponsRequest($applicationId, $campaignId = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $dateFormat = null, $campaignState = null, $valuesOnly = false) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling exportEffects' + 'Missing the required parameter $applicationId when calling exportCoupons' ); } - $resourcePath = '/v1/applications/{applicationId}/export_effects'; + $resourcePath = '/v1/applications/{applicationId}/export_coupons'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12034,6 +12296,20 @@ protected function exportEffectsRequest($applicationId, $campaignId = null, $cre $queryParams['campaignId'] = $campaignId; } // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($value)) { + $value = ObjectSerializer::serializeCollection($value, '', true); + } + if ($value !== null) { + $queryParams['value'] = $value; + } + // query params if (is_array($createdBefore)) { $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); } @@ -12048,12 +12324,68 @@ protected function exportEffectsRequest($applicationId, $campaignId = null, $cre $queryParams['createdAfter'] = $createdAfter; } // query params + if (is_array($valid)) { + $valid = ObjectSerializer::serializeCollection($valid, '', true); + } + if ($valid !== null) { + $queryParams['valid'] = $valid; + } + // query params + if (is_array($usable)) { + $usable = ObjectSerializer::serializeCollection($usable, '', true); + } + if ($usable !== null) { + $queryParams['usable'] = $usable; + } + // query params + if (is_array($referralId)) { + $referralId = ObjectSerializer::serializeCollection($referralId, '', true); + } + if ($referralId !== null) { + $queryParams['referralId'] = $referralId; + } + // query params + if (is_array($recipientIntegrationId)) { + $recipientIntegrationId = ObjectSerializer::serializeCollection($recipientIntegrationId, '', true); + } + if ($recipientIntegrationId !== null) { + $queryParams['recipientIntegrationId'] = $recipientIntegrationId; + } + // query params + if (is_array($batchId)) { + $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + } + if ($batchId !== null) { + $queryParams['batchId'] = $batchId; + } + // query params + if (is_array($exactMatch)) { + $exactMatch = ObjectSerializer::serializeCollection($exactMatch, '', true); + } + if ($exactMatch !== null) { + $queryParams['exactMatch'] = $exactMatch; + } + // query params if (is_array($dateFormat)) { $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); } if ($dateFormat !== null) { $queryParams['dateFormat'] = $dateFormat; } + // query params + if (is_array($campaignState)) { + $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); + } + if ($campaignState !== null) { + $queryParams['campaignState'] = $campaignState; + } + // query params + if (is_array($valuesOnly)) { + $valuesOnly = ObjectSerializer::serializeCollection($valuesOnly, '', true); + } + if ($valuesOnly !== null) { + $queryParams['valuesOnly'] = $valuesOnly; + } // path params @@ -12140,38 +12472,46 @@ protected function exportEffectsRequest($applicationId, $campaignId = null, $cre } /** - * Operation exportLoyaltyBalance + * Operation exportCustomerSessions * - * Export customer loyalty balance to CSV + * Export customer sessions * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $customerSessionState Filter results by state. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string */ - public function exportLoyaltyBalance($loyaltyProgramId, $endDate = null) + public function exportCustomerSessions($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) { - list($response) = $this->exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate); + list($response) = $this->exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); return $response; } /** - * Operation exportLoyaltyBalanceWithHttpInfo + * Operation exportCustomerSessionsWithHttpInfo * - * Export customer loyalty balance to CSV + * Export customer sessions * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $customerSessionState Filter results by state. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = null) + public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) { - $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); + $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); try { $options = $this->createHttpClientOption(); @@ -12215,30 +12555,6 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; } $returnType = 'string'; @@ -12265,41 +12581,29 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n ); $e->setResponseObject($data); break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation exportLoyaltyBalanceAsync + * Operation exportCustomerSessionsAsync * - * Export customer loyalty balance to CSV + * Export customer sessions * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $customerSessionState Filter results by state. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyBalanceAsync($loyaltyProgramId, $endDate = null) + public function exportCustomerSessionsAsync($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) { - return $this->exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate) + return $this->exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState) ->then( function ($response) { return $response[0]; @@ -12308,20 +12612,24 @@ function ($response) { } /** - * Operation exportLoyaltyBalanceAsyncWithHttpInfo + * Operation exportCustomerSessionsAsyncWithHttpInfo * - * Export customer loyalty balance to CSV + * Export customer sessions * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $customerSessionState Filter results by state. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + public function exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) { $returnType = 'string'; - $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); + $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12358,24 +12666,28 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyBalance' + * Create request for operation 'exportCustomerSessions' * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. (optional) + * @param string $profileIntegrationId Only return sessions for the customer that matches this customer integration ID. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $customerSessionState Filter results by state. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate = null) + protected function exportCustomerSessionsRequest($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyBalance' + 'Missing the required parameter $applicationId when calling exportCustomerSessions' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance'; + $resourcePath = '/v1/applications/{applicationId}/export_customer_sessions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12383,19 +12695,47 @@ protected function exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate = nul $multipart = false; // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); } - if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($profileIntegrationId)) { + $profileIntegrationId = ObjectSerializer::serializeCollection($profileIntegrationId, '', true); + } + if ($profileIntegrationId !== null) { + $queryParams['profileIntegrationId'] = $profileIntegrationId; + } + // query params + if (is_array($dateFormat)) { + $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + } + if ($dateFormat !== null) { + $queryParams['dateFormat'] = $dateFormat; + } + // query params + if (is_array($customerSessionState)) { + $customerSessionState = ObjectSerializer::serializeCollection($customerSessionState, '', true); + } + if ($customerSessionState !== null) { + $queryParams['customerSessionState'] = $customerSessionState; } // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -12475,38 +12815,40 @@ protected function exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate = nul } /** - * Operation exportLoyaltyBalances + * Operation exportCustomersTiers * - * Export customer loyalty balances + * Export customers' tier data * * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) + * @param string[] $tierNames An array of tier names to filter the export by. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string */ - public function exportLoyaltyBalances($loyaltyProgramId, $endDate = null) + public function exportCustomersTiers($loyaltyProgramId, $subledgerIds = null, $tierNames = null) { - list($response) = $this->exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate); + list($response) = $this->exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames); return $response; } /** - * Operation exportLoyaltyBalancesWithHttpInfo + * Operation exportCustomersTiersWithHttpInfo * - * Export customer loyalty balances + * Export customers' tier data * * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) + * @param string[] $tierNames An array of tier names to filter the export by. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) + public function exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) { - $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); + $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); try { $options = $this->createHttpClientOption(); @@ -12550,31 +12892,7 @@ public function exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } + } $returnType = 'string'; $responseBody = $response->getBody(); @@ -12600,41 +12918,26 @@ public function exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = ); $e->setResponseObject($data); break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation exportLoyaltyBalancesAsync + * Operation exportCustomersTiersAsync * - * Export customer loyalty balances + * Export customers' tier data * * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) + * @param string[] $tierNames An array of tier names to filter the export by. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyBalancesAsync($loyaltyProgramId, $endDate = null) + public function exportCustomersTiersAsync($loyaltyProgramId, $subledgerIds = null, $tierNames = null) { - return $this->exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) + return $this->exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames) ->then( function ($response) { return $response[0]; @@ -12643,20 +12946,21 @@ function ($response) { } /** - * Operation exportLoyaltyBalancesAsyncWithHttpInfo + * Operation exportCustomersTiersAsyncWithHttpInfo * - * Export customer loyalty balances + * Export customers' tier data * * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) + * @param string[] $tierNames An array of tier names to filter the export by. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + public function exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) { $returnType = 'string'; - $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); + $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12693,24 +12997,25 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyBalances' + * Create request for operation 'exportCustomersTiers' * * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerIds An array of subledgers IDs to filter the export by. (optional) + * @param string[] $tierNames An array of tier names to filter the export by. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate = null) + protected function exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds = null, $tierNames = null) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyBalances' + 'Missing the required parameter $loyaltyProgramId when calling exportCustomersTiers' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customers_tiers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12718,11 +13023,18 @@ protected function exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate = nu $multipart = false; // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + if (is_array($subledgerIds)) { + $subledgerIds = ObjectSerializer::serializeCollection($subledgerIds, 'form', true); } - if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ($subledgerIds !== null) { + $queryParams['subledgerIds'] = $subledgerIds; + } + // query params + if (is_array($tierNames)) { + $tierNames = ObjectSerializer::serializeCollection($tierNames, 'form', true); + } + if ($tierNames !== null) { + $queryParams['tierNames'] = $tierNames; } @@ -12810,38 +13122,44 @@ protected function exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate = nu } /** - * Operation exportLoyaltyCardBalances + * Operation exportEffects * - * Export all card transaction logs + * Export triggered effects * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string */ - public function exportLoyaltyCardBalances($loyaltyProgramId, $endDate = null) + public function exportEffects($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) { - list($response) = $this->exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate); + list($response) = $this->exportEffectsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); return $response; } /** - * Operation exportLoyaltyCardBalancesWithHttpInfo + * Operation exportEffectsWithHttpInfo * - * Export all card transaction logs + * Export triggered effects * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) + public function exportEffectsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) { - $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); + $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); try { $options = $this->createHttpClientOption(); @@ -12885,30 +13203,6 @@ public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDat $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; } $returnType = 'string'; @@ -12935,41 +13229,28 @@ public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDat ); $e->setResponseObject($data); break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation exportLoyaltyCardBalancesAsync + * Operation exportEffectsAsync * - * Export all card transaction logs + * Export triggered effects * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyCardBalancesAsync($loyaltyProgramId, $endDate = null) + public function exportEffectsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) { - return $this->exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) + return $this->exportEffectsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat) ->then( function ($response) { return $response[0]; @@ -12978,20 +13259,23 @@ function ($response) { } /** - * Operation exportLoyaltyCardBalancesAsyncWithHttpInfo + * Operation exportEffectsAsyncWithHttpInfo * - * Export all card transaction logs + * Export triggered effects * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + public function exportEffectsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) { $returnType = 'string'; - $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); + $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13028,24 +13312,27 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyCardBalances' + * Create request for operation 'exportEffects' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate = null) + protected function exportEffectsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyCardBalances' + 'Missing the required parameter $applicationId when calling exportEffects' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_card_balances'; + $resourcePath = '/v1/applications/{applicationId}/export_effects'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13053,19 +13340,40 @@ protected function exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate $multipart = false; // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); } - if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ($campaignId !== null) { + $queryParams['campaignId'] = $campaignId; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($dateFormat)) { + $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + } + if ($dateFormat !== null) { + $queryParams['dateFormat'] = $dateFormat; } // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -13145,44 +13453,38 @@ protected function exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate } /** - * Operation exportLoyaltyCardLedger + * Operation exportLoyaltyBalance * - * Export card's ledger log + * Export customer loyalty balance to CSV * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function exportLoyaltyBalance($loyaltyProgramId, $endDate = null) { - list($response) = $this->exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + list($response) = $this->exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate); return $response; } /** - * Operation exportLoyaltyCardLedgerWithHttpInfo + * Operation exportLoyaltyBalanceWithHttpInfo * - * Export card's ledger log + * Export customer loyalty balance to CSV * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = null) { - $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); try { $options = $this->createHttpClientOption(); @@ -13226,7 +13528,7 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -13238,7 +13540,7 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC $response->getStatusCode(), $response->getHeaders() ]; - case 404: + case 401: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -13276,7 +13578,7 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -13284,7 +13586,7 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -13298,22 +13600,19 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC } /** - * Operation exportLoyaltyCardLedgerAsync + * Operation exportLoyaltyBalanceAsync * - * Export card's ledger log + * Export customer loyalty balance to CSV * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyCardLedgerAsync($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function exportLoyaltyBalanceAsync($loyaltyProgramId, $endDate = null) { - return $this->exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat) + return $this->exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate) ->then( function ($response) { return $response[0]; @@ -13322,23 +13621,20 @@ function ($response) { } /** - * Operation exportLoyaltyCardLedgerAsyncWithHttpInfo + * Operation exportLoyaltyBalanceAsyncWithHttpInfo * - * Export card's ledger log + * Export customer loyalty balance to CSV * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) { $returnType = 'string'; - $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13375,49 +13671,24 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyCardLedger' + * Create request for operation 'exportLoyaltyBalance' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + protected function exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate = null) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyCardLedger' - ); - } - // verify the required parameter 'loyaltyCardId' is set - if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling exportLoyaltyCardLedger' - ); - } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.exportLoyaltyCardLedger, must be smaller than or equal to 108.'); - } - - // verify the required parameter 'rangeStart' is set - if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeStart when calling exportLoyaltyCardLedger' - ); - } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling exportLoyaltyCardLedger' + 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyBalance' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13425,25 +13696,11 @@ protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCar $multipart = false; // query params - if (is_array($rangeStart)) { - $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); - } - if ($rangeStart !== null) { - $queryParams['rangeStart'] = $rangeStart; - } - // query params - if (is_array($rangeEnd)) { - $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); - } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; - } - // query params - if (is_array($dateFormat)) { - $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); } - if ($dateFormat !== null) { - $queryParams['dateFormat'] = $dateFormat; + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; } @@ -13455,14 +13712,6 @@ protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCar $resourcePath ); } - // path params - if ($loyaltyCardId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -13539,44 +13788,38 @@ protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCar } /** - * Operation exportLoyaltyLedger + * Operation exportLoyaltyBalances * - * Export customer's transaction logs + * Export customer loyalty balances * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function exportLoyaltyBalances($loyaltyProgramId, $endDate = null) { - list($response) = $this->exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + list($response) = $this->exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate); return $response; } /** - * Operation exportLoyaltyLedgerWithHttpInfo + * Operation exportLoyaltyBalancesWithHttpInfo * - * Export customer's transaction logs + * Export customer loyalty balances * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) { - $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); try { $options = $this->createHttpClientOption(); @@ -13620,6 +13863,30 @@ public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyalty $response->getStatusCode(), $response->getHeaders() ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } $returnType = 'string'; @@ -13646,28 +13913,41 @@ public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyalty ); $e->setResponseObject($data); break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation exportLoyaltyLedgerAsync + * Operation exportLoyaltyBalancesAsync * - * Export customer's transaction logs + * Export customer loyalty balances * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyLedgerAsync($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function exportLoyaltyBalancesAsync($loyaltyProgramId, $endDate = null) { - return $this->exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat) + return $this->exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) ->then( function ($response) { return $response[0]; @@ -13676,23 +13956,20 @@ function ($response) { } /** - * Operation exportLoyaltyLedgerAsyncWithHttpInfo + * Operation exportLoyaltyBalancesAsyncWithHttpInfo * - * Export customer's transaction logs + * Export customer loyalty balances * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) { $returnType = 'string'; - $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13729,45 +14006,24 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyLedger' + * Create request for operation 'exportLoyaltyBalances' * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + protected function exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate = null) { - // verify the required parameter 'rangeStart' is set - if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeStart when calling exportLoyaltyLedger' - ); - } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling exportLoyaltyLedger' - ); - } // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyLedger' - ); - } - // verify the required parameter 'integrationId' is set - if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $integrationId when calling exportLoyaltyLedger' + 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyBalances' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13775,25 +14031,11 @@ protected function exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyPr $multipart = false; // query params - if (is_array($rangeStart)) { - $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); - } - if ($rangeStart !== null) { - $queryParams['rangeStart'] = $rangeStart; - } - // query params - if (is_array($rangeEnd)) { - $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); - } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; - } - // query params - if (is_array($dateFormat)) { - $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); } - if ($dateFormat !== null) { - $queryParams['dateFormat'] = $dateFormat; + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; } @@ -13805,14 +14047,6 @@ protected function exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyPr $resourcePath ); } - // path params - if ($integrationId !== null) { - $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -13889,40 +14123,38 @@ protected function exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyPr } /** - * Operation exportPoolGiveaways + * Operation exportLoyaltyCardBalances * - * Export giveaway codes of a giveaway pool + * Export all card transaction logs * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportPoolGiveaways($poolId, $createdBefore = null, $createdAfter = null) + public function exportLoyaltyCardBalances($loyaltyProgramId, $endDate = null) { - list($response) = $this->exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore, $createdAfter); + list($response) = $this->exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate); return $response; } /** - * Operation exportPoolGiveawaysWithHttpInfo + * Operation exportLoyaltyCardBalancesWithHttpInfo * - * Export giveaway codes of a giveaway pool + * Export all card transaction logs * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) + public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) { - $request = $this->exportPoolGiveawaysRequest($poolId, $createdBefore, $createdAfter); + $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); try { $options = $this->createHttpClientOption(); @@ -13973,6 +14205,18 @@ public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, $content = (string) $responseBody; } + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + return [ ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), @@ -14012,26 +14256,33 @@ public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, ); $e->setResponseObject($data); break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation exportPoolGiveawaysAsync + * Operation exportLoyaltyCardBalancesAsync * - * Export giveaway codes of a giveaway pool + * Export all card transaction logs * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportPoolGiveawaysAsync($poolId, $createdBefore = null, $createdAfter = null) + public function exportLoyaltyCardBalancesAsync($loyaltyProgramId, $endDate = null) { - return $this->exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore, $createdAfter) + return $this->exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) ->then( function ($response) { return $response[0]; @@ -14040,21 +14291,20 @@ function ($response) { } /** - * Operation exportPoolGiveawaysAsyncWithHttpInfo + * Operation exportLoyaltyCardBalancesAsyncWithHttpInfo * - * Export giveaway codes of a giveaway pool + * Export all card transaction logs * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) + public function exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) { $returnType = 'string'; - $request = $this->exportPoolGiveawaysRequest($poolId, $createdBefore, $createdAfter); + $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14091,25 +14341,24 @@ function ($exception) { } /** - * Create request for operation 'exportPoolGiveaways' + * Create request for operation 'exportLoyaltyCardBalances' * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) - * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \DateTime $endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportPoolGiveawaysRequest($poolId, $createdBefore = null, $createdAfter = null) + protected function exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate = null) { - // verify the required parameter 'poolId' is set - if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $poolId when calling exportPoolGiveaways' + 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyCardBalances' ); } - $resourcePath = '/v1/giveaways/pools/{poolId}/export'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_card_balances'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14117,26 +14366,19 @@ protected function exportPoolGiveawaysRequest($poolId, $createdBefore = null, $c $multipart = false; // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; } // path params - if ($poolId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'poolId' . '}', - ObjectSerializer::toPathValue($poolId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -14216,50 +14458,44 @@ protected function exportPoolGiveawaysRequest($poolId, $createdBefore = null, $c } /** - * Operation exportReferrals + * Operation exportLoyaltyCardLedger * - * Export referrals + * Export card's ledger log * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) - * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) - * @param string $batchId Filter results by batches of referrals (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportReferrals($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) { - list($response) = $this->exportReferralsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); + list($response) = $this->exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); return $response; } /** - * Operation exportReferralsWithHttpInfo + * Operation exportLoyaltyCardLedgerWithHttpInfo * - * Export referrals + * Export card's ledger log * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) - * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) - * @param string $batchId Filter results by batches of referrals (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) { - $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); + $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); try { $options = $this->createHttpClientOption(); @@ -14303,6 +14539,30 @@ public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, $response->getStatusCode(), $response->getHeaders() ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } $returnType = 'string'; @@ -14329,31 +14589,44 @@ public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, ); $e->setResponseObject($data); break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation exportReferralsAsync + * Operation exportLoyaltyCardLedgerAsync * - * Export referrals + * Export card's ledger log * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) - * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) - * @param string $batchId Filter results by batches of referrals (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportReferralsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function exportLoyaltyCardLedgerAsync($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) { - return $this->exportReferralsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat) + return $this->exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat) ->then( function ($response) { return $response[0]; @@ -14362,26 +14635,23 @@ function ($response) { } /** - * Operation exportReferralsAsyncWithHttpInfo + * Operation exportLoyaltyCardLedgerAsyncWithHttpInfo * - * Export referrals + * Export card's ledger log * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) - * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) - * @param string $batchId Filter results by batches of referrals (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportReferralsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) { $returnType = 'string'; - $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); + $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14418,30 +14688,49 @@ function ($exception) { } /** - * Create request for operation 'exportReferrals' + * Create request for operation 'exportLoyaltyCardLedger' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) - * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) - * @param string $batchId Filter results by batches of referrals (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportReferralsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling exportReferrals' + 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyCardLedger' + ); + } + // verify the required parameter 'loyaltyCardId' is set + if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyCardId when calling exportLoyaltyCardLedger' ); } + if (strlen($loyaltyCardId) > 108) { + throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.exportLoyaltyCardLedger, must be smaller than or equal to 108.'); + } - $resourcePath = '/v1/applications/{applicationId}/export_referrals'; + // verify the required parameter 'rangeStart' is set + if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeStart when calling exportLoyaltyCardLedger' + ); + } + // verify the required parameter 'rangeEnd' is set + if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeEnd when calling exportLoyaltyCardLedger' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/export_log'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14449,46 +14738,18 @@ protected function exportReferralsRequest($applicationId, $campaignId = null, $c $multipart = false; // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); - } - if ($campaignId !== null) { - $queryParams['campaignId'] = $campaignId; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($valid)) { - $valid = ObjectSerializer::serializeCollection($valid, '', true); - } - if ($valid !== null) { - $queryParams['valid'] = $valid; - } - // query params - if (is_array($usable)) { - $usable = ObjectSerializer::serializeCollection($usable, '', true); + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - if ($usable !== null) { - $queryParams['usable'] = $usable; + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; } // query params - if (is_array($batchId)) { - $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); } - if ($batchId !== null) { - $queryParams['batchId'] = $batchId; + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; } // query params if (is_array($dateFormat)) { @@ -14500,10 +14761,18 @@ protected function exportReferralsRequest($applicationId, $campaignId = null, $c // path params - if ($applicationId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + // path params + if ($loyaltyCardId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), $resourcePath ); } @@ -14583,52 +14852,38 @@ protected function exportReferralsRequest($applicationId, $campaignId = null, $c } /** - * Operation getAccessLogsWithoutTotalCount + * Operation exportLoyaltyCards * - * Get access logs for Application + * Export loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20019 + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function exportLoyaltyCards($loyaltyProgramId, $batchId = null) { - list($response) = $this->getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + list($response) = $this->exportLoyaltyCardsWithHttpInfo($loyaltyProgramId, $batchId); return $response; } /** - * Operation getAccessLogsWithoutTotalCountWithHttpInfo + * Operation exportLoyaltyCardsWithHttpInfo * - * Get access logs for Application + * Export loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20019, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function exportLoyaltyCardsWithHttpInfo($loyaltyProgramId, $batchId = null) { - $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $request = $this->exportLoyaltyCardsRequest($loyaltyProgramId, $batchId); try { $options = $this->createHttpClientOption(); @@ -14661,20 +14916,44 @@ public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rang $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20019' === '\SplFileObject') { + if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20019', []), + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20019'; + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -14693,7 +14972,23 @@ public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rang case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20019', + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14704,26 +14999,19 @@ public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rang } /** - * Operation getAccessLogsWithoutTotalCountAsync + * Operation exportLoyaltyCardsAsync * - * Get access logs for Application + * Export loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessLogsWithoutTotalCountAsync($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function exportLoyaltyCardsAsync($loyaltyProgramId, $batchId = null) { - return $this->getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) + return $this->exportLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $batchId) ->then( function ($response) { return $response[0]; @@ -14732,27 +15020,20 @@ function ($response) { } /** - * Operation getAccessLogsWithoutTotalCountAsyncWithHttpInfo + * Operation exportLoyaltyCardsAsyncWithHttpInfo * - * Get access logs for Application + * Export loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function exportLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $batchId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20019'; - $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $returnType = 'string'; + $request = $this->exportLoyaltyCardsRequest($loyaltyProgramId, $batchId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14789,50 +15070,24 @@ function ($exception) { } /** - * Create request for operation 'getAccessLogsWithoutTotalCount' + * Create request for operation 'exportLoyaltyCards' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + protected function exportLoyaltyCardsRequest($loyaltyProgramId, $batchId = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getAccessLogsWithoutTotalCount' - ); - } - // verify the required parameter 'rangeStart' is set - if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeStart when calling getAccessLogsWithoutTotalCount' - ); - } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling getAccessLogsWithoutTotalCount' + 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyCards' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAccessLogsWithoutTotalCount, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAccessLogsWithoutTotalCount, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/access_logs/no_total'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/export'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14840,68 +15095,19 @@ protected function getAccessLogsWithoutTotalCountRequest($applicationId, $rangeS $multipart = false; // query params - if (is_array($path)) { - $path = ObjectSerializer::serializeCollection($path, '', true); - } - if ($path !== null) { - $queryParams['path'] = $path; - } - // query params - if (is_array($method)) { - $method = ObjectSerializer::serializeCollection($method, '', true); - } - if ($method !== null) { - $queryParams['method'] = $method; - } - // query params - if (is_array($status)) { - $status = ObjectSerializer::serializeCollection($status, '', true); - } - if ($status !== null) { - $queryParams['status'] = $status; - } - // query params - if (is_array($rangeStart)) { - $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); - } - if ($rangeStart !== null) { - $queryParams['rangeStart'] = $rangeStart; - } - // query params - if (is_array($rangeEnd)) { - $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); - } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; - } - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); + if (is_array($batchId)) { + $batchId = ObjectSerializer::serializeCollection($batchId, '', true); } - if ($sort !== null) { - $queryParams['sort'] = $sort; + if ($batchId !== null) { + $queryParams['batchId'] = $batchId; } // path params - if ($applicationId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -14911,11 +15117,11 @@ protected function getAccessLogsWithoutTotalCountRequest($applicationId, $rangeS if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/csv'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/csv'], [] ); } @@ -14981,36 +15187,44 @@ protected function getAccessLogsWithoutTotalCountRequest($applicationId, $rangeS } /** - * Operation getAccount + * Operation exportLoyaltyLedger * - * Get account details + * Export customer's transaction logs * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Account + * @return string */ - public function getAccount($accountId) + public function exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) { - list($response) = $this->getAccountWithHttpInfo($accountId); + list($response) = $this->exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); return $response; } /** - * Operation getAccountWithHttpInfo + * Operation exportLoyaltyLedgerWithHttpInfo * - * Get account details + * Export customer's transaction logs * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Account, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountWithHttpInfo($accountId) + public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) { - $request = $this->getAccountRequest($accountId); + $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); try { $options = $this->createHttpClientOption(); @@ -15043,20 +15257,20 @@ public function getAccountWithHttpInfo($accountId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Account' === '\SplFileObject') { + if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Account', []), + ObjectSerializer::deserialize($content, 'string', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Account'; + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -15075,7 +15289,7 @@ public function getAccountWithHttpInfo($accountId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Account', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15086,18 +15300,22 @@ public function getAccountWithHttpInfo($accountId) } /** - * Operation getAccountAsync + * Operation exportLoyaltyLedgerAsync * - * Get account details + * Export customer's transaction logs * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAsync($accountId) + public function exportLoyaltyLedgerAsync($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) { - return $this->getAccountAsyncWithHttpInfo($accountId) + return $this->exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat) ->then( function ($response) { return $response[0]; @@ -15106,19 +15324,23 @@ function ($response) { } /** - * Operation getAccountAsyncWithHttpInfo + * Operation exportLoyaltyLedgerAsyncWithHttpInfo * - * Get account details + * Export customer's transaction logs * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAsyncWithHttpInfo($accountId) + public function exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) { - $returnType = '\TalonOne\Client\Model\Account'; - $request = $this->getAccountRequest($accountId); + $returnType = 'string'; + $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15155,36 +15377,87 @@ function ($exception) { } /** - * Create request for operation 'getAccount' + * Create request for operation 'exportLoyaltyLedger' * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccountRequest($accountId) + protected function exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) { - // verify the required parameter 'accountId' is set - if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { + // verify the required parameter 'rangeStart' is set + if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $accountId when calling getAccount' + 'Missing the required parameter $rangeStart when calling exportLoyaltyLedger' + ); + } + // verify the required parameter 'rangeEnd' is set + if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeEnd when calling exportLoyaltyLedger' + ); + } + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyLedger' + ); + } + // verify the required parameter 'integrationId' is set + if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $integrationId when calling exportLoyaltyLedger' ); } - $resourcePath = '/v1/accounts/{accountId}'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); + } + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; + } + // query params + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); + } + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; + } + // query params + if (is_array($dateFormat)) { + $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + } + if ($dateFormat !== null) { + $queryParams['dateFormat'] = $dateFormat; + } // path params - if ($accountId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'accountId' . '}', - ObjectSerializer::toPathValue($accountId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), $resourcePath ); } @@ -15194,11 +15467,11 @@ protected function getAccountRequest($accountId) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/csv'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/csv'], [] ); } @@ -15264,36 +15537,40 @@ protected function getAccountRequest($accountId) } /** - * Operation getAccountAnalytics + * Operation exportPoolGiveaways * - * Get account analytics + * Export giveaway codes of a giveaway pool * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\AccountAnalytics + * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getAccountAnalytics($accountId) + public function exportPoolGiveaways($poolId, $createdBefore = null, $createdAfter = null) { - list($response) = $this->getAccountAnalyticsWithHttpInfo($accountId); + list($response) = $this->exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore, $createdAfter); return $response; } /** - * Operation getAccountAnalyticsWithHttpInfo + * Operation exportPoolGiveawaysWithHttpInfo * - * Get account analytics + * Export giveaway codes of a giveaway pool * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\AccountAnalytics, HTTP status code, HTTP response headers (array of strings) + * @return array of string|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountAnalyticsWithHttpInfo($accountId) + public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) { - $request = $this->getAccountAnalyticsRequest($accountId); + $request = $this->exportPoolGiveawaysRequest($poolId, $createdBefore, $createdAfter); try { $options = $this->createHttpClientOption(); @@ -15326,20 +15603,32 @@ public function getAccountAnalyticsWithHttpInfo($accountId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\AccountAnalytics' === '\SplFileObject') { + if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AccountAnalytics', []), + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\AccountAnalytics'; + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -15358,7 +15647,15 @@ public function getAccountAnalyticsWithHttpInfo($accountId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\AccountAnalytics', + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15369,18 +15666,20 @@ public function getAccountAnalyticsWithHttpInfo($accountId) } /** - * Operation getAccountAnalyticsAsync + * Operation exportPoolGiveawaysAsync * - * Get account analytics + * Export giveaway codes of a giveaway pool * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAnalyticsAsync($accountId) + public function exportPoolGiveawaysAsync($poolId, $createdBefore = null, $createdAfter = null) { - return $this->getAccountAnalyticsAsyncWithHttpInfo($accountId) + return $this->exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore, $createdAfter) ->then( function ($response) { return $response[0]; @@ -15389,19 +15688,21 @@ function ($response) { } /** - * Operation getAccountAnalyticsAsyncWithHttpInfo + * Operation exportPoolGiveawaysAsyncWithHttpInfo * - * Get account analytics + * Export giveaway codes of a giveaway pool * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAnalyticsAsyncWithHttpInfo($accountId) + public function exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) { - $returnType = '\TalonOne\Client\Model\AccountAnalytics'; - $request = $this->getAccountAnalyticsRequest($accountId); + $returnType = 'string'; + $request = $this->exportPoolGiveawaysRequest($poolId, $createdBefore, $createdAfter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15438,36 +15739,52 @@ function ($exception) { } /** - * Create request for operation 'getAccountAnalytics' + * Create request for operation 'exportPoolGiveaways' * - * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param \DateTime $createdBefore Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. (optional) + * @param \DateTime $createdAfter Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccountAnalyticsRequest($accountId) + protected function exportPoolGiveawaysRequest($poolId, $createdBefore = null, $createdAfter = null) { - // verify the required parameter 'accountId' is set - if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { + // verify the required parameter 'poolId' is set + if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $accountId when calling getAccountAnalytics' + 'Missing the required parameter $poolId when calling exportPoolGiveaways' ); } - $resourcePath = '/v1/accounts/{accountId}/analytics'; + $resourcePath = '/v1/giveaways/pools/{poolId}/export'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } // path params - if ($accountId !== null) { + if ($poolId !== null) { $resourcePath = str_replace( - '{' . 'accountId' . '}', - ObjectSerializer::toPathValue($accountId), + '{' . 'poolId' . '}', + ObjectSerializer::toPathValue($poolId), $resourcePath ); } @@ -15477,11 +15794,11 @@ protected function getAccountAnalyticsRequest($accountId) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/csv'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/csv'], [] ); } @@ -15547,36 +15864,50 @@ protected function getAccountAnalyticsRequest($accountId) } /** - * Operation getAccountCollection + * Operation exportReferrals * - * Get account-level collection + * Export referrals * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) + * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) + * @param string $batchId Filter results by batches of referrals (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string */ - public function getAccountCollection($collectionId) + public function exportReferrals($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - list($response) = $this->getAccountCollectionWithHttpInfo($collectionId); + list($response) = $this->exportReferralsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); return $response; } /** - * Operation getAccountCollectionWithHttpInfo + * Operation exportReferralsWithHttpInfo * - * Get account-level collection + * Export referrals * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) + * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) + * @param string $batchId Filter results by batches of referrals (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountCollectionWithHttpInfo($collectionId) + public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - $request = $this->getAccountCollectionRequest($collectionId); + $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); try { $options = $this->createHttpClientOption(); @@ -15609,32 +15940,20 @@ public function getAccountCollectionWithHttpInfo($collectionId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Collection' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Collection', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, 'string', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Collection'; + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -15653,15 +15972,7 @@ public function getAccountCollectionWithHttpInfo($collectionId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Collection', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15672,18 +15983,25 @@ public function getAccountCollectionWithHttpInfo($collectionId) } /** - * Operation getAccountCollectionAsync + * Operation exportReferralsAsync * - * Get account-level collection + * Export referrals * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) + * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) + * @param string $batchId Filter results by batches of referrals (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccountCollectionAsync($collectionId) + public function exportReferralsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - return $this->getAccountCollectionAsyncWithHttpInfo($collectionId) + return $this->exportReferralsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat) ->then( function ($response) { return $response[0]; @@ -15692,19 +16010,26 @@ function ($response) { } /** - * Operation getAccountCollectionAsyncWithHttpInfo + * Operation exportReferralsAsyncWithHttpInfo * - * Get account-level collection + * Export referrals * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) + * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) + * @param string $batchId Filter results by batches of referrals (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAccountCollectionAsyncWithHttpInfo($collectionId) + public function exportReferralsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - $returnType = '\TalonOne\Client\Model\Collection'; - $request = $this->getAccountCollectionRequest($collectionId); + $returnType = 'string'; + $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15741,36 +16066,92 @@ function ($exception) { } /** - * Create request for operation 'getAccountCollection' + * Create request for operation 'exportReferrals' * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future. (optional) + * @param string $usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. (optional) + * @param string $batchId Filter results by batches of referrals (optional) + * @param string $dateFormat Determines the format of dates in the export document. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAccountCollectionRequest($collectionId) + protected function exportReferralsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling getAccountCollection' + 'Missing the required parameter $applicationId when calling exportReferrals' ); } - $resourcePath = '/v1/collections/{collectionId}'; + $resourcePath = '/v1/applications/{applicationId}/export_referrals'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + } + if ($campaignId !== null) { + $queryParams['campaignId'] = $campaignId; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($valid)) { + $valid = ObjectSerializer::serializeCollection($valid, '', true); + } + if ($valid !== null) { + $queryParams['valid'] = $valid; + } + // query params + if (is_array($usable)) { + $usable = ObjectSerializer::serializeCollection($usable, '', true); + } + if ($usable !== null) { + $queryParams['usable'] = $usable; + } + // query params + if (is_array($batchId)) { + $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + } + if ($batchId !== null) { + $queryParams['batchId'] = $batchId; + } + // query params + if (is_array($dateFormat)) { + $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + } + if ($dateFormat !== null) { + $queryParams['dateFormat'] = $dateFormat; + } // path params - if ($collectionId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -15780,11 +16161,11 @@ protected function getAccountCollectionRequest($collectionId) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/csv'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/csv'], [] ); } @@ -15850,40 +16231,52 @@ protected function getAccountCollectionRequest($collectionId) } /** - * Operation getAchievement + * Operation getAccessLogsWithoutTotalCount * - * Get achievement + * Get access logs for Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20019 */ - public function getAchievement($applicationId, $campaignId, $achievementId) + public function getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getAchievementWithHttpInfo($applicationId, $campaignId, $achievementId); + list($response) = $this->getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $response; } /** - * Operation getAchievementWithHttpInfo + * Operation getAccessLogsWithoutTotalCountWithHttpInfo * - * Get achievement + * Get access logs for Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20019, HTTP status code, HTTP response headers (array of strings) */ - public function getAchievementWithHttpInfo($applicationId, $campaignId, $achievementId) + public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getAchievementRequest($applicationId, $campaignId, $achievementId); + $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -15916,44 +16309,20 @@ public function getAchievementWithHttpInfo($applicationId, $campaignId, $achieve $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Achievement' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Achievement', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20019' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20019', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Achievement'; + $returnType = '\TalonOne\Client\Model\InlineResponse20019'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -15972,23 +16341,7 @@ public function getAchievementWithHttpInfo($applicationId, $campaignId, $achieve case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Achievement', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20019', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15999,20 +16352,26 @@ public function getAchievementWithHttpInfo($applicationId, $campaignId, $achieve } /** - * Operation getAchievementAsync + * Operation getAccessLogsWithoutTotalCountAsync * - * Get achievement + * Get access logs for Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAchievementAsync($applicationId, $campaignId, $achievementId) + public function getAccessLogsWithoutTotalCountAsync($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) + return $this->getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -16021,21 +16380,27 @@ function ($response) { } /** - * Operation getAchievementAsyncWithHttpInfo + * Operation getAccessLogsWithoutTotalCountAsyncWithHttpInfo * - * Get achievement + * Get access logs for Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) + public function getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\Achievement'; - $request = $this->getAchievementRequest($applicationId, $campaignId, $achievementId); + $returnType = '\TalonOne\Client\Model\InlineResponse20019'; + $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16072,43 +16437,112 @@ function ($exception) { } /** - * Create request for operation 'getAchievement' + * Create request for operation 'getAccessLogsWithoutTotalCount' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAchievementRequest($applicationId, $campaignId, $achievementId) + protected function getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getAchievement' + 'Missing the required parameter $applicationId when calling getAccessLogsWithoutTotalCount' ); } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'rangeStart' is set + if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getAchievement' + 'Missing the required parameter $rangeStart when calling getAccessLogsWithoutTotalCount' ); } - // verify the required parameter 'achievementId' is set - if ($achievementId === null || (is_array($achievementId) && count($achievementId) === 0)) { + // verify the required parameter 'rangeEnd' is set + if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $achievementId when calling getAchievement' + 'Missing the required parameter $rangeEnd when calling getAccessLogsWithoutTotalCount' ); } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAccessLogsWithoutTotalCount, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAccessLogsWithoutTotalCount, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}'; + + $resourcePath = '/v1/applications/{applicationId}/access_logs/no_total'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($path)) { + $path = ObjectSerializer::serializeCollection($path, '', true); + } + if ($path !== null) { + $queryParams['path'] = $path; + } + // query params + if (is_array($method)) { + $method = ObjectSerializer::serializeCollection($method, '', true); + } + if ($method !== null) { + $queryParams['method'] = $method; + } + // query params + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); + } + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; + } + // query params + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); + } + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; + } + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } // path params @@ -16119,22 +16553,6 @@ protected function getAchievementRequest($applicationId, $campaignId, $achieveme $resourcePath ); } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } - // path params - if ($achievementId !== null) { - $resourcePath = str_replace( - '{' . 'achievementId' . '}', - ObjectSerializer::toPathValue($achievementId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -16211,36 +16629,36 @@ protected function getAchievementRequest($applicationId, $campaignId, $achieveme } /** - * Operation getAdditionalCost + * Operation getAccount * - * Get additional cost + * Get account details * - * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\AccountAdditionalCost + * @return \TalonOne\Client\Model\Account */ - public function getAdditionalCost($additionalCostId) + public function getAccount($accountId) { - list($response) = $this->getAdditionalCostWithHttpInfo($additionalCostId); + list($response) = $this->getAccountWithHttpInfo($accountId); return $response; } /** - * Operation getAdditionalCostWithHttpInfo + * Operation getAccountWithHttpInfo * - * Get additional cost + * Get account details * - * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\AccountAdditionalCost, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Account, HTTP status code, HTTP response headers (array of strings) */ - public function getAdditionalCostWithHttpInfo($additionalCostId) + public function getAccountWithHttpInfo($accountId) { - $request = $this->getAdditionalCostRequest($additionalCostId); + $request = $this->getAccountRequest($accountId); try { $options = $this->createHttpClientOption(); @@ -16273,20 +16691,20 @@ public function getAdditionalCostWithHttpInfo($additionalCostId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\AccountAdditionalCost' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Account' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AccountAdditionalCost', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Account', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $returnType = '\TalonOne\Client\Model\Account'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -16305,7 +16723,7 @@ public function getAdditionalCostWithHttpInfo($additionalCostId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\AccountAdditionalCost', + '\TalonOne\Client\Model\Account', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16316,18 +16734,18 @@ public function getAdditionalCostWithHttpInfo($additionalCostId) } /** - * Operation getAdditionalCostAsync + * Operation getAccountAsync * - * Get additional cost + * Get account details * - * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAdditionalCostAsync($additionalCostId) + public function getAccountAsync($accountId) { - return $this->getAdditionalCostAsyncWithHttpInfo($additionalCostId) + return $this->getAccountAsyncWithHttpInfo($accountId) ->then( function ($response) { return $response[0]; @@ -16336,19 +16754,19 @@ function ($response) { } /** - * Operation getAdditionalCostAsyncWithHttpInfo + * Operation getAccountAsyncWithHttpInfo * - * Get additional cost + * Get account details * - * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAdditionalCostAsyncWithHttpInfo($additionalCostId) + public function getAccountAsyncWithHttpInfo($accountId) { - $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; - $request = $this->getAdditionalCostRequest($additionalCostId); + $returnType = '\TalonOne\Client\Model\Account'; + $request = $this->getAccountRequest($accountId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16385,23 +16803,23 @@ function ($exception) { } /** - * Create request for operation 'getAdditionalCost' + * Create request for operation 'getAccount' * - * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAdditionalCostRequest($additionalCostId) + protected function getAccountRequest($accountId) { - // verify the required parameter 'additionalCostId' is set - if ($additionalCostId === null || (is_array($additionalCostId) && count($additionalCostId) === 0)) { + // verify the required parameter 'accountId' is set + if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $additionalCostId when calling getAdditionalCost' + 'Missing the required parameter $accountId when calling getAccount' ); } - $resourcePath = '/v1/additional_costs/{additionalCostId}'; + $resourcePath = '/v1/accounts/{accountId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16411,10 +16829,10 @@ protected function getAdditionalCostRequest($additionalCostId) // path params - if ($additionalCostId !== null) { + if ($accountId !== null) { $resourcePath = str_replace( - '{' . 'additionalCostId' . '}', - ObjectSerializer::toPathValue($additionalCostId), + '{' . 'accountId' . '}', + ObjectSerializer::toPathValue($accountId), $resourcePath ); } @@ -16494,40 +16912,36 @@ protected function getAdditionalCostRequest($additionalCostId) } /** - * Operation getAdditionalCosts + * Operation getAccountAnalytics * - * List additional costs + * Get account analytics * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20036 + * @return \TalonOne\Client\Model\AccountAnalytics */ - public function getAdditionalCosts($pageSize = 1000, $skip = null, $sort = null) + public function getAccountAnalytics($accountId) { - list($response) = $this->getAdditionalCostsWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->getAccountAnalyticsWithHttpInfo($accountId); return $response; } /** - * Operation getAdditionalCostsWithHttpInfo + * Operation getAccountAnalyticsWithHttpInfo * - * List additional costs + * Get account analytics * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20036, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\AccountAnalytics, HTTP status code, HTTP response headers (array of strings) */ - public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getAccountAnalyticsWithHttpInfo($accountId) { - $request = $this->getAdditionalCostsRequest($pageSize, $skip, $sort); + $request = $this->getAccountAnalyticsRequest($accountId); try { $options = $this->createHttpClientOption(); @@ -16560,20 +16974,20 @@ public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20036' === '\SplFileObject') { + if ('\TalonOne\Client\Model\AccountAnalytics' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20036', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AccountAnalytics', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20036'; + $returnType = '\TalonOne\Client\Model\AccountAnalytics'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -16592,7 +17006,7 @@ public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20036', + '\TalonOne\Client\Model\AccountAnalytics', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16603,20 +17017,18 @@ public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $ } /** - * Operation getAdditionalCostsAsync + * Operation getAccountAnalyticsAsync * - * List additional costs + * Get account analytics * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAdditionalCostsAsync($pageSize = 1000, $skip = null, $sort = null) + public function getAccountAnalyticsAsync($accountId) { - return $this->getAdditionalCostsAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->getAccountAnalyticsAsyncWithHttpInfo($accountId) ->then( function ($response) { return $response[0]; @@ -16625,21 +17037,19 @@ function ($response) { } /** - * Operation getAdditionalCostsAsyncWithHttpInfo + * Operation getAccountAnalyticsAsyncWithHttpInfo * - * List additional costs + * Get account analytics * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAdditionalCostsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getAccountAnalyticsAsyncWithHttpInfo($accountId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20036'; - $request = $this->getAdditionalCostsRequest($pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\AccountAnalytics'; + $request = $this->getAccountAnalyticsRequest($accountId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16676,55 +17086,39 @@ function ($exception) { } /** - * Create request for operation 'getAdditionalCosts' + * Create request for operation 'getAccountAnalytics' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $accountId The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAdditionalCostsRequest($pageSize = 1000, $skip = null, $sort = null) + protected function getAccountAnalyticsRequest($accountId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAdditionalCosts, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAdditionalCosts, must be bigger than or equal to 1.'); + // verify the required parameter 'accountId' is set + if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $accountId when calling getAccountAnalytics' + ); } - - $resourcePath = '/v1/additional_costs'; + $resourcePath = '/v1/accounts/{accountId}/analytics'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } + // path params + if ($accountId !== null) { + $resourcePath = str_replace( + '{' . 'accountId' . '}', + ObjectSerializer::toPathValue($accountId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -16801,50 +17195,36 @@ protected function getAdditionalCostsRequest($pageSize = 1000, $skip = null, $so } /** - * Operation getAllAccessLogs + * Operation getAccountCollection * - * List access logs + * Get account-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20020 + * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getAllAccessLogs($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getAccountCollection($collectionId) { - list($response) = $this->getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + list($response) = $this->getAccountCollectionWithHttpInfo($collectionId); return $response; } /** - * Operation getAllAccessLogsWithHttpInfo + * Operation getAccountCollectionWithHttpInfo * - * List access logs + * Get account-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20020, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getAllAccessLogsWithHttpInfo($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getAccountCollectionWithHttpInfo($collectionId) { - $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $request = $this->getAccountCollectionRequest($collectionId); try { $options = $this->createHttpClientOption(); @@ -16877,20 +17257,32 @@ public function getAllAccessLogsWithHttpInfo($rangeStart = null, $rangeEnd = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20020' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Collection' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20020', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Collection', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20020'; + $returnType = '\TalonOne\Client\Model\Collection'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -16909,7 +17301,15 @@ public function getAllAccessLogsWithHttpInfo($rangeStart = null, $rangeEnd = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20020', + '\TalonOne\Client\Model\Collection', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16920,25 +17320,18 @@ public function getAllAccessLogsWithHttpInfo($rangeStart = null, $rangeEnd = nul } /** - * Operation getAllAccessLogsAsync + * Operation getAccountCollectionAsync * - * List access logs + * Get account-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAccessLogsAsync($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getAccountCollectionAsync($collectionId) { - return $this->getAllAccessLogsAsyncWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) + return $this->getAccountCollectionAsyncWithHttpInfo($collectionId) ->then( function ($response) { return $response[0]; @@ -16947,26 +17340,19 @@ function ($response) { } /** - * Operation getAllAccessLogsAsyncWithHttpInfo + * Operation getAccountCollectionAsyncWithHttpInfo * - * List access logs + * Get account-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAccessLogsAsyncWithHttpInfo($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getAccountCollectionAsyncWithHttpInfo($collectionId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20020'; - $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\Collection'; + $request = $this->getAccountCollectionRequest($collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17003,95 +17389,39 @@ function ($exception) { } /** - * Create request for operation 'getAllAccessLogs' + * Create request for operation 'getAccountCollection' * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param string $path Only return results where the request path matches the given regular expression. (optional) - * @param string $method Only return results where the request method matches the given regular expression. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAllAccessLogsRequest($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + protected function getAccountCollectionRequest($collectionId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAllAccessLogs, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAllAccessLogs, must be bigger than or equal to 1.'); + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collectionId when calling getAccountCollection' + ); } - - $resourcePath = '/v1/access_logs'; + $resourcePath = '/v1/collections/{collectionId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($rangeStart)) { - $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); - } - if ($rangeStart !== null) { - $queryParams['rangeStart'] = $rangeStart; - } - // query params - if (is_array($rangeEnd)) { - $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); - } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; - } - // query params - if (is_array($path)) { - $path = ObjectSerializer::serializeCollection($path, '', true); - } - if ($path !== null) { - $queryParams['path'] = $path; - } - // query params - if (is_array($method)) { - $method = ObjectSerializer::serializeCollection($method, '', true); - } - if ($method !== null) { - $queryParams['method'] = $method; - } - // query params - if (is_array($status)) { - $status = ObjectSerializer::serializeCollection($status, '', true); - } - if ($status !== null) { - $queryParams['status'] = $status; - } - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -17168,36 +17498,40 @@ protected function getAllAccessLogsRequest($rangeStart = null, $rangeEnd = null, } /** - * Operation getApplication + * Operation getAchievement * - * Get Application + * Get achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Application + * @return \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getApplication($applicationId) + public function getAchievement($applicationId, $campaignId, $achievementId) { - list($response) = $this->getApplicationWithHttpInfo($applicationId); + list($response) = $this->getAchievementWithHttpInfo($applicationId, $campaignId, $achievementId); return $response; } /** - * Operation getApplicationWithHttpInfo + * Operation getAchievementWithHttpInfo * - * Get Application + * Get achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Application, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationWithHttpInfo($applicationId) + public function getAchievementWithHttpInfo($applicationId, $campaignId, $achievementId) { - $request = $this->getApplicationRequest($applicationId); + $request = $this->getAchievementRequest($applicationId, $campaignId, $achievementId); try { $options = $this->createHttpClientOption(); @@ -17230,20 +17564,44 @@ public function getApplicationWithHttpInfo($applicationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Application' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Achievement' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Application', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Achievement', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Application'; + $returnType = '\TalonOne\Client\Model\Achievement'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17262,7 +17620,23 @@ public function getApplicationWithHttpInfo($applicationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Application', + '\TalonOne\Client\Model\Achievement', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17273,18 +17647,20 @@ public function getApplicationWithHttpInfo($applicationId) } /** - * Operation getApplicationAsync + * Operation getAchievementAsync * - * Get Application + * Get achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationAsync($applicationId) + public function getAchievementAsync($applicationId, $campaignId, $achievementId) { - return $this->getApplicationAsyncWithHttpInfo($applicationId) + return $this->getAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) ->then( function ($response) { return $response[0]; @@ -17293,19 +17669,21 @@ function ($response) { } /** - * Operation getApplicationAsyncWithHttpInfo + * Operation getAchievementAsyncWithHttpInfo * - * Get Application + * Get achievement * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationAsyncWithHttpInfo($applicationId) + public function getAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) { - $returnType = '\TalonOne\Client\Model\Application'; - $request = $this->getApplicationRequest($applicationId); + $returnType = '\TalonOne\Client\Model\Achievement'; + $request = $this->getAchievementRequest($applicationId, $campaignId, $achievementId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17342,23 +17720,37 @@ function ($exception) { } /** - * Create request for operation 'getApplication' + * Create request for operation 'getAchievement' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationRequest($applicationId) + protected function getAchievementRequest($applicationId, $campaignId, $achievementId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplication' + 'Missing the required parameter $applicationId when calling getAchievement' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getAchievement' + ); + } + // verify the required parameter 'achievementId' is set + if ($achievementId === null || (is_array($achievementId) && count($achievementId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $achievementId when calling getAchievement' ); } - $resourcePath = '/v1/applications/{applicationId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17375,6 +17767,22 @@ protected function getApplicationRequest($applicationId) $resourcePath ); } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + // path params + if ($achievementId !== null) { + $resourcePath = str_replace( + '{' . 'achievementId' . '}', + ObjectSerializer::toPathValue($achievementId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -17451,36 +17859,36 @@ protected function getApplicationRequest($applicationId) } /** - * Operation getApplicationApiHealth + * Operation getAdditionalCost * - * Get Application health + * Get additional cost * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\ApplicationApiHealth + * @return \TalonOne\Client\Model\AccountAdditionalCost */ - public function getApplicationApiHealth($applicationId) + public function getAdditionalCost($additionalCostId) { - list($response) = $this->getApplicationApiHealthWithHttpInfo($applicationId); + list($response) = $this->getAdditionalCostWithHttpInfo($additionalCostId); return $response; } /** - * Operation getApplicationApiHealthWithHttpInfo + * Operation getAdditionalCostWithHttpInfo * - * Get Application health + * Get additional cost * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\ApplicationApiHealth, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\AccountAdditionalCost, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationApiHealthWithHttpInfo($applicationId) + public function getAdditionalCostWithHttpInfo($additionalCostId) { - $request = $this->getApplicationApiHealthRequest($applicationId); + $request = $this->getAdditionalCostRequest($additionalCostId); try { $options = $this->createHttpClientOption(); @@ -17513,20 +17921,20 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationApiHealth' === '\SplFileObject') { + if ('\TalonOne\Client\Model\AccountAdditionalCost' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationApiHealth', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AccountAdditionalCost', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17545,7 +17953,7 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationApiHealth', + '\TalonOne\Client\Model\AccountAdditionalCost', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17556,18 +17964,18 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) } /** - * Operation getApplicationApiHealthAsync + * Operation getAdditionalCostAsync * - * Get Application health + * Get additional cost * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationApiHealthAsync($applicationId) + public function getAdditionalCostAsync($additionalCostId) { - return $this->getApplicationApiHealthAsyncWithHttpInfo($applicationId) + return $this->getAdditionalCostAsyncWithHttpInfo($additionalCostId) ->then( function ($response) { return $response[0]; @@ -17576,19 +17984,19 @@ function ($response) { } /** - * Operation getApplicationApiHealthAsyncWithHttpInfo + * Operation getAdditionalCostAsyncWithHttpInfo * - * Get Application health + * Get additional cost * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationApiHealthAsyncWithHttpInfo($applicationId) + public function getAdditionalCostAsyncWithHttpInfo($additionalCostId) { - $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; - $request = $this->getApplicationApiHealthRequest($applicationId); + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $request = $this->getAdditionalCostRequest($additionalCostId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17625,23 +18033,23 @@ function ($exception) { } /** - * Create request for operation 'getApplicationApiHealth' + * Create request for operation 'getAdditionalCost' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $additionalCostId The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationApiHealthRequest($applicationId) + protected function getAdditionalCostRequest($additionalCostId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'additionalCostId' is set + if ($additionalCostId === null || (is_array($additionalCostId) && count($additionalCostId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationApiHealth' + 'Missing the required parameter $additionalCostId when calling getAdditionalCost' ); } - $resourcePath = '/v1/applications/{applicationId}/health_report'; + $resourcePath = '/v1/additional_costs/{additionalCostId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17651,10 +18059,10 @@ protected function getApplicationApiHealthRequest($applicationId) // path params - if ($applicationId !== null) { + if ($additionalCostId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'additionalCostId' . '}', + ObjectSerializer::toPathValue($additionalCostId), $resourcePath ); } @@ -17734,38 +18142,40 @@ protected function getApplicationApiHealthRequest($applicationId) } /** - * Operation getApplicationCustomer + * Operation getAdditionalCosts * - * Get application's customer + * List additional costs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\ApplicationCustomer + * @return \TalonOne\Client\Model\InlineResponse20036 */ - public function getApplicationCustomer($applicationId, $customerId) + public function getAdditionalCosts($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getApplicationCustomerWithHttpInfo($applicationId, $customerId); + list($response) = $this->getAdditionalCostsWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getApplicationCustomerWithHttpInfo + * Operation getAdditionalCostsWithHttpInfo * - * Get application's customer + * List additional costs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\ApplicationCustomer, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20036, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) + public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getApplicationCustomerRequest($applicationId, $customerId); + $request = $this->getAdditionalCostsRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -17798,20 +18208,20 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationCustomer' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20036' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationCustomer', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20036', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; + $returnType = '\TalonOne\Client\Model\InlineResponse20036'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17830,7 +18240,7 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationCustomer', + '\TalonOne\Client\Model\InlineResponse20036', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17841,19 +18251,20 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) } /** - * Operation getApplicationCustomerAsync + * Operation getAdditionalCostsAsync * - * Get application's customer + * List additional costs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerAsync($applicationId, $customerId) + public function getAdditionalCostsAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) + return $this->getAdditionalCostsAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -17862,20 +18273,21 @@ function ($response) { } /** - * Operation getApplicationCustomerAsyncWithHttpInfo + * Operation getAdditionalCostsAsyncWithHttpInfo * - * Get application's customer + * List additional costs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) + public function getAdditionalCostsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; - $request = $this->getApplicationCustomerRequest($applicationId, $customerId); + $returnType = '\TalonOne\Client\Model\InlineResponse20036'; + $request = $this->getAdditionalCostsRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17912,54 +18324,55 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomer' + * Create request for operation 'getAdditionalCosts' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomerRequest($applicationId, $customerId) + protected function getAdditionalCostsRequest($pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationCustomer' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAdditionalCosts, must be smaller than or equal to 1000.'); } - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling getApplicationCustomer' - ); + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAdditionalCosts, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}'; + + $resourcePath = '/v1/additional_costs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + // body params $_tempBody = null; @@ -18036,46 +18449,50 @@ protected function getApplicationCustomerRequest($applicationId, $customerId) } /** - * Operation getApplicationCustomerFriends + * Operation getAllAccessLogs * - * List friends referred by customer profile + * List access logs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The Integration ID of the Advocate's Profile. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20033 + * @return \TalonOne\Client\Model\InlineResponse20020 */ - public function getApplicationCustomerFriends($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAllAccessLogs($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + list($response) = $this->getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $response; } /** - * Operation getApplicationCustomerFriendsWithHttpInfo + * Operation getAllAccessLogsWithHttpInfo * - * List friends referred by customer profile + * List access logs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The Integration ID of the Advocate's Profile. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20033, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20020, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAllAccessLogsWithHttpInfo($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -18108,20 +18525,20 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20033' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20020' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20033', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20020', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20033'; + $returnType = '\TalonOne\Client\Model\InlineResponse20020'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18140,7 +18557,7 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20033', + '\TalonOne\Client\Model\InlineResponse20020', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18151,23 +18568,25 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ } /** - * Operation getApplicationCustomerFriendsAsync + * Operation getAllAccessLogsAsync * - * List friends referred by customer profile + * List access logs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The Integration ID of the Advocate's Profile. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerFriendsAsync($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAllAccessLogsAsync($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) + return $this->getAllAccessLogsAsyncWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -18176,24 +18595,26 @@ function ($response) { } /** - * Operation getApplicationCustomerFriendsAsyncWithHttpInfo + * Operation getAllAccessLogsAsyncWithHttpInfo * - * List friends referred by customer profile + * List access logs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The Integration ID of the Advocate's Profile. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAllAccessLogsAsyncWithHttpInfo($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20033'; - $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse20020'; + $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18230,47 +18651,72 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomerFriends' + * Create request for operation 'getAllAccessLogs' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The Integration ID of the Advocate's Profile. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $path Only return results where the request path matches the given regular expression. (optional) + * @param string $method Only return results where the request method matches the given regular expression. (optional) + * @param string $status Filter results by HTTP status codes. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + protected function getAllAccessLogsRequest($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationCustomerFriends' - ); - } - // verify the required parameter 'integrationId' is set - if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $integrationId when calling getApplicationCustomerFriends' - ); - } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomerFriends, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAllAccessLogs, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomerFriends, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAllAccessLogs, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/profile/{integrationId}/friends'; + $resourcePath = '/v1/access_logs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); + } + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; + } + // query params + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); + } + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; + } + // query params + if (is_array($path)) { + $path = ObjectSerializer::serializeCollection($path, '', true); + } + if ($path !== null) { + $queryParams['path'] = $path; + } + // query params + if (is_array($method)) { + $method = ObjectSerializer::serializeCollection($method, '', true); + } + if ($method !== null) { + $queryParams['method'] = $method; + } + // query params + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } // query params if (is_array($pageSize)) { $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); @@ -18292,31 +18738,8 @@ protected function getApplicationCustomerFriendsRequest($applicationId, $integra if ($sort !== null) { $queryParams['sort'] = $sort; } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($integrationId !== null) { - $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -18393,44 +18816,36 @@ protected function getApplicationCustomerFriendsRequest($applicationId, $integra } /** - * Operation getApplicationCustomers + * Operation getApplication * - * List application's customers + * Get Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20022 + * @return \TalonOne\Client\Model\Application */ - public function getApplicationCustomers($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplication($applicationId) { - list($response) = $this->getApplicationCustomersWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + list($response) = $this->getApplicationWithHttpInfo($applicationId); return $response; } /** - * Operation getApplicationCustomersWithHttpInfo + * Operation getApplicationWithHttpInfo * - * List application's customers + * Get Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20022, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Application, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomersWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationWithHttpInfo($applicationId) { - $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + $request = $this->getApplicationRequest($applicationId); try { $options = $this->createHttpClientOption(); @@ -18463,20 +18878,20 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20022' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Application' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20022', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Application', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20022'; + $returnType = '\TalonOne\Client\Model\Application'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18495,7 +18910,7 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20022', + '\TalonOne\Client\Model\Application', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18506,22 +18921,18 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration } /** - * Operation getApplicationCustomersAsync + * Operation getApplicationAsync * - * List application's customers + * Get Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomersAsync($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationAsync($applicationId) { - return $this->getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) + return $this->getApplicationAsyncWithHttpInfo($applicationId) ->then( function ($response) { return $response[0]; @@ -18530,23 +18941,19 @@ function ($response) { } /** - * Operation getApplicationCustomersAsyncWithHttpInfo + * Operation getApplicationAsyncWithHttpInfo * - * List application's customers + * Get Application * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationAsyncWithHttpInfo($applicationId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20022'; - $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\Application'; + $request = $this->getApplicationRequest($applicationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18583,68 +18990,29 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomers' + * Create request for operation 'getApplication' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomersRequest($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + protected function getApplicationRequest($applicationId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationCustomers' + 'Missing the required parameter $applicationId when calling getApplication' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomers, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomers, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/customers'; + $resourcePath = '/v1/applications/{applicationId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($integrationId)) { - $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); - } - if ($integrationId !== null) { - $queryParams['integrationId'] = $integrationId; - } - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } // path params @@ -18731,44 +19099,36 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId } /** - * Operation getApplicationCustomersByAttributes + * Operation getApplicationApiHealth * - * List application customers matching the given attributes + * Get Application health * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20023 + * @return \TalonOne\Client\Model\ApplicationApiHealth */ - public function getApplicationCustomersByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationApiHealth($applicationId) { - list($response) = $this->getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + list($response) = $this->getApplicationApiHealthWithHttpInfo($applicationId); return $response; } /** - * Operation getApplicationCustomersByAttributesWithHttpInfo + * Operation getApplicationApiHealthWithHttpInfo * - * List application customers matching the given attributes + * Get Application health * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20023, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ApplicationApiHealth, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationApiHealthWithHttpInfo($applicationId) { - $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + $request = $this->getApplicationApiHealthRequest($applicationId); try { $options = $this->createHttpClientOption(); @@ -18801,20 +19161,20 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20023' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationApiHealth' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20023', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationApiHealth', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20023'; + $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18833,7 +19193,7 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20023', + '\TalonOne\Client\Model\ApplicationApiHealth', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18844,22 +19204,18 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, } /** - * Operation getApplicationCustomersByAttributesAsync + * Operation getApplicationApiHealthAsync * - * List application customers matching the given attributes + * Get Application health * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomersByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationApiHealthAsync($applicationId) { - return $this->getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize) + return $this->getApplicationApiHealthAsyncWithHttpInfo($applicationId) ->then( function ($response) { return $response[0]; @@ -18868,23 +19224,19 @@ function ($response) { } /** - * Operation getApplicationCustomersByAttributesAsyncWithHttpInfo + * Operation getApplicationApiHealthAsyncWithHttpInfo * - * List application customers matching the given attributes + * Get Application health * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationApiHealthAsyncWithHttpInfo($applicationId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20023'; - $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; + $request = $this->getApplicationApiHealthRequest($applicationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18921,67 +19273,29 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomersByAttributes' + * Create request for operation 'getApplicationApiHealth' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + protected function getApplicationApiHealthRequest($applicationId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationCustomersByAttributes' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling getApplicationCustomersByAttributes' + 'Missing the required parameter $applicationId when calling getApplicationApiHealth' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/customer_search'; + $resourcePath = '/v1/applications/{applicationId}/health_report'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } // path params @@ -18995,9 +19309,6 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -19006,7 +19317,7 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -19063,7 +19374,7 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19071,42 +19382,38 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b } /** - * Operation getApplicationEventTypes + * Operation getApplicationCustomer * - * List Applications event types + * Get application's customer * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20029 + * @return \TalonOne\Client\Model\ApplicationCustomer */ - public function getApplicationEventTypes($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomer($applicationId, $customerId) { - list($response) = $this->getApplicationEventTypesWithHttpInfo($applicationId, $pageSize, $skip, $sort); + list($response) = $this->getApplicationCustomerWithHttpInfo($applicationId, $customerId); return $response; } /** - * Operation getApplicationEventTypesWithHttpInfo + * Operation getApplicationCustomerWithHttpInfo * - * List Applications event types + * Get application's customer * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20029, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ApplicationCustomer, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) { - $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); + $request = $this->getApplicationCustomerRequest($applicationId, $customerId); try { $options = $this->createHttpClientOption(); @@ -19139,20 +19446,20 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20029' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationCustomer' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20029', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationCustomer', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20029'; + $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19171,7 +19478,7 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20029', + '\TalonOne\Client\Model\ApplicationCustomer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19182,21 +19489,19 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = } /** - * Operation getApplicationEventTypesAsync + * Operation getApplicationCustomerAsync * - * List Applications event types + * Get application's customer * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationEventTypesAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomerAsync($applicationId, $customerId) { - return $this->getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort) + return $this->getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) ->then( function ($response) { return $response[0]; @@ -19205,22 +19510,20 @@ function ($response) { } /** - * Operation getApplicationEventTypesAsyncWithHttpInfo + * Operation getApplicationCustomerAsyncWithHttpInfo * - * List Applications event types + * Get application's customer * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20029'; - $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; + $request = $this->getApplicationCustomerRequest($applicationId, $customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19257,60 +19560,36 @@ function ($exception) { } /** - * Create request for operation 'getApplicationEventTypes' + * Create request for operation 'getApplicationCustomer' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null) + protected function getApplicationCustomerRequest($applicationId, $customerId) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationEventTypes' + 'Missing the required parameter $applicationId when calling getApplicationCustomer' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventTypes, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventTypes, must be bigger than or equal to 1.'); + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling getApplicationCustomer' + ); } - - $resourcePath = '/v1/applications/{applicationId}/event_types'; + $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } // path params @@ -19321,6 +19600,14 @@ protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1 $resourcePath ); } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -19397,64 +19684,46 @@ protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1 } /** - * Operation getApplicationEventsWithoutTotalCount + * Operation getApplicationCustomerFriends * - * List Applications events + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The Integration ID of the Advocate's Profile. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $session Session integration ID filter for events. Must be exact match. (optional) - * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) - * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) - * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) - * @param string $couponCode Coupon code (optional) - * @param string $referralCode Referral code (optional) - * @param string $ruleQuery Rule name filter for events (optional) - * @param string $campaignQuery Campaign name filter for events (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20028 + * @return \TalonOne\Client\Model\InlineResponse20033 */ - public function getApplicationEventsWithoutTotalCount($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) + public function getApplicationCustomerFriends($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - list($response) = $this->getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + list($response) = $this->getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); return $response; } /** - * Operation getApplicationEventsWithoutTotalCountWithHttpInfo + * Operation getApplicationCustomerFriendsWithHttpInfo * - * List Applications events + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The Integration ID of the Advocate's Profile. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $session Session integration ID filter for events. Must be exact match. (optional) - * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) - * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) - * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) - * @param string $couponCode Coupon code (optional) - * @param string $referralCode Referral code (optional) - * @param string $ruleQuery Rule name filter for events (optional) - * @param string $campaignQuery Campaign name filter for events (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20028, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20033, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) + public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $request = $this->getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -19487,20 +19756,20 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20028' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20033' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20028', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20033', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20028'; + $returnType = '\TalonOne\Client\Model\InlineResponse20033'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19519,7 +19788,7 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20028', + '\TalonOne\Client\Model\InlineResponse20033', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19530,32 +19799,23 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId } /** - * Operation getApplicationEventsWithoutTotalCountAsync + * Operation getApplicationCustomerFriendsAsync * - * List Applications events + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The Integration ID of the Advocate's Profile. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $session Session integration ID filter for events. Must be exact match. (optional) - * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) - * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) - * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) - * @param string $couponCode Coupon code (optional) - * @param string $referralCode Referral code (optional) - * @param string $ruleQuery Rule name filter for events (optional) - * @param string $campaignQuery Campaign name filter for events (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationEventsWithoutTotalCountAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) + public function getApplicationCustomerFriendsAsync($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - return $this->getApplicationEventsWithoutTotalCountAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery) + return $this->getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -19564,33 +19824,24 @@ function ($response) { } /** - * Operation getApplicationEventsWithoutTotalCountAsyncWithHttpInfo + * Operation getApplicationCustomerFriendsAsyncWithHttpInfo * - * List Applications events + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The Integration ID of the Advocate's Profile. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $session Session integration ID filter for events. Must be exact match. (optional) - * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) - * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) - * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) - * @param string $couponCode Coupon code (optional) - * @param string $referralCode Referral code (optional) - * @param string $ruleQuery Rule name filter for events (optional) - * @param string $campaignQuery Campaign name filter for events (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationEventsWithoutTotalCountAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) + public function getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20028'; - $request = $this->getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + $returnType = '\TalonOne\Client\Model\InlineResponse20033'; + $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19627,52 +19878,41 @@ function ($exception) { } /** - * Create request for operation 'getApplicationEventsWithoutTotalCount' + * Create request for operation 'getApplicationCustomerFriends' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The Integration ID of the Advocate's Profile. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $session Session integration ID filter for events. Must be exact match. (optional) - * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) - * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) - * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) - * @param string $couponCode Coupon code (optional) - * @param string $referralCode Referral code (optional) - * @param string $ruleQuery Rule name filter for events (optional) - * @param string $campaignQuery Campaign name filter for events (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) + protected function getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationEventsWithoutTotalCount' + 'Missing the required parameter $applicationId when calling getApplicationCustomerFriends' + ); + } + // verify the required parameter 'integrationId' is set + if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $integrationId when calling getApplicationCustomerFriends' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomerFriends, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 1.'); - } - - if ($customerName !== null && strlen($customerName) < 2) { - throw new \InvalidArgumentException('invalid length for "$customerName" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 2.'); - } - - if ($customerEmail !== null && strlen($customerEmail) < 2) { - throw new \InvalidArgumentException('invalid length for "$customerEmail" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 2.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomerFriends, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/events/no_total'; + $resourcePath = '/v1/applications/{applicationId}/profile/{integrationId}/friends'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19701,81 +19941,11 @@ protected function getApplicationEventsWithoutTotalCountRequest($applicationId, $queryParams['sort'] = $sort; } // query params - if (is_array($type)) { - $type = ObjectSerializer::serializeCollection($type, '', true); - } - if ($type !== null) { - $queryParams['type'] = $type; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($session)) { - $session = ObjectSerializer::serializeCollection($session, '', true); - } - if ($session !== null) { - $queryParams['session'] = $session; - } - // query params - if (is_array($profile)) { - $profile = ObjectSerializer::serializeCollection($profile, '', true); - } - if ($profile !== null) { - $queryParams['profile'] = $profile; - } - // query params - if (is_array($customerName)) { - $customerName = ObjectSerializer::serializeCollection($customerName, '', true); - } - if ($customerName !== null) { - $queryParams['customerName'] = $customerName; - } - // query params - if (is_array($customerEmail)) { - $customerEmail = ObjectSerializer::serializeCollection($customerEmail, '', true); - } - if ($customerEmail !== null) { - $queryParams['customerEmail'] = $customerEmail; - } - // query params - if (is_array($couponCode)) { - $couponCode = ObjectSerializer::serializeCollection($couponCode, '', true); - } - if ($couponCode !== null) { - $queryParams['couponCode'] = $couponCode; - } - // query params - if (is_array($referralCode)) { - $referralCode = ObjectSerializer::serializeCollection($referralCode, '', true); - } - if ($referralCode !== null) { - $queryParams['referralCode'] = $referralCode; - } - // query params - if (is_array($ruleQuery)) { - $ruleQuery = ObjectSerializer::serializeCollection($ruleQuery, '', true); - } - if ($ruleQuery !== null) { - $queryParams['ruleQuery'] = $ruleQuery; - } - // query params - if (is_array($campaignQuery)) { - $campaignQuery = ObjectSerializer::serializeCollection($campaignQuery, '', true); + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); } - if ($campaignQuery !== null) { - $queryParams['campaignQuery'] = $campaignQuery; + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; } @@ -19787,6 +19957,14 @@ protected function getApplicationEventsWithoutTotalCountRequest($applicationId, $resourcePath ); } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -19863,38 +20041,44 @@ protected function getApplicationEventsWithoutTotalCountRequest($applicationId, } /** - * Operation getApplicationSession + * Operation getApplicationCustomers * - * Get Application session + * List application's customers * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\ApplicationSession + * @return \TalonOne\Client\Model\InlineResponse20022 */ - public function getApplicationSession($applicationId, $sessionId) + public function getApplicationCustomers($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - list($response) = $this->getApplicationSessionWithHttpInfo($applicationId, $sessionId); + list($response) = $this->getApplicationCustomersWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); return $response; } /** - * Operation getApplicationSessionWithHttpInfo + * Operation getApplicationCustomersWithHttpInfo * - * Get Application session + * List application's customers * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\ApplicationSession, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20022, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) + public function getApplicationCustomersWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $request = $this->getApplicationSessionRequest($applicationId, $sessionId); + $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -19927,20 +20111,20 @@ public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationSession' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20022' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationSession', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20022', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationSession'; + $returnType = '\TalonOne\Client\Model\InlineResponse20022'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19959,7 +20143,7 @@ public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationSession', + '\TalonOne\Client\Model\InlineResponse20022', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19970,19 +20154,22 @@ public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) } /** - * Operation getApplicationSessionAsync + * Operation getApplicationCustomersAsync * - * Get Application session + * List application's customers * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationSessionAsync($applicationId, $sessionId) + public function getApplicationCustomersAsync($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - return $this->getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) + return $this->getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -19991,20 +20178,23 @@ function ($response) { } /** - * Operation getApplicationSessionAsyncWithHttpInfo + * Operation getApplicationCustomersAsyncWithHttpInfo * - * Get Application session + * List application's customers * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) + public function getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\ApplicationSession'; - $request = $this->getApplicationSessionRequest($applicationId, $sessionId); + $returnType = '\TalonOne\Client\Model\InlineResponse20022'; + $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20041,36 +20231,68 @@ function ($exception) { } /** - * Create request for operation 'getApplicationSession' + * Create request for operation 'getApplicationCustomers' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationSessionRequest($applicationId, $sessionId) + protected function getApplicationCustomersRequest($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationSession' + 'Missing the required parameter $applicationId when calling getApplicationCustomers' ); } - // verify the required parameter 'sessionId' is set - if ($sessionId === null || (is_array($sessionId) && count($sessionId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sessionId when calling getApplicationSession' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomers, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomers, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/sessions/{sessionId}'; + + $resourcePath = '/v1/applications/{applicationId}/customers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($integrationId)) { + $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); + } + if ($integrationId !== null) { + $queryParams['integrationId'] = $integrationId; + } + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + } + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; + } // path params @@ -20081,14 +20303,6 @@ protected function getApplicationSessionRequest($applicationId, $sessionId) $resourcePath ); } - // path params - if ($sessionId !== null) { - $resourcePath = str_replace( - '{' . 'sessionId' . '}', - ObjectSerializer::toPathValue($sessionId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -20165,58 +20379,44 @@ protected function getApplicationSessionRequest($applicationId, $sessionId) } /** - * Operation getApplicationSessions + * Operation getApplicationCustomersByAttributes * - * List Application sessions + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) - * @param string $state Filter by sessions with this state. Must be exact match. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) - * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) - * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) - * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20027 + * @return \TalonOne\Client\Model\InlineResponse20023 */ - public function getApplicationSessions($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) + public function getApplicationCustomersByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - list($response) = $this->getApplicationSessionsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); + list($response) = $this->getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize); return $response; } /** - * Operation getApplicationSessionsWithHttpInfo + * Operation getApplicationCustomersByAttributesWithHttpInfo * - * List Application sessions + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) - * @param string $state Filter by sessions with this state. Must be exact match. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) - * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) - * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) - * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20027, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20023, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) + public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $request = $this->getApplicationSessionsRequest($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); + $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -20249,20 +20449,20 @@ public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1 $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20027' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20023' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20027', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20023', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20027'; + $returnType = '\TalonOne\Client\Model\InlineResponse20023'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20281,7 +20481,7 @@ public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1 case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20027', + '\TalonOne\Client\Model\InlineResponse20023', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20292,29 +20492,22 @@ public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1 } /** - * Operation getApplicationSessionsAsync + * Operation getApplicationCustomersByAttributesAsync * - * List Application sessions + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) - * @param string $state Filter by sessions with this state. Must be exact match. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) - * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) - * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) - * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationSessionsAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) + public function getApplicationCustomersByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - return $this->getApplicationSessionsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId) + return $this->getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -20323,30 +20516,23 @@ function ($response) { } /** - * Operation getApplicationSessionsAsyncWithHttpInfo + * Operation getApplicationCustomersByAttributesAsyncWithHttpInfo * - * List Application sessions + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) - * @param string $state Filter by sessions with this state. Must be exact match. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) - * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) - * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) - * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationSessionsAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) + public function getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20027'; - $request = $this->getApplicationSessionsRequest($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); + $returnType = '\TalonOne\Client\Model\InlineResponse20023'; + $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20383,41 +20569,40 @@ function ($exception) { } /** - * Create request for operation 'getApplicationSessions' + * Create request for operation 'getApplicationCustomersByAttributes' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) - * @param string $state Filter by sessions with this state. Must be exact match. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) - * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) - * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) - * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationSessionsRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) + protected function getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationSessions' + 'Missing the required parameter $applicationId when calling getApplicationCustomersByAttributes' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling getApplicationCustomersByAttributes' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationSessions, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationSessions, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/sessions'; + $resourcePath = '/v1/applications/{applicationId}/customer_search'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20439,67 +20624,11 @@ protected function getApplicationSessionsRequest($applicationId, $pageSize = 100 $queryParams['skip'] = $skip; } // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($profile)) { - $profile = ObjectSerializer::serializeCollection($profile, '', true); - } - if ($profile !== null) { - $queryParams['profile'] = $profile; - } - // query params - if (is_array($state)) { - $state = ObjectSerializer::serializeCollection($state, '', true); - } - if ($state !== null) { - $queryParams['state'] = $state; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($coupon)) { - $coupon = ObjectSerializer::serializeCollection($coupon, '', true); - } - if ($coupon !== null) { - $queryParams['coupon'] = $coupon; - } - // query params - if (is_array($referral)) { - $referral = ObjectSerializer::serializeCollection($referral, '', true); - } - if ($referral !== null) { - $queryParams['referral'] = $referral; - } - // query params - if (is_array($integrationId)) { - $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); - } - if ($integrationId !== null) { - $queryParams['integrationId'] = $integrationId; - } - // query params - if (is_array($storeIntegrationId)) { - $storeIntegrationId = ObjectSerializer::serializeCollection($storeIntegrationId, '', true); + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); } - if ($storeIntegrationId !== null) { - $queryParams['storeIntegrationId'] = $storeIntegrationId; + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; } @@ -20514,6 +20643,9 @@ protected function getApplicationSessionsRequest($applicationId, $pageSize = 100 // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -20522,7 +20654,7 @@ protected function getApplicationSessionsRequest($applicationId, $pageSize = 100 } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -20579,7 +20711,7 @@ protected function getApplicationSessionsRequest($applicationId, $pageSize = 100 $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -20587,40 +20719,42 @@ protected function getApplicationSessionsRequest($applicationId, $pageSize = 100 } /** - * Operation getApplications + * Operation getApplicationEventTypes * - * List Applications + * List Applications event types * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2005 + * @return \TalonOne\Client\Model\InlineResponse20029 */ - public function getApplications($pageSize = 1000, $skip = null, $sort = null) + public function getApplicationEventTypes($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getApplicationsWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->getApplicationEventTypesWithHttpInfo($applicationId, $pageSize, $skip, $sort); return $response; } /** - * Operation getApplicationsWithHttpInfo + * Operation getApplicationEventTypesWithHttpInfo * - * List Applications + * List Applications event types * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse2005, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20029, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getApplicationsRequest($pageSize, $skip, $sort); + $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -20653,20 +20787,20 @@ public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sor $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2005' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20029' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2005', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20029', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2005'; + $returnType = '\TalonOne\Client\Model\InlineResponse20029'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20685,7 +20819,7 @@ public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sor case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2005', + '\TalonOne\Client\Model\InlineResponse20029', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20696,10 +20830,11 @@ public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sor } /** - * Operation getApplicationsAsync + * Operation getApplicationEventTypesAsync * - * List Applications + * List Applications event types * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) @@ -20707,9 +20842,9 @@ public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sor * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationsAsync($pageSize = 1000, $skip = null, $sort = null) + public function getApplicationEventTypesAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getApplicationsAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -20718,10 +20853,11 @@ function ($response) { } /** - * Operation getApplicationsAsyncWithHttpInfo + * Operation getApplicationEventTypesAsyncWithHttpInfo * - * List Applications + * List Applications event types * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) @@ -20729,10 +20865,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse2005'; - $request = $this->getApplicationsRequest($pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\InlineResponse20029'; + $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20769,8 +20905,9 @@ function ($exception) { } /** - * Create request for operation 'getApplications' + * Create request for operation 'getApplicationEventTypes' * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) @@ -20778,17 +20915,23 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationsRequest($pageSize = 1000, $skip = null, $sort = null) + protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getApplicationEventTypes' + ); + } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplications, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventTypes, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplications, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventTypes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications'; + $resourcePath = '/v1/applications/{applicationId}/event_types'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20818,6 +20961,14 @@ protected function getApplicationsRequest($pageSize = 1000, $skip = null, $sort } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -20894,36 +21045,64 @@ protected function getApplicationsRequest($pageSize = 1000, $skip = null, $sort } /** - * Operation getAttribute + * Operation getApplicationEventsWithoutTotalCount * - * Get custom attribute + * List Applications events * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $session Session integration ID filter for events. Must be exact match. (optional) + * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) + * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) + * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) + * @param string $couponCode Coupon code (optional) + * @param string $referralCode Referral code (optional) + * @param string $ruleQuery Rule name filter for events (optional) + * @param string $campaignQuery Campaign name filter for events (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Attribute + * @return \TalonOne\Client\Model\InlineResponse20028 */ - public function getAttribute($attributeId) + public function getApplicationEventsWithoutTotalCount($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) { - list($response) = $this->getAttributeWithHttpInfo($attributeId); + list($response) = $this->getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); return $response; } /** - * Operation getAttributeWithHttpInfo + * Operation getApplicationEventsWithoutTotalCountWithHttpInfo * - * Get custom attribute + * List Applications events * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $session Session integration ID filter for events. Must be exact match. (optional) + * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) + * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) + * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) + * @param string $couponCode Coupon code (optional) + * @param string $referralCode Referral code (optional) + * @param string $ruleQuery Rule name filter for events (optional) + * @param string $campaignQuery Campaign name filter for events (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Attribute, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20028, HTTP status code, HTTP response headers (array of strings) */ - public function getAttributeWithHttpInfo($attributeId) + public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) { - $request = $this->getAttributeRequest($attributeId); + $request = $this->getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); try { $options = $this->createHttpClientOption(); @@ -20956,20 +21135,20 @@ public function getAttributeWithHttpInfo($attributeId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Attribute' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20028' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Attribute', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20028', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Attribute'; + $returnType = '\TalonOne\Client\Model\InlineResponse20028'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20988,7 +21167,7 @@ public function getAttributeWithHttpInfo($attributeId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Attribute', + '\TalonOne\Client\Model\InlineResponse20028', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20999,18 +21178,32 @@ public function getAttributeWithHttpInfo($attributeId) } /** - * Operation getAttributeAsync + * Operation getApplicationEventsWithoutTotalCountAsync * - * Get custom attribute + * List Applications events * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $session Session integration ID filter for events. Must be exact match. (optional) + * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) + * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) + * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) + * @param string $couponCode Coupon code (optional) + * @param string $referralCode Referral code (optional) + * @param string $ruleQuery Rule name filter for events (optional) + * @param string $campaignQuery Campaign name filter for events (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAttributeAsync($attributeId) + public function getApplicationEventsWithoutTotalCountAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) { - return $this->getAttributeAsyncWithHttpInfo($attributeId) + return $this->getApplicationEventsWithoutTotalCountAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery) ->then( function ($response) { return $response[0]; @@ -21019,19 +21212,33 @@ function ($response) { } /** - * Operation getAttributeAsyncWithHttpInfo + * Operation getApplicationEventsWithoutTotalCountAsyncWithHttpInfo * - * Get custom attribute + * List Applications events * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $session Session integration ID filter for events. Must be exact match. (optional) + * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) + * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) + * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) + * @param string $couponCode Coupon code (optional) + * @param string $referralCode Referral code (optional) + * @param string $ruleQuery Rule name filter for events (optional) + * @param string $campaignQuery Campaign name filter for events (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAttributeAsyncWithHttpInfo($attributeId) + public function getApplicationEventsWithoutTotalCountAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) { - $returnType = '\TalonOne\Client\Model\Attribute'; - $request = $this->getAttributeRequest($attributeId); + $returnType = '\TalonOne\Client\Model\InlineResponse20028'; + $request = $this->getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21068,36 +21275,163 @@ function ($exception) { } /** - * Create request for operation 'getAttribute' + * Create request for operation 'getApplicationEventsWithoutTotalCount' * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $type Comma-separated list of types by which to filter events. Must be exact match(es). (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $session Session integration ID filter for events. Must be exact match. (optional) + * @param string $profile Profile integration ID filter for events. Must be exact match. (optional) + * @param string $customerName Customer name filter for events. Will match substrings case-insensitively. (optional) + * @param string $customerEmail Customer e-mail address filter for events. Will match substrings case-insensitively. (optional) + * @param string $couponCode Coupon code (optional) + * @param string $referralCode Referral code (optional) + * @param string $ruleQuery Rule name filter for events (optional) + * @param string $campaignQuery Campaign name filter for events (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAttributeRequest($attributeId) + protected function getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $type = null, $createdBefore = null, $createdAfter = null, $session = null, $profile = null, $customerName = null, $customerEmail = null, $couponCode = null, $referralCode = null, $ruleQuery = null, $campaignQuery = null) { - // verify the required parameter 'attributeId' is set - if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $attributeId when calling getAttribute' + 'Missing the required parameter $applicationId when calling getApplicationEventsWithoutTotalCount' ); } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/attributes/{attributeId}'; + if ($customerName !== null && strlen($customerName) < 2) { + throw new \InvalidArgumentException('invalid length for "$customerName" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 2.'); + } + + if ($customerEmail !== null && strlen($customerEmail) < 2) { + throw new \InvalidArgumentException('invalid length for "$customerEmail" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 2.'); + } + + + $resourcePath = '/v1/applications/{applicationId}/events/no_total'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($type)) { + $type = ObjectSerializer::serializeCollection($type, '', true); + } + if ($type !== null) { + $queryParams['type'] = $type; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($session)) { + $session = ObjectSerializer::serializeCollection($session, '', true); + } + if ($session !== null) { + $queryParams['session'] = $session; + } + // query params + if (is_array($profile)) { + $profile = ObjectSerializer::serializeCollection($profile, '', true); + } + if ($profile !== null) { + $queryParams['profile'] = $profile; + } + // query params + if (is_array($customerName)) { + $customerName = ObjectSerializer::serializeCollection($customerName, '', true); + } + if ($customerName !== null) { + $queryParams['customerName'] = $customerName; + } + // query params + if (is_array($customerEmail)) { + $customerEmail = ObjectSerializer::serializeCollection($customerEmail, '', true); + } + if ($customerEmail !== null) { + $queryParams['customerEmail'] = $customerEmail; + } + // query params + if (is_array($couponCode)) { + $couponCode = ObjectSerializer::serializeCollection($couponCode, '', true); + } + if ($couponCode !== null) { + $queryParams['couponCode'] = $couponCode; + } + // query params + if (is_array($referralCode)) { + $referralCode = ObjectSerializer::serializeCollection($referralCode, '', true); + } + if ($referralCode !== null) { + $queryParams['referralCode'] = $referralCode; + } + // query params + if (is_array($ruleQuery)) { + $ruleQuery = ObjectSerializer::serializeCollection($ruleQuery, '', true); + } + if ($ruleQuery !== null) { + $queryParams['ruleQuery'] = $ruleQuery; + } + // query params + if (is_array($campaignQuery)) { + $campaignQuery = ObjectSerializer::serializeCollection($campaignQuery, '', true); + } + if ($campaignQuery !== null) { + $queryParams['campaignQuery'] = $campaignQuery; + } // path params - if ($attributeId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'attributeId' . '}', - ObjectSerializer::toPathValue($attributeId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -21177,42 +21511,38 @@ protected function getAttributeRequest($attributeId) } /** - * Operation getAttributes + * Operation getApplicationSession * - * List custom attributes + * Get Application session * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $entity Returned attributes will be filtered by supplied entity. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20034 + * @return \TalonOne\Client\Model\ApplicationSession */ - public function getAttributes($pageSize = 1000, $skip = null, $sort = null, $entity = null) + public function getApplicationSession($applicationId, $sessionId) { - list($response) = $this->getAttributesWithHttpInfo($pageSize, $skip, $sort, $entity); + list($response) = $this->getApplicationSessionWithHttpInfo($applicationId, $sessionId); return $response; } /** - * Operation getAttributesWithHttpInfo + * Operation getApplicationSessionWithHttpInfo * - * List custom attributes + * Get Application session * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $entity Returned attributes will be filtered by supplied entity. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20034, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ApplicationSession, HTTP status code, HTTP response headers (array of strings) */ - public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) + public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) { - $request = $this->getAttributesRequest($pageSize, $skip, $sort, $entity); + $request = $this->getApplicationSessionRequest($applicationId, $sessionId); try { $options = $this->createHttpClientOption(); @@ -21245,20 +21575,20 @@ public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20034' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationSession' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20034', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationSession', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20034'; + $returnType = '\TalonOne\Client\Model\ApplicationSession'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21277,7 +21607,7 @@ public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20034', + '\TalonOne\Client\Model\ApplicationSession', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21288,21 +21618,19 @@ public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort } /** - * Operation getAttributesAsync + * Operation getApplicationSessionAsync * - * List custom attributes + * Get Application session * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $entity Returned attributes will be filtered by supplied entity. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAttributesAsync($pageSize = 1000, $skip = null, $sort = null, $entity = null) + public function getApplicationSessionAsync($applicationId, $sessionId) { - return $this->getAttributesAsyncWithHttpInfo($pageSize, $skip, $sort, $entity) + return $this->getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) ->then( function ($response) { return $response[0]; @@ -21311,22 +21639,20 @@ function ($response) { } /** - * Operation getAttributesAsyncWithHttpInfo + * Operation getApplicationSessionAsyncWithHttpInfo * - * List custom attributes + * Get Application session * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $entity Returned attributes will be filtered by supplied entity. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAttributesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) + public function getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20034'; - $request = $this->getAttributesRequest($pageSize, $skip, $sort, $entity); + $returnType = '\TalonOne\Client\Model\ApplicationSession'; + $request = $this->getApplicationSessionRequest($applicationId, $sessionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21363,63 +21689,54 @@ function ($exception) { } /** - * Create request for operation 'getAttributes' + * Create request for operation 'getApplicationSession' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $entity Returned attributes will be filtered by supplied entity. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $sessionId The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAttributesRequest($pageSize = 1000, $skip = null, $sort = null, $entity = null) + protected function getApplicationSessionRequest($applicationId, $sessionId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAttributes, must be smaller than or equal to 1000.'); + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getApplicationSession' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAttributes, must be bigger than or equal to 1.'); + // verify the required parameter 'sessionId' is set + if ($sessionId === null || (is_array($sessionId) && count($sessionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sessionId when calling getApplicationSession' + ); } - - $resourcePath = '/v1/attributes'; + $resourcePath = '/v1/applications/{applicationId}/sessions/{sessionId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($entity)) { - $entity = ObjectSerializer::serializeCollection($entity, '', true); - } - if ($entity !== null) { - $queryParams['entity'] = $entity; - } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($sessionId !== null) { + $resourcePath = str_replace( + '{' . 'sessionId' . '}', + ObjectSerializer::toPathValue($sessionId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -21496,44 +21813,58 @@ protected function getAttributesRequest($pageSize = 1000, $skip = null, $sort = } /** - * Operation getAudienceMemberships + * Operation getApplicationSessions * - * List audience members + * List Application sessions * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profileQuery The filter to select a profile. (optional) + * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) + * @param string $state Filter by sessions with this state. Must be exact match. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) + * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) + * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) + * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20032|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20027 */ - public function getAudienceMemberships($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) + public function getApplicationSessions($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) { - list($response) = $this->getAudienceMembershipsWithHttpInfo($audienceId, $pageSize, $skip, $sort, $profileQuery); + list($response) = $this->getApplicationSessionsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); return $response; } /** - * Operation getAudienceMembershipsWithHttpInfo + * Operation getApplicationSessionsWithHttpInfo * - * List audience members + * List Application sessions * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profileQuery The filter to select a profile. (optional) + * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) + * @param string $state Filter by sessions with this state. Must be exact match. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) + * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) + * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) + * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20032|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20027, HTTP status code, HTTP response headers (array of strings) */ - public function getAudienceMembershipsWithHttpInfo($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) + public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) { - $request = $this->getAudienceMembershipsRequest($audienceId, $pageSize, $skip, $sort, $profileQuery); + $request = $this->getApplicationSessionsRequest($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); try { $options = $this->createHttpClientOption(); @@ -21566,32 +21897,20 @@ public function getAudienceMembershipsWithHttpInfo($audienceId, $pageSize = 1000 $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20032' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20032', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20027' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20027', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20032'; + $returnType = '\TalonOne\Client\Model\InlineResponse20027'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21610,15 +21929,7 @@ public function getAudienceMembershipsWithHttpInfo($audienceId, $pageSize = 1000 case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20032', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20027', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21629,22 +21940,29 @@ public function getAudienceMembershipsWithHttpInfo($audienceId, $pageSize = 1000 } /** - * Operation getAudienceMembershipsAsync + * Operation getApplicationSessionsAsync * - * List audience members + * List Application sessions * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profileQuery The filter to select a profile. (optional) + * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) + * @param string $state Filter by sessions with this state. Must be exact match. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) + * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) + * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) + * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAudienceMembershipsAsync($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) + public function getApplicationSessionsAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) { - return $this->getAudienceMembershipsAsyncWithHttpInfo($audienceId, $pageSize, $skip, $sort, $profileQuery) + return $this->getApplicationSessionsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId) ->then( function ($response) { return $response[0]; @@ -21653,23 +21971,30 @@ function ($response) { } /** - * Operation getAudienceMembershipsAsyncWithHttpInfo + * Operation getApplicationSessionsAsyncWithHttpInfo * - * List audience members + * List Application sessions * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profileQuery The filter to select a profile. (optional) + * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) + * @param string $state Filter by sessions with this state. Must be exact match. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) + * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) + * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) + * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAudienceMembershipsAsyncWithHttpInfo($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) + public function getApplicationSessionsAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20032'; - $request = $this->getAudienceMembershipsRequest($audienceId, $pageSize, $skip, $sort, $profileQuery); + $returnType = '\TalonOne\Client\Model\InlineResponse20027'; + $request = $this->getApplicationSessionsRequest($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21706,34 +22031,41 @@ function ($exception) { } /** - * Create request for operation 'getAudienceMemberships' + * Create request for operation 'getApplicationSessions' * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $profileQuery The filter to select a profile. (optional) + * @param string $profile Profile integration ID filter for sessions. Must be exact match. (optional) + * @param string $state Filter by sessions with this state. Must be exact match. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $coupon Filter by sessions with this coupon. Must be exact match. (optional) + * @param string $referral Filter by sessions with this referral. Must be exact match. (optional) + * @param string $integrationId Filter by sessions with this integrationId. Must be exact match. (optional) + * @param string $storeIntegrationId The integration ID of the store. You choose this ID when you create a store. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAudienceMembershipsRequest($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) + protected function getApplicationSessionsRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null, $storeIntegrationId = null) { - // verify the required parameter 'audienceId' is set - if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $audienceId when calling getAudienceMemberships' + 'Missing the required parameter $applicationId when calling getApplicationSessions' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudienceMemberships, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationSessions, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudienceMemberships, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationSessions, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/audiences/{audienceId}/memberships'; + $resourcePath = '/v1/applications/{applicationId}/sessions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21762,19 +22094,68 @@ protected function getAudienceMembershipsRequest($audienceId, $pageSize = 1000, $queryParams['sort'] = $sort; } // query params - if (is_array($profileQuery)) { - $profileQuery = ObjectSerializer::serializeCollection($profileQuery, '', true); + if (is_array($profile)) { + $profile = ObjectSerializer::serializeCollection($profile, '', true); } - if ($profileQuery !== null) { - $queryParams['profileQuery'] = $profileQuery; + if ($profile !== null) { + $queryParams['profile'] = $profile; + } + // query params + if (is_array($state)) { + $state = ObjectSerializer::serializeCollection($state, '', true); + } + if ($state !== null) { + $queryParams['state'] = $state; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($coupon)) { + $coupon = ObjectSerializer::serializeCollection($coupon, '', true); + } + if ($coupon !== null) { + $queryParams['coupon'] = $coupon; + } + // query params + if (is_array($referral)) { + $referral = ObjectSerializer::serializeCollection($referral, '', true); + } + if ($referral !== null) { + $queryParams['referral'] = $referral; + } + // query params + if (is_array($integrationId)) { + $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); + } + if ($integrationId !== null) { + $queryParams['integrationId'] = $integrationId; + } + // query params + if (is_array($storeIntegrationId)) { + $storeIntegrationId = ObjectSerializer::serializeCollection($storeIntegrationId, '', true); + } + if ($storeIntegrationId !== null) { + $queryParams['storeIntegrationId'] = $storeIntegrationId; } // path params - if ($audienceId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'audienceId' . '}', - ObjectSerializer::toPathValue($audienceId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -21854,42 +22235,40 @@ protected function getAudienceMembershipsRequest($audienceId, $pageSize = 1000, } /** - * Operation getAudiences + * Operation getApplications * - * List audiences + * List Applications * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20030 + * @return \TalonOne\Client\Model\InlineResponse2005 */ - public function getAudiences($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplications($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getAudiencesWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize); + list($response) = $this->getApplicationsWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getAudiencesWithHttpInfo + * Operation getApplicationsWithHttpInfo * - * List audiences + * List Applications * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20030, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse2005, HTTP status code, HTTP response headers (array of strings) */ - public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); + $request = $this->getApplicationsRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -21922,20 +22301,20 @@ public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20030' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2005' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20030', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2005', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20030'; + $returnType = '\TalonOne\Client\Model\InlineResponse2005'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21954,7 +22333,7 @@ public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20030', + '\TalonOne\Client\Model\InlineResponse2005', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21965,21 +22344,20 @@ public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = } /** - * Operation getAudiencesAsync + * Operation getApplicationsAsync * - * List audiences + * List Applications * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAudiencesAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplicationsAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getAudiencesAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize) + return $this->getApplicationsAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -21988,22 +22366,21 @@ function ($response) { } /** - * Operation getAudiencesAsyncWithHttpInfo + * Operation getApplicationsAsyncWithHttpInfo * - * List audiences + * List Applications * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAudiencesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplicationsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20030'; - $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse2005'; + $request = $this->getApplicationsRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22040,27 +22417,26 @@ function ($exception) { } /** - * Create request for operation 'getAudiences' + * Create request for operation 'getApplications' * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAudiencesRequest($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + protected function getApplicationsRequest($pageSize = 1000, $skip = null, $sort = null) { if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudiences, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplications, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudiences, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplications, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/audiences'; + $resourcePath = '/v1/applications'; $formParams = []; $queryParams = []; $headerParams = []; @@ -22088,13 +22464,6 @@ protected function getAudiencesRequest($pageSize = 1000, $skip = null, $sort = n if ($sort !== null) { $queryParams['sort'] = $sort; } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } @@ -22173,38 +22542,36 @@ protected function getAudiencesRequest($pageSize = 1000, $skip = null, $sort = n } /** - * Operation getAudiencesAnalytics + * Operation getAttribute * - * List audience analytics + * Get custom attribute * - * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20031 + * @return \TalonOne\Client\Model\Attribute */ - public function getAudiencesAnalytics($audienceIds, $sort = null) + public function getAttribute($attributeId) { - list($response) = $this->getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort); + list($response) = $this->getAttributeWithHttpInfo($attributeId); return $response; } /** - * Operation getAudiencesAnalyticsWithHttpInfo + * Operation getAttributeWithHttpInfo * - * List audience analytics + * Get custom attribute * - * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20031, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Attribute, HTTP status code, HTTP response headers (array of strings) */ - public function getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort = null) + public function getAttributeWithHttpInfo($attributeId) { - $request = $this->getAudiencesAnalyticsRequest($audienceIds, $sort); + $request = $this->getAttributeRequest($attributeId); try { $options = $this->createHttpClientOption(); @@ -22237,20 +22604,20 @@ public function getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20031' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Attribute' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20031', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Attribute', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20031'; + $returnType = '\TalonOne\Client\Model\Attribute'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22269,7 +22636,7 @@ public function getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20031', + '\TalonOne\Client\Model\Attribute', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22280,19 +22647,18 @@ public function getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort = null) } /** - * Operation getAudiencesAnalyticsAsync + * Operation getAttributeAsync * - * List audience analytics + * Get custom attribute * - * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAudiencesAnalyticsAsync($audienceIds, $sort = null) + public function getAttributeAsync($attributeId) { - return $this->getAudiencesAnalyticsAsyncWithHttpInfo($audienceIds, $sort) + return $this->getAttributeAsyncWithHttpInfo($attributeId) ->then( function ($response) { return $response[0]; @@ -22301,20 +22667,19 @@ function ($response) { } /** - * Operation getAudiencesAnalyticsAsyncWithHttpInfo + * Operation getAttributeAsyncWithHttpInfo * - * List audience analytics + * Get custom attribute * - * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAudiencesAnalyticsAsyncWithHttpInfo($audienceIds, $sort = null) + public function getAttributeAsyncWithHttpInfo($attributeId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20031'; - $request = $this->getAudiencesAnalyticsRequest($audienceIds, $sort); + $returnType = '\TalonOne\Client\Model\Attribute'; + $request = $this->getAttributeRequest($attributeId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22351,46 +22716,39 @@ function ($exception) { } /** - * Create request for operation 'getAudiencesAnalytics' + * Create request for operation 'getAttribute' * - * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAudiencesAnalyticsRequest($audienceIds, $sort = null) + protected function getAttributeRequest($attributeId) { - // verify the required parameter 'audienceIds' is set - if ($audienceIds === null || (is_array($audienceIds) && count($audienceIds) === 0)) { + // verify the required parameter 'attributeId' is set + if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $audienceIds when calling getAudiencesAnalytics' + 'Missing the required parameter $attributeId when calling getAttribute' ); } - $resourcePath = '/v1/audiences/analytics'; + $resourcePath = '/v1/attributes/{attributeId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($audienceIds)) { - $audienceIds = ObjectSerializer::serializeCollection($audienceIds, '', true); - } - if ($audienceIds !== null) { - $queryParams['audienceIds'] = $audienceIds; - } + // path params + if ($attributeId !== null) { + $resourcePath = str_replace( + '{' . 'attributeId' . '}', + ObjectSerializer::toPathValue($attributeId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -22467,38 +22825,42 @@ protected function getAudiencesAnalyticsRequest($audienceIds, $sort = null) } /** - * Operation getCampaign + * Operation getAttributes * - * Get campaign + * List custom attributes * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Campaign + * @return \TalonOne\Client\Model\InlineResponse20034 */ - public function getCampaign($applicationId, $campaignId) + public function getAttributes($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - list($response) = $this->getCampaignWithHttpInfo($applicationId, $campaignId); + list($response) = $this->getAttributesWithHttpInfo($pageSize, $skip, $sort, $entity); return $response; } /** - * Operation getCampaignWithHttpInfo + * Operation getAttributesWithHttpInfo * - * Get campaign + * List custom attributes * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Campaign, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20034, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignWithHttpInfo($applicationId, $campaignId) + public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - $request = $this->getCampaignRequest($applicationId, $campaignId); + $request = $this->getAttributesRequest($pageSize, $skip, $sort, $entity); try { $options = $this->createHttpClientOption(); @@ -22531,20 +22893,20 @@ public function getCampaignWithHttpInfo($applicationId, $campaignId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Campaign' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20034' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Campaign', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20034', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Campaign'; + $returnType = '\TalonOne\Client\Model\InlineResponse20034'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22563,7 +22925,7 @@ public function getCampaignWithHttpInfo($applicationId, $campaignId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Campaign', + '\TalonOne\Client\Model\InlineResponse20034', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22574,19 +22936,21 @@ public function getCampaignWithHttpInfo($applicationId, $campaignId) } /** - * Operation getCampaignAsync + * Operation getAttributesAsync * - * Get campaign + * List custom attributes * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAsync($applicationId, $campaignId) + public function getAttributesAsync($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - return $this->getCampaignAsyncWithHttpInfo($applicationId, $campaignId) + return $this->getAttributesAsyncWithHttpInfo($pageSize, $skip, $sort, $entity) ->then( function ($response) { return $response[0]; @@ -22595,20 +22959,22 @@ function ($response) { } /** - * Operation getCampaignAsyncWithHttpInfo + * Operation getAttributesAsyncWithHttpInfo * - * Get campaign + * List custom attributes * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAsyncWithHttpInfo($applicationId, $campaignId) + public function getAttributesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - $returnType = '\TalonOne\Client\Model\Campaign'; - $request = $this->getCampaignRequest($applicationId, $campaignId); + $returnType = '\TalonOne\Client\Model\InlineResponse20034'; + $request = $this->getAttributesRequest($pageSize, $skip, $sort, $entity); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22645,55 +23011,64 @@ function ($exception) { } /** - * Create request for operation 'getCampaign' + * Create request for operation 'getAttributes' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignRequest($applicationId, $campaignId) + protected function getAttributesRequest($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCampaign' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAttributes, must be smaller than or equal to 1000.'); } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getCampaign' - ); + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAttributes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; + + $resourcePath = '/v1/attributes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($entity)) { + $entity = ObjectSerializer::serializeCollection($entity, '', true); + } + if ($entity !== null) { + $queryParams['entity'] = $entity; } + + // body params $_tempBody = null; @@ -22769,44 +23144,44 @@ protected function getCampaignRequest($applicationId, $campaignId) } /** - * Operation getCampaignAnalytics + * Operation getAudienceMemberships * - * Get analytics of campaigns + * List audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @param int $audienceId The ID of the audience. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $profileQuery The filter to select a profile. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20021 + * @return \TalonOne\Client\Model\InlineResponse20032|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getAudienceMemberships($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - list($response) = $this->getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); + list($response) = $this->getAudienceMembershipsWithHttpInfo($audienceId, $pageSize, $skip, $sort, $profileQuery); return $response; } /** - * Operation getCampaignAnalyticsWithHttpInfo + * Operation getAudienceMembershipsWithHttpInfo * - * Get analytics of campaigns + * List audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @param int $audienceId The ID of the audience. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $profileQuery The filter to select a profile. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20021, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20032|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getAudienceMembershipsWithHttpInfo($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); + $request = $this->getAudienceMembershipsRequest($audienceId, $pageSize, $skip, $sort, $profileQuery); try { $options = $this->createHttpClientOption(); @@ -22839,20 +23214,32 @@ public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $r $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20021' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20032' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20021', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20032', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20021'; + $returnType = '\TalonOne\Client\Model\InlineResponse20032'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22871,7 +23258,15 @@ public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $r case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20021', + '\TalonOne\Client\Model\InlineResponse20032', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22882,22 +23277,22 @@ public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $r } /** - * Operation getCampaignAnalyticsAsync + * Operation getAudienceMembershipsAsync * - * Get analytics of campaigns + * List audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @param int $audienceId The ID of the audience. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $profileQuery The filter to select a profile. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAnalyticsAsync($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getAudienceMembershipsAsync($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - return $this->getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity) + return $this->getAudienceMembershipsAsyncWithHttpInfo($audienceId, $pageSize, $skip, $sort, $profileQuery) ->then( function ($response) { return $response[0]; @@ -22906,23 +23301,23 @@ function ($response) { } /** - * Operation getCampaignAnalyticsAsyncWithHttpInfo + * Operation getAudienceMembershipsAsyncWithHttpInfo * - * Get analytics of campaigns + * List audience members * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @param int $audienceId The ID of the audience. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $profileQuery The filter to select a profile. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getAudienceMembershipsAsyncWithHttpInfo($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20021'; - $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); + $returnType = '\TalonOne\Client\Model\InlineResponse20032'; + $request = $this->getAudienceMembershipsRequest($audienceId, $pageSize, $skip, $sort, $profileQuery); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22959,45 +23354,34 @@ function ($exception) { } /** - * Create request for operation 'getCampaignAnalytics' + * Create request for operation 'getAudienceMemberships' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @param int $audienceId The ID of the audience. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $profileQuery The filter to select a profile. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + protected function getAudienceMembershipsRequest($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCampaignAnalytics' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'audienceId' is set + if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getCampaignAnalytics' + 'Missing the required parameter $audienceId when calling getAudienceMemberships' ); } - // verify the required parameter 'rangeStart' is set - if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeStart when calling getCampaignAnalytics' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudienceMemberships, must be smaller than or equal to 1000.'); } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling getCampaignAnalytics' - ); + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudienceMemberships, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/analytics'; + + $resourcePath = '/v1/audiences/{audienceId}/memberships'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23005,41 +23389,40 @@ protected function getCampaignAnalyticsRequest($applicationId, $campaignId, $ran $multipart = false; // query params - if (is_array($rangeStart)) { - $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - if ($rangeStart !== null) { - $queryParams['rangeStart'] = $rangeStart; + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; } // query params - if (is_array($rangeEnd)) { - $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; + if ($skip !== null) { + $queryParams['skip'] = $skip; } // query params - if (is_array($granularity)) { - $granularity = ObjectSerializer::serializeCollection($granularity, '', true); + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($granularity !== null) { - $queryParams['granularity'] = $granularity; + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($profileQuery)) { + $profileQuery = ObjectSerializer::serializeCollection($profileQuery, '', true); + } + if ($profileQuery !== null) { + $queryParams['profileQuery'] = $profileQuery; } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($audienceId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'audienceId' . '}', + ObjectSerializer::toPathValue($audienceId), $resourcePath ); } @@ -23119,46 +23502,42 @@ protected function getCampaignAnalyticsRequest($applicationId, $campaignId, $ran } /** - * Operation getCampaignByAttributes + * Operation getAudiences * - * List campaigns that match the given attributes + * List audiences * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2006 + * @return \TalonOne\Client\Model\InlineResponse20030 */ - public function getCampaignByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + public function getAudiences($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - list($response) = $this->getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState); + list($response) = $this->getAudiencesWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize); return $response; } /** - * Operation getCampaignByAttributesWithHttpInfo + * Operation getAudiencesWithHttpInfo * - * List campaigns that match the given attributes + * List audiences * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse2006, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20030, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); + $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -23191,20 +23570,20 @@ public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $page $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2006' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20030' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2006', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20030', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2006'; + $returnType = '\TalonOne\Client\Model\InlineResponse20030'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23223,7 +23602,7 @@ public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $page case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2006', + '\TalonOne\Client\Model\InlineResponse20030', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23234,23 +23613,21 @@ public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $page } /** - * Operation getCampaignByAttributesAsync + * Operation getAudiencesAsync * - * List campaigns that match the given attributes + * List audiences * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + public function getAudiencesAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - return $this->getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState) + return $this->getAudiencesAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -23259,24 +23636,22 @@ function ($response) { } /** - * Operation getCampaignByAttributesAsyncWithHttpInfo + * Operation getAudiencesAsyncWithHttpInfo * - * List campaigns that match the given attributes + * List audiences * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + public function getAudiencesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse2006'; - $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); + $returnType = '\TalonOne\Client\Model\InlineResponse20030'; + $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23313,41 +23688,27 @@ function ($exception) { } /** - * Create request for operation 'getCampaignByAttributes' + * Create request for operation 'getAudiences' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + protected function getAudiencesRequest($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCampaignByAttributes' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling getCampaignByAttributes' - ); - } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignByAttributes, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudiences, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignByAttributes, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAudiences, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns_search'; + $resourcePath = '/v1/audiences'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23376,28 +23737,17 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi $queryParams['sort'] = $sort; } // query params - if (is_array($campaignState)) { - $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); } - if ($campaignState !== null) { - $queryParams['campaignState'] = $campaignState; + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; } - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -23406,7 +23756,7 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -23463,7 +23813,7 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -23471,36 +23821,38 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi } /** - * Operation getCampaignGroup + * Operation getAudiencesAnalytics * - * Get campaign access group + * List audience analytics * - * @param int $campaignGroupId The ID of the campaign access group. (required) + * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\CampaignGroup + * @return \TalonOne\Client\Model\InlineResponse20031 */ - public function getCampaignGroup($campaignGroupId) + public function getAudiencesAnalytics($audienceIds, $sort = null) { - list($response) = $this->getCampaignGroupWithHttpInfo($campaignGroupId); + list($response) = $this->getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort); return $response; } /** - * Operation getCampaignGroupWithHttpInfo + * Operation getAudiencesAnalyticsWithHttpInfo * - * Get campaign access group + * List audience analytics * - * @param int $campaignGroupId The ID of the campaign access group. (required) + * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\CampaignGroup, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20031, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignGroupWithHttpInfo($campaignGroupId) + public function getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort = null) { - $request = $this->getCampaignGroupRequest($campaignGroupId); + $request = $this->getAudiencesAnalyticsRequest($audienceIds, $sort); try { $options = $this->createHttpClientOption(); @@ -23533,20 +23885,20 @@ public function getCampaignGroupWithHttpInfo($campaignGroupId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\CampaignGroup' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20031' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CampaignGroup', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20031', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CampaignGroup'; + $returnType = '\TalonOne\Client\Model\InlineResponse20031'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23565,7 +23917,7 @@ public function getCampaignGroupWithHttpInfo($campaignGroupId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CampaignGroup', + '\TalonOne\Client\Model\InlineResponse20031', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23576,18 +23928,19 @@ public function getCampaignGroupWithHttpInfo($campaignGroupId) } /** - * Operation getCampaignGroupAsync + * Operation getAudiencesAnalyticsAsync * - * Get campaign access group + * List audience analytics * - * @param int $campaignGroupId The ID of the campaign access group. (required) + * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignGroupAsync($campaignGroupId) + public function getAudiencesAnalyticsAsync($audienceIds, $sort = null) { - return $this->getCampaignGroupAsyncWithHttpInfo($campaignGroupId) + return $this->getAudiencesAnalyticsAsyncWithHttpInfo($audienceIds, $sort) ->then( function ($response) { return $response[0]; @@ -23596,19 +23949,20 @@ function ($response) { } /** - * Operation getCampaignGroupAsyncWithHttpInfo + * Operation getAudiencesAnalyticsAsyncWithHttpInfo * - * Get campaign access group + * List audience analytics * - * @param int $campaignGroupId The ID of the campaign access group. (required) + * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignGroupAsyncWithHttpInfo($campaignGroupId) + public function getAudiencesAnalyticsAsyncWithHttpInfo($audienceIds, $sort = null) { - $returnType = '\TalonOne\Client\Model\CampaignGroup'; - $request = $this->getCampaignGroupRequest($campaignGroupId); + $returnType = '\TalonOne\Client\Model\InlineResponse20031'; + $request = $this->getAudiencesAnalyticsRequest($audienceIds, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23645,39 +23999,46 @@ function ($exception) { } /** - * Create request for operation 'getCampaignGroup' + * Create request for operation 'getAudiencesAnalytics' * - * @param int $campaignGroupId The ID of the campaign access group. (required) + * @param string $audienceIds The IDs of one or more audiences, separated by commas, by which to filter results. (required) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignGroupRequest($campaignGroupId) + protected function getAudiencesAnalyticsRequest($audienceIds, $sort = null) { - // verify the required parameter 'campaignGroupId' is set - if ($campaignGroupId === null || (is_array($campaignGroupId) && count($campaignGroupId) === 0)) { + // verify the required parameter 'audienceIds' is set + if ($audienceIds === null || (is_array($audienceIds) && count($audienceIds) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignGroupId when calling getCampaignGroup' + 'Missing the required parameter $audienceIds when calling getAudiencesAnalytics' ); } - $resourcePath = '/v1/campaign_groups/{campaignGroupId}'; + $resourcePath = '/v1/audiences/analytics'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($audienceIds)) { + $audienceIds = ObjectSerializer::serializeCollection($audienceIds, '', true); + } + if ($audienceIds !== null) { + $queryParams['audienceIds'] = $audienceIds; + } - // path params - if ($campaignGroupId !== null) { - $resourcePath = str_replace( - '{' . 'campaignGroupId' . '}', - ObjectSerializer::toPathValue($campaignGroupId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -23754,40 +24115,38 @@ protected function getCampaignGroupRequest($campaignGroupId) } /** - * Operation getCampaignGroups + * Operation getCampaign * - * List campaign access groups + * Get campaign * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20011 + * @return \TalonOne\Client\Model\Campaign */ - public function getCampaignGroups($pageSize = 1000, $skip = null, $sort = null) + public function getCampaign($applicationId, $campaignId) { - list($response) = $this->getCampaignGroupsWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->getCampaignWithHttpInfo($applicationId, $campaignId); return $response; } /** - * Operation getCampaignGroupsWithHttpInfo + * Operation getCampaignWithHttpInfo * - * List campaign access groups + * Get campaign * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20011, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Campaign, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignGroupsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getCampaignWithHttpInfo($applicationId, $campaignId) { - $request = $this->getCampaignGroupsRequest($pageSize, $skip, $sort); + $request = $this->getCampaignRequest($applicationId, $campaignId); try { $options = $this->createHttpClientOption(); @@ -23820,20 +24179,20 @@ public function getCampaignGroupsWithHttpInfo($pageSize = 1000, $skip = null, $s $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20011' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Campaign' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20011', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Campaign', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20011'; + $returnType = '\TalonOne\Client\Model\Campaign'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23852,7 +24211,7 @@ public function getCampaignGroupsWithHttpInfo($pageSize = 1000, $skip = null, $s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20011', + '\TalonOne\Client\Model\Campaign', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23863,20 +24222,19 @@ public function getCampaignGroupsWithHttpInfo($pageSize = 1000, $skip = null, $s } /** - * Operation getCampaignGroupsAsync + * Operation getCampaignAsync * - * List campaign access groups + * Get campaign * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignGroupsAsync($pageSize = 1000, $skip = null, $sort = null) + public function getCampaignAsync($applicationId, $campaignId) { - return $this->getCampaignGroupsAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->getCampaignAsyncWithHttpInfo($applicationId, $campaignId) ->then( function ($response) { return $response[0]; @@ -23885,21 +24243,20 @@ function ($response) { } /** - * Operation getCampaignGroupsAsyncWithHttpInfo + * Operation getCampaignAsyncWithHttpInfo * - * List campaign access groups + * Get campaign * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignGroupsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getCampaignAsyncWithHttpInfo($applicationId, $campaignId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20011'; - $request = $this->getCampaignGroupsRequest($pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\Campaign'; + $request = $this->getCampaignRequest($applicationId, $campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23936,55 +24293,54 @@ function ($exception) { } /** - * Create request for operation 'getCampaignGroups' + * Create request for operation 'getCampaign' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignGroupsRequest($pageSize = 1000, $skip = null, $sort = null) + protected function getCampaignRequest($applicationId, $campaignId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignGroups, must be smaller than or equal to 1000.'); + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getCampaign' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignGroups, must be bigger than or equal to 1.'); + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getCampaign' + ); } - - $resourcePath = '/v1/campaign_groups'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -24061,48 +24417,44 @@ protected function getCampaignGroupsRequest($pageSize = 1000, $skip = null, $sor } /** - * Operation getCampaignTemplates + * Operation getCampaignAnalytics * - * List campaign templates + * Get analytics of campaigns * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $state Filter results by the state of the campaign template. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) - * @param int $userId Filter results by user ID. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $granularity The time interval between the results in the returned time-series. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20012 + * @return \TalonOne\Client\Model\InlineResponse20021 */ - public function getCampaignTemplates($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - list($response) = $this->getCampaignTemplatesWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId); + list($response) = $this->getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); return $response; } /** - * Operation getCampaignTemplatesWithHttpInfo + * Operation getCampaignAnalyticsWithHttpInfo * - * List campaign templates + * Get analytics of campaigns * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $state Filter results by the state of the campaign template. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) - * @param int $userId Filter results by user ID. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $granularity The time interval between the results in the returned time-series. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20012, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20021, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); + $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); try { $options = $this->createHttpClientOption(); @@ -24135,20 +24487,20 @@ public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20012' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20021' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20012', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20021', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20012'; + $returnType = '\TalonOne\Client\Model\InlineResponse20021'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24167,7 +24519,7 @@ public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20012', + '\TalonOne\Client\Model\InlineResponse20021', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24178,24 +24530,22 @@ public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, } /** - * Operation getCampaignTemplatesAsync + * Operation getCampaignAnalyticsAsync * - * List campaign templates + * Get analytics of campaigns * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $state Filter results by the state of the campaign template. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) - * @param int $userId Filter results by user ID. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $granularity The time interval between the results in the returned time-series. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignTemplatesAsync($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCampaignAnalyticsAsync($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - return $this->getCampaignTemplatesAsyncWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId) + return $this->getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity) ->then( function ($response) { return $response[0]; @@ -24204,25 +24554,23 @@ function ($response) { } /** - * Operation getCampaignTemplatesAsyncWithHttpInfo + * Operation getCampaignAnalyticsAsyncWithHttpInfo * - * List campaign templates + * Get analytics of campaigns * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $state Filter results by the state of the campaign template. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) - * @param int $userId Filter results by user ID. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $granularity The time interval between the results in the returned time-series. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignTemplatesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20012'; - $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); + $returnType = '\TalonOne\Client\Model\InlineResponse20021'; + $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24259,30 +24607,45 @@ function ($exception) { } /** - * Create request for operation 'getCampaignTemplates' + * Create request for operation 'getCampaignAnalytics' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $state Filter results by the state of the campaign template. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) - * @param int $userId Filter results by user ID. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param string $granularity The time interval between the results in the returned time-series. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignTemplatesRequest($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + protected function getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignTemplates, must be smaller than or equal to 1000.'); + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getCampaignAnalytics' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignTemplates, must be bigger than or equal to 1.'); + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getCampaignAnalytics' + ); + } + // verify the required parameter 'rangeStart' is set + if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeStart when calling getCampaignAnalytics' + ); + } + // verify the required parameter 'rangeEnd' is set + if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeEnd when calling getCampaignAnalytics' + ); } - - $resourcePath = '/v1/campaign_templates'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/analytics'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24290,56 +24653,44 @@ protected function getCampaignTemplatesRequest($pageSize = 1000, $skip = null, $ $multipart = false; // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($state)) { - $state = ObjectSerializer::serializeCollection($state, '', true); - } - if ($state !== null) { - $queryParams['state'] = $state; - } - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - if ($name !== null) { - $queryParams['name'] = $name; + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); } - if ($tags !== null) { - $queryParams['tags'] = $tags; + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; } // query params - if (is_array($userId)) { - $userId = ObjectSerializer::serializeCollection($userId, '', true); + if (is_array($granularity)) { + $granularity = ObjectSerializer::serializeCollection($granularity, '', true); } - if ($userId !== null) { - $queryParams['userId'] = $userId; + if ($granularity !== null) { + $queryParams['granularity'] = $granularity; } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -24416,58 +24767,46 @@ protected function getCampaignTemplatesRequest($pageSize = 1000, $skip = null, $ } /** - * Operation getCampaigns + * Operation getCampaignByAttributes * - * List campaigns + * List campaigns that match the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) - * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) - * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2006|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse2006 */ - public function getCampaigns($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) + public function getCampaignByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { - list($response) = $this->getCampaignsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); + list($response) = $this->getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState); return $response; } /** - * Operation getCampaignsWithHttpInfo + * Operation getCampaignByAttributesWithHttpInfo * - * List campaigns + * List campaigns that match the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) - * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) - * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse2006|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse2006, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignsWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) + public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { - $request = $this->getCampaignsRequest($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); + $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); try { $options = $this->createHttpClientOption(); @@ -24511,18 +24850,6 @@ public function getCampaignsWithHttpInfo($applicationId, $pageSize = 1000, $skip $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; } $returnType = '\TalonOne\Client\Model\InlineResponse2006'; @@ -24549,43 +24876,29 @@ public function getCampaignsWithHttpInfo($applicationId, $pageSize = 1000, $skip ); $e->setResponseObject($data); break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getCampaignsAsync + * Operation getCampaignByAttributesAsync * - * List campaigns + * List campaigns that match the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) - * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) - * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) + public function getCampaignByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { - return $this->getCampaignsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId) + return $this->getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState) ->then( function ($response) { return $response[0]; @@ -24594,30 +24907,24 @@ function ($response) { } /** - * Operation getCampaignsAsyncWithHttpInfo + * Operation getCampaignByAttributesAsyncWithHttpInfo * - * List campaigns + * List campaigns that match the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) - * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) - * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) + public function getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { $returnType = '\TalonOne\Client\Model\InlineResponse2006'; - $request = $this->getCampaignsRequest($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); + $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24654,41 +24961,41 @@ function ($exception) { } /** - * Create request for operation 'getCampaigns' + * Create request for operation 'getCampaignByAttributes' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\CampaignSearch $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) - * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) - * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) - * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) - * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) + protected function getCampaignByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCampaigns' + 'Missing the required parameter $applicationId when calling getCampaignByAttributes' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling getCampaignByAttributes' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaigns, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignByAttributes, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaigns, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignByAttributes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns'; + $resourcePath = '/v1/applications/{applicationId}/campaigns_search'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24723,55 +25030,6 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = if ($campaignState !== null) { $queryParams['campaignState'] = $campaignState; } - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); - } - if ($name !== null) { - $queryParams['name'] = $name; - } - // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } - if ($tags !== null) { - $queryParams['tags'] = $tags; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($campaignGroupId)) { - $campaignGroupId = ObjectSerializer::serializeCollection($campaignGroupId, '', true); - } - if ($campaignGroupId !== null) { - $queryParams['campaignGroupId'] = $campaignGroupId; - } - // query params - if (is_array($templateId)) { - $templateId = ObjectSerializer::serializeCollection($templateId, '', true); - } - if ($templateId !== null) { - $queryParams['templateId'] = $templateId; - } - // query params - if (is_array($storeId)) { - $storeId = ObjectSerializer::serializeCollection($storeId, '', true); - } - if ($storeId !== null) { - $queryParams['storeId'] = $storeId; - } // path params @@ -24785,6 +25043,9 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -24793,7 +25054,7 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -24850,7 +25111,7 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -24858,56 +25119,36 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = } /** - * Operation getChanges + * Operation getCampaignGroup * - * Get audit logs for an account + * Get campaign access group * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) - * @param int $userId Filter results by user ID. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param int $managementKeyId Filter results that match the given management key ID. (optional) - * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) + * @param int $campaignGroupId The ID of the campaign access group. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20042 + * @return \TalonOne\Client\Model\CampaignGroup */ - public function getChanges($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) + public function getCampaignGroup($campaignGroupId) { - list($response) = $this->getChangesWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); + list($response) = $this->getCampaignGroupWithHttpInfo($campaignGroupId); return $response; } /** - * Operation getChangesWithHttpInfo + * Operation getCampaignGroupWithHttpInfo * - * Get audit logs for an account + * Get campaign access group * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) - * @param int $userId Filter results by user ID. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param int $managementKeyId Filter results that match the given management key ID. (optional) - * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) + * @param int $campaignGroupId The ID of the campaign access group. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20042, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\CampaignGroup, HTTP status code, HTTP response headers (array of strings) */ - public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) + public function getCampaignGroupWithHttpInfo($campaignGroupId) { - $request = $this->getChangesRequest($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); + $request = $this->getCampaignGroupRequest($campaignGroupId); try { $options = $this->createHttpClientOption(); @@ -24940,20 +25181,20 @@ public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = n $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20042' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CampaignGroup' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20042', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CampaignGroup', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20042'; + $returnType = '\TalonOne\Client\Model\CampaignGroup'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24972,7 +25213,7 @@ public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20042', + '\TalonOne\Client\Model\CampaignGroup', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24983,28 +25224,18 @@ public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = n } /** - * Operation getChangesAsync + * Operation getCampaignGroupAsync * - * Get audit logs for an account + * Get campaign access group * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) - * @param int $userId Filter results by user ID. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param int $managementKeyId Filter results that match the given management key ID. (optional) - * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) + * @param int $campaignGroupId The ID of the campaign access group. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChangesAsync($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) + public function getCampaignGroupAsync($campaignGroupId) { - return $this->getChangesAsyncWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld) + return $this->getCampaignGroupAsyncWithHttpInfo($campaignGroupId) ->then( function ($response) { return $response[0]; @@ -25013,29 +25244,19 @@ function ($response) { } /** - * Operation getChangesAsyncWithHttpInfo + * Operation getCampaignGroupAsyncWithHttpInfo * - * Get audit logs for an account + * Get campaign access group * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) - * @param int $userId Filter results by user ID. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param int $managementKeyId Filter results that match the given management key ID. (optional) - * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) + * @param int $campaignGroupId The ID of the campaign access group. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChangesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) + public function getCampaignGroupAsyncWithHttpInfo($campaignGroupId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20042'; - $request = $this->getChangesRequest($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); + $returnType = '\TalonOne\Client\Model\CampaignGroup'; + $request = $this->getCampaignGroupRequest($campaignGroupId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25072,119 +25293,39 @@ function ($exception) { } /** - * Create request for operation 'getChanges' + * Create request for operation 'getCampaignGroup' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) - * @param int $userId Filter results by user ID. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param int $managementKeyId Filter results that match the given management key ID. (optional) - * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) + * @param int $campaignGroupId The ID of the campaign access group. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChangesRequest($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) + protected function getCampaignGroupRequest($campaignGroupId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getChanges, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getChanges, must be bigger than or equal to 1.'); + // verify the required parameter 'campaignGroupId' is set + if ($campaignGroupId === null || (is_array($campaignGroupId) && count($campaignGroupId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignGroupId when calling getCampaignGroup' + ); } - - $resourcePath = '/v1/changes'; + $resourcePath = '/v1/campaign_groups/{campaignGroupId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + + + // path params + if ($campaignGroupId !== null) { + $resourcePath = str_replace( + '{' . 'campaignGroupId' . '}', + ObjectSerializer::toPathValue($campaignGroupId), + $resourcePath + ); } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($applicationId)) { - $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); - } - if ($applicationId !== null) { - $queryParams['applicationId'] = $applicationId; - } - // query params - if (is_array($entityPath)) { - $entityPath = ObjectSerializer::serializeCollection($entityPath, '', true); - } - if ($entityPath !== null) { - $queryParams['entityPath'] = $entityPath; - } - // query params - if (is_array($userId)) { - $userId = ObjectSerializer::serializeCollection($userId, '', true); - } - if ($userId !== null) { - $queryParams['userId'] = $userId; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } - // query params - if (is_array($managementKeyId)) { - $managementKeyId = ObjectSerializer::serializeCollection($managementKeyId, '', true); - } - if ($managementKeyId !== null) { - $queryParams['managementKeyId'] = $managementKeyId; - } - // query params - if (is_array($includeOld)) { - $includeOld = ObjectSerializer::serializeCollection($includeOld, '', true); - } - if ($includeOld !== null) { - $queryParams['includeOld'] = $includeOld; - } - - // body params $_tempBody = null; @@ -25261,40 +25402,40 @@ protected function getChangesRequest($pageSize = 1000, $skip = null, $sort = nul } /** - * Operation getCollection + * Operation getCampaignGroups * - * Get campaign-level collection + * List campaign access groups * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20011 */ - public function getCollection($applicationId, $campaignId, $collectionId) + public function getCampaignGroups($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); + list($response) = $this->getCampaignGroupsWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getCollectionWithHttpInfo + * Operation getCampaignGroupsWithHttpInfo * - * Get campaign-level collection + * List campaign access groups * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20011, HTTP status code, HTTP response headers (array of strings) */ - public function getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) + public function getCampaignGroupsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); + $request = $this->getCampaignGroupsRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -25327,32 +25468,20 @@ public function getCollectionWithHttpInfo($applicationId, $campaignId, $collecti $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Collection' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Collection', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20011' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20011', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Collection'; + $returnType = '\TalonOne\Client\Model\InlineResponse20011'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25371,15 +25500,7 @@ public function getCollectionWithHttpInfo($applicationId, $campaignId, $collecti case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Collection', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20011', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25390,20 +25511,20 @@ public function getCollectionWithHttpInfo($applicationId, $campaignId, $collecti } /** - * Operation getCollectionAsync + * Operation getCampaignGroupsAsync * - * Get campaign-level collection + * List campaign access groups * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCollectionAsync($applicationId, $campaignId, $collectionId) + public function getCampaignGroupsAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + return $this->getCampaignGroupsAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -25412,21 +25533,21 @@ function ($response) { } /** - * Operation getCollectionAsyncWithHttpInfo + * Operation getCampaignGroupsAsyncWithHttpInfo * - * Get campaign-level collection + * List campaign access groups * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + public function getCampaignGroupsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\Collection'; - $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); + $returnType = '\TalonOne\Client\Model\InlineResponse20011'; + $request = $this->getCampaignGroupsRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25463,69 +25584,55 @@ function ($exception) { } /** - * Create request for operation 'getCollection' + * Create request for operation 'getCampaignGroups' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCollectionRequest($applicationId, $campaignId, $collectionId) + protected function getCampaignGroupsRequest($pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCollection' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getCollection' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignGroups, must be smaller than or equal to 1000.'); } - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling getCollection' - ); + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignGroups, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; + + $resourcePath = '/v1/campaign_groups'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; } - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + // body params $_tempBody = null; @@ -25602,40 +25709,48 @@ protected function getCollectionRequest($applicationId, $campaignId, $collection } /** - * Operation getCollectionItems + * Operation getCampaignTemplates * - * Get collection items + * List campaign templates * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $state Filter results by the state of the campaign template. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) + * @param int $userId Filter results by user ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20012 */ - public function getCollectionItems($collectionId, $pageSize = 1000, $skip = null) + public function getCampaignTemplates($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - list($response) = $this->getCollectionItemsWithHttpInfo($collectionId, $pageSize, $skip); + list($response) = $this->getCampaignTemplatesWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId); return $response; } /** - * Operation getCollectionItemsWithHttpInfo + * Operation getCampaignTemplatesWithHttpInfo * - * Get collection items + * List campaign templates * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $state Filter results by the state of the campaign template. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) + * @param int $userId Filter results by user ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20012, HTTP status code, HTTP response headers (array of strings) */ - public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) + public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); + $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); try { $options = $this->createHttpClientOption(); @@ -25668,32 +25783,20 @@ public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20018' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20018', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20012' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20012', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20018'; + $returnType = '\TalonOne\Client\Model\InlineResponse20012'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25712,15 +25815,7 @@ public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20018', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20012', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25731,20 +25826,24 @@ public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, } /** - * Operation getCollectionItemsAsync + * Operation getCampaignTemplatesAsync * - * Get collection items + * List campaign templates * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $state Filter results by the state of the campaign template. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) + * @param int $userId Filter results by user ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCollectionItemsAsync($collectionId, $pageSize = 1000, $skip = null) + public function getCampaignTemplatesAsync($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - return $this->getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize, $skip) + return $this->getCampaignTemplatesAsyncWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId) ->then( function ($response) { return $response[0]; @@ -25753,21 +25852,25 @@ function ($response) { } /** - * Operation getCollectionItemsAsyncWithHttpInfo + * Operation getCampaignTemplatesAsyncWithHttpInfo * - * Get collection items + * List campaign templates * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $state Filter results by the state of the campaign template. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) + * @param int $userId Filter results by user ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) + public function getCampaignTemplatesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20018'; - $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); + $returnType = '\TalonOne\Client\Model\InlineResponse20012'; + $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25804,32 +25907,30 @@ function ($exception) { } /** - * Create request for operation 'getCollectionItems' + * Create request for operation 'getCampaignTemplates' * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $state Filter results by the state of the campaign template. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign template. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values. (optional) + * @param int $userId Filter results by user ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCollectionItemsRequest($collectionId, $pageSize = 1000, $skip = null) + protected function getCampaignTemplatesRequest($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling getCollectionItems' - ); - } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCollectionItems, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignTemplates, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCollectionItems, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignTemplates, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/collections/{collectionId}/items'; + $resourcePath = '/v1/campaign_templates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -25850,16 +25951,43 @@ protected function getCollectionItemsRequest($collectionId, $pageSize = 1000, $s if ($skip !== null) { $queryParams['skip'] = $skip; } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($state)) { + $state = ObjectSerializer::serializeCollection($state, '', true); + } + if ($state !== null) { + $queryParams['state'] = $state; + } + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + // query params + if (is_array($userId)) { + $userId = ObjectSerializer::serializeCollection($userId, '', true); + } + if ($userId !== null) { + $queryParams['userId'] = $userId; + } - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -25936,62 +26064,58 @@ protected function getCollectionItemsRequest($collectionId, $pageSize = 1000, $s } /** - * Operation getCouponsWithoutTotalCount + * Operation getCampaigns * - * List coupons + * List campaigns * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) + * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) + * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2009 + * @return \TalonOne\Client\Model\InlineResponse2006|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCouponsWithoutTotalCount($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false) + public function getCampaigns($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) { - list($response) = $this->getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); + list($response) = $this->getCampaignsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); return $response; } /** - * Operation getCouponsWithoutTotalCountWithHttpInfo + * Operation getCampaignsWithHttpInfo * - * List coupons + * List campaigns * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) + * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) + * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse2009, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse2006|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false) + public function getCampaignsWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) { - $request = $this->getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); + $request = $this->getCampaignsRequest($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); try { $options = $this->createHttpClientOption(); @@ -26024,20 +26148,32 @@ public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaig $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2009' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2006' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2009', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2006', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2009'; + $returnType = '\TalonOne\Client\Model\InlineResponse2006'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26056,7 +26192,15 @@ public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaig case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2009', + '\TalonOne\Client\Model\InlineResponse2006', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26067,31 +26211,29 @@ public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaig } /** - * Operation getCouponsWithoutTotalCountAsync + * Operation getCampaignsAsync * - * List coupons + * List campaigns * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) + * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) + * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponsWithoutTotalCountAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false) + public function getCampaignsAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) { - return $this->getCouponsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch) + return $this->getCampaignsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId) ->then( function ($response) { return $response[0]; @@ -26100,32 +26242,30 @@ function ($response) { } /** - * Operation getCouponsWithoutTotalCountAsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * List coupons + * List campaigns * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) + * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) + * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCouponsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false) + public function getCampaignsAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse2009'; - $request = $this->getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); + $returnType = '\TalonOne\Client\Model\InlineResponse2006'; + $request = $this->getCampaignsRequest($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26162,49 +26302,41 @@ function ($exception) { } /** - * Create request for operation 'getCouponsWithoutTotalCount' + * Create request for operation 'getCampaigns' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) - * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) - * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) - * @param string $batchId Filter results by batches of coupons (optional) - * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) + * @param string $name Filter results performing case-insensitive matching against the name of the campaign. (optional) + * @param string $tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $campaignGroupId Filter results to campaigns owned by the specified campaign access group ID. (optional) + * @param int $templateId The ID of the Campaign Template this Campaign was created from. (optional) + * @param int $storeId Filter results to campaigns linked to the specified store ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false) + protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null, $name = null, $tags = null, $createdBefore = null, $createdAfter = null, $campaignGroupId = null, $templateId = null, $storeId = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCouponsWithoutTotalCount' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getCouponsWithoutTotalCount' + 'Missing the required parameter $applicationId when calling getCampaigns' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCouponsWithoutTotalCount, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaigns, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCouponsWithoutTotalCount, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaigns, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total'; + $resourcePath = '/v1/applications/{applicationId}/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -26233,11 +26365,25 @@ protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignI $queryParams['sort'] = $sort; } // query params - if (is_array($value)) { - $value = ObjectSerializer::serializeCollection($value, '', true); + if (is_array($campaignState)) { + $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); } - if ($value !== null) { - $queryParams['value'] = $value; + if ($campaignState !== null) { + $queryParams['campaignState'] = $campaignState; + } + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; } // query params if (is_array($createdBefore)) { @@ -26254,46 +26400,25 @@ protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignI $queryParams['createdAfter'] = $createdAfter; } // query params - if (is_array($valid)) { - $valid = ObjectSerializer::serializeCollection($valid, '', true); - } - if ($valid !== null) { - $queryParams['valid'] = $valid; - } - // query params - if (is_array($usable)) { - $usable = ObjectSerializer::serializeCollection($usable, '', true); - } - if ($usable !== null) { - $queryParams['usable'] = $usable; - } - // query params - if (is_array($referralId)) { - $referralId = ObjectSerializer::serializeCollection($referralId, '', true); - } - if ($referralId !== null) { - $queryParams['referralId'] = $referralId; - } - // query params - if (is_array($recipientIntegrationId)) { - $recipientIntegrationId = ObjectSerializer::serializeCollection($recipientIntegrationId, '', true); + if (is_array($campaignGroupId)) { + $campaignGroupId = ObjectSerializer::serializeCollection($campaignGroupId, '', true); } - if ($recipientIntegrationId !== null) { - $queryParams['recipientIntegrationId'] = $recipientIntegrationId; + if ($campaignGroupId !== null) { + $queryParams['campaignGroupId'] = $campaignGroupId; } // query params - if (is_array($batchId)) { - $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + if (is_array($templateId)) { + $templateId = ObjectSerializer::serializeCollection($templateId, '', true); } - if ($batchId !== null) { - $queryParams['batchId'] = $batchId; + if ($templateId !== null) { + $queryParams['templateId'] = $templateId; } // query params - if (is_array($exactMatch)) { - $exactMatch = ObjectSerializer::serializeCollection($exactMatch, '', true); + if (is_array($storeId)) { + $storeId = ObjectSerializer::serializeCollection($storeId, '', true); } - if ($exactMatch !== null) { - $queryParams['exactMatch'] = $exactMatch; + if ($storeId !== null) { + $queryParams['storeId'] = $storeId; } @@ -26305,14 +26430,6 @@ protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignI $resourcePath ); } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -26389,46 +26506,56 @@ protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignI } /** - * Operation getCustomerActivityReport + * Operation getChanges * - * Get customer's activity report + * Get audit logs for an account * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) + * @param int $userId Filter results by user ID. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param int $managementKeyId Filter results that match the given management key ID. (optional) + * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\CustomerActivityReport + * @return \TalonOne\Client\Model\InlineResponse20042 */ - public function getCustomerActivityReport($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getChanges($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) { - list($response) = $this->getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); + list($response) = $this->getChangesWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); return $response; } /** - * Operation getCustomerActivityReportWithHttpInfo + * Operation getChangesWithHttpInfo * - * Get customer's activity report + * Get audit logs for an account * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) + * @param int $userId Filter results by user ID. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param int $managementKeyId Filter results that match the given management key ID. (optional) + * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\CustomerActivityReport, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20042, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) { - $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); + $request = $this->getChangesRequest($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); try { $options = $this->createHttpClientOption(); @@ -26461,20 +26588,20 @@ public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $a $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\CustomerActivityReport' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20042' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CustomerActivityReport', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20042', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; + $returnType = '\TalonOne\Client\Model\InlineResponse20042'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26493,7 +26620,7 @@ public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $a case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CustomerActivityReport', + '\TalonOne\Client\Model\InlineResponse20042', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26504,23 +26631,28 @@ public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $a } /** - * Operation getCustomerActivityReportAsync + * Operation getChangesAsync * - * Get customer's activity report + * Get audit logs for an account * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) + * @param int $userId Filter results by user ID. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param int $managementKeyId Filter results that match the given management key ID. (optional) + * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerActivityReportAsync($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getChangesAsync($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) { - return $this->getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip) + return $this->getChangesAsyncWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld) ->then( function ($response) { return $response[0]; @@ -26529,24 +26661,29 @@ function ($response) { } /** - * Operation getCustomerActivityReportAsyncWithHttpInfo + * Operation getChangesAsyncWithHttpInfo * - * Get customer's activity report + * Get audit logs for an account * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) + * @param int $userId Filter results by user ID. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param int $managementKeyId Filter results that match the given management key ID. (optional) + * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getChangesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) { - $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; - $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); + $returnType = '\TalonOne\Client\Model\InlineResponse20042'; + $request = $this->getChangesRequest($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26583,53 +26720,34 @@ function ($exception) { } /** - * Create request for operation 'getCustomerActivityReport' + * Create request for operation 'getChanges' * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param string $entityPath Filter results on a case insensitive matching of the url path of the entity (optional) + * @param int $userId Filter results by user ID. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param int $managementKeyId Filter results that match the given management key ID. (optional) + * @param bool $includeOld When this flag is set to false, the state without the change will not be returned. The default value is true. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + protected function getChangesRequest($pageSize = 1000, $skip = null, $sort = null, $applicationId = null, $entityPath = null, $userId = null, $createdBefore = null, $createdAfter = null, $withTotalResultSize = null, $managementKeyId = null, $includeOld = null) { - // verify the required parameter 'rangeStart' is set - if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeStart when calling getCustomerActivityReport' - ); - } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling getCustomerActivityReport' - ); - } - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCustomerActivityReport' - ); - } - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling getCustomerActivityReport' - ); - } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReport, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getChanges, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReport, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getChanges, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customer_activity_reports/{customerId}'; + $resourcePath = '/v1/changes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -26651,38 +26769,71 @@ protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $app $queryParams['skip'] = $skip; } // query params - if (is_array($rangeStart)) { - $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($rangeStart !== null) { - $queryParams['rangeStart'] = $rangeStart; + if ($sort !== null) { + $queryParams['sort'] = $sort; } // query params - if (is_array($rangeEnd)) { - $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); - } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; + if (is_array($applicationId)) { + $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); } - - - // path params if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); + $queryParams['applicationId'] = $applicationId; } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); + // query params + if (is_array($entityPath)) { + $entityPath = ObjectSerializer::serializeCollection($entityPath, '', true); + } + if ($entityPath !== null) { + $queryParams['entityPath'] = $entityPath; + } + // query params + if (is_array($userId)) { + $userId = ObjectSerializer::serializeCollection($userId, '', true); + } + if ($userId !== null) { + $queryParams['userId'] = $userId; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + } + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; + } + // query params + if (is_array($managementKeyId)) { + $managementKeyId = ObjectSerializer::serializeCollection($managementKeyId, '', true); + } + if ($managementKeyId !== null) { + $queryParams['managementKeyId'] = $managementKeyId; + } + // query params + if (is_array($includeOld)) { + $includeOld = ObjectSerializer::serializeCollection($includeOld, '', true); + } + if ($includeOld !== null) { + $queryParams['includeOld'] = $includeOld; } + + // body params $_tempBody = null; @@ -26758,54 +26909,40 @@ protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $app } /** - * Operation getCustomerActivityReportsWithoutTotalCount + * Operation getCollection * - * Get Activity Reports for Application Customers + * Get campaign-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $name Only return reports matching the customer name (optional) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param string $campaignName Only return reports matching the campaignName (optional) - * @param string $advocateName Only return reports matching the current customer referrer name (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20026 + * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCustomerActivityReportsWithoutTotalCount($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getCollection($applicationId, $campaignId, $collectionId) { - list($response) = $this->getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); + list($response) = $this->getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); return $response; } /** - * Operation getCustomerActivityReportsWithoutTotalCountWithHttpInfo + * Operation getCollectionWithHttpInfo * - * Get Activity Reports for Application Customers + * Get campaign-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $name Only return reports matching the customer name (optional) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param string $campaignName Only return reports matching the campaignName (optional) - * @param string $advocateName Only return reports matching the current customer referrer name (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20026, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) { - $request = $this->getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); + $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); try { $options = $this->createHttpClientOption(); @@ -26838,20 +26975,32 @@ public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeSt $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20026' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Collection' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20026', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Collection', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20026'; + $returnType = '\TalonOne\Client\Model\Collection'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26870,7 +27019,15 @@ public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeSt case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20026', + '\TalonOne\Client\Model\Collection', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26881,27 +27038,20 @@ public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeSt } /** - * Operation getCustomerActivityReportsWithoutTotalCountAsync + * Operation getCollectionAsync * - * Get Activity Reports for Application Customers + * Get campaign-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $name Only return reports matching the customer name (optional) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param string $campaignName Only return reports matching the campaignName (optional) - * @param string $advocateName Only return reports matching the current customer referrer name (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerActivityReportsWithoutTotalCountAsync($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getCollectionAsync($applicationId, $campaignId, $collectionId) { - return $this->getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName) + return $this->getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) ->then( function ($response) { return $response[0]; @@ -26910,28 +27060,21 @@ function ($response) { } /** - * Operation getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo + * Operation getCollectionAsyncWithHttpInfo * - * Get Activity Reports for Application Customers + * Get campaign-level collection * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $name Only return reports matching the customer name (optional) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param string $campaignName Only return reports matching the campaignName (optional) - * @param string $advocateName Only return reports matching the current customer referrer name (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20026'; - $request = $this->getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); + $returnType = '\TalonOne\Client\Model\Collection'; + $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26968,127 +27111,66 @@ function ($exception) { } /** - * Create request for operation 'getCustomerActivityReportsWithoutTotalCount' + * Create request for operation 'getCollection' * - * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $name Only return reports matching the customer name (optional) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) - * @param string $campaignName Only return reports matching the campaignName (optional) - * @param string $advocateName Only return reports matching the current customer referrer name (optional) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + protected function getCollectionRequest($applicationId, $campaignId, $collectionId) { - // verify the required parameter 'rangeStart' is set - if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $rangeStart when calling getCustomerActivityReportsWithoutTotalCount' + 'Missing the required parameter $applicationId when calling getCollection' ); } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling getCustomerActivityReportsWithoutTotalCount' + 'Missing the required parameter $campaignId when calling getCollection' ); } - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCustomerActivityReportsWithoutTotalCount' + 'Missing the required parameter $collectionId when calling getCollection' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReportsWithoutTotalCount, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReportsWithoutTotalCount, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/customer_activity_reports/no_total'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($rangeStart)) { - $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); - } - if ($rangeStart !== null) { - $queryParams['rangeStart'] = $rangeStart; - } - // query params - if (is_array($rangeEnd)) { - $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); - } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; - } - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); - } - if ($name !== null) { - $queryParams['name'] = $name; - } - // query params - if (is_array($integrationId)) { - $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); - } - if ($integrationId !== null) { - $queryParams['integrationId'] = $integrationId; - } - // query params - if (is_array($campaignName)) { - $campaignName = ObjectSerializer::serializeCollection($campaignName, '', true); - } - if ($campaignName !== null) { - $queryParams['campaignName'] = $campaignName; - } - // query params - if (is_array($advocateName)) { - $advocateName = ObjectSerializer::serializeCollection($advocateName, '', true); - } - if ($advocateName !== null) { - $queryParams['advocateName'] = $advocateName; + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); } - - // path params - if ($applicationId !== null) { + if ($collectionId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -27168,44 +27250,40 @@ protected function getCustomerActivityReportsWithoutTotalCountRequest($rangeStar } /** - * Operation getCustomerAnalytics + * Operation getCollectionItems * - * Get customer's analytics report + * Get collection items * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\CustomerAnalytics + * @return \TalonOne\Client\Model\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCustomerAnalytics($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getCollectionItems($collectionId, $pageSize = 1000, $skip = null) { - list($response) = $this->getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort); + list($response) = $this->getCollectionItemsWithHttpInfo($collectionId, $pageSize, $skip); return $response; } /** - * Operation getCustomerAnalyticsWithHttpInfo + * Operation getCollectionItemsWithHttpInfo * - * Get customer's analytics report + * Get collection items * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\CustomerAnalytics, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) { - $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); + $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); try { $options = $this->createHttpClientOption(); @@ -27238,20 +27316,32 @@ public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $p $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\CustomerAnalytics' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20018' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CustomerAnalytics', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20018', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; + $returnType = '\TalonOne\Client\Model\InlineResponse20018'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -27270,7 +27360,15 @@ public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $p case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CustomerAnalytics', + '\TalonOne\Client\Model\InlineResponse20018', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27281,22 +27379,20 @@ public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $p } /** - * Operation getCustomerAnalyticsAsync + * Operation getCollectionItemsAsync * - * Get customer's analytics report + * Get collection items * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerAnalyticsAsync($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getCollectionItemsAsync($collectionId, $pageSize = 1000, $skip = null) { - return $this->getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort) + return $this->getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize, $skip) ->then( function ($response) { return $response[0]; @@ -27305,23 +27401,21 @@ function ($response) { } /** - * Operation getCustomerAnalyticsAsyncWithHttpInfo + * Operation getCollectionItemsAsyncWithHttpInfo * - * Get customer's analytics report + * Get collection items * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) { - $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; - $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\InlineResponse20018'; + $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27358,40 +27452,32 @@ function ($exception) { } /** - * Create request for operation 'getCustomerAnalytics' + * Create request for operation 'getCollectionItems' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + protected function getCollectionItemsRequest($collectionId, $pageSize = 1000, $skip = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCustomerAnalytics' - ); - } - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling getCustomerAnalytics' + 'Missing the required parameter $collectionId when calling getCollectionItems' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerAnalytics, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCollectionItems, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerAnalytics, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCollectionItems, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}/analytics'; + $resourcePath = '/v1/collections/{collectionId}/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27412,28 +27498,13 @@ protected function getCustomerAnalyticsRequest($applicationId, $customerId, $pag if ($skip !== null) { $queryParams['skip'] = $skip; } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($customerId !== null) { + if ($collectionId !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -27513,36 +27584,74 @@ protected function getCustomerAnalyticsRequest($applicationId, $customerId, $pag } /** - * Operation getCustomerProfile + * Operation getCouponsWithoutTotalCount * - * Get customer profile + * List coupons * - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param string $redeemed - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\CustomerProfile + * @return \TalonOne\Client\Model\InlineResponse2009 */ - public function getCustomerProfile($customerId) + public function getCouponsWithoutTotalCount($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $redeemed = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $expiresBefore = null, $expiresAfter = null, $startsBefore = null, $startsAfter = null, $valuesOnly = false) { - list($response) = $this->getCustomerProfileWithHttpInfo($customerId); + list($response) = $this->getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $redeemed, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $expiresBefore, $expiresAfter, $startsBefore, $startsAfter, $valuesOnly); return $response; } /** - * Operation getCustomerProfileWithHttpInfo + * Operation getCouponsWithoutTotalCountWithHttpInfo * - * Get customer profile + * List coupons * - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param string $redeemed - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\CustomerProfile, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse2009, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomerProfileWithHttpInfo($customerId) + public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $redeemed = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $expiresBefore = null, $expiresAfter = null, $startsBefore = null, $startsAfter = null, $valuesOnly = false) { - $request = $this->getCustomerProfileRequest($customerId); + $request = $this->getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $redeemed, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $expiresBefore, $expiresAfter, $startsBefore, $startsAfter, $valuesOnly); try { $options = $this->createHttpClientOption(); @@ -27575,20 +27684,20 @@ public function getCustomerProfileWithHttpInfo($customerId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\CustomerProfile' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2009' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CustomerProfile', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2009', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CustomerProfile'; + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -27607,7 +27716,7 @@ public function getCustomerProfileWithHttpInfo($customerId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CustomerProfile', + '\TalonOne\Client\Model\InlineResponse2009', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27618,18 +27727,37 @@ public function getCustomerProfileWithHttpInfo($customerId) } /** - * Operation getCustomerProfileAsync + * Operation getCouponsWithoutTotalCountAsync * - * Get customer profile + * List coupons * - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param string $redeemed - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfileAsync($customerId) + public function getCouponsWithoutTotalCountAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $redeemed = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $expiresBefore = null, $expiresAfter = null, $startsBefore = null, $startsAfter = null, $valuesOnly = false) { - return $this->getCustomerProfileAsyncWithHttpInfo($customerId) + return $this->getCouponsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $redeemed, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $expiresBefore, $expiresAfter, $startsBefore, $startsAfter, $valuesOnly) ->then( function ($response) { return $response[0]; @@ -27638,19 +27766,38 @@ function ($response) { } /** - * Operation getCustomerProfileAsyncWithHttpInfo + * Operation getCouponsWithoutTotalCountAsyncWithHttpInfo * - * Get customer profile + * List coupons * - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param string $redeemed - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfileAsyncWithHttpInfo($customerId) + public function getCouponsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $redeemed = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $expiresBefore = null, $expiresAfter = null, $startsBefore = null, $startsAfter = null, $valuesOnly = false) { - $returnType = '\TalonOne\Client\Model\CustomerProfile'; - $request = $this->getCustomerProfileRequest($customerId); + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; + $request = $this->getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $redeemed, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $expiresBefore, $expiresAfter, $startsBefore, $startsAfter, $valuesOnly); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27687,36 +27834,202 @@ function ($exception) { } /** - * Create request for operation 'getCustomerProfile' + * Create request for operation 'getCouponsWithoutTotalCount' * - * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration date is null or in the future, the third matches coupons in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. (optional) + * @param string $redeemed - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. (optional) + * @param int $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. (optional) + * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) + * @param string $batchId Filter results by batches of coupons (optional) + * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param \DateTime $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon expiration date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon start date timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param bool $valuesOnly Filter results to only return the coupon codes (`value` column) without the associated coupon data. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerProfileRequest($customerId) + protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $redeemed = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $expiresBefore = null, $expiresAfter = null, $startsBefore = null, $startsAfter = null, $valuesOnly = false) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling getCustomerProfile' + 'Missing the required parameter $applicationId when calling getCouponsWithoutTotalCount' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getCouponsWithoutTotalCount' ); } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCouponsWithoutTotalCount, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCouponsWithoutTotalCount, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/customers/{customerId}'; + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($value)) { + $value = ObjectSerializer::serializeCollection($value, '', true); + } + if ($value !== null) { + $queryParams['value'] = $value; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($valid)) { + $valid = ObjectSerializer::serializeCollection($valid, '', true); + } + if ($valid !== null) { + $queryParams['valid'] = $valid; + } + // query params + if (is_array($usable)) { + $usable = ObjectSerializer::serializeCollection($usable, '', true); + } + if ($usable !== null) { + $queryParams['usable'] = $usable; + } + // query params + if (is_array($redeemed)) { + $redeemed = ObjectSerializer::serializeCollection($redeemed, '', true); + } + if ($redeemed !== null) { + $queryParams['redeemed'] = $redeemed; + } + // query params + if (is_array($referralId)) { + $referralId = ObjectSerializer::serializeCollection($referralId, '', true); + } + if ($referralId !== null) { + $queryParams['referralId'] = $referralId; + } + // query params + if (is_array($recipientIntegrationId)) { + $recipientIntegrationId = ObjectSerializer::serializeCollection($recipientIntegrationId, '', true); + } + if ($recipientIntegrationId !== null) { + $queryParams['recipientIntegrationId'] = $recipientIntegrationId; + } + // query params + if (is_array($batchId)) { + $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + } + if ($batchId !== null) { + $queryParams['batchId'] = $batchId; + } + // query params + if (is_array($exactMatch)) { + $exactMatch = ObjectSerializer::serializeCollection($exactMatch, '', true); + } + if ($exactMatch !== null) { + $queryParams['exactMatch'] = $exactMatch; + } + // query params + if (is_array($expiresBefore)) { + $expiresBefore = ObjectSerializer::serializeCollection($expiresBefore, '', true); + } + if ($expiresBefore !== null) { + $queryParams['expiresBefore'] = $expiresBefore; + } + // query params + if (is_array($expiresAfter)) { + $expiresAfter = ObjectSerializer::serializeCollection($expiresAfter, '', true); + } + if ($expiresAfter !== null) { + $queryParams['expiresAfter'] = $expiresAfter; + } + // query params + if (is_array($startsBefore)) { + $startsBefore = ObjectSerializer::serializeCollection($startsBefore, '', true); + } + if ($startsBefore !== null) { + $queryParams['startsBefore'] = $startsBefore; + } + // query params + if (is_array($startsAfter)) { + $startsAfter = ObjectSerializer::serializeCollection($startsAfter, '', true); + } + if ($startsAfter !== null) { + $queryParams['startsAfter'] = $startsAfter; + } + // query params + if (is_array($valuesOnly)) { + $valuesOnly = ObjectSerializer::serializeCollection($valuesOnly, '', true); + } + if ($valuesOnly !== null) { + $queryParams['valuesOnly'] = $valuesOnly; + } // path params - if ($customerId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -27796,46 +28109,46 @@ protected function getCustomerProfileRequest($customerId) } /** - * Operation getCustomerProfileAchievementProgress + * Operation getCustomerActivityReport * - * List customer achievements + * Get customer's activity report * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) - * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20047|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\CustomerActivityReport */ - public function getCustomerProfileAchievementProgress($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) + public function getCustomerActivityReport($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - list($response) = $this->getCustomerProfileAchievementProgressWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); + list($response) = $this->getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); return $response; } /** - * Operation getCustomerProfileAchievementProgressWithHttpInfo + * Operation getCustomerActivityReportWithHttpInfo * - * List customer achievements + * Get customer's activity report * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) - * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20047|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\CustomerActivityReport, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomerProfileAchievementProgressWithHttpInfo($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) + public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - $request = $this->getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); + $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); try { $options = $this->createHttpClientOption(); @@ -27868,44 +28181,20 @@ public function getCustomerProfileAchievementProgressWithHttpInfo($applicationId $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20047' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20047', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CustomerActivityReport' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CustomerActivityReport', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20047'; + $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -27924,23 +28213,7 @@ public function getCustomerProfileAchievementProgressWithHttpInfo($applicationId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20047', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\CustomerActivityReport', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27951,23 +28224,23 @@ public function getCustomerProfileAchievementProgressWithHttpInfo($applicationId } /** - * Operation getCustomerProfileAchievementProgressAsync + * Operation getCustomerActivityReportAsync * - * List customer achievements + * Get customer's activity report * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) - * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfileAchievementProgressAsync($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) + public function getCustomerActivityReportAsync($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - return $this->getCustomerProfileAchievementProgressAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title) + return $this->getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip) ->then( function ($response) { return $response[0]; @@ -27976,24 +28249,24 @@ function ($response) { } /** - * Operation getCustomerProfileAchievementProgressAsyncWithHttpInfo + * Operation getCustomerActivityReportAsyncWithHttpInfo * - * List customer achievements + * Get customer's activity report * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) - * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfileAchievementProgressAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) + public function getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20047'; - $request = $this->getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); + $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; + $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28030,41 +28303,53 @@ function ($exception) { } /** - * Create request for operation 'getCustomerProfileAchievementProgress' + * Create request for operation 'getCustomerActivityReport' * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) - * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) + protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { + // verify the required parameter 'rangeStart' is set + if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeStart when calling getCustomerActivityReport' + ); + } + // verify the required parameter 'rangeEnd' is set + if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeEnd when calling getCustomerActivityReport' + ); + } // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getCustomerProfileAchievementProgress' + 'Missing the required parameter $applicationId when calling getCustomerActivityReport' ); } - // verify the required parameter 'integrationId' is set - if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $integrationId when calling getCustomerProfileAchievementProgress' + 'Missing the required parameter $customerId when calling getCustomerActivityReport' ); } - if ($pageSize !== null && $pageSize > 50) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfileAchievementProgress, must be smaller than or equal to 50.'); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReport, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfileAchievementProgress, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReport, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/achievement_progress/{integrationId}'; + $resourcePath = '/v1/applications/{applicationId}/customer_activity_reports/{customerId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28086,18 +28371,18 @@ protected function getCustomerProfileAchievementProgressRequest($applicationId, $queryParams['skip'] = $skip; } // query params - if (is_array($achievementId)) { - $achievementId = ObjectSerializer::serializeCollection($achievementId, '', true); + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - if ($achievementId !== null) { - $queryParams['achievementId'] = $achievementId; + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; } // query params - if (is_array($title)) { - $title = ObjectSerializer::serializeCollection($title, '', true); + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); } - if ($title !== null) { - $queryParams['title'] = $title; + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; } @@ -28110,10 +28395,10 @@ protected function getCustomerProfileAchievementProgressRequest($applicationId, ); } // path params - if ($integrationId !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -28193,40 +28478,54 @@ protected function getCustomerProfileAchievementProgressRequest($applicationId, } /** - * Operation getCustomerProfiles + * Operation getCustomerActivityReportsWithoutTotalCount * - * List customer profiles + * Get Activity Reports for Application Customers * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $name Only return reports matching the customer name (optional) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param string $campaignName Only return reports matching the campaignName (optional) + * @param string $advocateName Only return reports matching the current customer referrer name (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20025 + * @return \TalonOne\Client\Model\InlineResponse20026 */ - public function getCustomerProfiles($pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerActivityReportsWithoutTotalCount($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - list($response) = $this->getCustomerProfilesWithHttpInfo($pageSize, $skip, $sandbox); + list($response) = $this->getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); return $response; } /** - * Operation getCustomerProfilesWithHttpInfo + * Operation getCustomerActivityReportsWithoutTotalCountWithHttpInfo * - * List customer profiles + * Get Activity Reports for Application Customers * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $name Only return reports matching the customer name (optional) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param string $campaignName Only return reports matching the campaignName (optional) + * @param string $advocateName Only return reports matching the current customer referrer name (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20025, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20026, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); + $request = $this->getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); try { $options = $this->createHttpClientOption(); @@ -28259,20 +28558,20 @@ public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20025' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20026' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20025', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20026', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20025'; + $returnType = '\TalonOne\Client\Model\InlineResponse20026'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -28291,7 +28590,7 @@ public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20025', + '\TalonOne\Client\Model\InlineResponse20026', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28302,20 +28601,27 @@ public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, } /** - * Operation getCustomerProfilesAsync + * Operation getCustomerActivityReportsWithoutTotalCountAsync * - * List customer profiles + * Get Activity Reports for Application Customers * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $name Only return reports matching the customer name (optional) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param string $campaignName Only return reports matching the campaignName (optional) + * @param string $advocateName Only return reports matching the current customer referrer name (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfilesAsync($pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerActivityReportsWithoutTotalCountAsync($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - return $this->getCustomerProfilesAsyncWithHttpInfo($pageSize, $skip, $sandbox) + return $this->getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName) ->then( function ($response) { return $response[0]; @@ -28324,21 +28630,28 @@ function ($response) { } /** - * Operation getCustomerProfilesAsyncWithHttpInfo + * Operation getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo * - * List customer profiles + * Get Activity Reports for Application Customers * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $name Only return reports matching the customer name (optional) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param string $campaignName Only return reports matching the campaignName (optional) + * @param string $advocateName Only return reports matching the current customer referrer name (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfilesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20025'; - $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); + $returnType = '\TalonOne\Client\Model\InlineResponse20026'; + $request = $this->getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28375,26 +28688,51 @@ function ($exception) { } /** - * Create request for operation 'getCustomerProfiles' + * Create request for operation 'getCustomerActivityReportsWithoutTotalCount' * + * @param \DateTime $rangeStart Only return results from after this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param \DateTime $rangeEnd Only return results from before this timestamp. **Note:** - This must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $name Only return reports matching the customer name (optional) + * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param string $campaignName Only return reports matching the campaignName (optional) + * @param string $advocateName Only return reports matching the current customer referrer name (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerProfilesRequest($pageSize = 1000, $skip = null, $sandbox = false) + protected function getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { + // verify the required parameter 'rangeStart' is set + if ($rangeStart === null || (is_array($rangeStart) && count($rangeStart) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeStart when calling getCustomerActivityReportsWithoutTotalCount' + ); + } + // verify the required parameter 'rangeEnd' is set + if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rangeEnd when calling getCustomerActivityReportsWithoutTotalCount' + ); + } + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getCustomerActivityReportsWithoutTotalCount' + ); + } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfiles, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReportsWithoutTotalCount, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfiles, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerActivityReportsWithoutTotalCount, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/customers/no_total'; + $resourcePath = '/v1/applications/{applicationId}/customer_activity_reports/no_total'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28416,39 +28754,89 @@ protected function getCustomerProfilesRequest($pageSize = 1000, $skip = null, $s $queryParams['skip'] = $skip; } // query params - if (is_array($sandbox)) { - $sandbox = ObjectSerializer::serializeCollection($sandbox, '', true); + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($sandbox !== null) { - $queryParams['sandbox'] = $sandbox; + if ($sort !== null) { + $queryParams['sort'] = $sort; } - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + // query params + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; + } + // query params + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); + } + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; + } + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } + // query params + if (is_array($integrationId)) { + $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); + } + if ($integrationId !== null) { + $queryParams['integrationId'] = $integrationId; + } + // query params + if (is_array($campaignName)) { + $campaignName = ObjectSerializer::serializeCollection($campaignName, '', true); + } + if ($campaignName !== null) { + $queryParams['campaignName'] = $campaignName; + } + // query params + if (is_array($advocateName)) { + $advocateName = ObjectSerializer::serializeCollection($advocateName, '', true); + } + if ($advocateName !== null) { + $queryParams['advocateName'] = $advocateName; + } + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ @@ -28500,42 +28888,44 @@ protected function getCustomerProfilesRequest($pageSize = 1000, $skip = null, $s } /** - * Operation getCustomersByAttributes + * Operation getCustomerAnalytics * - * List customer profiles matching the given attributes + * Get customer's analytics report * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20024 + * @return \TalonOne\Client\Model\CustomerAnalytics */ - public function getCustomersByAttributes($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerAnalytics($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getCustomersByAttributesWithHttpInfo($body, $pageSize, $skip, $sandbox); + list($response) = $this->getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort); return $response; } /** - * Operation getCustomersByAttributesWithHttpInfo + * Operation getCustomerAnalyticsWithHttpInfo * - * List customer profiles matching the given attributes + * Get customer's analytics report * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20024, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\CustomerAnalytics, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); + $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -28568,20 +28958,20 @@ public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $s $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20024' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CustomerAnalytics' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20024', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CustomerAnalytics', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20024'; + $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -28600,7 +28990,7 @@ public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20024', + '\TalonOne\Client\Model\CustomerAnalytics', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28611,21 +29001,22 @@ public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $s } /** - * Operation getCustomersByAttributesAsync + * Operation getCustomerAnalyticsAsync * - * List customer profiles matching the given attributes + * Get customer's analytics report * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomersByAttributesAsync($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerAnalyticsAsync($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize, $skip, $sandbox) + return $this->getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -28634,22 +29025,23 @@ function ($response) { } /** - * Operation getCustomersByAttributesAsyncWithHttpInfo + * Operation getCustomerAnalyticsAsyncWithHttpInfo * - * List customer profiles matching the given attributes + * Get customer's analytics report * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20024'; - $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); + $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; + $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28686,33 +29078,40 @@ function ($exception) { } /** - * Create request for operation 'getCustomersByAttributes' + * Create request for operation 'getCustomerAnalytics' * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $skip = null, $sandbox = false) + protected function getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling getCustomersByAttributes' + 'Missing the required parameter $applicationId when calling getCustomerAnalytics' + ); + } + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling getCustomerAnalytics' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomersByAttributes, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerAnalytics, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomersByAttributes, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerAnalytics, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/customer_search/no_total'; + $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}/analytics'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28734,20 +29133,33 @@ protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $ski $queryParams['skip'] = $skip; } // query params - if (is_array($sandbox)) { - $sandbox = ObjectSerializer::serializeCollection($sandbox, '', true); + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($sandbox !== null) { - $queryParams['sandbox'] = $sandbox; + if ($sort !== null) { + $queryParams['sort'] = $sort; } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -28756,7 +29168,7 @@ protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $ski } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -28813,7 +29225,7 @@ protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $ski $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -28821,44 +29233,36 @@ protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $ski } /** - * Operation getEventTypes + * Operation getCustomerProfile * - * List event types + * Get customer profile * - * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) - * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20040 + * @return \TalonOne\Client\Model\CustomerProfile */ - public function getEventTypes($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getCustomerProfile($customerId) { - list($response) = $this->getEventTypesWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort); + list($response) = $this->getCustomerProfileWithHttpInfo($customerId); return $response; } /** - * Operation getEventTypesWithHttpInfo + * Operation getCustomerProfileWithHttpInfo * - * List event types + * Get customer profile * - * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) - * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20040, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\CustomerProfile, HTTP status code, HTTP response headers (array of strings) */ - public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getCustomerProfileWithHttpInfo($customerId) { - $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); + $request = $this->getCustomerProfileRequest($customerId); try { $options = $this->createHttpClientOption(); @@ -28891,20 +29295,20 @@ public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = fa $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20040' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CustomerProfile' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20040', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\CustomerProfile', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20040'; + $returnType = '\TalonOne\Client\Model\CustomerProfile'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -28923,7 +29327,7 @@ public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = fa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20040', + '\TalonOne\Client\Model\CustomerProfile', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28934,22 +29338,18 @@ public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = fa } /** - * Operation getEventTypesAsync + * Operation getCustomerProfileAsync * - * List event types + * Get customer profile * - * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) - * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventTypesAsync($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getCustomerProfileAsync($customerId) { - return $this->getEventTypesAsyncWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort) + return $this->getCustomerProfileAsyncWithHttpInfo($customerId) ->then( function ($response) { return $response[0]; @@ -28958,23 +29358,19 @@ function ($response) { } /** - * Operation getEventTypesAsyncWithHttpInfo + * Operation getCustomerProfileAsyncWithHttpInfo * - * List event types + * Get customer profile * - * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) - * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventTypesAsyncWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getCustomerProfileAsyncWithHttpInfo($customerId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20040'; - $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\CustomerProfile'; + $request = $this->getCustomerProfileRequest($customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29011,71 +29407,39 @@ function ($exception) { } /** - * Create request for operation 'getEventTypes' + * Create request for operation 'getCustomerProfile' * - * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) - * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $customerId The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getEventTypesRequest($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + protected function getCustomerProfileRequest($customerId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getEventTypes, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getEventTypes, must be bigger than or equal to 1.'); + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling getCustomerProfile' + ); } - - $resourcePath = '/v1/event_types'; + $resourcePath = '/v1/customers/{customerId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); - } - if ($name !== null) { - $queryParams['name'] = $name; - } - // query params - if (is_array($includeOldVersions)) { - $includeOldVersions = ObjectSerializer::serializeCollection($includeOldVersions, '', true); - } - if ($includeOldVersions !== null) { - $queryParams['includeOldVersions'] = $includeOldVersions; - } - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -29152,44 +29516,46 @@ protected function getEventTypesRequest($name = null, $includeOldVersions = fals } /** - * Operation getExports + * Operation getCustomerProfileAchievementProgress * - * Get exports + * List customer achievements * - * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) - * @param string $entity The name of the entity type that was exported. (optional) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) + * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20043 + * @return \TalonOne\Client\Model\InlineResponse20047|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getExports($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getCustomerProfileAchievementProgress($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - list($response) = $this->getExportsWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity); + list($response) = $this->getCustomerProfileAchievementProgressWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); return $response; } /** - * Operation getExportsWithHttpInfo + * Operation getCustomerProfileAchievementProgressWithHttpInfo * - * Get exports + * List customer achievements * - * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) - * @param string $entity The name of the entity type that was exported. (optional) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) + * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20043, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20047|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getCustomerProfileAchievementProgressWithHttpInfo($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); + $request = $this->getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); try { $options = $this->createHttpClientOption(); @@ -29222,20 +29588,44 @@ public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicat $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20043' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20047' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20043', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20047', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20043'; + $returnType = '\TalonOne\Client\Model\InlineResponse20047'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -29254,7 +29644,23 @@ public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicat case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20043', + '\TalonOne\Client\Model\InlineResponse20047', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -29265,22 +29671,23 @@ public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicat } /** - * Operation getExportsAsync + * Operation getCustomerProfileAchievementProgressAsync * - * Get exports + * List customer achievements * - * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) - * @param string $entity The name of the entity type that was exported. (optional) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) + * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getExportsAsync($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getCustomerProfileAchievementProgressAsync($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - return $this->getExportsAsyncWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity) + return $this->getCustomerProfileAchievementProgressAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title) ->then( function ($response) { return $response[0]; @@ -29289,23 +29696,24 @@ function ($response) { } /** - * Operation getExportsAsyncWithHttpInfo + * Operation getCustomerProfileAchievementProgressAsyncWithHttpInfo * - * Get exports + * List customer achievements * - * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) - * @param string $entity The name of the entity type that was exported. (optional) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) + * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getExportsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getCustomerProfileAchievementProgressAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20043'; - $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); + $returnType = '\TalonOne\Client\Model\InlineResponse20047'; + $request = $this->getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29342,28 +29750,41 @@ function ($exception) { } /** - * Create request for operation 'getExports' + * Create request for operation 'getCustomerProfileAchievementProgress' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) - * @param string $entity The name of the entity type that was exported. (optional) + * @param int $achievementId The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint. (optional) + * @param string $title Filter results by the `title` of an achievement. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getExportsRequest($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + protected function getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getExports, must be smaller than or equal to 1000.'); + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getCustomerProfileAchievementProgress' + ); + } + // verify the required parameter 'integrationId' is set + if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $integrationId when calling getCustomerProfileAchievementProgress' + ); + } + if ($pageSize !== null && $pageSize > 50) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfileAchievementProgress, must be smaller than or equal to 50.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getExports, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfileAchievementProgress, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/exports'; + $resourcePath = '/v1/applications/{applicationId}/achievement_progress/{integrationId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -29385,28 +29806,37 @@ protected function getExportsRequest($pageSize = 1000, $skip = null, $applicatio $queryParams['skip'] = $skip; } // query params - if (is_array($applicationId)) { - $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); - } - if ($applicationId !== null) { - $queryParams['applicationId'] = $applicationId; - } - // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + if (is_array($achievementId)) { + $achievementId = ObjectSerializer::serializeCollection($achievementId, '', true); } - if ($campaignId !== null) { - $queryParams['campaignId'] = $campaignId; + if ($achievementId !== null) { + $queryParams['achievementId'] = $achievementId; } // query params - if (is_array($entity)) { - $entity = ObjectSerializer::serializeCollection($entity, '', true); + if (is_array($title)) { + $title = ObjectSerializer::serializeCollection($title, '', true); } - if ($entity !== null) { - $queryParams['entity'] = $entity; + if ($title !== null) { + $queryParams['title'] = $title; } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -29483,38 +29913,40 @@ protected function getExportsRequest($pageSize = 1000, $skip = null, $applicatio } /** - * Operation getLoyaltyCard + * Operation getCustomerProfiles * - * Get loyalty card + * List customer profiles * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20025 */ - public function getLoyaltyCard($loyaltyProgramId, $loyaltyCardId) + public function getCustomerProfiles($pageSize = 1000, $skip = null, $sandbox = false) { - list($response) = $this->getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); + list($response) = $this->getCustomerProfilesWithHttpInfo($pageSize, $skip, $sandbox); return $response; } /** - * Operation getLoyaltyCardWithHttpInfo + * Operation getCustomerProfilesWithHttpInfo * - * Get loyalty card + * List customer profiles * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20025, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) { - $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); try { $options = $this->createHttpClientOption(); @@ -29547,56 +29979,20 @@ public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyCard' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyCard', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20025' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20025', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $returnType = '\TalonOne\Client\Model\InlineResponse20025'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -29615,31 +30011,7 @@ public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyCard', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20025', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -29650,19 +30022,20 @@ public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) } /** - * Operation getLoyaltyCardAsync + * Operation getCustomerProfilesAsync * - * Get loyalty card + * List customer profiles * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) + public function getCustomerProfilesAsync($pageSize = 1000, $skip = null, $sandbox = false) { - return $this->getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + return $this->getCustomerProfilesAsyncWithHttpInfo($pageSize, $skip, $sandbox) ->then( function ($response) { return $response[0]; @@ -29671,20 +30044,21 @@ function ($response) { } /** - * Operation getLoyaltyCardAsyncWithHttpInfo + * Operation getCustomerProfilesAsyncWithHttpInfo * - * Get loyalty card + * List customer profiles * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function getCustomerProfilesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) { - $returnType = '\TalonOne\Client\Model\LoyaltyCard'; - $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $returnType = '\TalonOne\Client\Model\InlineResponse20025'; + $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29721,59 +30095,56 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyCard' + * Create request for operation 'getCustomerProfiles' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) + protected function getCustomerProfilesRequest($pageSize = 1000, $skip = null, $sandbox = false) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyCard' - ); - } - // verify the required parameter 'loyaltyCardId' is set - if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling getLoyaltyCard' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfiles, must be smaller than or equal to 1000.'); } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.getLoyaltyCard, must be smaller than or equal to 108.'); + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfiles, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; + $resourcePath = '/v1/customers/no_total'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - - // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - // path params - if ($loyaltyCardId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), - $resourcePath - ); + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sandbox)) { + $sandbox = ObjectSerializer::serializeCollection($sandbox, '', true); + } + if ($sandbox !== null) { + $queryParams['sandbox'] = $sandbox; } + + // body params $_tempBody = null; @@ -29849,48 +30220,42 @@ protected function getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) } /** - * Operation getLoyaltyCardTransactionLogs + * Operation getCustomersByAttributes * - * List card's transactions + * List customer profiles matching the given attributes * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20016|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20024 */ - public function getLoyaltyCardTransactionLogs($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getCustomersByAttributes($body, $pageSize = 1000, $skip = null, $sandbox = false) { - list($response) = $this->getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); + list($response) = $this->getCustomersByAttributesWithHttpInfo($body, $pageSize, $skip, $sandbox); return $response; } /** - * Operation getLoyaltyCardTransactionLogsWithHttpInfo + * Operation getCustomersByAttributesWithHttpInfo * - * List card's transactions + * List customer profiles matching the given attributes * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20016|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20024, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) { - $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); + $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); try { $options = $this->createHttpClientOption(); @@ -29923,44 +30288,20 @@ public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $lo $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20016' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20016', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20024' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20024', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + } - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\InlineResponse20016'; + $returnType = '\TalonOne\Client\Model\InlineResponse20024'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -29979,23 +30320,7 @@ public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $lo case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20016', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20024', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -30006,24 +30331,21 @@ public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $lo } /** - * Operation getLoyaltyCardTransactionLogsAsync + * Operation getCustomersByAttributesAsync * - * List card's transactions + * List customer profiles matching the given attributes * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardTransactionLogsAsync($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getCustomersByAttributesAsync($body, $pageSize = 1000, $skip = null, $sandbox = false) { - return $this->getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId) + return $this->getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize, $skip, $sandbox) ->then( function ($response) { return $response[0]; @@ -30032,25 +30354,22 @@ function ($response) { } /** - * Operation getLoyaltyCardTransactionLogsAsyncWithHttpInfo + * Operation getCustomersByAttributesAsyncWithHttpInfo * - * List card's transactions + * List customer profiles matching the given attributes * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) { - $returnType = '\TalonOne\Client\Model\InlineResponse20016'; - $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); + $returnType = '\TalonOne\Client\Model\InlineResponse20024'; + $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30087,66 +30406,39 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyCardTransactionLogs' + * Create request for operation 'getCustomersByAttributes' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param bool $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $skip = null, $sandbox = false) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyCardTransactionLogs' - ); - } - // verify the required parameter 'loyaltyCardId' is set - if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling getLoyaltyCardTransactionLogs' + 'Missing the required parameter $body when calling getCustomersByAttributes' ); } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.getLoyaltyCardTransactionLogs, must be smaller than or equal to 108.'); - } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCardTransactionLogs, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomersByAttributes, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCardTransactionLogs, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomersByAttributes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs'; + $resourcePath = '/v1/customer_search/no_total'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } - if ($startDate !== null) { - $queryParams['startDate'] = $startDate; - } - // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } - if ($endDate !== null) { - $queryParams['endDate'] = $endDate; - } // query params if (is_array($pageSize)) { $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); @@ -30162,33 +30454,20 @@ protected function getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loya $queryParams['skip'] = $skip; } // query params - if (is_array($subledgerId)) { - $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); + if (is_array($sandbox)) { + $sandbox = ObjectSerializer::serializeCollection($sandbox, '', true); } - if ($subledgerId !== null) { - $queryParams['subledgerId'] = $subledgerId; + if ($sandbox !== null) { + $queryParams['sandbox'] = $sandbox; } - // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } - // path params - if ($loyaltyCardId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -30197,7 +30476,7 @@ protected function getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loya } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -30254,7 +30533,7 @@ protected function getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loya $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -30262,46 +30541,44 @@ protected function getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loya } /** - * Operation getLoyaltyCards + * Operation getEventTypes * - * List loyalty cards + * List event types * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) + * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $identifier Optional query parameter to search cards by identifier. (optional) - * @param int $profileId Filter by the profile ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20015|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20040 */ - public function getLoyaltyCards($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getEventTypes($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); + list($response) = $this->getEventTypesWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort); return $response; } /** - * Operation getLoyaltyCardsWithHttpInfo + * Operation getEventTypesWithHttpInfo * - * List loyalty cards + * List event types * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) + * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $identifier Optional query parameter to search cards by identifier. (optional) - * @param int $profileId Filter by the profile ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20015|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20040, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); + $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -30334,44 +30611,20 @@ public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20015' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20015', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20040' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20040', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20015'; + $returnType = '\TalonOne\Client\Model\InlineResponse20040'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -30390,23 +30643,7 @@ public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20015', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20040', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -30417,23 +30654,22 @@ public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, } /** - * Operation getLoyaltyCardsAsync + * Operation getEventTypesAsync * - * List loyalty cards + * List event types * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) + * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $identifier Optional query parameter to search cards by identifier. (optional) - * @param int $profileId Filter by the profile ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardsAsync($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getEventTypesAsync($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId) + return $this->getEventTypesAsyncWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -30442,24 +30678,23 @@ function ($response) { } /** - * Operation getLoyaltyCardsAsyncWithHttpInfo + * Operation getEventTypesAsyncWithHttpInfo * - * List loyalty cards + * List event types * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) + * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $identifier Optional query parameter to search cards by identifier. (optional) - * @param int $profileId Filter by the profile ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getEventTypesAsyncWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20015'; - $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); + $returnType = '\TalonOne\Client\Model\InlineResponse20040'; + $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30496,49 +30731,48 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyCards' + * Create request for operation 'getEventTypes' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $name Filter results to event types with the given name. This parameter implies `includeOldVersions`. (optional) + * @param bool $includeOldVersions Include all versions of every event type. (optional, default to false) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $identifier Optional query parameter to search cards by identifier. (optional) - * @param int $profileId Filter by the profile ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyCardsRequest($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + protected function getEventTypesRequest($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyCards' - ); - } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCards, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getEventTypes, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCards, must be bigger than or equal to 1.'); - } - - if ($identifier !== null && strlen($identifier) < 4) { - throw new \InvalidArgumentException('invalid length for "$identifier" when calling ManagementApi.getLoyaltyCards, must be bigger than or equal to 4.'); - } - - if ($profileId !== null && $profileId < 1) { - throw new \InvalidArgumentException('invalid value for "$profileId" when calling ManagementApi.getLoyaltyCards, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getEventTypes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards'; + $resourcePath = '/v1/event_types'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } + // query params + if (is_array($includeOldVersions)) { + $includeOldVersions = ObjectSerializer::serializeCollection($includeOldVersions, '', true); + } + if ($includeOldVersions !== null) { + $queryParams['includeOldVersions'] = $includeOldVersions; + } // query params if (is_array($pageSize)) { $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); @@ -30560,30 +30794,8 @@ protected function getLoyaltyCardsRequest($loyaltyProgramId, $pageSize = 1000, $ if ($sort !== null) { $queryParams['sort'] = $sort; } - // query params - if (is_array($identifier)) { - $identifier = ObjectSerializer::serializeCollection($identifier, '', true); - } - if ($identifier !== null) { - $queryParams['identifier'] = $identifier; - } - // query params - if (is_array($profileId)) { - $profileId = ObjectSerializer::serializeCollection($profileId, '', true); - } - if ($profileId !== null) { - $queryParams['profileId'] = $profileId; - } - // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -30660,38 +30872,44 @@ protected function getLoyaltyCardsRequest($loyaltyProgramId, $pageSize = 1000, $ } /** - * Operation getLoyaltyPoints + * Operation getExports * - * Get customer's full loyalty ledger + * Get exports * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) + * @param string $entity The name of the entity type that was exported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\LoyaltyLedger + * @return \TalonOne\Client\Model\InlineResponse20043 */ - public function getLoyaltyPoints($loyaltyProgramId, $integrationId) + public function getExports($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - list($response) = $this->getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId); + list($response) = $this->getExportsWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity); return $response; } /** - * Operation getLoyaltyPointsWithHttpInfo + * Operation getExportsWithHttpInfo * - * Get customer's full loyalty ledger + * Get exports * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) + * @param string $entity The name of the entity type that was exported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\LoyaltyLedger, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20043, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) + public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - $request = $this->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); + $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); try { $options = $this->createHttpClientOption(); @@ -30724,20 +30942,20 @@ public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyLedger' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20043' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyLedger', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20043', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyLedger'; + $returnType = '\TalonOne\Client\Model\InlineResponse20043'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -30756,7 +30974,7 @@ public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyLedger', + '\TalonOne\Client\Model\InlineResponse20043', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -30767,19 +30985,22 @@ public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) } /** - * Operation getLoyaltyPointsAsync + * Operation getExportsAsync * - * Get customer's full loyalty ledger + * Get exports * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) + * @param string $entity The name of the entity type that was exported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyPointsAsync($loyaltyProgramId, $integrationId) + public function getExportsAsync($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - return $this->getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) + return $this->getExportsAsyncWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity) ->then( function ($response) { return $response[0]; @@ -30788,20 +31009,23 @@ function ($response) { } /** - * Operation getLoyaltyPointsAsyncWithHttpInfo + * Operation getExportsAsyncWithHttpInfo * - * Get customer's full loyalty ledger + * Get exports * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) + * @param string $entity The name of the entity type that was exported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) + public function getExportsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - $returnType = '\TalonOne\Client\Model\LoyaltyLedger'; - $request = $this->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); + $returnType = '\TalonOne\Client\Model\InlineResponse20043'; + $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30838,54 +31062,71 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyPoints' + * Create request for operation 'getExports' * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param int $campaignId Filter by the campaign ID on which the limit counters are used. (optional) + * @param string $entity The name of the entity type that was exported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyPointsRequest($loyaltyProgramId, $integrationId) + protected function getExportsRequest($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyPoints' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getExports, must be smaller than or equal to 1000.'); } - // verify the required parameter 'integrationId' is set - if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $integrationId when calling getLoyaltyPoints' - ); + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getExports, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}'; + + $resourcePath = '/v1/exports'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - - // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - // path params - if ($integrationId !== null) { - $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), - $resourcePath - ); + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($applicationId)) { + $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); + } + if ($applicationId !== null) { + $queryParams['applicationId'] = $applicationId; + } + // query params + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + } + if ($campaignId !== null) { + $queryParams['campaignId'] = $campaignId; + } + // query params + if (is_array($entity)) { + $entity = ObjectSerializer::serializeCollection($entity, '', true); } + if ($entity !== null) { + $queryParams['entity'] = $entity; + } + + // body params $_tempBody = null; @@ -30962,36 +31203,38 @@ protected function getLoyaltyPointsRequest($loyaltyProgramId, $integrationId) } /** - * Operation getLoyaltyProgram + * Operation getLoyaltyCard * - * Get loyalty program + * Get loyalty card * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\LoyaltyProgram + * @return \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyProgram($loyaltyProgramId) + public function getLoyaltyCard($loyaltyProgramId, $loyaltyCardId) { - list($response) = $this->getLoyaltyProgramWithHttpInfo($loyaltyProgramId); + list($response) = $this->getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); return $response; } /** - * Operation getLoyaltyProgramWithHttpInfo + * Operation getLoyaltyCardWithHttpInfo * - * Get loyalty program + * Get loyalty card * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\LoyaltyProgram, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) + public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) { - $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); + $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); try { $options = $this->createHttpClientOption(); @@ -31024,20 +31267,56 @@ public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyProgram' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyCard' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyProgram', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyCard', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -31056,7 +31335,31 @@ public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyProgram', + '\TalonOne\Client\Model\LoyaltyCard', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -31067,18 +31370,19 @@ public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) } /** - * Operation getLoyaltyProgramAsync + * Operation getLoyaltyCardAsync * - * Get loyalty program + * Get loyalty card * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramAsync($loyaltyProgramId) + public function getLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) { - return $this->getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) + return $this->getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) ->then( function ($response) { return $response[0]; @@ -31087,19 +31391,20 @@ function ($response) { } /** - * Operation getLoyaltyProgramAsyncWithHttpInfo + * Operation getLoyaltyCardAsyncWithHttpInfo * - * Get loyalty program + * Get loyalty card * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) + public function getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) { - $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; - $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31136,23 +31441,34 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyProgram' + * Create request for operation 'getLoyaltyCard' * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyProgramRequest($loyaltyProgramId) + protected function getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgram' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyCard' + ); + } + // verify the required parameter 'loyaltyCardId' is set + if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyCardId when calling getLoyaltyCard' ); } + if (strlen($loyaltyCardId) > 108) { + throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.getLoyaltyCard, must be smaller than or equal to 108.'); + } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}'; + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31169,6 +31485,14 @@ protected function getLoyaltyProgramRequest($loyaltyProgramId) $resourcePath ); } + // path params + if ($loyaltyCardId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -31245,48 +31569,48 @@ protected function getLoyaltyProgramRequest($loyaltyProgramId) } /** - * Operation getLoyaltyProgramTransactions + * Operation getLoyaltyCardTransactionLogs * - * List loyalty program transactions + * List card's transactions * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20016|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyProgramTransactions($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + public function getLoyaltyCardTransactionLogs($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - list($response) = $this->getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); + list($response) = $this->getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); return $response; } /** - * Operation getLoyaltyProgramTransactionsWithHttpInfo + * Operation getLoyaltyCardTransactionLogsWithHttpInfo * - * List loyalty program transactions + * List card's transactions * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20016|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); + $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); try { $options = $this->createHttpClientOption(); @@ -31319,26 +31643,14 @@ public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $lo $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20014' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20014', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20016' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20016', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -31368,7 +31680,7 @@ public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $lo ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20014'; + $returnType = '\TalonOne\Client\Model\InlineResponse20016'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -31387,15 +31699,7 @@ public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $lo case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20014', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20016', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -31422,24 +31726,24 @@ public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $lo } /** - * Operation getLoyaltyProgramTransactionsAsync + * Operation getLoyaltyCardTransactionLogsAsync * - * List loyalty program transactions + * List card's transactions * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramTransactionsAsync($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + public function getLoyaltyCardTransactionLogsAsync($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - return $this->getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip) + return $this->getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId) ->then( function ($response) { return $response[0]; @@ -31448,25 +31752,25 @@ function ($response) { } /** - * Operation getLoyaltyProgramTransactionsAsyncWithHttpInfo + * Operation getLoyaltyCardTransactionLogsAsyncWithHttpInfo * - * List loyalty program transactions + * List card's transactions * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + public function getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20014'; - $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); + $returnType = '\TalonOne\Client\Model\InlineResponse20016'; + $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31503,56 +31807,52 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyProgramTransactions' + * Create request for operation 'getLoyaltyCardTransactionLogs' * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) - * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyCardId Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + protected function getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgramTransactions' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyCardTransactionLogs' ); } - if ($pageSize !== null && $pageSize > 50) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyProgramTransactions, must be smaller than or equal to 50.'); + // verify the required parameter 'loyaltyCardId' is set + if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyCardId when calling getLoyaltyCardTransactionLogs' + ); + } + if (strlen($loyaltyCardId) > 108) { + throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.getLoyaltyCardTransactionLogs, must be smaller than or equal to 108.'); + } + + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCardTransactionLogs, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyProgramTransactions, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCardTransactionLogs, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/transactions'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($loyaltyTransactionType)) { - $loyaltyTransactionType = ObjectSerializer::serializeCollection($loyaltyTransactionType, '', true); - } - if ($loyaltyTransactionType !== null) { - $queryParams['loyaltyTransactionType'] = $loyaltyTransactionType; - } - // query params - if (is_array($subledgerId)) { - $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); - } - if ($subledgerId !== null) { - $queryParams['subledgerId'] = $subledgerId; - } // query params if (is_array($startDate)) { $startDate = ObjectSerializer::serializeCollection($startDate, '', true); @@ -31581,6 +31881,13 @@ protected function getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loya if ($skip !== null) { $queryParams['skip'] = $skip; } + // query params + if (is_array($subledgerId)) { + $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); + } + if ($subledgerId !== null) { + $queryParams['subledgerId'] = $subledgerId; + } // path params @@ -31591,6 +31898,14 @@ protected function getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loya $resourcePath ); } + // path params + if ($loyaltyCardId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -31667,34 +31982,48 @@ protected function getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loya } /** - * Operation getLoyaltyPrograms + * Operation getLoyaltyCards * - * List loyalty programs + * List loyalty cards * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $identifier The card code by which to filter loyalty cards in the response. (optional) + * @param int $profileId Filter results by customer profile ID. (optional) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20013 + * @return \TalonOne\Client\Model\InlineResponse20015|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyPrograms() + public function getLoyaltyCards($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null, $batchId = null) { - list($response) = $this->getLoyaltyProgramsWithHttpInfo(); + list($response) = $this->getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId, $batchId); return $response; } /** - * Operation getLoyaltyProgramsWithHttpInfo + * Operation getLoyaltyCardsWithHttpInfo * - * List loyalty programs + * List loyalty cards * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $identifier The card code by which to filter loyalty cards in the response. (optional) + * @param int $profileId Filter results by customer profile ID. (optional) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20013, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20015|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyProgramsWithHttpInfo() + public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null, $batchId = null) { - $request = $this->getLoyaltyProgramsRequest(); + $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId, $batchId); try { $options = $this->createHttpClientOption(); @@ -31727,20 +32056,44 @@ public function getLoyaltyProgramsWithHttpInfo() $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20013' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20015' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20013', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20015', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20013'; + $returnType = '\TalonOne\Client\Model\InlineResponse20015'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -31759,7 +32112,23 @@ public function getLoyaltyProgramsWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20013', + '\TalonOne\Client\Model\InlineResponse20015', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -31770,17 +32139,24 @@ public function getLoyaltyProgramsWithHttpInfo() } /** - * Operation getLoyaltyProgramsAsync + * Operation getLoyaltyCardsAsync * - * List loyalty programs + * List loyalty cards * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $identifier The card code by which to filter loyalty cards in the response. (optional) + * @param int $profileId Filter results by customer profile ID. (optional) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramsAsync() + public function getLoyaltyCardsAsync($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null, $batchId = null) { - return $this->getLoyaltyProgramsAsyncWithHttpInfo() + return $this->getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId, $batchId) ->then( function ($response) { return $response[0]; @@ -31789,18 +32165,25 @@ function ($response) { } /** - * Operation getLoyaltyProgramsAsyncWithHttpInfo + * Operation getLoyaltyCardsAsyncWithHttpInfo * - * List loyalty programs + * List loyalty cards * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $identifier The card code by which to filter loyalty cards in the response. (optional) + * @param int $profileId Filter results by customer profile ID. (optional) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramsAsyncWithHttpInfo() + public function getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null, $batchId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20013'; - $request = $this->getLoyaltyProgramsRequest(); + $returnType = '\TalonOne\Client\Model\InlineResponse20015'; + $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId, $batchId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31837,24 +32220,102 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyPrograms' + * Create request for operation 'getLoyaltyCards' * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $identifier The card code by which to filter loyalty cards in the response. (optional) + * @param int $profileId Filter results by customer profile ID. (optional) + * @param string $batchId Filter results by loyalty card batch ID. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyProgramsRequest() + protected function getLoyaltyCardsRequest($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null, $batchId = null) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyCards' + ); + } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCards, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyCards, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/loyalty_programs'; + if ($identifier !== null && strlen($identifier) < 4) { + throw new \InvalidArgumentException('invalid length for "$identifier" when calling ManagementApi.getLoyaltyCards, must be bigger than or equal to 4.'); + } + + if ($profileId !== null && $profileId < 1) { + throw new \InvalidArgumentException('invalid value for "$profileId" when calling ManagementApi.getLoyaltyCards, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($identifier)) { + $identifier = ObjectSerializer::serializeCollection($identifier, '', true); + } + if ($identifier !== null) { + $queryParams['identifier'] = $identifier; + } + // query params + if (is_array($profileId)) { + $profileId = ObjectSerializer::serializeCollection($profileId, '', true); + } + if ($profileId !== null) { + $queryParams['profileId'] = $profileId; + } + // query params + if (is_array($batchId)) { + $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + } + if ($batchId !== null) { + $queryParams['batchId'] = $batchId; + } + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -31931,36 +32392,38 @@ protected function getLoyaltyProgramsRequest() } /** - * Operation getLoyaltyStatistics + * Operation getLoyaltyPoints * - * Get loyalty program statistics + * Get customer's full loyalty ledger * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\LoyaltyDashboardData + * @return \TalonOne\Client\Model\LoyaltyLedger */ - public function getLoyaltyStatistics($loyaltyProgramId) + public function getLoyaltyPoints($loyaltyProgramId, $integrationId) { - list($response) = $this->getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId); + list($response) = $this->getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId); return $response; } /** - * Operation getLoyaltyStatisticsWithHttpInfo + * Operation getLoyaltyPointsWithHttpInfo * - * Get loyalty program statistics + * Get customer's full loyalty ledger * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\LoyaltyDashboardData, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\LoyaltyLedger, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) + public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) { - $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); + $request = $this->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); try { $options = $this->createHttpClientOption(); @@ -31993,20 +32456,20 @@ public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyDashboardData' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyLedger' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyDashboardData', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyLedger', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyDashboardData'; + $returnType = '\TalonOne\Client\Model\LoyaltyLedger'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -32025,7 +32488,7 @@ public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyDashboardData', + '\TalonOne\Client\Model\LoyaltyLedger', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -32036,18 +32499,19 @@ public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) } /** - * Operation getLoyaltyStatisticsAsync + * Operation getLoyaltyPointsAsync * - * Get loyalty program statistics + * Get customer's full loyalty ledger * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyStatisticsAsync($loyaltyProgramId) + public function getLoyaltyPointsAsync($loyaltyProgramId, $integrationId) { - return $this->getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) + return $this->getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) ->then( function ($response) { return $response[0]; @@ -32056,19 +32520,20 @@ function ($response) { } /** - * Operation getLoyaltyStatisticsAsyncWithHttpInfo + * Operation getLoyaltyPointsAsyncWithHttpInfo * - * Get loyalty program statistics + * Get customer's full loyalty ledger * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) + public function getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) { - $returnType = '\TalonOne\Client\Model\LoyaltyDashboardData'; - $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); + $returnType = '\TalonOne\Client\Model\LoyaltyLedger'; + $request = $this->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32105,23 +32570,30 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyStatistics' + * Create request for operation 'getLoyaltyPoints' * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyStatisticsRequest($loyaltyProgramId) + protected function getLoyaltyPointsRequest($loyaltyProgramId, $integrationId) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyStatistics' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyPoints' + ); + } + // verify the required parameter 'integrationId' is set + if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $integrationId when calling getLoyaltyPoints' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/statistics'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32138,6 +32610,14 @@ protected function getLoyaltyStatisticsRequest($loyaltyProgramId) $resourcePath ); } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -32214,56 +32694,36 @@ protected function getLoyaltyStatisticsRequest($loyaltyProgramId) } /** - * Operation getReferralsWithoutTotalCount + * Operation getLoyaltyProgram * - * List referrals + * Get loyalty program * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) - * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20010 + * @return \TalonOne\Client\Model\LoyaltyProgram */ - public function getReferralsWithoutTotalCount($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) + public function getLoyaltyProgram($loyaltyProgramId) { - list($response) = $this->getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); + list($response) = $this->getLoyaltyProgramWithHttpInfo($loyaltyProgramId); return $response; } /** - * Operation getReferralsWithoutTotalCountWithHttpInfo + * Operation getLoyaltyProgramWithHttpInfo * - * List referrals + * Get loyalty program * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) - * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20010, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\LoyaltyProgram, HTTP status code, HTTP response headers (array of strings) */ - public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) + public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) { - $request = $this->getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); + $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); try { $options = $this->createHttpClientOption(); @@ -32296,20 +32756,20 @@ public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campa $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20010' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyProgram' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20010', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyProgram', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20010'; + $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -32328,7 +32788,7 @@ public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20010', + '\TalonOne\Client\Model\LoyaltyProgram', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -32339,28 +32799,18 @@ public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campa } /** - * Operation getReferralsWithoutTotalCountAsync + * Operation getLoyaltyProgramAsync * - * List referrals + * Get loyalty program * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) - * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReferralsWithoutTotalCountAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) + public function getLoyaltyProgramAsync($loyaltyProgramId) { - return $this->getReferralsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate) + return $this->getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) ->then( function ($response) { return $response[0]; @@ -32369,29 +32819,19 @@ function ($response) { } /** - * Operation getReferralsWithoutTotalCountAsyncWithHttpInfo + * Operation getLoyaltyProgramAsyncWithHttpInfo * - * List referrals + * Get loyalty program * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) - * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReferralsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) + public function getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20010'; - $request = $this->getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); + $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; + $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32428,130 +32868,36 @@ function ($exception) { } /** - * Create request for operation 'getReferralsWithoutTotalCount' + * Create request for operation 'getLoyaltyProgram' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) - * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) - * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) - * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) + protected function getLoyaltyProgramRequest($loyaltyProgramId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getReferralsWithoutTotalCount' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getReferralsWithoutTotalCount' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgram' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getReferralsWithoutTotalCount, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getReferralsWithoutTotalCount, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($code)) { - $code = ObjectSerializer::serializeCollection($code, '', true); - } - if ($code !== null) { - $queryParams['code'] = $code; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($valid)) { - $valid = ObjectSerializer::serializeCollection($valid, '', true); - } - if ($valid !== null) { - $queryParams['valid'] = $valid; - } - // query params - if (is_array($usable)) { - $usable = ObjectSerializer::serializeCollection($usable, '', true); - } - if ($usable !== null) { - $queryParams['usable'] = $usable; - } - // query params - if (is_array($advocate)) { - $advocate = ObjectSerializer::serializeCollection($advocate, '', true); - } - if ($advocate !== null) { - $queryParams['advocate'] = $advocate; - } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -32631,36 +32977,48 @@ protected function getReferralsWithoutTotalCountRequest($applicationId, $campaig } /** - * Operation getRoleV2 + * Operation getLoyaltyProgramTransactions * - * Get role + * List loyalty program transactions * - * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\RoleV2 + * @return \TalonOne\Client\Model\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getRoleV2($roleId) + public function getLoyaltyProgramTransactions($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - list($response) = $this->getRoleV2WithHttpInfo($roleId); + list($response) = $this->getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); return $response; } /** - * Operation getRoleV2WithHttpInfo + * Operation getLoyaltyProgramTransactionsWithHttpInfo * - * Get role + * List loyalty program transactions * - * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\RoleV2, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getRoleV2WithHttpInfo($roleId) + public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - $request = $this->getRoleV2Request($roleId); + $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); try { $options = $this->createHttpClientOption(); @@ -32693,20 +33051,56 @@ public function getRoleV2WithHttpInfo($roleId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\RoleV2' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20014' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\RoleV2', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20014', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\RoleV2'; + $returnType = '\TalonOne\Client\Model\InlineResponse20014'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -32725,7 +33119,31 @@ public function getRoleV2WithHttpInfo($roleId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\RoleV2', + '\TalonOne\Client\Model\InlineResponse20014', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -32736,18 +33154,24 @@ public function getRoleV2WithHttpInfo($roleId) } /** - * Operation getRoleV2Async + * Operation getLoyaltyProgramTransactionsAsync * - * Get role + * List loyalty program transactions * - * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRoleV2Async($roleId) + public function getLoyaltyProgramTransactionsAsync($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - return $this->getRoleV2AsyncWithHttpInfo($roleId) + return $this->getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip) ->then( function ($response) { return $response[0]; @@ -32756,19 +33180,25 @@ function ($response) { } /** - * Operation getRoleV2AsyncWithHttpInfo + * Operation getLoyaltyProgramTransactionsAsyncWithHttpInfo * - * Get role + * List loyalty program transactions * - * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRoleV2AsyncWithHttpInfo($roleId) + public function getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - $returnType = '\TalonOne\Client\Model\RoleV2'; - $request = $this->getRoleV2Request($roleId); + $returnType = '\TalonOne\Client\Model\InlineResponse20014'; + $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32805,36 +33235,91 @@ function ($exception) { } /** - * Create request for operation 'getRoleV2' + * Create request for operation 'getLoyaltyProgramTransactions' * - * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $loyaltyTransactionType Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param \DateTime $startDate Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param \DateTime $endDate Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getRoleV2Request($roleId) + protected function getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - // verify the required parameter 'roleId' is set - if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $roleId when calling getRoleV2' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgramTransactions' ); } + if ($pageSize !== null && $pageSize > 50) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyProgramTransactions, must be smaller than or equal to 50.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyProgramTransactions, must be bigger than or equal to 1.'); + } - $resourcePath = '/v2/roles/{roleId}'; + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/transactions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($loyaltyTransactionType)) { + $loyaltyTransactionType = ObjectSerializer::serializeCollection($loyaltyTransactionType, '', true); + } + if ($loyaltyTransactionType !== null) { + $queryParams['loyaltyTransactionType'] = $loyaltyTransactionType; + } + // query params + if (is_array($subledgerId)) { + $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); + } + if ($subledgerId !== null) { + $queryParams['subledgerId'] = $subledgerId; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } // path params - if ($roleId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'roleId' . '}', - ObjectSerializer::toPathValue($roleId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -32914,40 +33399,34 @@ protected function getRoleV2Request($roleId) } /** - * Operation getRuleset + * Operation getLoyaltyPrograms * - * Get ruleset + * List loyalty programs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $rulesetId The ID of the ruleset. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Ruleset + * @return \TalonOne\Client\Model\InlineResponse20013 */ - public function getRuleset($applicationId, $campaignId, $rulesetId) + public function getLoyaltyPrograms() { - list($response) = $this->getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId); + list($response) = $this->getLoyaltyProgramsWithHttpInfo(); return $response; } /** - * Operation getRulesetWithHttpInfo + * Operation getLoyaltyProgramsWithHttpInfo * - * Get ruleset + * List loyalty programs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $rulesetId The ID of the ruleset. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Ruleset, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20013, HTTP status code, HTTP response headers (array of strings) */ - public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) + public function getLoyaltyProgramsWithHttpInfo() { - $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); + $request = $this->getLoyaltyProgramsRequest(); try { $options = $this->createHttpClientOption(); @@ -32980,20 +33459,20 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Ruleset' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20013' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Ruleset', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20013', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Ruleset'; + $returnType = '\TalonOne\Client\Model\InlineResponse20013'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -33012,7 +33491,7 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Ruleset', + '\TalonOne\Client\Model\InlineResponse20013', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33023,20 +33502,17 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) } /** - * Operation getRulesetAsync + * Operation getLoyaltyProgramsAsync * - * Get ruleset + * List loyalty programs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $rulesetId The ID of the ruleset. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRulesetAsync($applicationId, $campaignId, $rulesetId) + public function getLoyaltyProgramsAsync() { - return $this->getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) + return $this->getLoyaltyProgramsAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -33045,21 +33521,18 @@ function ($response) { } /** - * Operation getRulesetAsyncWithHttpInfo + * Operation getLoyaltyProgramsAsyncWithHttpInfo * - * Get ruleset + * List loyalty programs * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $rulesetId The ID of the ruleset. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) + public function getLoyaltyProgramsAsyncWithHttpInfo() { - $returnType = '\TalonOne\Client\Model\Ruleset'; - $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); + $returnType = '\TalonOne\Client\Model\InlineResponse20013'; + $request = $this->getLoyaltyProgramsRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33096,37 +33569,16 @@ function ($exception) { } /** - * Create request for operation 'getRuleset' + * Create request for operation 'getLoyaltyPrograms' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $rulesetId The ID of the ruleset. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) + protected function getLoyaltyProgramsRequest() { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getRuleset' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getRuleset' - ); - } - // verify the required parameter 'rulesetId' is set - if ($rulesetId === null || (is_array($rulesetId) && count($rulesetId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $rulesetId when calling getRuleset' - ); - } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'; + $resourcePath = '/v1/loyalty_programs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -33135,30 +33587,6 @@ protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } - // path params - if ($rulesetId !== null) { - $resourcePath = str_replace( - '{' . 'rulesetId' . '}', - ObjectSerializer::toPathValue($rulesetId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -33235,44 +33663,36 @@ protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) } /** - * Operation getRulesets + * Operation getLoyaltyStatistics * - * List campaign rulesets + * Get loyalty program statistics * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2007 + * @return \TalonOne\Client\Model\LoyaltyDashboardData */ - public function getRulesets($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyStatistics($loyaltyProgramId) { - list($response) = $this->getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort); + list($response) = $this->getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId); return $response; } /** - * Operation getRulesetsWithHttpInfo + * Operation getLoyaltyStatisticsWithHttpInfo * - * List campaign rulesets + * Get loyalty program statistics * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse2007, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\LoyaltyDashboardData, HTTP status code, HTTP response headers (array of strings) */ - public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) { - $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); + $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); try { $options = $this->createHttpClientOption(); @@ -33305,20 +33725,20 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2007' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyDashboardData' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2007', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyDashboardData', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2007'; + $returnType = '\TalonOne\Client\Model\LoyaltyDashboardData'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -33337,7 +33757,7 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2007', + '\TalonOne\Client\Model\LoyaltyDashboardData', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33348,22 +33768,18 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = } /** - * Operation getRulesetsAsync + * Operation getLoyaltyStatisticsAsync * - * List campaign rulesets + * Get loyalty program statistics * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRulesetsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyStatisticsAsync($loyaltyProgramId) { - return $this->getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort) + return $this->getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) ->then( function ($response) { return $response[0]; @@ -33372,23 +33788,19 @@ function ($response) { } /** - * Operation getRulesetsAsyncWithHttpInfo + * Operation getLoyaltyStatisticsAsyncWithHttpInfo * - * List campaign rulesets + * Get loyalty program statistics * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) { - $returnType = '\TalonOne\Client\Model\InlineResponse2007'; - $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\LoyaltyDashboardData'; + $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33425,82 +33837,36 @@ function ($exception) { } /** - * Create request for operation 'getRulesets' + * Create request for operation 'getLoyaltyStatistics' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getRulesetsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + protected function getLoyaltyStatisticsRequest($loyaltyProgramId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getRulesets' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getRulesets' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyStatistics' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/statistics'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -33580,38 +33946,56 @@ protected function getRulesetsRequest($applicationId, $campaignId, $pageSize = 1 } /** - * Operation getStore + * Operation getReferralsWithoutTotalCount * - * Get store + * List referrals * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) + * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20010 */ - public function getStore($applicationId, $storeId) + public function getReferralsWithoutTotalCount($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) { - list($response) = $this->getStoreWithHttpInfo($applicationId, $storeId); + list($response) = $this->getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); return $response; } /** - * Operation getStoreWithHttpInfo + * Operation getReferralsWithoutTotalCountWithHttpInfo * - * Get store + * List referrals * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) + * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20010, HTTP status code, HTTP response headers (array of strings) */ - public function getStoreWithHttpInfo($applicationId, $storeId) + public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) { - $request = $this->getStoreRequest($applicationId, $storeId); + $request = $this->getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); try { $options = $this->createHttpClientOption(); @@ -33644,32 +34028,20 @@ public function getStoreWithHttpInfo($applicationId, $storeId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Store' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Store', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20010' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20010', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Store'; + $returnType = '\TalonOne\Client\Model\InlineResponse20010'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -33688,15 +34060,7 @@ public function getStoreWithHttpInfo($applicationId, $storeId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Store', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20010', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33707,19 +34071,28 @@ public function getStoreWithHttpInfo($applicationId, $storeId) } /** - * Operation getStoreAsync + * Operation getReferralsWithoutTotalCountAsync * - * Get store + * List referrals * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) + * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStoreAsync($applicationId, $storeId) + public function getReferralsWithoutTotalCountAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) { - return $this->getStoreAsyncWithHttpInfo($applicationId, $storeId) + return $this->getReferralsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate) ->then( function ($response) { return $response[0]; @@ -33728,20 +34101,29 @@ function ($response) { } /** - * Operation getStoreAsyncWithHttpInfo + * Operation getReferralsWithoutTotalCountAsyncWithHttpInfo * - * Get store + * List referrals * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) + * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStoreAsyncWithHttpInfo($applicationId, $storeId) + public function getReferralsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) { - $returnType = '\TalonOne\Client\Model\Store'; - $request = $this->getStoreRequest($applicationId, $storeId); + $returnType = '\TalonOne\Client\Model\InlineResponse20010'; + $request = $this->getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33778,36 +34160,115 @@ function ($exception) { } /** - * Create request for operation 'getStore' + * Create request for operation 'getReferralsWithoutTotalCount' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. (optional) + * @param \DateTime $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param string $valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration date is null or in the future, the third matches referrals in which start date is set and in the future. (optional) + * @param string $usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. (optional) + * @param string $advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getStoreRequest($applicationId, $storeId) + protected function getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $code = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $advocate = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getStore' + 'Missing the required parameter $applicationId when calling getReferralsWithoutTotalCount' ); } - // verify the required parameter 'storeId' is set - if ($storeId === null || (is_array($storeId) && count($storeId) === 0)) { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $storeId when calling getStore' + 'Missing the required parameter $campaignId when calling getReferralsWithoutTotalCount' ); } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getReferralsWithoutTotalCount, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getReferralsWithoutTotalCount, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($code)) { + $code = ObjectSerializer::serializeCollection($code, '', true); + } + if ($code !== null) { + $queryParams['code'] = $code; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + // query params + if (is_array($valid)) { + $valid = ObjectSerializer::serializeCollection($valid, '', true); + } + if ($valid !== null) { + $queryParams['valid'] = $valid; + } + // query params + if (is_array($usable)) { + $usable = ObjectSerializer::serializeCollection($usable, '', true); + } + if ($usable !== null) { + $queryParams['usable'] = $usable; + } + // query params + if (is_array($advocate)) { + $advocate = ObjectSerializer::serializeCollection($advocate, '', true); + } + if ($advocate !== null) { + $queryParams['advocate'] = $advocate; + } // path params @@ -33819,10 +34280,10 @@ protected function getStoreRequest($applicationId, $storeId) ); } // path params - if ($storeId !== null) { + if ($campaignId !== null) { $resourcePath = str_replace( - '{' . 'storeId' . '}', - ObjectSerializer::toPathValue($storeId), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -33902,36 +34363,36 @@ protected function getStoreRequest($applicationId, $storeId) } /** - * Operation getUser + * Operation getRoleV2 * - * Get user + * Get role * - * @param int $userId The ID of the user. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\User + * @return \TalonOne\Client\Model\RoleV2 */ - public function getUser($userId) + public function getRoleV2($roleId) { - list($response) = $this->getUserWithHttpInfo($userId); + list($response) = $this->getRoleV2WithHttpInfo($roleId); return $response; } /** - * Operation getUserWithHttpInfo + * Operation getRoleV2WithHttpInfo * - * Get user + * Get role * - * @param int $userId The ID of the user. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\User, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\RoleV2, HTTP status code, HTTP response headers (array of strings) */ - public function getUserWithHttpInfo($userId) + public function getRoleV2WithHttpInfo($roleId) { - $request = $this->getUserRequest($userId); + $request = $this->getRoleV2Request($roleId); try { $options = $this->createHttpClientOption(); @@ -33964,20 +34425,20 @@ public function getUserWithHttpInfo($userId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\User' === '\SplFileObject') { + if ('\TalonOne\Client\Model\RoleV2' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\User', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\RoleV2', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\User'; + $returnType = '\TalonOne\Client\Model\RoleV2'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -33996,7 +34457,7 @@ public function getUserWithHttpInfo($userId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\User', + '\TalonOne\Client\Model\RoleV2', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34007,18 +34468,18 @@ public function getUserWithHttpInfo($userId) } /** - * Operation getUserAsync + * Operation getRoleV2Async * - * Get user + * Get role * - * @param int $userId The ID of the user. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserAsync($userId) + public function getRoleV2Async($roleId) { - return $this->getUserAsyncWithHttpInfo($userId) + return $this->getRoleV2AsyncWithHttpInfo($roleId) ->then( function ($response) { return $response[0]; @@ -34027,19 +34488,19 @@ function ($response) { } /** - * Operation getUserAsyncWithHttpInfo + * Operation getRoleV2AsyncWithHttpInfo * - * Get user + * Get role * - * @param int $userId The ID of the user. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserAsyncWithHttpInfo($userId) + public function getRoleV2AsyncWithHttpInfo($roleId) { - $returnType = '\TalonOne\Client\Model\User'; - $request = $this->getUserRequest($userId); + $returnType = '\TalonOne\Client\Model\RoleV2'; + $request = $this->getRoleV2Request($roleId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34076,23 +34537,23 @@ function ($exception) { } /** - * Create request for operation 'getUser' + * Create request for operation 'getRoleV2' * - * @param int $userId The ID of the user. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getUserRequest($userId) + protected function getRoleV2Request($roleId) { - // verify the required parameter 'userId' is set - if ($userId === null || (is_array($userId) && count($userId) === 0)) { + // verify the required parameter 'roleId' is set + if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $userId when calling getUser' + 'Missing the required parameter $roleId when calling getRoleV2' ); } - $resourcePath = '/v1/users/{userId}'; + $resourcePath = '/v2/roles/{roleId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -34102,10 +34563,10 @@ protected function getUserRequest($userId) // path params - if ($userId !== null) { + if ($roleId !== null) { $resourcePath = str_replace( - '{' . 'userId' . '}', - ObjectSerializer::toPathValue($userId), + '{' . 'roleId' . '}', + ObjectSerializer::toPathValue($roleId), $resourcePath ); } @@ -34185,40 +34646,40 @@ protected function getUserRequest($userId) } /** - * Operation getUsers + * Operation getRuleset * - * List users in account + * Get ruleset * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $rulesetId The ID of the ruleset. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20041 + * @return \TalonOne\Client\Model\Ruleset */ - public function getUsers($pageSize = 1000, $skip = null, $sort = null) + public function getRuleset($applicationId, $campaignId, $rulesetId) { - list($response) = $this->getUsersWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId); return $response; } /** - * Operation getUsersWithHttpInfo + * Operation getRulesetWithHttpInfo * - * List users in account + * Get ruleset * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $rulesetId The ID of the ruleset. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20041, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Ruleset, HTTP status code, HTTP response headers (array of strings) */ - public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) { - $request = $this->getUsersRequest($pageSize, $skip, $sort); + $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); try { $options = $this->createHttpClientOption(); @@ -34251,20 +34712,20 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20041' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Ruleset' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20041', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Ruleset', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20041'; + $returnType = '\TalonOne\Client\Model\Ruleset'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34283,7 +34744,7 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20041', + '\TalonOne\Client\Model\Ruleset', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34294,20 +34755,20 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul } /** - * Operation getUsersAsync + * Operation getRulesetAsync * - * List users in account + * Get ruleset * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $rulesetId The ID of the ruleset. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUsersAsync($pageSize = 1000, $skip = null, $sort = null) + public function getRulesetAsync($applicationId, $campaignId, $rulesetId) { - return $this->getUsersAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) ->then( function ($response) { return $response[0]; @@ -34316,21 +34777,21 @@ function ($response) { } /** - * Operation getUsersAsyncWithHttpInfo + * Operation getRulesetAsyncWithHttpInfo * - * List users in account + * Get ruleset * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $rulesetId The ID of the ruleset. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUsersAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20041'; - $request = $this->getUsersRequest($pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\Ruleset'; + $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34367,56 +34828,70 @@ function ($exception) { } /** - * Create request for operation 'getUsers' + * Create request for operation 'getRuleset' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $rulesetId The ID of the ruleset. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) + protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getUsers, must be smaller than or equal to 1000.'); + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getRuleset' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getUsers, must be bigger than or equal to 1.'); + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getRuleset' + ); + } + // verify the required parameter 'rulesetId' is set + if ($rulesetId === null || (is_array($rulesetId) && count($rulesetId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rulesetId when calling getRuleset' + ); } - - $resourcePath = '/v1/users'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); } - if ($sort !== null) { - $queryParams['sort'] = $sort; + // path params + if ($rulesetId !== null) { + $resourcePath = str_replace( + '{' . 'rulesetId' . '}', + ObjectSerializer::toPathValue($rulesetId), + $resourcePath + ); } - - // body params $_tempBody = null; @@ -34492,36 +34967,44 @@ protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) } /** - * Operation getWebhook + * Operation getRulesets * - * Get webhook + * List campaign rulesets * - * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Webhook + * @return \TalonOne\Client\Model\InlineResponse2007 */ - public function getWebhook($webhookId) + public function getRulesets($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getWebhookWithHttpInfo($webhookId); + list($response) = $this->getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort); return $response; } /** - * Operation getWebhookWithHttpInfo + * Operation getRulesetsWithHttpInfo * - * Get webhook + * List campaign rulesets * - * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Webhook, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse2007, HTTP status code, HTTP response headers (array of strings) */ - public function getWebhookWithHttpInfo($webhookId) + public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getWebhookRequest($webhookId); + $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -34554,20 +35037,20 @@ public function getWebhookWithHttpInfo($webhookId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Webhook' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2007' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Webhook', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2007', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Webhook'; + $returnType = '\TalonOne\Client\Model\InlineResponse2007'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34586,7 +35069,7 @@ public function getWebhookWithHttpInfo($webhookId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Webhook', + '\TalonOne\Client\Model\InlineResponse2007', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34597,18 +35080,22 @@ public function getWebhookWithHttpInfo($webhookId) } /** - * Operation getWebhookAsync + * Operation getRulesetsAsync * - * Get webhook + * List campaign rulesets * - * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhookAsync($webhookId) + public function getRulesetsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getWebhookAsyncWithHttpInfo($webhookId) + return $this->getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -34617,19 +35104,23 @@ function ($response) { } /** - * Operation getWebhookAsyncWithHttpInfo + * Operation getRulesetsAsyncWithHttpInfo * - * Get webhook + * List campaign rulesets * - * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhookAsyncWithHttpInfo($webhookId) + public function getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\Webhook'; - $request = $this->getWebhookRequest($webhookId); + $returnType = '\TalonOne\Client\Model\InlineResponse2007'; + $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34666,36 +35157,82 @@ function ($exception) { } /** - * Create request for operation 'getWebhook' + * Create request for operation 'getRulesets' * - * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getWebhookRequest($webhookId) + protected function getRulesetsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'webhookId' is set - if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $webhookId when calling getWebhook' + 'Missing the required parameter $applicationId when calling getRulesets' ); } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getRulesets' + ); + } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/webhooks/{webhookId}'; + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } // path params - if ($webhookId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'webhookId' . '}', - ObjectSerializer::toPathValue($webhookId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -34775,52 +35312,38 @@ protected function getWebhookRequest($webhookId) } /** - * Operation getWebhookActivationLogs + * Operation getStore * - * List webhook activation log entries + * Get store * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20038 + * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getWebhookActivationLogs($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + public function getStore($applicationId, $storeId) { - list($response) = $this->getWebhookActivationLogsWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + list($response) = $this->getStoreWithHttpInfo($applicationId, $storeId); return $response; } /** - * Operation getWebhookActivationLogsWithHttpInfo + * Operation getStoreWithHttpInfo * - * List webhook activation log entries + * Get store * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20038, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + public function getStoreWithHttpInfo($applicationId, $storeId) { - $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + $request = $this->getStoreRequest($applicationId, $storeId); try { $options = $this->createHttpClientOption(); @@ -34853,20 +35376,32 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20038' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Store' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20038', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Store', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20038'; + $returnType = '\TalonOne\Client\Model\Store'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34885,7 +35420,15 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20038', + '\TalonOne\Client\Model\Store', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34896,26 +35439,19 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n } /** - * Operation getWebhookActivationLogsAsync + * Operation getStoreAsync * - * List webhook activation log entries + * Get store * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhookActivationLogsAsync($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + public function getStoreAsync($applicationId, $storeId) { - return $this->getWebhookActivationLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) + return $this->getStoreAsyncWithHttpInfo($applicationId, $storeId) ->then( function ($response) { return $response[0]; @@ -34924,27 +35460,20 @@ function ($response) { } /** - * Operation getWebhookActivationLogsAsyncWithHttpInfo + * Operation getStoreAsyncWithHttpInfo * - * List webhook activation log entries + * Get store * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhookActivationLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + public function getStoreAsyncWithHttpInfo($applicationId, $storeId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20038'; - $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + $returnType = '\TalonOne\Client\Model\Store'; + $request = $this->getStoreRequest($applicationId, $storeId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34981,104 +35510,55 @@ function ($exception) { } /** - * Create request for operation 'getWebhookActivationLogs' + * Create request for operation 'getStore' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param string $storeId The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + protected function getStoreRequest($applicationId, $storeId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be smaller than or equal to 1000.'); + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getStore' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be bigger than or equal to 1.'); + // verify the required parameter 'storeId' is set + if ($storeId === null || (is_array($storeId) && count($storeId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $storeId when calling getStore' + ); } - - $resourcePath = '/v1/webhook_activation_logs'; + $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($integrationRequestUuid)) { - $integrationRequestUuid = ObjectSerializer::serializeCollection($integrationRequestUuid, '', true); - } - if ($integrationRequestUuid !== null) { - $queryParams['integrationRequestUuid'] = $integrationRequestUuid; - } - // query params - if (is_array($webhookId)) { - $webhookId = ObjectSerializer::serializeCollection($webhookId, '', true); - } - if ($webhookId !== null) { - $queryParams['webhookId'] = $webhookId; - } - // query params - if (is_array($applicationId)) { - $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); - } + + + // path params if ($applicationId !== null) { - $queryParams['applicationId'] = $applicationId; - } - // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); - } - if ($campaignId !== null) { - $queryParams['campaignId'] = $campaignId; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; + // path params + if ($storeId !== null) { + $resourcePath = str_replace( + '{' . 'storeId' . '}', + ObjectSerializer::toPathValue($storeId), + $resourcePath + ); } - - // body params $_tempBody = null; @@ -35154,54 +35634,36 @@ protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = nul } /** - * Operation getWebhookLogs + * Operation getUser * - * List webhook log entries + * Get user * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20039 + * @return \TalonOne\Client\Model\User */ - public function getWebhookLogs($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function getUser($userId) { - list($response) = $this->getWebhookLogsWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + list($response) = $this->getUserWithHttpInfo($userId); return $response; } /** - * Operation getWebhookLogsWithHttpInfo + * Operation getUserWithHttpInfo * - * List webhook log entries + * Get user * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20039, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ - public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function getUserWithHttpInfo($userId) { - $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + $request = $this->getUserRequest($userId); try { $options = $this->createHttpClientOption(); @@ -35234,20 +35696,20 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20039' === '\SplFileObject') { + if ('\TalonOne\Client\Model\User' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20039', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\User', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20039'; + $returnType = '\TalonOne\Client\Model\User'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -35266,7 +35728,7 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20039', + '\TalonOne\Client\Model\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -35277,27 +35739,18 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort } /** - * Operation getWebhookLogsAsync + * Operation getUserAsync * - * List webhook log entries + * Get user * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhookLogsAsync($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function getUserAsync($userId) { - return $this->getWebhookLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) + return $this->getUserAsyncWithHttpInfo($userId) ->then( function ($response) { return $response[0]; @@ -35306,28 +35759,19 @@ function ($response) { } /** - * Operation getWebhookLogsAsyncWithHttpInfo + * Operation getUserAsyncWithHttpInfo * - * List webhook log entries + * Get user * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhookLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function getUserAsyncWithHttpInfo($userId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20039'; - $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + $returnType = '\TalonOne\Client\Model\User'; + $request = $this->getUserRequest($userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35364,111 +35808,39 @@ function ($exception) { } /** - * Create request for operation 'getWebhookLogs' + * Create request for operation 'getUser' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + protected function getUserRequest($userId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be bigger than or equal to 1.'); + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $userId when calling getUser' + ); } - - $resourcePath = '/v1/webhook_logs'; + $resourcePath = '/v1/users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($status)) { - $status = ObjectSerializer::serializeCollection($status, '', true); - } - if ($status !== null) { - $queryParams['status'] = $status; - } - // query params - if (is_array($webhookId)) { - $webhookId = ObjectSerializer::serializeCollection($webhookId, '', true); - } - if ($webhookId !== null) { - $queryParams['webhookId'] = $webhookId; - } - // query params - if (is_array($applicationId)) { - $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); - } - if ($applicationId !== null) { - $queryParams['applicationId'] = $applicationId; - } - // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); - } - if ($campaignId !== null) { - $queryParams['campaignId'] = $campaignId; - } - // query params - if (is_array($requestUuid)) { - $requestUuid = ObjectSerializer::serializeCollection($requestUuid, '', true); - } - if ($requestUuid !== null) { - $queryParams['requestUuid'] = $requestUuid; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -35545,50 +35917,40 @@ protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = } /** - * Operation getWebhooks + * Operation getUsers * - * List webhooks + * List users in account * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20037 + * @return \TalonOne\Client\Model\InlineResponse20041 */ - public function getWebhooks($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function getUsers($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getWebhooksWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + list($response) = $this->getUsersWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getWebhooksWithHttpInfo + * Operation getUsersWithHttpInfo * - * List webhooks + * List users in account * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20037, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20041, HTTP status code, HTTP response headers (array of strings) */ - public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + $request = $this->getUsersRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -35621,20 +35983,20 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20037' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20041' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20037', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20041', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20037'; + $returnType = '\TalonOne\Client\Model\InlineResponse20041'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -35653,7 +36015,7 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20037', + '\TalonOne\Client\Model\InlineResponse20041', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -35664,25 +36026,20 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p } /** - * Operation getWebhooksAsync + * Operation getUsersAsync * - * List webhooks + * List users in account * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhooksAsync($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function getUsersAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getWebhooksAsyncWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) + return $this->getUsersAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -35691,26 +36048,21 @@ function ($response) { } /** - * Operation getWebhooksAsyncWithHttpInfo + * Operation getUsersAsyncWithHttpInfo * - * List webhooks + * List users in account * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWebhooksAsyncWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function getUsersAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20037'; - $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + $returnType = '\TalonOne\Client\Model\InlineResponse20041'; + $request = $this->getUsersRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35747,31 +36099,26 @@ function ($exception) { } /** - * Create request for operation 'getWebhooks' + * Create request for operation 'getUsers' * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getWebhooksRequest($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) { if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhooks, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getUsers, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhooks, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getUsers, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/webhooks'; + $resourcePath = '/v1/users'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35779,25 +36126,11 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag $multipart = false; // query params - if (is_array($applicationIds)) { - $applicationIds = ObjectSerializer::serializeCollection($applicationIds, '', true); + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - if ($applicationIds !== null) { - $queryParams['applicationIds'] = $applicationIds; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; } // query params if (is_array($skip)) { @@ -35807,36 +36140,298 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag $queryParams['skip'] = $skip; } // query params - if (is_array($creationType)) { - $creationType = ObjectSerializer::serializeCollection($creationType, '', true); + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($creationType !== null) { - $queryParams['creationType'] = $creationType; + if ($sort !== null) { + $queryParams['sort'] = $sort; } - // query params - if (is_array($visibility)) { - $visibility = ObjectSerializer::serializeCollection($visibility, '', true); + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); } - if ($visibility !== null) { - $queryParams['visibility'] = $visibility; + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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); + } } - // query params - if (is_array($outgoingIntegrationsTypeId)) { - $outgoingIntegrationsTypeId = ObjectSerializer::serializeCollection($outgoingIntegrationsTypeId, '', true); + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; } - if ($outgoingIntegrationsTypeId !== null) { - $queryParams['outgoingIntegrationsTypeId'] = $outgoingIntegrationsTypeId; + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; } - // query params - if (is_array($title)) { - $title = ObjectSerializer::serializeCollection($title, '', true); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - if ($title !== null) { - $queryParams['title'] = $title; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWebhook + * + * Get webhook + * + * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Webhook + */ + public function getWebhook($webhookId) + { + list($response) = $this->getWebhookWithHttpInfo($webhookId); + return $response; + } + + /** + * Operation getWebhookWithHttpInfo + * + * Get webhook + * + * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Webhook, HTTP status code, HTTP response headers (array of strings) + */ + public function getWebhookWithHttpInfo($webhookId) + { + $request = $this->getWebhookRequest($webhookId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Webhook' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Webhook', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Webhook'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Webhook', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhookAsync + * + * Get webhook + * + * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookAsync($webhookId) + { + return $this->getWebhookAsyncWithHttpInfo($webhookId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhookAsyncWithHttpInfo + * + * Get webhook + * + * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookAsyncWithHttpInfo($webhookId) + { + $returnType = '\TalonOne\Client\Model\Webhook'; + $request = $this->getWebhookRequest($webhookId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhook' + * + * @param int $webhookId The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getWebhookRequest($webhookId) + { + // verify the required parameter 'webhookId' is set + if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $webhookId when calling getWebhook' + ); } + $resourcePath = '/v1/webhooks/{webhookId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($webhookId !== null) { + $resourcePath = str_replace( + '{' . 'webhookId' . '}', + ObjectSerializer::toPathValue($webhookId), + $resourcePath + ); + } + // body params $_tempBody = null; @@ -35912,38 +36507,52 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag } /** - * Operation importAccountCollection + * Operation getWebhookActivationLogs * - * Import data into existing account-level collection + * List webhook activation log entries * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20038 */ - public function importAccountCollection($collectionId, $upFile = null) + public function getWebhookActivationLogs($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) { - list($response) = $this->importAccountCollectionWithHttpInfo($collectionId, $upFile); + list($response) = $this->getWebhookActivationLogsWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); return $response; } /** - * Operation importAccountCollectionWithHttpInfo + * Operation getWebhookActivationLogsWithHttpInfo * - * Import data into existing account-level collection + * List webhook activation log entries * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20038, HTTP status code, HTTP response headers (array of strings) */ - public function importAccountCollectionWithHttpInfo($collectionId, $upFile = null) + public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) { - $request = $this->importAccountCollectionRequest($collectionId, $upFile); + $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); try { $options = $this->createHttpClientOption(); @@ -35976,102 +36585,4804 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20038' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20038', []), $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + } + + $returnType = '\TalonOne\Client\Model\InlineResponse20038'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\InlineResponse20038', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhookActivationLogsAsync + * + * List webhook activation log entries + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookActivationLogsAsync($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + { + return $this->getWebhookActivationLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhookActivationLogsAsyncWithHttpInfo + * + * List webhook activation log entries + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookActivationLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + { + $returnType = '\TalonOne\Client\Model\InlineResponse20038'; + $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + }, + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhookActivationLogs' + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $integrationRequestUuid Filter results by integration request UUID. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param \DateTime $createdBefore Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + { + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/webhook_activation_logs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($integrationRequestUuid)) { + $integrationRequestUuid = ObjectSerializer::serializeCollection($integrationRequestUuid, '', true); + } + if ($integrationRequestUuid !== null) { + $queryParams['integrationRequestUuid'] = $integrationRequestUuid; + } + // query params + if (is_array($webhookId)) { + $webhookId = ObjectSerializer::serializeCollection($webhookId, '', true); + } + if ($webhookId !== null) { + $queryParams['webhookId'] = $webhookId; + } + // query params + if (is_array($applicationId)) { + $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); + } + if ($applicationId !== null) { + $queryParams['applicationId'] = $applicationId; + } + // query params + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + } + if ($campaignId !== null) { + $queryParams['campaignId'] = $campaignId; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWebhookLogs + * + * List webhook log entries + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $requestUuid Filter results by request UUID. (optional) + * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\InlineResponse20039 + */ + public function getWebhookLogs($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + { + list($response) = $this->getWebhookLogsWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + return $response; + } + + /** + * Operation getWebhookLogsWithHttpInfo + * + * List webhook log entries + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $requestUuid Filter results by request UUID. (optional) + * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\InlineResponse20039, HTTP status code, HTTP response headers (array of strings) + */ + public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + { + $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\InlineResponse20039' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20039', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\InlineResponse20039'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\InlineResponse20039', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhookLogsAsync + * + * List webhook log entries + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $requestUuid Filter results by request UUID. (optional) + * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookLogsAsync($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + { + return $this->getWebhookLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhookLogsAsyncWithHttpInfo + * + * List webhook log entries + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $requestUuid Filter results by request UUID. (optional) + * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + { + $returnType = '\TalonOne\Client\Model\InlineResponse20039'; + $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhookLogs' + * + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param string $status Filter results by HTTP status codes. (optional) + * @param float $webhookId Filter results by Webhook. (optional) + * @param float $applicationId Filter results by Application ID. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $requestUuid Filter results by request UUID. (optional) + * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + { + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/webhook_logs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + if (is_array($webhookId)) { + $webhookId = ObjectSerializer::serializeCollection($webhookId, '', true); + } + if ($webhookId !== null) { + $queryParams['webhookId'] = $webhookId; + } + // query params + if (is_array($applicationId)) { + $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); + } + if ($applicationId !== null) { + $queryParams['applicationId'] = $applicationId; + } + // query params + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + } + if ($campaignId !== null) { + $queryParams['campaignId'] = $campaignId; + } + // query params + if (is_array($requestUuid)) { + $requestUuid = ObjectSerializer::serializeCollection($requestUuid, '', true); + } + if ($requestUuid !== null) { + $queryParams['requestUuid'] = $requestUuid; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWebhooks + * + * List webhooks + * + * @param string $applicationIds Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $creationType Filter results by creation type. (optional) + * @param string $visibility Filter results by visibility. (optional) + * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) + * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\InlineResponse20037 + */ + public function getWebhooks($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + { + list($response) = $this->getWebhooksWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + return $response; + } + + /** + * Operation getWebhooksWithHttpInfo + * + * List webhooks + * + * @param string $applicationIds Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $creationType Filter results by creation type. (optional) + * @param string $visibility Filter results by visibility. (optional) + * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) + * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\InlineResponse20037, HTTP status code, HTTP response headers (array of strings) + */ + public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + { + $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\InlineResponse20037' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20037', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\InlineResponse20037'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\InlineResponse20037', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhooksAsync + * + * List webhooks + * + * @param string $applicationIds Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $creationType Filter results by creation type. (optional) + * @param string $visibility Filter results by visibility. (optional) + * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) + * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhooksAsync($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + { + return $this->getWebhooksAsyncWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhooksAsyncWithHttpInfo + * + * List webhooks + * + * @param string $applicationIds Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $creationType Filter results by creation type. (optional) + * @param string $visibility Filter results by visibility. (optional) + * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) + * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhooksAsyncWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + { + $returnType = '\TalonOne\Client\Model\InlineResponse20037'; + $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhooks' + * + * @param string $applicationIds Checks if the given catalog or its attributes are referenced in the specified Application ID. **Note**: If no Application ID is provided, we check for all connected Applications. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $creationType Filter results by creation type. (optional) + * @param string $visibility Filter results by visibility. (optional) + * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) + * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getWebhooksRequest($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + { + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhooks, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhooks, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/webhooks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($applicationIds)) { + $applicationIds = ObjectSerializer::serializeCollection($applicationIds, '', true); + } + if ($applicationIds !== null) { + $queryParams['applicationIds'] = $applicationIds; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($creationType)) { + $creationType = ObjectSerializer::serializeCollection($creationType, '', true); + } + if ($creationType !== null) { + $queryParams['creationType'] = $creationType; + } + // query params + if (is_array($visibility)) { + $visibility = ObjectSerializer::serializeCollection($visibility, '', true); + } + if ($visibility !== null) { + $queryParams['visibility'] = $visibility; + } + // query params + if (is_array($outgoingIntegrationsTypeId)) { + $outgoingIntegrationsTypeId = ObjectSerializer::serializeCollection($outgoingIntegrationsTypeId, '', true); + } + if ($outgoingIntegrationsTypeId !== null) { + $queryParams['outgoingIntegrationsTypeId'] = $outgoingIntegrationsTypeId; + } + // query params + if (is_array($title)) { + $title = ObjectSerializer::serializeCollection($title, '', true); + } + if ($title !== null) { + $queryParams['title'] = $title; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importAccountCollection + * + * Import data into existing account-level collection + * + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function importAccountCollection($collectionId, $upFile = null) + { + list($response) = $this->importAccountCollectionWithHttpInfo($collectionId, $upFile); + return $response; + } + + /** + * Operation importAccountCollectionWithHttpInfo + * + * Import data into existing account-level collection + * + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function importAccountCollectionWithHttpInfo($collectionId, $upFile = null) + { + $request = $this->importAccountCollectionRequest($collectionId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importAccountCollectionAsync + * + * Import data into existing account-level collection + * + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importAccountCollectionAsync($collectionId, $upFile = null) + { + return $this->importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importAccountCollectionAsyncWithHttpInfo + * + * Import data into existing account-level collection + * + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importAccountCollectionRequest($collectionId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importAccountCollection' + * + * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importAccountCollectionRequest($collectionId, $upFile = null) + { + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collectionId when calling importAccountCollection' + ); + } + + $resourcePath = '/v1/collections/{collectionId}/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importAllowedList + * + * Import allowed values for attribute + * + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function importAllowedList($attributeId, $upFile = null) + { + list($response) = $this->importAllowedListWithHttpInfo($attributeId, $upFile); + return $response; + } + + /** + * Operation importAllowedListWithHttpInfo + * + * Import allowed values for attribute + * + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function importAllowedListWithHttpInfo($attributeId, $upFile = null) + { + $request = $this->importAllowedListRequest($attributeId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importAllowedListAsync + * + * Import allowed values for attribute + * + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importAllowedListAsync($attributeId, $upFile = null) + { + return $this->importAllowedListAsyncWithHttpInfo($attributeId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importAllowedListAsyncWithHttpInfo + * + * Import allowed values for attribute + * + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importAllowedListAsyncWithHttpInfo($attributeId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importAllowedListRequest($attributeId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importAllowedList' + * + * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importAllowedListRequest($attributeId, $upFile = null) + { + // verify the required parameter 'attributeId' is set + if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeId when calling importAllowedList' + ); + } + + $resourcePath = '/v1/attributes/{attributeId}/allowed_list/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($attributeId !== null) { + $resourcePath = str_replace( + '{' . 'attributeId' . '}', + ObjectSerializer::toPathValue($attributeId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importAudiencesMemberships + * + * Import audience members + * + * @param int $audienceId The ID of the audience. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function importAudiencesMemberships($audienceId, $upFile = null) + { + list($response) = $this->importAudiencesMembershipsWithHttpInfo($audienceId, $upFile); + return $response; + } + + /** + * Operation importAudiencesMembershipsWithHttpInfo + * + * Import audience members + * + * @param int $audienceId The ID of the audience. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = null) + { + $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importAudiencesMembershipsAsync + * + * Import audience members + * + * @param int $audienceId The ID of the audience. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importAudiencesMembershipsAsync($audienceId, $upFile = null) + { + return $this->importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importAudiencesMembershipsAsyncWithHttpInfo + * + * Import audience members + * + * @param int $audienceId The ID of the audience. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importAudiencesMemberships' + * + * @param int $audienceId The ID of the audience. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importAudiencesMembershipsRequest($audienceId, $upFile = null) + { + // verify the required parameter 'audienceId' is set + if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $audienceId when calling importAudiencesMemberships' + ); + } + + $resourcePath = '/v1/audiences/{audienceId}/memberships/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($audienceId !== null) { + $resourcePath = str_replace( + '{' . 'audienceId' . '}', + ObjectSerializer::toPathValue($audienceId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCampaignStores + * + * Import stores + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function importCampaignStores($applicationId, $campaignId, $upFile = null) + { + list($response) = $this->importCampaignStoresWithHttpInfo($applicationId, $campaignId, $upFile); + return $response; + } + + /** + * Operation importCampaignStoresWithHttpInfo + * + * Import stores + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function importCampaignStoresWithHttpInfo($applicationId, $campaignId, $upFile = null) + { + $request = $this->importCampaignStoresRequest($applicationId, $campaignId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCampaignStoresAsync + * + * Import stores + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importCampaignStoresAsync($applicationId, $campaignId, $upFile = null) + { + return $this->importCampaignStoresAsyncWithHttpInfo($applicationId, $campaignId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCampaignStoresAsyncWithHttpInfo + * + * Import stores + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importCampaignStoresAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importCampaignStoresRequest($applicationId, $campaignId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCampaignStores' + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importCampaignStoresRequest($applicationId, $campaignId, $upFile = null) + { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling importCampaignStores' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling importCampaignStores' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/stores/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCollection + * + * Import data into existing campaign-level collection + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function importCollection($applicationId, $campaignId, $collectionId, $upFile = null) + { + list($response) = $this->importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile); + return $response; + } + + /** + * Operation importCollectionWithHttpInfo + * + * Import data into existing campaign-level collection + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) + { + $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCollectionAsync + * + * Import data into existing campaign-level collection + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importCollectionAsync($applicationId, $campaignId, $collectionId, $upFile = null) + { + return $this->importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCollectionAsyncWithHttpInfo + * + * Import data into existing campaign-level collection + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCollection' + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile = null) + { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling importCollection' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling importCollection' + ); + } + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collectionId when calling importCollection' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importCoupons + * + * Import coupons + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import + */ + public function importCoupons($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + { + list($response) = $this->importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile); + return $response; + } + + /** + * Operation importCouponsWithHttpInfo + * + * Import coupons + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + */ + public function importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + { + $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importCouponsAsync + * + * Import coupons + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importCouponsAsync($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + { + return $this->importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importCouponsAsyncWithHttpInfo + * + * Import coupons + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importCoupons' + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importCouponsRequest($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling importCoupons' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling importCoupons' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($skipDuplicates)) { + $skipDuplicates = ObjectSerializer::serializeCollection($skipDuplicates, '', true); + } + if ($skipDuplicates !== null) { + $queryParams['skipDuplicates'] = $skipDuplicates; + } + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importLoyaltyCards + * + * Import loyalty cards + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function importLoyaltyCards($loyaltyProgramId, $upFile = null) + { + list($response) = $this->importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile); + return $response; + } + + /** + * Operation importLoyaltyCardsWithHttpInfo + * + * Import loyalty cards + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null) + { + $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importLoyaltyCardsAsync + * + * Import loyalty cards + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importLoyaltyCardsAsync($loyaltyProgramId, $upFile = null) + { + return $this->importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importLoyaltyCardsAsyncWithHttpInfo + * + * Import loyalty cards + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importLoyaltyCards' + * + * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) + { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCards' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_cards'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importLoyaltyCustomersTiers + * + * Import customers into loyalty tiers + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function importLoyaltyCustomersTiers($loyaltyProgramId, $upFile = null) + { + list($response) = $this->importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile); + return $response; + } + + /** + * Operation importLoyaltyCustomersTiersWithHttpInfo + * + * Import customers into loyalty tiers + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile = null) + { + $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importLoyaltyCustomersTiersAsync + * + * Import customers into loyalty tiers + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importLoyaltyCustomersTiersAsync($loyaltyProgramId, $upFile = null) + { + return $this->importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importLoyaltyCustomersTiersAsyncWithHttpInfo + * + * Import customers into loyalty tiers + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importLoyaltyCustomersTiers' + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile = null) + { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCustomersTiers' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importLoyaltyPoints + * + * Import loyalty points + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import + */ + public function importLoyaltyPoints($loyaltyProgramId, $upFile = null) + { + list($response) = $this->importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile); + return $response; + } + + /** + * Operation importLoyaltyPointsWithHttpInfo + * + * Import loyalty points + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + */ + public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = null) + { + $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importLoyaltyPointsAsync + * + * Import loyalty points + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importLoyaltyPointsAsync($loyaltyProgramId, $upFile = null) + { + return $this->importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importLoyaltyPointsAsyncWithHttpInfo + * + * Import loyalty points + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importLoyaltyPoints' + * + * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) + { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyPoints' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_points'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importPoolGiveaways + * + * Import giveaway codes into a giveaway pool + * + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import + */ + public function importPoolGiveaways($poolId, $upFile = null) + { + list($response) = $this->importPoolGiveawaysWithHttpInfo($poolId, $upFile); + return $response; + } + + /** + * Operation importPoolGiveawaysWithHttpInfo + * + * Import giveaway codes into a giveaway pool + * + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + */ + public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) + { + $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importPoolGiveawaysAsync + * + * Import giveaway codes into a giveaway pool + * + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importPoolGiveawaysAsync($poolId, $upFile = null) + { + return $this->importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importPoolGiveawaysAsyncWithHttpInfo + * + * Import giveaway codes into a giveaway pool + * + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importPoolGiveaways' + * + * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importPoolGiveawaysRequest($poolId, $upFile = null) + { + // verify the required parameter 'poolId' is set + if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $poolId when calling importPoolGiveaways' + ); + } + + $resourcePath = '/v1/giveaways/pools/{poolId}/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($poolId !== null) { + $resourcePath = str_replace( + '{' . 'poolId' . '}', + ObjectSerializer::toPathValue($poolId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importReferrals + * + * Import referrals + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Import + */ + public function importReferrals($applicationId, $campaignId, $upFile = null) + { + list($response) = $this->importReferralsWithHttpInfo($applicationId, $campaignId, $upFile); + return $response; + } + + /** + * Operation importReferralsWithHttpInfo + * + * Import referrals + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + */ + public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile = null) + { + $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Import'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\Import', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importReferralsAsync + * + * Import referrals + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importReferralsAsync($applicationId, $campaignId, $upFile = null) + { + return $this->importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importReferralsAsyncWithHttpInfo + * + * Import referrals + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) + { + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importReferrals' + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param string $upFile The file containing the data that is being imported. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importReferralsRequest($applicationId, $campaignId, $upFile = null) + { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling importReferrals' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling importReferrals' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // 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 + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation inviteUserExternal + * + * Invite user from identity provider + * + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function inviteUserExternal($body) + { + $this->inviteUserExternalWithHttpInfo($body); + } + + /** + * Operation inviteUserExternalWithHttpInfo + * + * Invite user from identity provider + * + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function inviteUserExternalWithHttpInfo($body) + { + $request = $this->inviteUserExternalRequest($body); - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); } - $returnType = '\TalonOne\Client\Model\Import'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation importAccountCollectionAsync + * Operation inviteUserExternalAsync * - * Import data into existing account-level collection + * Invite user from identity provider * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAccountCollectionAsync($collectionId, $upFile = null) + public function inviteUserExternalAsync($body) { - return $this->importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile) + return $this->inviteUserExternalAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -36080,37 +41391,25 @@ function ($response) { } /** - * Operation importAccountCollectionAsyncWithHttpInfo + * Operation inviteUserExternalAsyncWithHttpInfo * - * Import data into existing account-level collection + * Invite user from identity provider * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile = null) + public function inviteUserExternalAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAccountCollectionRequest($collectionId, $upFile); + $returnType = ''; + $request = $this->inviteUserExternalRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -36130,24 +41429,23 @@ function ($exception) { } /** - * Create request for operation 'importAccountCollection' + * Create request for operation 'inviteUserExternal' * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importAccountCollectionRequest($collectionId, $upFile = null) + protected function inviteUserExternalRequest($body) { - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling importAccountCollection' + 'Missing the required parameter $body when calling inviteUserExternal' ); } - $resourcePath = '/v1/collections/{collectionId}/import'; + $resourcePath = '/v1/users/invite'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36156,30 +41454,21 @@ protected function importAccountCollectionRequest($collectionId, $upFile = null) - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); - } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] + [], + ['application/json'] ); } @@ -36244,38 +41533,44 @@ protected function importAccountCollectionRequest($collectionId, $upFile = null) } /** - * Operation importAllowedList + * Operation listAccountCollections * - * Import allowed values for attribute + * List collections in account * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importAllowedList($attributeId, $upFile = null) + public function listAccountCollections($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - list($response) = $this->importAllowedListWithHttpInfo($attributeId, $upFile); + list($response) = $this->listAccountCollectionsWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name); return $response; } /** - * Operation importAllowedListWithHttpInfo + * Operation listAccountCollectionsWithHttpInfo * - * Import allowed values for attribute + * List collections in account * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function importAllowedListWithHttpInfo($attributeId, $upFile = null) + public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $request = $this->importAllowedListRequest($attributeId, $upFile); + $request = $this->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); try { $options = $this->createHttpClientOption(); @@ -36308,26 +41603,26 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20017' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20017', []), $response->getStatusCode(), $response->getHeaders() ]; case 400: - if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -36357,7 +41652,7 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) ]; } - $returnType = '\TalonOne\Client\Model\Import'; + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -36376,7 +41671,7 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', + '\TalonOne\Client\Model\InlineResponse20017', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36384,7 +41679,7 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponse', + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36411,19 +41706,22 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) } /** - * Operation importAllowedListAsync + * Operation listAccountCollectionsAsync * - * Import allowed values for attribute + * List collections in account * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAllowedListAsync($attributeId, $upFile = null) + public function listAccountCollectionsAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - return $this->importAllowedListAsyncWithHttpInfo($attributeId, $upFile) + return $this->listAccountCollectionsAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name) ->then( function ($response) { return $response[0]; @@ -36432,20 +41730,23 @@ function ($response) { } /** - * Operation importAllowedListAsyncWithHttpInfo + * Operation listAccountCollectionsAsyncWithHttpInfo * - * Import allowed values for attribute + * List collections in account * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAllowedListAsyncWithHttpInfo($attributeId, $upFile = null) + public function listAccountCollectionsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAllowedListRequest($attributeId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $request = $this->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36482,45 +41783,72 @@ function ($exception) { } /** - * Create request for operation 'importAllowedList' + * Create request for operation 'listAccountCollections' * - * @param int $attributeId The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importAllowedListRequest($attributeId, $upFile = null) + protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - // verify the required parameter 'attributeId' is set - if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $attributeId when calling importAllowedList' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAccountCollections, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAccountCollections, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/attributes/{attributeId}/allowed_list/import'; + + $resourcePath = '/v1/collections'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + } + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; + } + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } - // path params - if ($attributeId !== null) { - $resourcePath = str_replace( - '{' . 'attributeId' . '}', - ObjectSerializer::toPathValue($attributeId), - $resourcePath - ); - } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -36531,7 +41859,7 @@ protected function importAllowedListRequest($attributeId, $upFile = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -36588,7 +41916,7 @@ protected function importAllowedListRequest($attributeId, $upFile = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36596,38 +41924,44 @@ protected function importAllowedListRequest($attributeId, $upFile = null) } /** - * Operation importAudiencesMemberships + * Operation listAchievements * - * Import audience members + * List achievements * - * @param int $audienceId The ID of the audience. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20046 */ - public function importAudiencesMemberships($audienceId, $upFile = null) + public function listAchievements($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - list($response) = $this->importAudiencesMembershipsWithHttpInfo($audienceId, $upFile); + list($response) = $this->listAchievementsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $title); return $response; } /** - * Operation importAudiencesMembershipsWithHttpInfo + * Operation listAchievementsWithHttpInfo * - * Import audience members + * List achievements * - * @param int $audienceId The ID of the audience. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20046, HTTP status code, HTTP response headers (array of strings) */ - public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = null) + public function listAchievementsWithHttpInfo($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); + $request = $this->listAchievementsRequest($applicationId, $campaignId, $pageSize, $skip, $title); try { $options = $this->createHttpClientOption(); @@ -36660,56 +41994,20 @@ public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = nu $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20046' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20046', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Import'; + $returnType = '\TalonOne\Client\Model\InlineResponse20046'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -36728,31 +42026,7 @@ public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = nu case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20046', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36763,19 +42037,22 @@ public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = nu } /** - * Operation importAudiencesMembershipsAsync + * Operation listAchievementsAsync * - * Import audience members + * List achievements * - * @param int $audienceId The ID of the audience. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAudiencesMembershipsAsync($audienceId, $upFile = null) + public function listAchievementsAsync($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - return $this->importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile) + return $this->listAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $title) ->then( function ($response) { return $response[0]; @@ -36784,20 +42061,23 @@ function ($response) { } /** - * Operation importAudiencesMembershipsAsyncWithHttpInfo + * Operation listAchievementsAsyncWithHttpInfo * - * Import audience members + * List achievements * - * @param int $audienceId The ID of the audience. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile = null) + public function listAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20046'; + $request = $this->listAchievementsRequest($applicationId, $campaignId, $pageSize, $skip, $title); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36834,45 +42114,86 @@ function ($exception) { } /** - * Create request for operation 'importAudiencesMemberships' + * Create request for operation 'listAchievements' * - * @param int $audienceId The ID of the audience. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 50) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importAudiencesMembershipsRequest($audienceId, $upFile = null) + protected function listAchievementsRequest($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - // verify the required parameter 'audienceId' is set - if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $audienceId when calling importAudiencesMemberships' + 'Missing the required parameter $applicationId when calling listAchievements' ); } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling listAchievements' + ); + } + if ($pageSize !== null && $pageSize > 50) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAchievements, must be smaller than or equal to 50.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAchievements, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/audiences/{audienceId}/memberships/import'; + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($title)) { + $title = ObjectSerializer::serializeCollection($title, '', true); + } + if ($title !== null) { + $queryParams['title'] = $title; + } // path params - if ($audienceId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'audienceId' . '}', - ObjectSerializer::toPathValue($audienceId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } - - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); } + // body params $_tempBody = null; @@ -36883,7 +42204,7 @@ protected function importAudiencesMembershipsRequest($audienceId, $upFile = null } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -36940,7 +42261,7 @@ protected function importAudiencesMembershipsRequest($audienceId, $upFile = null $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36948,42 +42269,34 @@ protected function importAudiencesMembershipsRequest($audienceId, $upFile = null } /** - * Operation importCollection + * Operation listAllRolesV2 * - * Import data into existing campaign-level collection + * List roles * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20044 */ - public function importCollection($applicationId, $campaignId, $collectionId, $upFile = null) + public function listAllRolesV2() { - list($response) = $this->importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile); + list($response) = $this->listAllRolesV2WithHttpInfo(); return $response; } /** - * Operation importCollectionWithHttpInfo + * Operation listAllRolesV2WithHttpInfo * - * Import data into existing campaign-level collection + * List roles * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20044, HTTP status code, HTTP response headers (array of strings) */ - public function importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) + public function listAllRolesV2WithHttpInfo() { - $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + $request = $this->listAllRolesV2Request(); try { $options = $this->createHttpClientOption(); @@ -37016,32 +42329,20 @@ public function importCollectionWithHttpInfo($applicationId, $campaignId, $colle $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20044' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20044', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Import'; + $returnType = '\TalonOne\Client\Model\InlineResponse20044'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -37060,15 +42361,7 @@ public function importCollectionWithHttpInfo($applicationId, $campaignId, $colle case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20044', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37079,21 +42372,17 @@ public function importCollectionWithHttpInfo($applicationId, $campaignId, $colle } /** - * Operation importCollectionAsync + * Operation listAllRolesV2Async * - * Import data into existing campaign-level collection + * List roles * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importCollectionAsync($applicationId, $campaignId, $collectionId, $upFile = null) + public function listAllRolesV2Async() { - return $this->importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile) + return $this->listAllRolesV2AsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -37102,22 +42391,18 @@ function ($response) { } /** - * Operation importCollectionAsyncWithHttpInfo + * Operation listAllRolesV2AsyncWithHttpInfo * - * Import data into existing campaign-level collection + * List roles * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) + public function listAllRolesV2AsyncWithHttpInfo() { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20044'; + $request = $this->listAllRolesV2Request(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37154,38 +42439,16 @@ function ($exception) { } /** - * Create request for operation 'importCollection' + * Create request for operation 'listAllRolesV2' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile = null) + protected function listAllRolesV2Request() { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling importCollection' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling importCollection' - ); - } - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling importCollection' - ); - } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import'; + $resourcePath = '/v2/roles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -37194,35 +42457,7 @@ protected function importCollectionRequest($applicationId, $campaignId, $collect - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); - } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -37233,7 +42468,7 @@ protected function importCollectionRequest($applicationId, $campaignId, $collect } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -37290,7 +42525,7 @@ protected function importCollectionRequest($applicationId, $campaignId, $collect $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -37298,42 +42533,46 @@ protected function importCollectionRequest($applicationId, $campaignId, $collect } /** - * Operation importCoupons + * Operation listCatalogItems * - * Import coupons + * List items in a catalog * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) + * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import + * @return \TalonOne\Client\Model\InlineResponse20035 */ - public function importCoupons($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function listCatalogItems($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - list($response) = $this->importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile); + list($response) = $this->listCatalogItemsWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); return $response; } /** - * Operation importCouponsWithHttpInfo + * Operation listCatalogItemsWithHttpInfo * - * Import coupons + * List items in a catalog * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) + * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20035, HTTP status code, HTTP response headers (array of strings) */ - public function importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); + $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); try { $options = $this->createHttpClientOption(); @@ -37366,20 +42605,20 @@ public function importCouponsWithHttpInfo($applicationId, $campaignId, $skipDupl $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20035' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20035', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Import'; + $returnType = '\TalonOne\Client\Model\InlineResponse20035'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -37398,7 +42637,7 @@ public function importCouponsWithHttpInfo($applicationId, $campaignId, $skipDupl case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', + '\TalonOne\Client\Model\InlineResponse20035', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37409,21 +42648,23 @@ public function importCouponsWithHttpInfo($applicationId, $campaignId, $skipDupl } /** - * Operation importCouponsAsync + * Operation listCatalogItemsAsync * - * Import coupons + * List items in a catalog * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) + * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importCouponsAsync($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function listCatalogItemsAsync($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - return $this->importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile) + return $this->listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames) ->then( function ($response) { return $response[0]; @@ -37432,22 +42673,24 @@ function ($response) { } /** - * Operation importCouponsAsyncWithHttpInfo + * Operation listCatalogItemsAsyncWithHttpInfo * - * Import coupons + * List items in a catalog * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) + * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20035'; + $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37484,32 +42727,35 @@ function ($exception) { } /** - * Create request for operation 'importCoupons' + * Create request for operation 'listCatalogItems' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) + * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importCouponsRequest($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'catalogId' is set + if ($catalogId === null || (is_array($catalogId) && count($catalogId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling importCoupons' + 'Missing the required parameter $catalogId when calling listCatalogItems' ); } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling importCoupons' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCatalogItems, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCatalogItems, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons'; + + $resourcePath = '/v1/catalogs/{catalogId}/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -37517,35 +42763,51 @@ protected function importCouponsRequest($applicationId, $campaignId, $skipDuplic $multipart = false; // query params - if (is_array($skipDuplicates)) { - $skipDuplicates = ObjectSerializer::serializeCollection($skipDuplicates, '', true); + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - if ($skipDuplicates !== null) { - $queryParams['skipDuplicates'] = $skipDuplicates; + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + } + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; + } + // query params + if (is_array($sku)) { + $sku = ObjectSerializer::serializeCollection($sku, 'form', true); + } + if ($sku !== null) { + $queryParams['sku'] = $sku; + } + // query params + if (is_array($productNames)) { + $productNames = ObjectSerializer::serializeCollection($productNames, 'form', true); + } + if ($productNames !== null) { + $queryParams['productNames'] = $productNames; } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($catalogId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'catalogId' . '}', + ObjectSerializer::toPathValue($catalogId), $resourcePath ); } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -37556,7 +42818,7 @@ protected function importCouponsRequest($applicationId, $campaignId, $skipDuplic } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -37613,7 +42875,7 @@ protected function importCouponsRequest($applicationId, $campaignId, $skipDuplic $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -37621,38 +42883,48 @@ protected function importCouponsRequest($applicationId, $campaignId, $skipDuplic } /** - * Operation importLoyaltyCards + * Operation listCollections * - * Import loyalty cards + * List collections in campaign * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importLoyaltyCards($loyaltyProgramId, $upFile = null) + public function listCollections($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - list($response) = $this->importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $response; } /** - * Operation importLoyaltyCardsWithHttpInfo + * Operation listCollectionsWithHttpInfo * - * Import loyalty cards + * List collections in campaign * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); try { $options = $this->createHttpClientOption(); @@ -37679,32 +42951,20 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null $statusCode, $response->getHeaders(), $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + ); + } - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\InlineResponse20017' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20017', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -37722,7 +42982,7 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null ]; } - $returnType = '\TalonOne\Client\Model\Import'; + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -37741,15 +43001,7 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20017', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37768,19 +43020,24 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null } /** - * Operation importLoyaltyCardsAsync + * Operation listCollectionsAsync * - * Import loyalty cards + * List collections in campaign * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCardsAsync($loyaltyProgramId, $upFile = null) + public function listCollectionsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - return $this->importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name) ->then( function ($response) { return $response[0]; @@ -37789,20 +43046,25 @@ function ($response) { } /** - * Operation importLoyaltyCardsAsyncWithHttpInfo + * Operation listCollectionsAsyncWithHttpInfo * - * Import loyalty cards + * List collections in campaign * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37839,45 +43101,102 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyCards' + * Create request for operation 'listCollections' * - * @param int $loyaltyProgramId Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) + protected function listCollectionsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCards' + 'Missing the required parameter $applicationId when calling listCollections' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling listCollections' ); } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollections, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollections, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_cards'; + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + } + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; + } + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } - - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); } + // body params $_tempBody = null; @@ -37888,7 +43207,7 @@ protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -37945,7 +43264,7 @@ protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -37953,38 +43272,46 @@ protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) } /** - * Operation importLoyaltyCustomersTiers + * Operation listCollectionsInApplication * - * Import customers into loyalty tiers + * List collections in Application * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importLoyaltyCustomersTiers($loyaltyProgramId, $upFile = null) + public function listCollectionsInApplication($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - list($response) = $this->importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $response; } /** - * Operation importLoyaltyCustomersTiersWithHttpInfo + * Operation listCollectionsInApplicationWithHttpInfo * - * Import customers into loyalty tiers + * List collections in Application * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); + $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); try { $options = $this->createHttpClientOption(); @@ -38017,38 +43344,14 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20017' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20017', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -38066,7 +43369,7 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi ]; } - $returnType = '\TalonOne\Client\Model\Import'; + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -38085,23 +43388,7 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20017', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -38120,19 +43407,23 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi } /** - * Operation importLoyaltyCustomersTiersAsync + * Operation listCollectionsInApplicationAsync * - * Import customers into loyalty tiers + * List collections in Application * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCustomersTiersAsync($loyaltyProgramId, $upFile = null) + public function listCollectionsInApplicationAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - return $this->importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name) ->then( function ($response) { return $response[0]; @@ -38141,20 +43432,24 @@ function ($response) { } /** - * Operation importLoyaltyCustomersTiersAsyncWithHttpInfo + * Operation listCollectionsInApplicationAsyncWithHttpInfo * - * Import customers into loyalty tiers + * List collections in Application * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38191,45 +43486,87 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyCustomersTiers' + * Create request for operation 'listCollectionsInApplication' * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param string $name Filter by collection name. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile = null) + protected function listCollectionsInApplicationRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCustomersTiers' + 'Missing the required parameter $applicationId when calling listCollectionsInApplication' ); } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollectionsInApplication, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollectionsInApplication, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers'; + + $resourcePath = '/v1/applications/{applicationId}/collections'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + } + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; + } + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -38240,7 +43577,7 @@ protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -38297,7 +43634,7 @@ protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38305,38 +43642,52 @@ protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile } /** - * Operation importLoyaltyPoints + * Operation listStores * - * Import loyalty points + * List stores * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $name The name of the store. (optional) + * @param string $integrationId The integration ID of the store. (optional) + * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import + * @return \TalonOne\Client\Model\InlineResponse20045 */ - public function importLoyaltyPoints($loyaltyProgramId, $upFile = null) + public function listStores($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - list($response) = $this->importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->listStoresWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); return $response; } /** - * Operation importLoyaltyPointsWithHttpInfo + * Operation listStoresWithHttpInfo * - * Import loyalty points + * List stores * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $name The name of the store. (optional) + * @param string $integrationId The integration ID of the store. (optional) + * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20045, HTTP status code, HTTP response headers (array of strings) */ - public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); try { $options = $this->createHttpClientOption(); @@ -38369,20 +43720,20 @@ public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20045' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20045', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Import'; + $returnType = '\TalonOne\Client\Model\InlineResponse20045'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -38401,7 +43752,7 @@ public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', + '\TalonOne\Client\Model\InlineResponse20045', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -38412,19 +43763,26 @@ public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = nul } /** - * Operation importLoyaltyPointsAsync + * Operation listStoresAsync * - * Import loyalty points + * List stores * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $name The name of the store. (optional) + * @param string $integrationId The integration ID of the store. (optional) + * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyPointsAsync($loyaltyProgramId, $upFile = null) + public function listStoresAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - return $this->importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->listStoresAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query) ->then( function ($response) { return $response[0]; @@ -38433,20 +43791,27 @@ function ($response) { } /** - * Operation importLoyaltyPointsAsyncWithHttpInfo + * Operation listStoresAsyncWithHttpInfo * - * Import loyalty points + * List stores * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $name The name of the store. (optional) + * @param string $integrationId The integration ID of the store. (optional) + * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listStoresAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20045'; + $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38483,45 +43848,111 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyPoints' + * Create request for operation 'listStores' * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) + * @param float $campaignId Filter results by campaign. (optional) + * @param string $name The name of the store. (optional) + * @param string $integrationId The integration ID of the store. (optional) + * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) + protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyPoints' + 'Missing the required parameter $applicationId when calling listStores' ); } - - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_points'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listStores, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listStores, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/applications/{applicationId}/stores'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); + } + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; + } + // query params + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); + } + if ($skip !== null) { + $queryParams['skip'] = $skip; + } + // query params + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + if (is_array($withTotalResultSize)) { + $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + } + if ($withTotalResultSize !== null) { + $queryParams['withTotalResultSize'] = $withTotalResultSize; + } + // query params + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + } + if ($campaignId !== null) { + $queryParams['campaignId'] = $campaignId; + } + // query params + if (is_array($name)) { + $name = ObjectSerializer::serializeCollection($name, '', true); + } + if ($name !== null) { + $queryParams['name'] = $name; + } + // query params + if (is_array($integrationId)) { + $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); + } + if ($integrationId !== null) { + $queryParams['integrationId'] = $integrationId; + } + // query params + if (is_array($query)) { + $query = ObjectSerializer::serializeCollection($query, '', true); + } + if ($query !== null) { + $queryParams['query'] = $query; + } // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -38532,7 +43963,7 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -38589,7 +44020,7 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38597,38 +44028,37 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) } /** - * Operation importPoolGiveaways + * Operation notificationActivation * - * Import giveaway codes into a giveaway pool + * Activate or deactivate notification * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) + * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import + * @return void */ - public function importPoolGiveaways($poolId, $upFile = null) + public function notificationActivation($notificationId, $body) { - list($response) = $this->importPoolGiveawaysWithHttpInfo($poolId, $upFile); - return $response; + $this->notificationActivationWithHttpInfo($notificationId, $body); } /** - * Operation importPoolGiveawaysWithHttpInfo + * Operation notificationActivationWithHttpInfo * - * Import giveaway codes into a giveaway pool + * Activate or deactivate notification * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) + * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) + public function notificationActivationWithHttpInfo($notificationId, $body) { - $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + $request = $this->notificationActivationRequest($notificationId, $body); try { $options = $this->createHttpClientOption(); @@ -38658,65 +44088,29 @@ public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\Import'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation importPoolGiveawaysAsync + * Operation notificationActivationAsync * - * Import giveaway codes into a giveaway pool + * Activate or deactivate notification * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) + * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importPoolGiveawaysAsync($poolId, $upFile = null) + public function notificationActivationAsync($notificationId, $body) { - return $this->importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile) + return $this->notificationActivationAsyncWithHttpInfo($notificationId, $body) ->then( function ($response) { return $response[0]; @@ -38725,37 +44119,26 @@ function ($response) { } /** - * Operation importPoolGiveawaysAsyncWithHttpInfo + * Operation notificationActivationAsyncWithHttpInfo * - * Import giveaway codes into a giveaway pool + * Activate or deactivate notification * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) + * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile = null) + public function notificationActivationAsyncWithHttpInfo($notificationId, $body) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + $returnType = ''; + $request = $this->notificationActivationRequest($notificationId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -38775,24 +44158,30 @@ function ($exception) { } /** - * Create request for operation 'importPoolGiveaways' + * Create request for operation 'notificationActivation' * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (required) - * @param string $upFile The file containing the data that is being imported. (optional) + * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) + * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importPoolGiveawaysRequest($poolId, $upFile = null) + protected function notificationActivationRequest($notificationId, $body) { - // verify the required parameter 'poolId' is set - if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { + // verify the required parameter 'notificationId' is set + if ($notificationId === null || (is_array($notificationId) && count($notificationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $poolId when calling importPoolGiveaways' + 'Missing the required parameter $notificationId when calling notificationActivation' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling notificationActivation' ); } - $resourcePath = '/v1/giveaways/pools/{poolId}/import'; + $resourcePath = '/v1/notifications/{notificationId}/activation'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38802,29 +44191,28 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) // path params - if ($poolId !== null) { + if ($notificationId !== null) { $resourcePath = str_replace( - '{' . 'poolId' . '}', - ObjectSerializer::toPathValue($poolId), + '{' . 'notificationId' . '}', + ObjectSerializer::toPathValue($notificationId), $resourcePath ); } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] + [], + ['application/json'] ); } @@ -38881,7 +44269,7 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38889,40 +44277,33 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) } /** - * Operation importReferrals + * Operation oktaEventHandlerChallenge * - * Import referrals + * Validate Okta API ownership * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import + * @return void */ - public function importReferrals($applicationId, $campaignId, $upFile = null) + public function oktaEventHandlerChallenge() { - list($response) = $this->importReferralsWithHttpInfo($applicationId, $campaignId, $upFile); - return $response; + $this->oktaEventHandlerChallengeWithHttpInfo(); } /** - * Operation importReferralsWithHttpInfo + * Operation oktaEventHandlerChallengeWithHttpInfo * - * Import referrals + * Validate Okta API ownership * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function oktaEventHandlerChallengeWithHttpInfo() { - $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + $request = $this->oktaEventHandlerChallengeRequest(); try { $options = $this->createHttpClientOption(); @@ -38952,66 +44333,27 @@ public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\Import'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation importReferralsAsync + * Operation oktaEventHandlerChallengeAsync * - * Import referrals + * Validate Okta API ownership * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importReferralsAsync($applicationId, $campaignId, $upFile = null) + public function oktaEventHandlerChallengeAsync() { - return $this->importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile) + return $this->oktaEventHandlerChallengeAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -39020,38 +44362,24 @@ function ($response) { } /** - * Operation importReferralsAsyncWithHttpInfo + * Operation oktaEventHandlerChallengeAsyncWithHttpInfo * - * Import referrals + * Validate Okta API ownership * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function oktaEventHandlerChallengeAsyncWithHttpInfo() { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + $returnType = ''; + $request = $this->oktaEventHandlerChallengeRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -39071,31 +44399,16 @@ function ($exception) { } /** - * Create request for operation 'importReferrals' + * Create request for operation 'oktaEventHandlerChallenge' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importReferralsRequest($applicationId, $campaignId, $upFile = null) + protected function oktaEventHandlerChallengeRequest() { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling importReferrals' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling importReferrals' - ); - } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals'; + $resourcePath = '/v1/provisioning/okta'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39104,38 +44417,18 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] + [], + [] ); } @@ -39192,7 +44485,7 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -39200,35 +44493,38 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = } /** - * Operation inviteUserExternal + * Operation postAddedDeductedPointsNotification * - * Invite user from identity provider + * Create notification about added or deducted loyalty points * - * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function inviteUserExternal($body) + public function postAddedDeductedPointsNotification($loyaltyProgramId, $body) { - $this->inviteUserExternalWithHttpInfo($body); + list($response) = $this->postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body); + return $response; } /** - * Operation inviteUserExternalWithHttpInfo + * Operation postAddedDeductedPointsNotificationWithHttpInfo * - * Invite user from identity provider + * Create notification about added or deducted loyalty points * - * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function inviteUserExternalWithHttpInfo($body) + public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body) { - $request = $this->inviteUserExternalRequest($body); + $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); try { $options = $this->createHttpClientOption(); @@ -39258,28 +44554,125 @@ public function inviteUserExternalWithHttpInfo($body) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\BaseNotification' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\BaseNotification', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\BaseNotification'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\BaseNotification', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation inviteUserExternalAsync + * Operation postAddedDeductedPointsNotificationAsync * - * Invite user from identity provider + * Create notification about added or deducted loyalty points * - * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function inviteUserExternalAsync($body) + public function postAddedDeductedPointsNotificationAsync($loyaltyProgramId, $body) { - return $this->inviteUserExternalAsyncWithHttpInfo($body) + return $this->postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) ->then( function ($response) { return $response[0]; @@ -39288,25 +44681,37 @@ function ($response) { } /** - * Operation inviteUserExternalAsyncWithHttpInfo + * Operation postAddedDeductedPointsNotificationAsyncWithHttpInfo * - * Invite user from identity provider + * Create notification about added or deducted loyalty points * - * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function inviteUserExternalAsyncWithHttpInfo($body) + public function postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) { - $returnType = ''; - $request = $this->inviteUserExternalRequest($body); + $returnType = '\TalonOne\Client\Model\BaseNotification'; + $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -39326,23 +44731,30 @@ function ($exception) { } /** - * Create request for operation 'inviteUserExternal' + * Create request for operation 'postAddedDeductedPointsNotification' * - * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function inviteUserExternalRequest($body) + protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling postAddedDeductedPointsNotification' + ); + } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling inviteUserExternal' + 'Missing the required parameter $body when calling postAddedDeductedPointsNotification' ); } - $resourcePath = '/v1/users/invite'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39351,6 +44763,14 @@ protected function inviteUserExternalRequest($body) + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -39360,11 +44780,11 @@ protected function inviteUserExternalRequest($body) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], ['application/json'] ); } @@ -39430,44 +44850,38 @@ protected function inviteUserExternalRequest($body) } /** - * Operation listAccountCollections + * Operation postCatalogsStrikethroughNotification * - * List collections in account + * Create strikethrough notification * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function listAccountCollections($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postCatalogsStrikethroughNotification($applicationId, $body) { - list($response) = $this->listAccountCollectionsWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name); + list($response) = $this->postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body); return $response; } /** - * Operation listAccountCollectionsWithHttpInfo + * Operation postCatalogsStrikethroughNotificationWithHttpInfo * - * List collections in account + * Create strikethrough notification * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body) { - $request = $this->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); + $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); try { $options = $this->createHttpClientOption(); @@ -39500,14 +44914,14 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20017' === '\SplFileObject') { + if ('\TalonOne\Client\Model\BaseNotification' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20017', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\BaseNotification', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -39549,7 +44963,7 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $returnType = '\TalonOne\Client\Model\BaseNotification'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -39568,7 +44982,7 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20017', + '\TalonOne\Client\Model\BaseNotification', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39603,22 +45017,19 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul } /** - * Operation listAccountCollectionsAsync + * Operation postCatalogsStrikethroughNotificationAsync * - * List collections in account + * Create strikethrough notification * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAccountCollectionsAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postCatalogsStrikethroughNotificationAsync($applicationId, $body) { - return $this->listAccountCollectionsAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name) + return $this->postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) ->then( function ($response) { return $response[0]; @@ -39627,23 +45038,20 @@ function ($response) { } /** - * Operation listAccountCollectionsAsyncWithHttpInfo + * Operation postCatalogsStrikethroughNotificationAsyncWithHttpInfo * - * List collections in account + * Create strikethrough notification * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAccountCollectionsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; - $request = $this->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); + $returnType = '\TalonOne\Client\Model\BaseNotification'; + $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39680,74 +45088,52 @@ function ($exception) { } /** - * Create request for operation 'listAccountCollections' + * Create request for operation 'postCatalogsStrikethroughNotification' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + protected function postCatalogsStrikethroughNotificationRequest($applicationId, $body) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAccountCollections, must be smaller than or equal to 1000.'); + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling postCatalogsStrikethroughNotification' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAccountCollections, must be bigger than or equal to 1.'); + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling postCatalogsStrikethroughNotification' + ); } - - $resourcePath = '/v1/collections'; + $resourcePath = '/v1/applications/{applicationId}/catalogs/notifications/strikethrough'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); - } - if ($name !== null) { - $queryParams['name'] = $name; - } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -39756,7 +45142,7 @@ protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -39813,7 +45199,7 @@ protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -39821,44 +45207,38 @@ protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, } /** - * Operation listAchievements + * Operation postPendingPointsNotification * - * List achievements + * Create notification about pending loyalty points * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20046 + * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function listAchievements($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) + public function postPendingPointsNotification($loyaltyProgramId, $body) { - list($response) = $this->listAchievementsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $title); + list($response) = $this->postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body); return $response; } /** - * Operation listAchievementsWithHttpInfo + * Operation postPendingPointsNotificationWithHttpInfo * - * List achievements + * Create notification about pending loyalty points * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20046, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function listAchievementsWithHttpInfo($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) + public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body) { - $request = $this->listAchievementsRequest($applicationId, $campaignId, $pageSize, $skip, $title); + $request = $this->postPendingPointsNotificationRequest($loyaltyProgramId, $body); try { $options = $this->createHttpClientOption(); @@ -39891,20 +45271,56 @@ public function listAchievementsWithHttpInfo($applicationId, $campaignId, $pageS $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20046' === '\SplFileObject') { + if ('\TalonOne\Client\Model\BaseNotification' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20046', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\BaseNotification', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20046'; + $returnType = '\TalonOne\Client\Model\BaseNotification'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -39923,7 +45339,31 @@ public function listAchievementsWithHttpInfo($applicationId, $campaignId, $pageS case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20046', + '\TalonOne\Client\Model\BaseNotification', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39934,22 +45374,19 @@ public function listAchievementsWithHttpInfo($applicationId, $campaignId, $pageS } /** - * Operation listAchievementsAsync + * Operation postPendingPointsNotificationAsync * - * List achievements + * Create notification about pending loyalty points * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAchievementsAsync($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) + public function postPendingPointsNotificationAsync($loyaltyProgramId, $body) { - return $this->listAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $title) + return $this->postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) ->then( function ($response) { return $response[0]; @@ -39958,23 +45395,20 @@ function ($response) { } /** - * Operation listAchievementsAsyncWithHttpInfo + * Operation postPendingPointsNotificationAsyncWithHttpInfo * - * List achievements + * Create notification about pending loyalty points * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) + public function postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20046'; - $request = $this->listAchievementsRequest($applicationId, $campaignId, $pageSize, $skip, $title); + $returnType = '\TalonOne\Client\Model\BaseNotification'; + $request = $this->postPendingPointsNotificationRequest($loyaltyProgramId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40011,88 +45445,52 @@ function ($exception) { } /** - * Create request for operation 'listAchievements' + * Create request for operation 'postPendingPointsNotification' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $title Filter by the display name for the achievement in the campaign manager. **Note**: If no `title` is provided, all the achievements from the campaign are returned. (optional) + * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listAchievementsRequest($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) + protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling listAchievements' + 'Missing the required parameter $loyaltyProgramId when calling postPendingPointsNotification' ); } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling listAchievements' + 'Missing the required parameter $body when calling postPendingPointsNotification' ); } - if ($pageSize !== null && $pageSize > 50) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAchievements, must be smaller than or equal to 50.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAchievements, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/pending_points'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($title)) { - $title = ObjectSerializer::serializeCollection($title, '', true); - } - if ($title !== null) { - $queryParams['title'] = $title; - } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -40101,7 +45499,7 @@ protected function listAchievementsRequest($applicationId, $campaignId, $pageSiz } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -40158,7 +45556,7 @@ protected function listAchievementsRequest($applicationId, $campaignId, $pageSiz $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -40166,34 +45564,39 @@ protected function listAchievementsRequest($applicationId, $campaignId, $pageSiz } /** - * Operation listAllRolesV2 + * Operation removeLoyaltyPoints * - * List roles + * Deduct points from customer profile * + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20044 + * @return void */ - public function listAllRolesV2() + public function removeLoyaltyPoints($loyaltyProgramId, $integrationId, $body) { - list($response) = $this->listAllRolesV2WithHttpInfo(); - return $response; + $this->removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body); } /** - * Operation listAllRolesV2WithHttpInfo + * Operation removeLoyaltyPointsWithHttpInfo * - * List roles + * Deduct points from customer profile * + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20044, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function listAllRolesV2WithHttpInfo() + public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body) { - $request = $this->listAllRolesV2Request(); + $request = $this->removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body); try { $options = $this->createHttpClientOption(); @@ -40223,42 +45626,30 @@ public function listAllRolesV2WithHttpInfo() ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\InlineResponse20044' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20044', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\InlineResponse20044'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20044', + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -40269,17 +45660,20 @@ public function listAllRolesV2WithHttpInfo() } /** - * Operation listAllRolesV2Async + * Operation removeLoyaltyPointsAsync * - * List roles + * Deduct points from customer profile * + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAllRolesV2Async() + public function removeLoyaltyPointsAsync($loyaltyProgramId, $integrationId, $body) { - return $this->listAllRolesV2AsyncWithHttpInfo() + return $this->removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) ->then( function ($response) { return $response[0]; @@ -40288,35 +45682,27 @@ function ($response) { } /** - * Operation listAllRolesV2AsyncWithHttpInfo + * Operation removeLoyaltyPointsAsyncWithHttpInfo * - * List roles + * Deduct points from customer profile * + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAllRolesV2AsyncWithHttpInfo() + public function removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20044'; - $request = $this->listAllRolesV2Request(); + $returnType = ''; + $request = $this->removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -40336,16 +45722,37 @@ function ($exception) { } /** - * Create request for operation 'listAllRolesV2' + * Create request for operation 'removeLoyaltyPoints' * + * @param string $loyaltyProgramId The identifier for the loyalty program. (required) + * @param string $integrationId The identifier of the profile. (required) + * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listAllRolesV2Request() + protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $loyaltyProgramId when calling removeLoyaltyPoints' + ); + } + // verify the required parameter 'integrationId' is set + if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $integrationId when calling removeLoyaltyPoints' + ); + } + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling removeLoyaltyPoints' + ); + } - $resourcePath = '/v2/roles'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -40354,9 +45761,28 @@ protected function listAllRolesV2Request() + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), + $resourcePath + ); + } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -40365,7 +45791,7 @@ protected function listAllRolesV2Request() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -40422,7 +45848,7 @@ protected function listAllRolesV2Request() $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -40430,46 +45856,36 @@ protected function listAllRolesV2Request() } /** - * Operation listCatalogItems + * Operation resetPassword * - * List items in a catalog + * Reset password * - * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) - * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) + * @param \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20035 + * @return \TalonOne\Client\Model\NewPassword */ - public function listCatalogItems($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) + public function resetPassword($body) { - list($response) = $this->listCatalogItemsWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); + list($response) = $this->resetPasswordWithHttpInfo($body); return $response; } /** - * Operation listCatalogItemsWithHttpInfo + * Operation resetPasswordWithHttpInfo * - * List items in a catalog + * Reset password * - * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) - * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) + * @param \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20035, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\NewPassword, HTTP status code, HTTP response headers (array of strings) */ - public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) + public function resetPasswordWithHttpInfo($body) { - $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); + $request = $this->resetPasswordRequest($body); try { $options = $this->createHttpClientOption(); @@ -40501,21 +45917,21 @@ public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip $responseBody = $response->getBody(); switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\InlineResponse20035' === '\SplFileObject') { + case 204: + if ('\TalonOne\Client\Model\NewPassword' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20035', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\NewPassword', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20035'; + $returnType = '\TalonOne\Client\Model\NewPassword'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -40531,10 +45947,10 @@ public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 204: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20035', + '\TalonOne\Client\Model\NewPassword', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -40545,23 +45961,18 @@ public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip } /** - * Operation listCatalogItemsAsync + * Operation resetPasswordAsync * - * List items in a catalog + * Reset password * - * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) - * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) + * @param \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCatalogItemsAsync($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) + public function resetPasswordAsync($body) { - return $this->listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames) + return $this->resetPasswordAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -40570,24 +45981,19 @@ function ($response) { } /** - * Operation listCatalogItemsAsyncWithHttpInfo + * Operation resetPasswordAsyncWithHttpInfo * - * List items in a catalog + * Reset password * - * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) - * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) + * @param \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) + public function resetPasswordAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20035'; - $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); + $returnType = '\TalonOne\Client\Model\NewPassword'; + $request = $this->resetPasswordRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40624,89 +46030,37 @@ function ($exception) { } /** - * Create request for operation 'listCatalogItems' + * Create request for operation 'resetPassword' * - * @param int $catalogId The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string[] $sku Filter results by one or more SKUs. Must be exact match. (optional) - * @param string[] $productNames Filter results by one or more product names. Must be exact match. (optional) + * @param \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) + protected function resetPasswordRequest($body) { - // verify the required parameter 'catalogId' is set - if ($catalogId === null || (is_array($catalogId) && count($catalogId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalogId when calling listCatalogItems' + 'Missing the required parameter $body when calling resetPassword' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCatalogItems, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCatalogItems, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/catalogs/{catalogId}/items'; + $resourcePath = '/v1/reset_password'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } - // query params - if (is_array($sku)) { - $sku = ObjectSerializer::serializeCollection($sku, 'form', true); - } - if ($sku !== null) { - $queryParams['sku'] = $sku; - } - // query params - if (is_array($productNames)) { - $productNames = ObjectSerializer::serializeCollection($productNames, 'form', true); - } - if ($productNames !== null) { - $queryParams['productNames'] = $productNames; - } - // path params - if ($catalogId !== null) { - $resourcePath = str_replace( - '{' . 'catalogId' . '}', - ObjectSerializer::toPathValue($catalogId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -40715,7 +46069,7 @@ protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -40772,7 +46126,7 @@ protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -40780,48 +46134,36 @@ protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = } /** - * Operation listCollections + * Operation scimCreateUser * - * List collections in campaign + * Create SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\ScimUser */ - public function listCollections($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimCreateUser($body) { - list($response) = $this->listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + list($response) = $this->scimCreateUserWithHttpInfo($body); return $response; } /** - * Operation listCollectionsWithHttpInfo + * Operation scimCreateUserWithHttpInfo * - * List collections in campaign + * Create SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimUser, HTTP status code, HTTP response headers (array of strings) */ - public function listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimCreateUserWithHttpInfo($body) { - $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $request = $this->scimCreateUserRequest($body); try { $options = $this->createHttpClientOption(); @@ -40853,33 +46195,21 @@ public function listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSi $responseBody = $response->getBody(); switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\InlineResponse20017' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20017', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + case 201: + if ('\TalonOne\Client\Model\ScimUser' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimUser', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $returnType = '\TalonOne\Client\Model\ScimUser'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -40895,18 +46225,10 @@ public function listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20017', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ScimUser', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -40917,24 +46239,18 @@ public function listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSi } /** - * Operation listCollectionsAsync + * Operation scimCreateUserAsync * - * List collections in campaign + * Create SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCollectionsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimCreateUserAsync($body) { - return $this->listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name) + return $this->scimCreateUserAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -40943,25 +46259,19 @@ function ($response) { } /** - * Operation listCollectionsAsyncWithHttpInfo + * Operation scimCreateUserAsyncWithHttpInfo * - * List collections in campaign + * Create SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimCreateUserAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; - $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $returnType = '\TalonOne\Client\Model\ScimUser'; + $request = $this->scimCreateUserRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40998,104 +46308,37 @@ function ($exception) { } /** - * Create request for operation 'listCollections' + * Create request for operation 'scimCreateUser' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listCollectionsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + protected function scimCreateUserRequest($body) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling listCollections' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling listCollections' - ); - } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollections, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollections, must be bigger than or equal to 1.'); + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling scimCreateUser' + ); } - - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections'; + $resourcePath = '/v1/provisioning/scim/Users'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); - } - if ($name !== null) { - $queryParams['name'] = $name; - } - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -41104,7 +46347,7 @@ protected function listCollectionsRequest($applicationId, $campaignId, $pageSize } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -41161,7 +46404,7 @@ protected function listCollectionsRequest($applicationId, $campaignId, $pageSize $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -41169,46 +46412,35 @@ protected function listCollectionsRequest($applicationId, $campaignId, $pageSize } /** - * Operation listCollectionsInApplication + * Operation scimDeleteUser * - * List collections in Application + * Delete SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return void */ - public function listCollectionsInApplication($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimDeleteUser($userId) { - list($response) = $this->listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); - return $response; + $this->scimDeleteUserWithHttpInfo($userId); } /** - * Operation listCollectionsInApplicationWithHttpInfo + * Operation scimDeleteUserWithHttpInfo * - * List collections in Application + * Delete SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimDeleteUserWithHttpInfo($userId) { - $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $request = $this->scimDeleteUserRequest($userId); try { $options = $this->createHttpClientOption(); @@ -41238,89 +46470,28 @@ public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSi ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\InlineResponse20017' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20017', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20017', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation listCollectionsInApplicationAsync + * Operation scimDeleteUserAsync * - * List collections in Application + * Delete SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCollectionsInApplicationAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimDeleteUserAsync($userId) { - return $this->listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name) + return $this->scimDeleteUserAsyncWithHttpInfo($userId) ->then( function ($response) { return $response[0]; @@ -41329,41 +46500,25 @@ function ($response) { } /** - * Operation listCollectionsInApplicationAsyncWithHttpInfo + * Operation scimDeleteUserAsyncWithHttpInfo * - * List collections in Application + * Delete SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function scimDeleteUserAsyncWithHttpInfo($userId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; - $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $returnType = ''; + $request = $this->scimDeleteUserRequest($userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -41383,83 +46538,36 @@ function ($exception) { } /** - * Create request for operation 'listCollectionsInApplication' + * Create request for operation 'scimDeleteUser' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param string $name Filter by collection name. (optional) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listCollectionsInApplicationRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + protected function scimDeleteUserRequest($userId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling listCollectionsInApplication' + 'Missing the required parameter $userId when calling scimDeleteUser' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollectionsInApplication, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollectionsInApplication, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/collections'; + $resourcePath = '/v1/provisioning/scim/Users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); - } - if ($name !== null) { - $queryParams['name'] = $name; - } // path params - if ($applicationId !== null) { + if ($userId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), $resourcePath ); } @@ -41469,11 +46577,11 @@ protected function listCollectionsInApplicationRequest($applicationId, $pageSize if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], [] ); } @@ -41531,7 +46639,7 @@ protected function listCollectionsInApplicationRequest($applicationId, $pageSize $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -41539,52 +46647,34 @@ protected function listCollectionsInApplicationRequest($applicationId, $pageSize } /** - * Operation listStores + * Operation scimGetResourceTypes * - * List stores + * List supported SCIM resource types * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $name The name of the store. (optional) - * @param string $integrationId The integration ID of the store. (optional) - * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20045 + * @return \TalonOne\Client\Model\ScimResourceTypesListResponse */ - public function listStores($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) + public function scimGetResourceTypes() { - list($response) = $this->listStoresWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); + list($response) = $this->scimGetResourceTypesWithHttpInfo(); return $response; } /** - * Operation listStoresWithHttpInfo + * Operation scimGetResourceTypesWithHttpInfo * - * List stores + * List supported SCIM resource types * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $name The name of the store. (optional) - * @param string $integrationId The integration ID of the store. (optional) - * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20045, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimResourceTypesListResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) + public function scimGetResourceTypesWithHttpInfo() { - $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); + $request = $this->scimGetResourceTypesRequest(); try { $options = $this->createHttpClientOption(); @@ -41617,20 +46707,20 @@ public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20045' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ScimResourceTypesListResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20045', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimResourceTypesListResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20045'; + $returnType = '\TalonOne\Client\Model\ScimResourceTypesListResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -41649,7 +46739,7 @@ public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20045', + '\TalonOne\Client\Model\ScimResourceTypesListResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -41660,26 +46750,17 @@ public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = } /** - * Operation listStoresAsync + * Operation scimGetResourceTypesAsync * - * List stores + * List supported SCIM resource types * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $name The name of the store. (optional) - * @param string $integrationId The integration ID of the store. (optional) - * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listStoresAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) + public function scimGetResourceTypesAsync() { - return $this->listStoresAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query) + return $this->scimGetResourceTypesAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -41688,27 +46769,18 @@ function ($response) { } /** - * Operation listStoresAsyncWithHttpInfo + * Operation scimGetResourceTypesAsyncWithHttpInfo * - * List stores + * List supported SCIM resource types * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $name The name of the store. (optional) - * @param string $integrationId The integration ID of the store. (optional) - * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listStoresAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) + public function scimGetResourceTypesAsyncWithHttpInfo() { - $returnType = '\TalonOne\Client\Model\InlineResponse20045'; - $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); + $returnType = '\TalonOne\Client\Model\ScimResourceTypesListResponse'; + $request = $this->scimGetResourceTypesRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41745,110 +46817,24 @@ function ($exception) { } /** - * Create request for operation 'listStores' + * Create request for operation 'scimGetResourceTypes' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $name The name of the store. (optional) - * @param string $integrationId The integration ID of the store. (optional) - * @param string $query Filter results by `name` or `integrationId`. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) + protected function scimGetResourceTypesRequest() { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling listStores' - ); - } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listStores, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listStores, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/stores'; + $resourcePath = '/v1/provisioning/scim/ResourceTypes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); - } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; - } - // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); - } - if ($campaignId !== null) { - $queryParams['campaignId'] = $campaignId; - } - // query params - if (is_array($name)) { - $name = ObjectSerializer::serializeCollection($name, '', true); - } - if ($name !== null) { - $queryParams['name'] = $name; - } - // query params - if (is_array($integrationId)) { - $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); - } - if ($integrationId !== null) { - $queryParams['integrationId'] = $integrationId; - } - // query params - if (is_array($query)) { - $query = ObjectSerializer::serializeCollection($query, '', true); - } - if ($query !== null) { - $queryParams['query'] = $query; - } - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -41925,37 +46911,34 @@ protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = n } /** - * Operation notificationActivation + * Operation scimGetSchemas * - * Activate or deactivate notification + * List supported SCIM schemas * - * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) - * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\ScimSchemasListResponse */ - public function notificationActivation($notificationId, $body) + public function scimGetSchemas() { - $this->notificationActivationWithHttpInfo($notificationId, $body); + list($response) = $this->scimGetSchemasWithHttpInfo(); + return $response; } /** - * Operation notificationActivationWithHttpInfo + * Operation scimGetSchemasWithHttpInfo * - * Activate or deactivate notification + * List supported SCIM schemas * - * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) - * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimSchemasListResponse, HTTP status code, HTTP response headers (array of strings) */ - public function notificationActivationWithHttpInfo($notificationId, $body) + public function scimGetSchemasWithHttpInfo() { - $request = $this->notificationActivationRequest($notificationId, $body); + $request = $this->scimGetSchemasRequest(); try { $options = $this->createHttpClientOption(); @@ -41985,29 +46968,63 @@ public function notificationActivationWithHttpInfo($notificationId, $body) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\ScimSchemasListResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimSchemasListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\ScimSchemasListResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ScimSchemasListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation notificationActivationAsync + * Operation scimGetSchemasAsync * - * Activate or deactivate notification + * List supported SCIM schemas * - * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) - * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function notificationActivationAsync($notificationId, $body) + public function scimGetSchemasAsync() { - return $this->notificationActivationAsyncWithHttpInfo($notificationId, $body) + return $this->scimGetSchemasAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -42016,26 +47033,35 @@ function ($response) { } /** - * Operation notificationActivationAsyncWithHttpInfo + * Operation scimGetSchemasAsyncWithHttpInfo * - * Activate or deactivate notification + * List supported SCIM schemas * - * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) - * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function notificationActivationAsyncWithHttpInfo($notificationId, $body) + public function scimGetSchemasAsyncWithHttpInfo() { - $returnType = ''; - $request = $this->notificationActivationRequest($notificationId, $body); + $returnType = '\TalonOne\Client\Model\ScimSchemasListResponse'; + $request = $this->scimGetSchemasRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -42055,30 +47081,16 @@ function ($exception) { } /** - * Create request for operation 'notificationActivation' + * Create request for operation 'scimGetSchemas' * - * @param int $notificationId The ID of the notification. Get it with the appropriate _List notifications_ endpoint. (required) - * @param \TalonOne\Client\Model\NotificationActivation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function notificationActivationRequest($notificationId, $body) + protected function scimGetSchemasRequest() { - // verify the required parameter 'notificationId' is set - if ($notificationId === null || (is_array($notificationId) && count($notificationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $notificationId when calling notificationActivation' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling notificationActivation' - ); - } - $resourcePath = '/v1/notifications/{notificationId}/activation'; + $resourcePath = '/v1/provisioning/scim/Schemas'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42087,29 +47099,18 @@ protected function notificationActivationRequest($notificationId, $body) - // path params - if ($notificationId !== null) { - $resourcePath = str_replace( - '{' . 'notificationId' . '}', - ObjectSerializer::toPathValue($notificationId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] + ['application/json'], + [] ); } @@ -42166,7 +47167,7 @@ protected function notificationActivationRequest($notificationId, $body) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -42174,38 +47175,34 @@ protected function notificationActivationRequest($notificationId, $body) } /** - * Operation postAddedDeductedPointsNotification + * Operation scimGetServiceProviderConfig * - * Create notification about added or deducted loyalty points + * Get SCIM service provider configuration * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\ScimServiceProviderConfigResponse */ - public function postAddedDeductedPointsNotification($loyaltyProgramId, $body) + public function scimGetServiceProviderConfig() { - list($response) = $this->postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body); + list($response) = $this->scimGetServiceProviderConfigWithHttpInfo(); return $response; } /** - * Operation postAddedDeductedPointsNotificationWithHttpInfo + * Operation scimGetServiceProviderConfigWithHttpInfo * - * Create notification about added or deducted loyalty points + * Get SCIM service provider configuration * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimServiceProviderConfigResponse, HTTP status code, HTTP response headers (array of strings) */ - public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body) + public function scimGetServiceProviderConfigWithHttpInfo() { - $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); + $request = $this->scimGetServiceProviderConfigRequest(); try { $options = $this->createHttpClientOption(); @@ -42238,56 +47235,20 @@ public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramI $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\BaseNotification' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\BaseNotification', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ScimServiceProviderConfigResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimServiceProviderConfigResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\BaseNotification'; + $returnType = '\TalonOne\Client\Model\ScimServiceProviderConfigResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -42306,31 +47267,7 @@ public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramI case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\BaseNotification', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ScimServiceProviderConfigResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -42341,19 +47278,17 @@ public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramI } /** - * Operation postAddedDeductedPointsNotificationAsync + * Operation scimGetServiceProviderConfigAsync * - * Create notification about added or deducted loyalty points + * Get SCIM service provider configuration * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postAddedDeductedPointsNotificationAsync($loyaltyProgramId, $body) + public function scimGetServiceProviderConfigAsync() { - return $this->postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + return $this->scimGetServiceProviderConfigAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -42362,20 +47297,18 @@ function ($response) { } /** - * Operation postAddedDeductedPointsNotificationAsyncWithHttpInfo + * Operation scimGetServiceProviderConfigAsyncWithHttpInfo * - * Create notification about added or deducted loyalty points + * Get SCIM service provider configuration * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + public function scimGetServiceProviderConfigAsyncWithHttpInfo() { - $returnType = '\TalonOne\Client\Model\BaseNotification'; - $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); + $returnType = '\TalonOne\Client\Model\ScimServiceProviderConfigResponse'; + $request = $this->scimGetServiceProviderConfigRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42412,30 +47345,16 @@ function ($exception) { } /** - * Create request for operation 'postAddedDeductedPointsNotification' + * Create request for operation 'scimGetServiceProviderConfig' * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body) + protected function scimGetServiceProviderConfigRequest() { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling postAddedDeductedPointsNotification' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling postAddedDeductedPointsNotification' - ); - } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_points'; + $resourcePath = '/v1/provisioning/scim/ServiceProviderConfig'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42444,20 +47363,9 @@ protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, - // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -42466,7 +47374,7 @@ protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -42523,7 +47431,7 @@ protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -42531,38 +47439,36 @@ protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, } /** - * Operation postCatalogsStrikethroughNotification + * Operation scimGetUser * - * Create strikethrough notification + * Get SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\ScimUser */ - public function postCatalogsStrikethroughNotification($applicationId, $body) + public function scimGetUser($userId) { - list($response) = $this->postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body); + list($response) = $this->scimGetUserWithHttpInfo($userId); return $response; } /** - * Operation postCatalogsStrikethroughNotificationWithHttpInfo + * Operation scimGetUserWithHttpInfo * - * Create strikethrough notification + * Get SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) + * @param int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimUser, HTTP status code, HTTP response headers (array of strings) */ - public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body) + public function scimGetUserWithHttpInfo($userId) { - $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); + $request = $this->scimGetUserRequest($userId); try { $options = $this->createHttpClientOption(); @@ -42595,56 +47501,20 @@ public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\BaseNotification' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\BaseNotification', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ScimUser' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimUser', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\BaseNotification'; + $returnType = '\TalonOne\Client\Model\ScimUser'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -42663,31 +47533,7 @@ public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\BaseNotification', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ScimUser', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -42698,19 +47544,18 @@ public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId } /** - * Operation postCatalogsStrikethroughNotificationAsync + * Operation scimGetUserAsync * - * Create strikethrough notification + * Get SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postCatalogsStrikethroughNotificationAsync($applicationId, $body) + public function scimGetUserAsync($userId) { - return $this->postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) + return $this->scimGetUserAsyncWithHttpInfo($userId) ->then( function ($response) { return $response[0]; @@ -42719,20 +47564,19 @@ function ($response) { } /** - * Operation postCatalogsStrikethroughNotificationAsyncWithHttpInfo + * Operation scimGetUserAsyncWithHttpInfo * - * Create strikethrough notification + * Get SCIM user * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) + public function scimGetUserAsyncWithHttpInfo($userId) { - $returnType = '\TalonOne\Client\Model\BaseNotification'; - $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); + $returnType = '\TalonOne\Client\Model\ScimUser'; + $request = $this->scimGetUserRequest($userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42769,30 +47613,23 @@ function ($exception) { } /** - * Create request for operation 'postCatalogsStrikethroughNotification' + * Create request for operation 'scimGetUser' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) + * @param int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postCatalogsStrikethroughNotificationRequest($applicationId, $body) + protected function scimGetUserRequest($userId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling postCatalogsStrikethroughNotification' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling postCatalogsStrikethroughNotification' + 'Missing the required parameter $userId when calling scimGetUser' ); } - $resourcePath = '/v1/applications/{applicationId}/catalogs/notifications/strikethrough'; + $resourcePath = '/v1/provisioning/scim/Users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42802,19 +47639,16 @@ protected function postCatalogsStrikethroughNotificationRequest($applicationId, // path params - if ($applicationId !== null) { + if ($userId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), $resourcePath ); } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -42823,7 +47657,7 @@ protected function postCatalogsStrikethroughNotificationRequest($applicationId, } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -42880,7 +47714,7 @@ protected function postCatalogsStrikethroughNotificationRequest($applicationId, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -42888,38 +47722,34 @@ protected function postCatalogsStrikethroughNotificationRequest($applicationId, } /** - * Operation postPendingPointsNotification + * Operation scimGetUsers * - * Create notification about pending loyalty points + * List SCIM users * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\ScimUsersListResponse */ - public function postPendingPointsNotification($loyaltyProgramId, $body) + public function scimGetUsers() { - list($response) = $this->postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body); + list($response) = $this->scimGetUsersWithHttpInfo(); return $response; } /** - * Operation postPendingPointsNotificationWithHttpInfo + * Operation scimGetUsersWithHttpInfo * - * Create notification about pending loyalty points + * List SCIM users * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimUsersListResponse, HTTP status code, HTTP response headers (array of strings) */ - public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body) + public function scimGetUsersWithHttpInfo() { - $request = $this->postPendingPointsNotificationRequest($loyaltyProgramId, $body); + $request = $this->scimGetUsersRequest(); try { $options = $this->createHttpClientOption(); @@ -42952,56 +47782,20 @@ public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $bo $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\BaseNotification' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\BaseNotification', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ScimUsersListResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimUsersListResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\BaseNotification'; + $returnType = '\TalonOne\Client\Model\ScimUsersListResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -43020,31 +47814,7 @@ public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $bo case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\BaseNotification', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ScimUsersListResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -43055,19 +47825,17 @@ public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $bo } /** - * Operation postPendingPointsNotificationAsync + * Operation scimGetUsersAsync * - * Create notification about pending loyalty points + * List SCIM users * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postPendingPointsNotificationAsync($loyaltyProgramId, $body) + public function scimGetUsersAsync() { - return $this->postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + return $this->scimGetUsersAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -43076,20 +47844,18 @@ function ($response) { } /** - * Operation postPendingPointsNotificationAsyncWithHttpInfo + * Operation scimGetUsersAsyncWithHttpInfo * - * Create notification about pending loyalty points + * List SCIM users * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + public function scimGetUsersAsyncWithHttpInfo() { - $returnType = '\TalonOne\Client\Model\BaseNotification'; - $request = $this->postPendingPointsNotificationRequest($loyaltyProgramId, $body); + $returnType = '\TalonOne\Client\Model\ScimUsersListResponse'; + $request = $this->scimGetUsersRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43126,30 +47892,16 @@ function ($exception) { } /** - * Create request for operation 'postPendingPointsNotification' + * Create request for operation 'scimGetUsers' * - * @param int $loyaltyProgramId Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - * @param \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body) + protected function scimGetUsersRequest() { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling postPendingPointsNotification' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling postPendingPointsNotification' - ); - } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/pending_points'; + $resourcePath = '/v1/provisioning/scim/Users'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43158,20 +47910,9 @@ protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body - // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -43180,7 +47921,7 @@ protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -43237,7 +47978,7 @@ protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -43245,39 +47986,38 @@ protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body } /** - * Operation removeLoyaltyPoints + * Operation scimPatchUser * - * Deduct points from customer profile + * Update SCIM user attributes * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimPatchRequest $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\ScimUser */ - public function removeLoyaltyPoints($loyaltyProgramId, $integrationId, $body) + public function scimPatchUser($userId, $body) { - $this->removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body); + list($response) = $this->scimPatchUserWithHttpInfo($userId, $body); + return $response; } /** - * Operation removeLoyaltyPointsWithHttpInfo + * Operation scimPatchUserWithHttpInfo * - * Deduct points from customer profile + * Update SCIM user attributes * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimPatchRequest $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimUser, HTTP status code, HTTP response headers (array of strings) */ - public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body) + public function scimPatchUserWithHttpInfo($userId, $body) { - $request = $this->removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body); + $request = $this->scimPatchUserRequest($userId, $body); try { $options = $this->createHttpClientOption(); @@ -43307,30 +48047,42 @@ public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationI ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\ScimUser' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimUser', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\ScimUser'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ScimUser', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -43341,20 +48093,19 @@ public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationI } /** - * Operation removeLoyaltyPointsAsync + * Operation scimPatchUserAsync * - * Deduct points from customer profile + * Update SCIM user attributes * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimPatchRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeLoyaltyPointsAsync($loyaltyProgramId, $integrationId, $body) + public function scimPatchUserAsync($userId, $body) { - return $this->removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) + return $this->scimPatchUserAsyncWithHttpInfo($userId, $body) ->then( function ($response) { return $response[0]; @@ -43363,27 +48114,37 @@ function ($response) { } /** - * Operation removeLoyaltyPointsAsyncWithHttpInfo + * Operation scimPatchUserAsyncWithHttpInfo * - * Deduct points from customer profile + * Update SCIM user attributes * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimPatchRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) + public function scimPatchUserAsyncWithHttpInfo($userId, $body) { - $returnType = ''; - $request = $this->removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body); + $returnType = '\TalonOne\Client\Model\ScimUser'; + $request = $this->scimPatchUserRequest($userId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -43403,37 +48164,30 @@ function ($exception) { } /** - * Create request for operation 'removeLoyaltyPoints' + * Create request for operation 'scimPatchUser' * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (required) - * @param \TalonOne\Client\Model\DeductLoyaltyPoints $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimPatchRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body) + protected function scimPatchUserRequest($userId, $body) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling removeLoyaltyPoints' - ); - } - // verify the required parameter 'integrationId' is set - if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $integrationId when calling removeLoyaltyPoints' + 'Missing the required parameter $userId when calling scimPatchUser' ); } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling removeLoyaltyPoints' + 'Missing the required parameter $body when calling scimPatchUser' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points'; + $resourcePath = '/v1/provisioning/scim/Users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43443,18 +48197,10 @@ protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } - // path params - if ($integrationId !== null) { + if ($userId !== null) { $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), $resourcePath ); } @@ -43529,7 +48275,7 @@ protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -43537,36 +48283,38 @@ protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, } /** - * Operation resetPassword + * Operation scimReplaceUserAttributes * - * Reset password + * Update SCIM user * - * @param \TalonOne\Client\Model\NewPassword $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\NewPassword + * @return \TalonOne\Client\Model\ScimUser */ - public function resetPassword($body) + public function scimReplaceUserAttributes($userId, $body) { - list($response) = $this->resetPasswordWithHttpInfo($body); + list($response) = $this->scimReplaceUserAttributesWithHttpInfo($userId, $body); return $response; } /** - * Operation resetPasswordWithHttpInfo + * Operation scimReplaceUserAttributesWithHttpInfo * - * Reset password + * Update SCIM user * - * @param \TalonOne\Client\Model\NewPassword $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\NewPassword, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\ScimUser, HTTP status code, HTTP response headers (array of strings) */ - public function resetPasswordWithHttpInfo($body) + public function scimReplaceUserAttributesWithHttpInfo($userId, $body) { - $request = $this->resetPasswordRequest($body); + $request = $this->scimReplaceUserAttributesRequest($userId, $body); try { $options = $this->createHttpClientOption(); @@ -43598,21 +48346,21 @@ public function resetPasswordWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { - case 204: - if ('\TalonOne\Client\Model\NewPassword' === '\SplFileObject') { + case 200: + if ('\TalonOne\Client\Model\ScimUser' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\NewPassword', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ScimUser', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\NewPassword'; + $returnType = '\TalonOne\Client\Model\ScimUser'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -43628,10 +48376,10 @@ public function resetPasswordWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { - case 204: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\NewPassword', + '\TalonOne\Client\Model\ScimUser', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -43642,18 +48390,19 @@ public function resetPasswordWithHttpInfo($body) } /** - * Operation resetPasswordAsync + * Operation scimReplaceUserAttributesAsync * - * Reset password + * Update SCIM user * - * @param \TalonOne\Client\Model\NewPassword $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function resetPasswordAsync($body) + public function scimReplaceUserAttributesAsync($userId, $body) { - return $this->resetPasswordAsyncWithHttpInfo($body) + return $this->scimReplaceUserAttributesAsyncWithHttpInfo($userId, $body) ->then( function ($response) { return $response[0]; @@ -43662,19 +48411,20 @@ function ($response) { } /** - * Operation resetPasswordAsyncWithHttpInfo + * Operation scimReplaceUserAttributesAsyncWithHttpInfo * - * Reset password + * Update SCIM user * - * @param \TalonOne\Client\Model\NewPassword $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function resetPasswordAsyncWithHttpInfo($body) + public function scimReplaceUserAttributesAsyncWithHttpInfo($userId, $body) { - $returnType = '\TalonOne\Client\Model\NewPassword'; - $request = $this->resetPasswordRequest($body); + $returnType = '\TalonOne\Client\Model\ScimUser'; + $request = $this->scimReplaceUserAttributesRequest($userId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43711,23 +48461,30 @@ function ($exception) { } /** - * Create request for operation 'resetPassword' + * Create request for operation 'scimReplaceUserAttributes' * - * @param \TalonOne\Client\Model\NewPassword $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\ScimNewUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function resetPasswordRequest($body) + protected function scimReplaceUserAttributesRequest($userId, $body) { + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $userId when calling scimReplaceUserAttributes' + ); + } // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling resetPassword' + 'Missing the required parameter $body when calling scimReplaceUserAttributes' ); } - $resourcePath = '/v1/reset_password'; + $resourcePath = '/v1/provisioning/scim/Users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43736,6 +48493,14 @@ protected function resetPasswordRequest($body) + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -43807,7 +48572,7 @@ protected function resetPasswordRequest($body) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -43833,7 +48598,7 @@ protected function resetPasswordRequest($body) * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) * @param string $batchId Filter results by batches of coupons (optional) * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -43864,7 +48629,7 @@ public function searchCouponsAdvancedApplicationWideWithoutTotalCount($applicati * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) * @param string $batchId Filter results by batches of coupons (optional) * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -43966,7 +48731,7 @@ public function searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInf * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) * @param string $batchId Filter results by batches of coupons (optional) * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -44000,7 +48765,7 @@ function ($response) { * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) * @param string $batchId Filter results by batches of coupons (optional) * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -44061,7 +48826,7 @@ function ($exception) { * @param string $recipientIntegrationId Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field (optional) * @param string $batchId Filter results by batches of coupons (optional) * @param bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts. (optional) + * @param string $campaignState Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Configuration.php b/lib/Configuration.php index d28b50d3..bf8b0292 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/8.0.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/9.0.0/PHP'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: ' . PHP_EOL; - $report .= ' SDK Package Version: 8.0.0' . PHP_EOL; + $report .= ' SDK Package Version: 9.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AchievementProgress.php b/lib/Model/AchievementProgress.php index bcb2d599..f7399c5e 100644 --- a/lib/Model/AchievementProgress.php +++ b/lib/Model/AchievementProgress.php @@ -60,6 +60,7 @@ class AchievementProgress implements ModelInterface, ArrayAccess 'achievementId' => 'int', 'name' => 'string', 'title' => 'string', + 'description' => 'string', 'campaignId' => 'int', 'status' => 'string', 'target' => 'float', @@ -78,6 +79,7 @@ class AchievementProgress implements ModelInterface, ArrayAccess 'achievementId' => null, 'name' => null, 'title' => null, + 'description' => 'string', 'campaignId' => null, 'status' => null, 'target' => null, @@ -117,6 +119,7 @@ public static function openAPIFormats() 'achievementId' => 'achievementId', 'name' => 'name', 'title' => 'title', + 'description' => 'description', 'campaignId' => 'campaignId', 'status' => 'status', 'target' => 'target', @@ -135,6 +138,7 @@ public static function openAPIFormats() 'achievementId' => 'setAchievementId', 'name' => 'setName', 'title' => 'setTitle', + 'description' => 'setDescription', 'campaignId' => 'setCampaignId', 'status' => 'setStatus', 'target' => 'setTarget', @@ -153,6 +157,7 @@ public static function openAPIFormats() 'achievementId' => 'getAchievementId', 'name' => 'getName', 'title' => 'getTitle', + 'description' => 'getDescription', 'campaignId' => 'getCampaignId', 'status' => 'getStatus', 'target' => 'getTarget', @@ -242,6 +247,7 @@ public function __construct(array $data = null) $this->container['achievementId'] = isset($data['achievementId']) ? $data['achievementId'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; $this->container['status'] = isset($data['status']) ? $data['status'] : null; $this->container['target'] = isset($data['target']) ? $data['target'] : null; @@ -281,6 +287,9 @@ public function listInvalidProperties() if ($this->container['title'] === null) { $invalidProperties[] = "'title' can't be null"; } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } if ($this->container['campaignId'] === null) { $invalidProperties[] = "'campaignId' can't be null"; } @@ -401,6 +410,30 @@ public function setTitle($title) return $this; } + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description The description of the achievement in the Campaign Manager. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** * Gets campaignId * diff --git a/lib/Model/AdditionalCampaignProperties.php b/lib/Model/AdditionalCampaignProperties.php index bd2c5576..342e832b 100644 --- a/lib/Model/AdditionalCampaignProperties.php +++ b/lib/Model/AdditionalCampaignProperties.php @@ -78,7 +78,8 @@ class AdditionalCampaignProperties implements ModelInterface, ArrayAccess 'createdBy' => 'string', 'updatedBy' => 'string', 'templateId' => 'int', - 'frontendState' => 'string' + 'frontendState' => 'string', + 'storesImported' => 'bool' ]; /** @@ -108,7 +109,8 @@ class AdditionalCampaignProperties implements ModelInterface, ArrayAccess 'createdBy' => null, 'updatedBy' => null, 'templateId' => null, - 'frontendState' => null + 'frontendState' => null, + 'storesImported' => null ]; /** @@ -159,7 +161,8 @@ public static function openAPIFormats() 'createdBy' => 'createdBy', 'updatedBy' => 'updatedBy', 'templateId' => 'templateId', - 'frontendState' => 'frontendState' + 'frontendState' => 'frontendState', + 'storesImported' => 'storesImported' ]; /** @@ -189,7 +192,8 @@ public static function openAPIFormats() 'createdBy' => 'setCreatedBy', 'updatedBy' => 'setUpdatedBy', 'templateId' => 'setTemplateId', - 'frontendState' => 'setFrontendState' + 'frontendState' => 'setFrontendState', + 'storesImported' => 'setStoresImported' ]; /** @@ -219,7 +223,8 @@ public static function openAPIFormats() 'createdBy' => 'getCreatedBy', 'updatedBy' => 'getUpdatedBy', 'templateId' => 'getTemplateId', - 'frontendState' => 'getFrontendState' + 'frontendState' => 'getFrontendState', + 'storesImported' => 'getStoresImported' ]; /** @@ -266,7 +271,6 @@ public function getModelName() const FRONTEND_STATE_EXPIRED = 'expired'; const FRONTEND_STATE_SCHEDULED = 'scheduled'; const FRONTEND_STATE_RUNNING = 'running'; - const FRONTEND_STATE_DRAFT = 'draft'; const FRONTEND_STATE_DISABLED = 'disabled'; const FRONTEND_STATE_ARCHIVED = 'archived'; @@ -283,7 +287,6 @@ public function getFrontendStateAllowableValues() self::FRONTEND_STATE_EXPIRED, self::FRONTEND_STATE_SCHEDULED, self::FRONTEND_STATE_RUNNING, - self::FRONTEND_STATE_DRAFT, self::FRONTEND_STATE_DISABLED, self::FRONTEND_STATE_ARCHIVED, ]; @@ -327,6 +330,7 @@ public function __construct(array $data = null) $this->container['updatedBy'] = isset($data['updatedBy']) ? $data['updatedBy'] : null; $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; $this->container['frontendState'] = isset($data['frontendState']) ? $data['frontendState'] : null; + $this->container['storesImported'] = isset($data['storesImported']) ? $data['storesImported'] : null; } /** @@ -352,6 +356,9 @@ public function listInvalidProperties() ); } + if ($this->container['storesImported'] === null) { + $invalidProperties[] = "'storesImported' can't be null"; + } return $invalidProperties; } @@ -903,6 +910,30 @@ public function setFrontendState($frontendState) return $this; } + + /** + * Gets storesImported + * + * @return bool + */ + public function getStoresImported() + { + return $this->container['storesImported']; + } + + /** + * Sets storesImported + * + * @param bool $storesImported Indicates whether the linked stores were imported via a CSV file. + * + * @return $this + */ + public function setStoresImported($storesImported) + { + $this->container['storesImported'] = $storesImported; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ApplicationAnalyticsDataPointTotalRevenue.php b/lib/Model/AnalyticsDataPoint.php similarity index 92% rename from lib/Model/ApplicationAnalyticsDataPointTotalRevenue.php rename to lib/Model/AnalyticsDataPoint.php index b8145119..78cb824a 100644 --- a/lib/Model/ApplicationAnalyticsDataPointTotalRevenue.php +++ b/lib/Model/AnalyticsDataPoint.php @@ -1,6 +1,6 @@ container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + if ($this->container['influenced'] === null) { + $invalidProperties[] = "'influenced' can't be null"; + } return $invalidProperties; } @@ -214,7 +219,7 @@ public function valid() /** * Gets total * - * @return float|null + * @return float */ public function getTotal() { @@ -224,7 +229,7 @@ public function getTotal() /** * Sets total * - * @param float|null $total total + * @param float $total total * * @return $this */ @@ -238,7 +243,7 @@ public function setTotal($total) /** * Gets influenced * - * @return float|null + * @return float */ public function getInfluenced() { @@ -248,7 +253,7 @@ public function getInfluenced() /** * Sets influenced * - * @param float|null $influenced influenced + * @param float $influenced influenced * * @return $this */ diff --git a/lib/Model/ApplicationCampaignAnalyticsTotalDiscounts.php b/lib/Model/AnalyticsDataPointWithTrend.php similarity index 92% rename from lib/Model/ApplicationCampaignAnalyticsTotalDiscounts.php rename to lib/Model/AnalyticsDataPointWithTrend.php index ea8b42a5..4939aa36 100644 --- a/lib/Model/ApplicationCampaignAnalyticsTotalDiscounts.php +++ b/lib/Model/AnalyticsDataPointWithTrend.php @@ -1,6 +1,6 @@ container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['trend'] === null) { + $invalidProperties[] = "'trend' can't be null"; + } return $invalidProperties; } @@ -214,7 +219,7 @@ public function valid() /** * Gets value * - * @return float|null + * @return float */ public function getValue() { @@ -224,7 +229,7 @@ public function getValue() /** * Sets value * - * @param float|null $value value + * @param float $value value * * @return $this */ @@ -238,7 +243,7 @@ public function setValue($value) /** * Gets trend * - * @return float|null + * @return float */ public function getTrend() { @@ -248,7 +253,7 @@ public function getTrend() /** * Sets trend * - * @param float|null $trend trend + * @param float $trend trend * * @return $this */ diff --git a/lib/Model/ApplicationCampaignAnalyticsTotalRevenue.php b/lib/Model/AnalyticsDataPointWithTrendAndInfluencedRate.php similarity index 83% rename from lib/Model/ApplicationCampaignAnalyticsTotalRevenue.php rename to lib/Model/AnalyticsDataPointWithTrendAndInfluencedRate.php index ad460f6b..ace9204c 100644 --- a/lib/Model/ApplicationCampaignAnalyticsTotalRevenue.php +++ b/lib/Model/AnalyticsDataPointWithTrendAndInfluencedRate.php @@ -1,6 +1,6 @@ 'float', - 'influenceRate' => 'float', + 'influencedRate' => 'float', 'trend' => 'float' ]; @@ -70,7 +69,7 @@ class ApplicationCampaignAnalyticsTotalRevenue implements ModelInterface, ArrayA */ protected static $openAPIFormats = [ 'value' => null, - 'influenceRate' => null, + 'influencedRate' => null, 'trend' => null ]; @@ -102,7 +101,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'value' => 'value', - 'influenceRate' => 'influence_rate', + 'influencedRate' => 'influencedRate', 'trend' => 'trend' ]; @@ -113,7 +112,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'value' => 'setValue', - 'influenceRate' => 'setInfluenceRate', + 'influencedRate' => 'setInfluencedRate', 'trend' => 'setTrend' ]; @@ -124,7 +123,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'value' => 'getValue', - 'influenceRate' => 'getInfluenceRate', + 'influencedRate' => 'getInfluencedRate', 'trend' => 'getTrend' ]; @@ -189,7 +188,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['influenceRate'] = isset($data['influenceRate']) ? $data['influenceRate'] : null; + $this->container['influencedRate'] = isset($data['influencedRate']) ? $data['influencedRate'] : null; $this->container['trend'] = isset($data['trend']) ? $data['trend'] : null; } @@ -202,6 +201,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['influencedRate'] === null) { + $invalidProperties[] = "'influencedRate' can't be null"; + } + if ($this->container['trend'] === null) { + $invalidProperties[] = "'trend' can't be null"; + } return $invalidProperties; } @@ -220,7 +228,7 @@ public function valid() /** * Gets value * - * @return float|null + * @return float */ public function getValue() { @@ -230,7 +238,7 @@ public function getValue() /** * Sets value * - * @param float|null $value value + * @param float $value value * * @return $this */ @@ -242,25 +250,25 @@ public function setValue($value) } /** - * Gets influenceRate + * Gets influencedRate * - * @return float|null + * @return float */ - public function getInfluenceRate() + public function getInfluencedRate() { - return $this->container['influenceRate']; + return $this->container['influencedRate']; } /** - * Sets influenceRate + * Sets influencedRate * - * @param float|null $influenceRate influenceRate + * @param float $influencedRate influencedRate * * @return $this */ - public function setInfluenceRate($influenceRate) + public function setInfluencedRate($influencedRate) { - $this->container['influenceRate'] = $influenceRate; + $this->container['influencedRate'] = $influencedRate; return $this; } @@ -268,7 +276,7 @@ public function setInfluenceRate($influenceRate) /** * Gets trend * - * @return float|null + * @return float */ public function getTrend() { @@ -278,7 +286,7 @@ public function getTrend() /** * Sets trend * - * @param float|null $trend trend + * @param float $trend trend * * @return $this */ diff --git a/lib/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.php b/lib/Model/AnalyticsDataPointWithTrendAndUplift.php similarity index 90% rename from lib/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.php rename to lib/Model/AnalyticsDataPointWithTrendAndUplift.php index 62412967..cc81d8e9 100644 --- a/lib/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.php +++ b/lib/Model/AnalyticsDataPointWithTrendAndUplift.php @@ -1,6 +1,6 @@ container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['uplift'] === null) { + $invalidProperties[] = "'uplift' can't be null"; + } + if ($this->container['trend'] === null) { + $invalidProperties[] = "'trend' can't be null"; + } return $invalidProperties; } @@ -220,7 +228,7 @@ public function valid() /** * Gets value * - * @return float|null + * @return float */ public function getValue() { @@ -230,7 +238,7 @@ public function getValue() /** * Sets value * - * @param float|null $value value + * @param float $value value * * @return $this */ @@ -244,7 +252,7 @@ public function setValue($value) /** * Gets uplift * - * @return float|null + * @return float */ public function getUplift() { @@ -254,7 +262,7 @@ public function getUplift() /** * Sets uplift * - * @param float|null $uplift uplift + * @param float $uplift uplift * * @return $this */ @@ -268,7 +276,7 @@ public function setUplift($uplift) /** * Gets trend * - * @return float|null + * @return float */ public function getTrend() { @@ -278,7 +286,7 @@ public function getTrend() /** * Sets trend * - * @param float|null $trend trend + * @param float $trend trend * * @return $this */ diff --git a/lib/Model/Application.php b/lib/Model/Application.php index 278e6ea3..ba83f70e 100644 --- a/lib/Model/Application.php +++ b/lib/Model/Application.php @@ -77,6 +77,8 @@ class Application implements ModelInterface, ArrayAccess 'enablePartialDiscounts' => 'bool', 'defaultDiscountAdditionalCostPerItemScope' => 'string', 'defaultEvaluationGroupId' => 'int', + 'defaultCartItemFilterId' => 'int', + 'enableCampaignStateManagement' => 'bool', 'loyaltyPrograms' => '\TalonOne\Client\Model\LoyaltyProgram[]' ]; @@ -105,6 +107,8 @@ class Application implements ModelInterface, ArrayAccess 'enablePartialDiscounts' => null, 'defaultDiscountAdditionalCostPerItemScope' => null, 'defaultEvaluationGroupId' => null, + 'defaultCartItemFilterId' => null, + 'enableCampaignStateManagement' => null, 'loyaltyPrograms' => null ]; @@ -154,6 +158,8 @@ public static function openAPIFormats() 'enablePartialDiscounts' => 'enablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'defaultDiscountAdditionalCostPerItemScope', 'defaultEvaluationGroupId' => 'defaultEvaluationGroupId', + 'defaultCartItemFilterId' => 'defaultCartItemFilterId', + 'enableCampaignStateManagement' => 'enableCampaignStateManagement', 'loyaltyPrograms' => 'loyaltyPrograms' ]; @@ -182,6 +188,8 @@ public static function openAPIFormats() 'enablePartialDiscounts' => 'setEnablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'setDefaultDiscountAdditionalCostPerItemScope', 'defaultEvaluationGroupId' => 'setDefaultEvaluationGroupId', + 'defaultCartItemFilterId' => 'setDefaultCartItemFilterId', + 'enableCampaignStateManagement' => 'setEnableCampaignStateManagement', 'loyaltyPrograms' => 'setLoyaltyPrograms' ]; @@ -210,6 +218,8 @@ public static function openAPIFormats() 'enablePartialDiscounts' => 'getEnablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'getDefaultDiscountAdditionalCostPerItemScope', 'defaultEvaluationGroupId' => 'getDefaultEvaluationGroupId', + 'defaultCartItemFilterId' => 'getDefaultCartItemFilterId', + 'enableCampaignStateManagement' => 'getEnableCampaignStateManagement', 'loyaltyPrograms' => 'getLoyaltyPrograms' ]; @@ -343,6 +353,8 @@ public function __construct(array $data = null) $this->container['enablePartialDiscounts'] = isset($data['enablePartialDiscounts']) ? $data['enablePartialDiscounts'] : null; $this->container['defaultDiscountAdditionalCostPerItemScope'] = isset($data['defaultDiscountAdditionalCostPerItemScope']) ? $data['defaultDiscountAdditionalCostPerItemScope'] : null; $this->container['defaultEvaluationGroupId'] = isset($data['defaultEvaluationGroupId']) ? $data['defaultEvaluationGroupId'] : null; + $this->container['defaultCartItemFilterId'] = isset($data['defaultCartItemFilterId']) ? $data['defaultCartItemFilterId'] : null; + $this->container['enableCampaignStateManagement'] = isset($data['enableCampaignStateManagement']) ? $data['enableCampaignStateManagement'] : null; $this->container['loyaltyPrograms'] = isset($data['loyaltyPrograms']) ? $data['loyaltyPrograms'] : null; } @@ -928,6 +940,54 @@ public function setDefaultEvaluationGroupId($defaultEvaluationGroupId) return $this; } + /** + * Gets defaultCartItemFilterId + * + * @return int|null + */ + public function getDefaultCartItemFilterId() + { + return $this->container['defaultCartItemFilterId']; + } + + /** + * Sets defaultCartItemFilterId + * + * @param int|null $defaultCartItemFilterId The ID of the default Cart-Item-Filter for this application. + * + * @return $this + */ + public function setDefaultCartItemFilterId($defaultCartItemFilterId) + { + $this->container['defaultCartItemFilterId'] = $defaultCartItemFilterId; + + return $this; + } + + /** + * Gets enableCampaignStateManagement + * + * @return bool|null + */ + public function getEnableCampaignStateManagement() + { + return $this->container['enableCampaignStateManagement']; + } + + /** + * Sets enableCampaignStateManagement + * + * @param bool|null $enableCampaignStateManagement Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. + * + * @return $this + */ + public function setEnableCampaignStateManagement($enableCampaignStateManagement) + { + $this->container['enableCampaignStateManagement'] = $enableCampaignStateManagement; + + return $this; + } + /** * Gets loyaltyPrograms * diff --git a/lib/Model/ApplicationAnalyticsDataPoint.php b/lib/Model/ApplicationAnalyticsDataPoint.php index d4864e7a..cae0f436 100644 --- a/lib/Model/ApplicationAnalyticsDataPoint.php +++ b/lib/Model/ApplicationAnalyticsDataPoint.php @@ -59,10 +59,10 @@ class ApplicationAnalyticsDataPoint implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'startTime' => '\DateTime', 'endTime' => '\DateTime', - 'totalRevenue' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointTotalRevenue', - 'sessionsCount' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointSessionsCount', - 'avgItemsPerSession' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgItemsPerSession', - 'avgSessionValue' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgSessionValue', + 'totalRevenue' => '\TalonOne\Client\Model\AnalyticsDataPoint', + 'sessionsCount' => '\TalonOne\Client\Model\AnalyticsDataPoint', + 'avgItemsPerSession' => '\TalonOne\Client\Model\AnalyticsDataPoint', + 'avgSessionValue' => '\TalonOne\Client\Model\AnalyticsDataPoint', 'totalDiscounts' => 'float', 'couponsCount' => 'float' ]; @@ -231,6 +231,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['startTime'] === null) { + $invalidProperties[] = "'startTime' can't be null"; + } + if ($this->container['endTime'] === null) { + $invalidProperties[] = "'endTime' can't be null"; + } return $invalidProperties; } @@ -249,7 +255,7 @@ public function valid() /** * Gets startTime * - * @return \DateTime|null + * @return \DateTime */ public function getStartTime() { @@ -259,7 +265,7 @@ public function getStartTime() /** * Sets startTime * - * @param \DateTime|null $startTime The start of the aggregation time frame in UTC. + * @param \DateTime $startTime The start of the aggregation time frame in UTC. * * @return $this */ @@ -273,7 +279,7 @@ public function setStartTime($startTime) /** * Gets endTime * - * @return \DateTime|null + * @return \DateTime */ public function getEndTime() { @@ -283,7 +289,7 @@ public function getEndTime() /** * Sets endTime * - * @param \DateTime|null $endTime The end of the aggregation time frame in UTC. + * @param \DateTime $endTime The end of the aggregation time frame in UTC. * * @return $this */ @@ -297,7 +303,7 @@ public function setEndTime($endTime) /** * Gets totalRevenue * - * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointTotalRevenue|null + * @return \TalonOne\Client\Model\AnalyticsDataPoint|null */ public function getTotalRevenue() { @@ -307,7 +313,7 @@ public function getTotalRevenue() /** * Sets totalRevenue * - * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointTotalRevenue|null $totalRevenue totalRevenue + * @param \TalonOne\Client\Model\AnalyticsDataPoint|null $totalRevenue totalRevenue * * @return $this */ @@ -321,7 +327,7 @@ public function setTotalRevenue($totalRevenue) /** * Gets sessionsCount * - * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointSessionsCount|null + * @return \TalonOne\Client\Model\AnalyticsDataPoint|null */ public function getSessionsCount() { @@ -331,7 +337,7 @@ public function getSessionsCount() /** * Sets sessionsCount * - * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointSessionsCount|null $sessionsCount sessionsCount + * @param \TalonOne\Client\Model\AnalyticsDataPoint|null $sessionsCount sessionsCount * * @return $this */ @@ -345,7 +351,7 @@ public function setSessionsCount($sessionsCount) /** * Gets avgItemsPerSession * - * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgItemsPerSession|null + * @return \TalonOne\Client\Model\AnalyticsDataPoint|null */ public function getAvgItemsPerSession() { @@ -355,7 +361,7 @@ public function getAvgItemsPerSession() /** * Sets avgItemsPerSession * - * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgItemsPerSession|null $avgItemsPerSession avgItemsPerSession + * @param \TalonOne\Client\Model\AnalyticsDataPoint|null $avgItemsPerSession avgItemsPerSession * * @return $this */ @@ -369,7 +375,7 @@ public function setAvgItemsPerSession($avgItemsPerSession) /** * Gets avgSessionValue * - * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgSessionValue|null + * @return \TalonOne\Client\Model\AnalyticsDataPoint|null */ public function getAvgSessionValue() { @@ -379,7 +385,7 @@ public function getAvgSessionValue() /** * Sets avgSessionValue * - * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgSessionValue|null $avgSessionValue avgSessionValue + * @param \TalonOne\Client\Model\AnalyticsDataPoint|null $avgSessionValue avgSessionValue * * @return $this */ diff --git a/lib/Model/OutgoingIntegrationWebhookTemplate.php b/lib/Model/ApplicationCIF.php similarity index 56% rename from lib/Model/OutgoingIntegrationWebhookTemplate.php rename to lib/Model/ApplicationCIF.php index 7d679f06..0e7fd09b 100644 --- a/lib/Model/OutgoingIntegrationWebhookTemplate.php +++ b/lib/Model/ApplicationCIF.php @@ -1,6 +1,6 @@ 'int', - 'integrationType' => 'int', - 'title' => 'string', + 'created' => '\DateTime', + 'name' => 'string', 'description' => 'string', - 'payload' => 'string', - 'method' => 'string' + 'activeExpressionId' => 'int', + 'modifiedBy' => 'int', + 'createdBy' => 'int', + 'modified' => '\DateTime', + 'applicationId' => 'int' ]; /** @@ -72,11 +76,14 @@ class OutgoingIntegrationWebhookTemplate implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'id' => null, - 'integrationType' => null, - 'title' => null, + 'created' => 'date-time', + 'name' => null, 'description' => null, - 'payload' => null, - 'method' => null + 'activeExpressionId' => null, + 'modifiedBy' => null, + 'createdBy' => null, + 'modified' => 'date-time', + 'applicationId' => null ]; /** @@ -107,11 +114,14 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'integrationType' => 'integrationType', - 'title' => 'title', + 'created' => 'created', + 'name' => 'name', 'description' => 'description', - 'payload' => 'payload', - 'method' => 'method' + 'activeExpressionId' => 'activeExpressionId', + 'modifiedBy' => 'modifiedBy', + 'createdBy' => 'createdBy', + 'modified' => 'modified', + 'applicationId' => 'applicationId' ]; /** @@ -121,11 +131,14 @@ public static function openAPIFormats() */ protected static $setters = [ 'id' => 'setId', - 'integrationType' => 'setIntegrationType', - 'title' => 'setTitle', + 'created' => 'setCreated', + 'name' => 'setName', 'description' => 'setDescription', - 'payload' => 'setPayload', - 'method' => 'setMethod' + 'activeExpressionId' => 'setActiveExpressionId', + 'modifiedBy' => 'setModifiedBy', + 'createdBy' => 'setCreatedBy', + 'modified' => 'setModified', + 'applicationId' => 'setApplicationId' ]; /** @@ -135,11 +148,14 @@ public static function openAPIFormats() */ protected static $getters = [ 'id' => 'getId', - 'integrationType' => 'getIntegrationType', - 'title' => 'getTitle', + 'created' => 'getCreated', + 'name' => 'getName', 'description' => 'getDescription', - 'payload' => 'getPayload', - 'method' => 'getMethod' + 'activeExpressionId' => 'getActiveExpressionId', + 'modifiedBy' => 'getModifiedBy', + 'createdBy' => 'getCreatedBy', + 'modified' => 'getModified', + 'applicationId' => 'getApplicationId' ]; /** @@ -183,30 +199,9 @@ public function getModelName() return self::$openAPIModelName; } - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_GET = 'GET'; - const METHOD_DELETE = 'DELETE'; - const METHOD_PATCH = 'PATCH'; - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getMethodAllowableValues() - { - return [ - self::METHOD_POST, - self::METHOD_PUT, - self::METHOD_GET, - self::METHOD_DELETE, - self::METHOD_PATCH, - ]; - } - /** * Associative array for storing property values @@ -224,11 +219,14 @@ public function getMethodAllowableValues() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['integrationType'] = isset($data['integrationType']) ? $data['integrationType'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['created'] = isset($data['created']) ? $data['created'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['payload'] = isset($data['payload']) ? $data['payload'] : null; - $this->container['method'] = isset($data['method']) ? $data['method'] : null; + $this->container['activeExpressionId'] = isset($data['activeExpressionId']) ? $data['activeExpressionId'] : null; + $this->container['modifiedBy'] = isset($data['modifiedBy']) ? $data['modifiedBy'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; + $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; } /** @@ -243,45 +241,15 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ($this->container['integrationType'] === null) { - $invalidProperties[] = "'integrationType' can't be null"; - } - if ($this->container['title'] === null) { - $invalidProperties[] = "'title' can't be null"; - } - if ((mb_strlen($this->container['title']) > 255)) { - $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 255."; - } - - if ((mb_strlen($this->container['title']) < 1)) { - $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; - } - - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' can't be null"; - } - if ((mb_strlen($this->container['description']) > 1000)) { - $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 1000."; - } - - if ((mb_strlen($this->container['description']) < 1)) { - $invalidProperties[] = "invalid value for 'description', the character length must be bigger than or equal to 1."; - } - - if ($this->container['payload'] === null) { - $invalidProperties[] = "'payload' can't be null"; + if ($this->container['created'] === null) { + $invalidProperties[] = "'created' can't be null"; } - if ($this->container['method'] === null) { - $invalidProperties[] = "'method' can't be null"; + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; } - $allowedValues = $this->getMethodAllowableValues(); - if (!is_null($this->container['method']) && !in_array($this->container['method'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'method', must be one of '%s'", - implode("', '", $allowedValues) - ); + if ($this->container['applicationId'] === null) { + $invalidProperties[] = "'applicationId' can't be null"; } - return $invalidProperties; } @@ -310,7 +278,7 @@ public function getId() /** * Sets id * - * @param int $id Unique Id for this entity. + * @param int $id Internal ID of this entity. * * @return $this */ @@ -322,56 +290,49 @@ public function setId($id) } /** - * Gets integrationType + * Gets created * - * @return int + * @return \DateTime */ - public function getIntegrationType() + public function getCreated() { - return $this->container['integrationType']; + return $this->container['created']; } /** - * Sets integrationType + * Sets created * - * @param int $integrationType Unique Id of outgoing integration type. + * @param \DateTime $created The time this entity was created. * * @return $this */ - public function setIntegrationType($integrationType) + public function setCreated($created) { - $this->container['integrationType'] = $integrationType; + $this->container['created'] = $created; return $this; } /** - * Gets title + * Gets name * * @return string */ - public function getTitle() + public function getName() { - return $this->container['title']; + return $this->container['name']; } /** - * Sets title + * Sets name * - * @param string $title Title of the webhook template. + * @param string $name The name of the Application cart item filter used in API requests. * * @return $this */ - public function setTitle($title) + public function setName($name) { - if ((mb_strlen($title) > 255)) { - throw new \InvalidArgumentException('invalid length for $title when calling OutgoingIntegrationWebhookTemplate., must be smaller than or equal to 255.'); - } - if ((mb_strlen($title) < 1)) { - throw new \InvalidArgumentException('invalid length for $title when calling OutgoingIntegrationWebhookTemplate., must be bigger than or equal to 1.'); - } - - $this->container['title'] = $title; + $this->container['name'] = $name; return $this; } @@ -379,7 +340,7 @@ public function setTitle($title) /** * Gets description * - * @return string + * @return string|null */ public function getDescription() { @@ -389,77 +350,133 @@ public function getDescription() /** * Sets description * - * @param string $description General description for the specific outgoing integration webhook template. + * @param string|null $description A short description of the Application cart item filter. * * @return $this */ public function setDescription($description) { - if ((mb_strlen($description) > 1000)) { - throw new \InvalidArgumentException('invalid length for $description when calling OutgoingIntegrationWebhookTemplate., must be smaller than or equal to 1000.'); - } - if ((mb_strlen($description) < 1)) { - throw new \InvalidArgumentException('invalid length for $description when calling OutgoingIntegrationWebhookTemplate., must be bigger than or equal to 1.'); - } - $this->container['description'] = $description; return $this; } /** - * Gets payload + * Gets activeExpressionId * - * @return string + * @return int|null */ - public function getPayload() + public function getActiveExpressionId() { - return $this->container['payload']; + return $this->container['activeExpressionId']; } /** - * Sets payload + * Sets activeExpressionId * - * @param string $payload API payload (supports templating using parameters) for this webhook template. + * @param int|null $activeExpressionId The ID of the expression that the Application cart item filter uses. * * @return $this */ - public function setPayload($payload) + public function setActiveExpressionId($activeExpressionId) { - $this->container['payload'] = $payload; + $this->container['activeExpressionId'] = $activeExpressionId; return $this; } /** - * Gets method + * Gets modifiedBy * - * @return string + * @return int|null */ - public function getMethod() + public function getModifiedBy() { - return $this->container['method']; + return $this->container['modifiedBy']; } /** - * Sets method + * Sets modifiedBy * - * @param string $method API method for this webhook. + * @param int|null $modifiedBy The ID of the user who last updated the Application cart item filter. * * @return $this */ - public function setMethod($method) + public function setModifiedBy($modifiedBy) { - $allowedValues = $this->getMethodAllowableValues(); - if (!in_array($method, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'method', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['method'] = $method; + $this->container['modifiedBy'] = $modifiedBy; + + return $this; + } + + /** + * Gets createdBy + * + * @return int|null + */ + public function getCreatedBy() + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param int|null $createdBy The ID of the user who created the Application cart item filter. + * + * @return $this + */ + public function setCreatedBy($createdBy) + { + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets modified + * + * @return \DateTime|null + */ + public function getModified() + { + return $this->container['modified']; + } + + /** + * Sets modified + * + * @param \DateTime|null $modified Timestamp of the most recent update to the Application cart item filter. + * + * @return $this + */ + public function setModified($modified) + { + $this->container['modified'] = $modified; + + return $this; + } + + /** + * Gets applicationId + * + * @return int + */ + public function getApplicationId() + { + return $this->container['applicationId']; + } + + /** + * Sets applicationId + * + * @param int $applicationId The ID of the application that owns this entity. + * + * @return $this + */ + public function setApplicationId($applicationId) + { + $this->container['applicationId'] = $applicationId; return $this; } diff --git a/lib/Model/NotificationWebhook.php b/lib/Model/ApplicationCIFExpression.php similarity index 78% rename from lib/Model/NotificationWebhook.php rename to lib/Model/ApplicationCIFExpression.php index 3d04f68b..5419eb68 100644 --- a/lib/Model/NotificationWebhook.php +++ b/lib/Model/ApplicationCIFExpression.php @@ -1,6 +1,6 @@ 'int', 'created' => '\DateTime', - 'modified' => '\DateTime', - 'applicationId' => 'int', - 'url' => 'string', - 'headers' => 'string[]' + 'cartItemFilterId' => 'int', + 'createdBy' => 'int', + 'expression' => 'object[]', + 'applicationId' => 'int' ]; /** @@ -74,10 +74,10 @@ class NotificationWebhook implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'created' => 'date-time', - 'modified' => 'date-time', - 'applicationId' => null, - 'url' => null, - 'headers' => null + 'cartItemFilterId' => null, + 'createdBy' => null, + 'expression' => null, + 'applicationId' => null ]; /** @@ -109,10 +109,10 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'created' => 'created', - 'modified' => 'modified', - 'applicationId' => 'applicationId', - 'url' => 'url', - 'headers' => 'headers' + 'cartItemFilterId' => 'cartItemFilterId', + 'createdBy' => 'createdBy', + 'expression' => 'expression', + 'applicationId' => 'applicationId' ]; /** @@ -123,10 +123,10 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'created' => 'setCreated', - 'modified' => 'setModified', - 'applicationId' => 'setApplicationId', - 'url' => 'setUrl', - 'headers' => 'setHeaders' + 'cartItemFilterId' => 'setCartItemFilterId', + 'createdBy' => 'setCreatedBy', + 'expression' => 'setExpression', + 'applicationId' => 'setApplicationId' ]; /** @@ -137,10 +137,10 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'created' => 'getCreated', - 'modified' => 'getModified', - 'applicationId' => 'getApplicationId', - 'url' => 'getUrl', - 'headers' => 'getHeaders' + 'cartItemFilterId' => 'getCartItemFilterId', + 'createdBy' => 'getCreatedBy', + 'expression' => 'getExpression', + 'applicationId' => 'getApplicationId' ]; /** @@ -205,10 +205,10 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['created'] = isset($data['created']) ? $data['created'] : null; - $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; + $this->container['cartItemFilterId'] = isset($data['cartItemFilterId']) ? $data['cartItemFilterId'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['expression'] = isset($data['expression']) ? $data['expression'] : null; $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null; } /** @@ -226,18 +226,9 @@ public function listInvalidProperties() if ($this->container['created'] === null) { $invalidProperties[] = "'created' can't be null"; } - if ($this->container['modified'] === null) { - $invalidProperties[] = "'modified' can't be null"; - } if ($this->container['applicationId'] === null) { $invalidProperties[] = "'applicationId' can't be null"; } - if ($this->container['url'] === null) { - $invalidProperties[] = "'url' can't be null"; - } - if ($this->container['headers'] === null) { - $invalidProperties[] = "'headers' can't be null"; - } return $invalidProperties; } @@ -302,97 +293,97 @@ public function setCreated($created) } /** - * Gets modified + * Gets cartItemFilterId * - * @return \DateTime + * @return int|null */ - public function getModified() + public function getCartItemFilterId() { - return $this->container['modified']; + return $this->container['cartItemFilterId']; } /** - * Sets modified + * Sets cartItemFilterId * - * @param \DateTime $modified The time this entity was last modified. + * @param int|null $cartItemFilterId The ID of the Application cart item filter. * * @return $this */ - public function setModified($modified) + public function setCartItemFilterId($cartItemFilterId) { - $this->container['modified'] = $modified; + $this->container['cartItemFilterId'] = $cartItemFilterId; return $this; } /** - * Gets applicationId + * Gets createdBy * - * @return int + * @return int|null */ - public function getApplicationId() + public function getCreatedBy() { - return $this->container['applicationId']; + return $this->container['createdBy']; } /** - * Sets applicationId + * Sets createdBy * - * @param int $applicationId The ID of the application that owns this entity. + * @param int|null $createdBy The ID of the user who created the Application cart item filter. * * @return $this */ - public function setApplicationId($applicationId) + public function setCreatedBy($createdBy) { - $this->container['applicationId'] = $applicationId; + $this->container['createdBy'] = $createdBy; return $this; } /** - * Gets url + * Gets expression * - * @return string + * @return object[]|null */ - public function getUrl() + public function getExpression() { - return $this->container['url']; + return $this->container['expression']; } /** - * Sets url + * Sets expression * - * @param string $url API URL for the given webhook-based notification. + * @param object[]|null $expression Arbitrary additional JSON data associated with the Application cart item filter. * * @return $this */ - public function setUrl($url) + public function setExpression($expression) { - $this->container['url'] = $url; + $this->container['expression'] = $expression; return $this; } /** - * Gets headers + * Gets applicationId * - * @return string[] + * @return int */ - public function getHeaders() + public function getApplicationId() { - return $this->container['headers']; + return $this->container['applicationId']; } /** - * Sets headers + * Sets applicationId * - * @param string[] $headers List of API HTTP headers for the given webhook-based notification. + * @param int $applicationId The ID of the application that owns this entity. * * @return $this */ - public function setHeaders($headers) + public function setApplicationId($applicationId) { - $this->container['headers'] = $headers; + $this->container['applicationId'] = $applicationId; return $this; } diff --git a/lib/Model/ApplicationCampaignAnalytics.php b/lib/Model/ApplicationCampaignAnalytics.php index d0dc2435..f092a09d 100644 --- a/lib/Model/ApplicationCampaignAnalytics.php +++ b/lib/Model/ApplicationCampaignAnalytics.php @@ -63,15 +63,12 @@ class ApplicationCampaignAnalytics implements ModelInterface, ArrayAccess 'campaignName' => 'string', 'campaignTags' => 'string[]', 'campaignState' => 'string', - 'campaignActiveRulesetId' => 'int', - 'campaignStartTime' => '\DateTime', - 'campaignEndTime' => '\DateTime', - 'totalRevenue' => '\TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalRevenue', - 'sessionsCount' => '\TalonOne\Client\Model\ApplicationCampaignAnalyticsSessionsCount', - 'avgItemsPerSession' => '\TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgItemsPerSession', - 'avgSessionValue' => '\TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgSessionValue', - 'totalDiscounts' => '\TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalDiscounts', - 'couponsCount' => '\TalonOne\Client\Model\ApplicationCampaignAnalyticsCouponsCount' + 'totalRevenue' => '\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate', + 'sessionsCount' => '\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate', + 'avgItemsPerSession' => '\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift', + 'avgSessionValue' => '\TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift', + 'totalDiscounts' => '\TalonOne\Client\Model\AnalyticsDataPointWithTrend', + 'couponsCount' => '\TalonOne\Client\Model\AnalyticsDataPointWithTrend' ]; /** @@ -86,9 +83,6 @@ class ApplicationCampaignAnalytics implements ModelInterface, ArrayAccess 'campaignName' => null, 'campaignTags' => null, 'campaignState' => null, - 'campaignActiveRulesetId' => null, - 'campaignStartTime' => 'date-time', - 'campaignEndTime' => 'date-time', 'totalRevenue' => null, 'sessionsCount' => null, 'avgItemsPerSession' => null, @@ -130,9 +124,6 @@ public static function openAPIFormats() 'campaignName' => 'campaignName', 'campaignTags' => 'campaignTags', 'campaignState' => 'campaignState', - 'campaignActiveRulesetId' => 'campaignActiveRulesetId', - 'campaignStartTime' => 'campaignStartTime', - 'campaignEndTime' => 'campaignEndTime', 'totalRevenue' => 'totalRevenue', 'sessionsCount' => 'sessionsCount', 'avgItemsPerSession' => 'avgItemsPerSession', @@ -153,9 +144,6 @@ public static function openAPIFormats() 'campaignName' => 'setCampaignName', 'campaignTags' => 'setCampaignTags', 'campaignState' => 'setCampaignState', - 'campaignActiveRulesetId' => 'setCampaignActiveRulesetId', - 'campaignStartTime' => 'setCampaignStartTime', - 'campaignEndTime' => 'setCampaignEndTime', 'totalRevenue' => 'setTotalRevenue', 'sessionsCount' => 'setSessionsCount', 'avgItemsPerSession' => 'setAvgItemsPerSession', @@ -176,9 +164,6 @@ public static function openAPIFormats() 'campaignName' => 'getCampaignName', 'campaignTags' => 'getCampaignTags', 'campaignState' => 'getCampaignState', - 'campaignActiveRulesetId' => 'getCampaignActiveRulesetId', - 'campaignStartTime' => 'getCampaignStartTime', - 'campaignEndTime' => 'getCampaignEndTime', 'totalRevenue' => 'getTotalRevenue', 'sessionsCount' => 'getSessionsCount', 'avgItemsPerSession' => 'getAvgItemsPerSession', @@ -228,7 +213,9 @@ public function getModelName() return self::$openAPIModelName; } - const CAMPAIGN_STATE_ENABLED = 'enabled'; + const CAMPAIGN_STATE_EXPIRED = 'expired'; + const CAMPAIGN_STATE_SCHEDULED = 'scheduled'; + const CAMPAIGN_STATE_RUNNING = 'running'; const CAMPAIGN_STATE_DISABLED = 'disabled'; const CAMPAIGN_STATE_ARCHIVED = 'archived'; @@ -242,7 +229,9 @@ public function getModelName() public function getCampaignStateAllowableValues() { return [ - self::CAMPAIGN_STATE_ENABLED, + self::CAMPAIGN_STATE_EXPIRED, + self::CAMPAIGN_STATE_SCHEDULED, + self::CAMPAIGN_STATE_RUNNING, self::CAMPAIGN_STATE_DISABLED, self::CAMPAIGN_STATE_ARCHIVED, ]; @@ -269,10 +258,7 @@ public function __construct(array $data = null) $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; $this->container['campaignName'] = isset($data['campaignName']) ? $data['campaignName'] : null; $this->container['campaignTags'] = isset($data['campaignTags']) ? $data['campaignTags'] : null; - $this->container['campaignState'] = isset($data['campaignState']) ? $data['campaignState'] : 'enabled'; - $this->container['campaignActiveRulesetId'] = isset($data['campaignActiveRulesetId']) ? $data['campaignActiveRulesetId'] : null; - $this->container['campaignStartTime'] = isset($data['campaignStartTime']) ? $data['campaignStartTime'] : null; - $this->container['campaignEndTime'] = isset($data['campaignEndTime']) ? $data['campaignEndTime'] : null; + $this->container['campaignState'] = isset($data['campaignState']) ? $data['campaignState'] : null; $this->container['totalRevenue'] = isset($data['totalRevenue']) ? $data['totalRevenue'] : null; $this->container['sessionsCount'] = isset($data['sessionsCount']) ? $data['sessionsCount'] : null; $this->container['avgItemsPerSession'] = isset($data['avgItemsPerSession']) ? $data['avgItemsPerSession'] : null; @@ -290,6 +276,24 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['startTime'] === null) { + $invalidProperties[] = "'startTime' can't be null"; + } + if ($this->container['endTime'] === null) { + $invalidProperties[] = "'endTime' can't be null"; + } + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['campaignName'] === null) { + $invalidProperties[] = "'campaignName' can't be null"; + } + if ($this->container['campaignTags'] === null) { + $invalidProperties[] = "'campaignTags' can't be null"; + } + if ($this->container['campaignState'] === null) { + $invalidProperties[] = "'campaignState' can't be null"; + } $allowedValues = $this->getCampaignStateAllowableValues(); if (!is_null($this->container['campaignState']) && !in_array($this->container['campaignState'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -316,7 +320,7 @@ public function valid() /** * Gets startTime * - * @return \DateTime|null + * @return \DateTime */ public function getStartTime() { @@ -326,7 +330,7 @@ public function getStartTime() /** * Sets startTime * - * @param \DateTime|null $startTime The start of the aggregation time frame in UTC. + * @param \DateTime $startTime The start of the aggregation time frame in UTC. * * @return $this */ @@ -340,7 +344,7 @@ public function setStartTime($startTime) /** * Gets endTime * - * @return \DateTime|null + * @return \DateTime */ public function getEndTime() { @@ -350,7 +354,7 @@ public function getEndTime() /** * Sets endTime * - * @param \DateTime|null $endTime The end of the aggregation time frame in UTC. + * @param \DateTime $endTime The end of the aggregation time frame in UTC. * * @return $this */ @@ -364,7 +368,7 @@ public function setEndTime($endTime) /** * Gets campaignId * - * @return int|null + * @return int */ public function getCampaignId() { @@ -374,7 +378,7 @@ public function getCampaignId() /** * Sets campaignId * - * @param int|null $campaignId The ID of the campaign. + * @param int $campaignId The ID of the campaign. * * @return $this */ @@ -388,7 +392,7 @@ public function setCampaignId($campaignId) /** * Gets campaignName * - * @return string|null + * @return string */ public function getCampaignName() { @@ -398,7 +402,7 @@ public function getCampaignName() /** * Sets campaignName * - * @param string|null $campaignName The name of the campaign. + * @param string $campaignName The name of the campaign. * * @return $this */ @@ -412,7 +416,7 @@ public function setCampaignName($campaignName) /** * Gets campaignTags * - * @return string[]|null + * @return string[] */ public function getCampaignTags() { @@ -422,7 +426,7 @@ public function getCampaignTags() /** * Sets campaignTags * - * @param string[]|null $campaignTags A list of tags for the campaign. + * @param string[] $campaignTags A list of tags for the campaign. * * @return $this */ @@ -436,7 +440,7 @@ public function setCampaignTags($campaignTags) /** * Gets campaignState * - * @return string|null + * @return string */ public function getCampaignState() { @@ -446,14 +450,14 @@ public function getCampaignState() /** * Sets campaignState * - * @param string|null $campaignState The state of the campaign. **Note:** A disabled or archived campaign is not evaluated for rules or coupons. + * @param string $campaignState The state of the campaign. **Note:** A disabled or archived campaign is not evaluated for rules or coupons. * * @return $this */ public function setCampaignState($campaignState) { $allowedValues = $this->getCampaignStateAllowableValues(); - if (!is_null($campaignState) && !in_array($campaignState, $allowedValues, true)) { + if (!in_array($campaignState, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'campaignState', must be one of '%s'", @@ -466,82 +470,10 @@ public function setCampaignState($campaignState) return $this; } - /** - * Gets campaignActiveRulesetId - * - * @return int|null - */ - public function getCampaignActiveRulesetId() - { - return $this->container['campaignActiveRulesetId']; - } - - /** - * Sets campaignActiveRulesetId - * - * @param int|null $campaignActiveRulesetId The [ID of the ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. - * - * @return $this - */ - public function setCampaignActiveRulesetId($campaignActiveRulesetId) - { - $this->container['campaignActiveRulesetId'] = $campaignActiveRulesetId; - - return $this; - } - - /** - * Gets campaignStartTime - * - * @return \DateTime|null - */ - public function getCampaignStartTime() - { - return $this->container['campaignStartTime']; - } - - /** - * Sets campaignStartTime - * - * @param \DateTime|null $campaignStartTime Date and time when the campaign becomes active. - * - * @return $this - */ - public function setCampaignStartTime($campaignStartTime) - { - $this->container['campaignStartTime'] = $campaignStartTime; - - return $this; - } - - /** - * Gets campaignEndTime - * - * @return \DateTime|null - */ - public function getCampaignEndTime() - { - return $this->container['campaignEndTime']; - } - - /** - * Sets campaignEndTime - * - * @param \DateTime|null $campaignEndTime Date and time when the campaign becomes inactive. - * - * @return $this - */ - public function setCampaignEndTime($campaignEndTime) - { - $this->container['campaignEndTime'] = $campaignEndTime; - - return $this; - } - /** * Gets totalRevenue * - * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalRevenue|null + * @return \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate|null */ public function getTotalRevenue() { @@ -551,7 +483,7 @@ public function getTotalRevenue() /** * Sets totalRevenue * - * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalRevenue|null $totalRevenue totalRevenue + * @param \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate|null $totalRevenue totalRevenue * * @return $this */ @@ -565,7 +497,7 @@ public function setTotalRevenue($totalRevenue) /** * Gets sessionsCount * - * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsSessionsCount|null + * @return \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate|null */ public function getSessionsCount() { @@ -575,7 +507,7 @@ public function getSessionsCount() /** * Sets sessionsCount * - * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsSessionsCount|null $sessionsCount sessionsCount + * @param \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndInfluencedRate|null $sessionsCount sessionsCount * * @return $this */ @@ -589,7 +521,7 @@ public function setSessionsCount($sessionsCount) /** * Gets avgItemsPerSession * - * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgItemsPerSession|null + * @return \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift|null */ public function getAvgItemsPerSession() { @@ -599,7 +531,7 @@ public function getAvgItemsPerSession() /** * Sets avgItemsPerSession * - * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgItemsPerSession|null $avgItemsPerSession avgItemsPerSession + * @param \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift|null $avgItemsPerSession avgItemsPerSession * * @return $this */ @@ -613,7 +545,7 @@ public function setAvgItemsPerSession($avgItemsPerSession) /** * Gets avgSessionValue * - * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgSessionValue|null + * @return \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift|null */ public function getAvgSessionValue() { @@ -623,7 +555,7 @@ public function getAvgSessionValue() /** * Sets avgSessionValue * - * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgSessionValue|null $avgSessionValue avgSessionValue + * @param \TalonOne\Client\Model\AnalyticsDataPointWithTrendAndUplift|null $avgSessionValue avgSessionValue * * @return $this */ @@ -637,7 +569,7 @@ public function setAvgSessionValue($avgSessionValue) /** * Gets totalDiscounts * - * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalDiscounts|null + * @return \TalonOne\Client\Model\AnalyticsDataPointWithTrend|null */ public function getTotalDiscounts() { @@ -647,7 +579,7 @@ public function getTotalDiscounts() /** * Sets totalDiscounts * - * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalDiscounts|null $totalDiscounts totalDiscounts + * @param \TalonOne\Client\Model\AnalyticsDataPointWithTrend|null $totalDiscounts totalDiscounts * * @return $this */ @@ -661,7 +593,7 @@ public function setTotalDiscounts($totalDiscounts) /** * Gets couponsCount * - * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsCouponsCount|null + * @return \TalonOne\Client\Model\AnalyticsDataPointWithTrend|null */ public function getCouponsCount() { @@ -671,7 +603,7 @@ public function getCouponsCount() /** * Sets couponsCount * - * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsCouponsCount|null $couponsCount couponsCount + * @param \TalonOne\Client\Model\AnalyticsDataPointWithTrend|null $couponsCount couponsCount * * @return $this */ diff --git a/lib/Model/ApplicationCampaignStats.php b/lib/Model/ApplicationCampaignStats.php index 4371b23c..44fef79b 100644 --- a/lib/Model/ApplicationCampaignStats.php +++ b/lib/Model/ApplicationCampaignStats.php @@ -58,7 +58,6 @@ class ApplicationCampaignStats implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'draft' => 'int', 'disabled' => 'int', 'scheduled' => 'int', 'running' => 'int', @@ -72,7 +71,6 @@ class ApplicationCampaignStats implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'draft' => null, 'disabled' => null, 'scheduled' => null, 'running' => null, @@ -107,7 +105,6 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'draft' => 'draft', 'disabled' => 'disabled', 'scheduled' => 'scheduled', 'running' => 'running', @@ -121,7 +118,6 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'draft' => 'setDraft', 'disabled' => 'setDisabled', 'scheduled' => 'setScheduled', 'running' => 'setRunning', @@ -135,7 +131,6 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'draft' => 'getDraft', 'disabled' => 'getDisabled', 'scheduled' => 'getScheduled', 'running' => 'getRunning', @@ -203,7 +198,6 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['draft'] = isset($data['draft']) ? $data['draft'] : null; $this->container['disabled'] = isset($data['disabled']) ? $data['disabled'] : null; $this->container['scheduled'] = isset($data['scheduled']) ? $data['scheduled'] : null; $this->container['running'] = isset($data['running']) ? $data['running'] : null; @@ -220,9 +214,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['draft'] === null) { - $invalidProperties[] = "'draft' can't be null"; - } if ($this->container['disabled'] === null) { $invalidProperties[] = "'disabled' can't be null"; } @@ -253,30 +244,6 @@ public function valid() } - /** - * Gets draft - * - * @return int - */ - public function getDraft() - { - return $this->container['draft']; - } - - /** - * Sets draft - * - * @param int $draft Number of draft campaigns. - * - * @return $this - */ - public function setDraft($draft) - { - $this->container['draft'] = $draft; - - return $this; - } - /** * Gets disabled * diff --git a/lib/Model/AsyncCouponDeletionJobResponse.php b/lib/Model/AsyncCouponDeletionJobResponse.php new file mode 100644 index 00000000..5424f55a --- /dev/null +++ b/lib/Model/AsyncCouponDeletionJobResponse.php @@ -0,0 +1,312 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/Attribute.php b/lib/Model/Attribute.php index cd769e8e..f727f6a9 100644 --- a/lib/Model/Attribute.php +++ b/lib/Model/Attribute.php @@ -239,7 +239,6 @@ public function getModelName() return self::$openAPIModelName; } - const ENTITY_ACCOUNT = 'Account'; const ENTITY_APPLICATION = 'Application'; const ENTITY_CAMPAIGN = 'Campaign'; const ENTITY_CUSTOMER_PROFILE = 'CustomerProfile'; @@ -272,7 +271,6 @@ public function getModelName() public function getEntityAllowableValues() { return [ - self::ENTITY_ACCOUNT, self::ENTITY_APPLICATION, self::ENTITY_CAMPAIGN, self::ENTITY_CUSTOMER_PROFILE, diff --git a/lib/Model/BaseLoyaltyProgram.php b/lib/Model/BaseLoyaltyProgram.php index 74cf4efb..1cae20fd 100644 --- a/lib/Model/BaseLoyaltyProgram.php +++ b/lib/Model/BaseLoyaltyProgram.php @@ -65,10 +65,12 @@ class BaseLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'programJoinPolicy' => 'string', 'tiersExpirationPolicy' => 'string', + 'tierCycleStartDate' => '\DateTime', 'tiersExpireIn' => 'string', 'tiersDowngradePolicy' => 'string', - 'programJoinPolicy' => 'string' + 'cardCodeSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings' ]; /** @@ -85,10 +87,12 @@ class BaseLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'programJoinPolicy' => null, 'tiersExpirationPolicy' => null, + 'tierCycleStartDate' => 'date-time', 'tiersExpireIn' => null, 'tiersDowngradePolicy' => null, - 'programJoinPolicy' => null + 'cardCodeSettings' => null ]; /** @@ -126,10 +130,12 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'programJoinPolicy' => 'programJoinPolicy', 'tiersExpirationPolicy' => 'tiersExpirationPolicy', + 'tierCycleStartDate' => 'tierCycleStartDate', 'tiersExpireIn' => 'tiersExpireIn', 'tiersDowngradePolicy' => 'tiersDowngradePolicy', - 'programJoinPolicy' => 'programJoinPolicy' + 'cardCodeSettings' => 'cardCodeSettings' ]; /** @@ -146,10 +152,12 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'programJoinPolicy' => 'setProgramJoinPolicy', 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', + 'tierCycleStartDate' => 'setTierCycleStartDate', 'tiersExpireIn' => 'setTiersExpireIn', 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', - 'programJoinPolicy' => 'setProgramJoinPolicy' + 'cardCodeSettings' => 'setCardCodeSettings' ]; /** @@ -166,10 +174,12 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'programJoinPolicy' => 'getProgramJoinPolicy', 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', + 'tierCycleStartDate' => 'getTierCycleStartDate', 'tiersExpireIn' => 'getTiersExpireIn', 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', - 'programJoinPolicy' => 'getProgramJoinPolicy' + 'cardCodeSettings' => 'getCardCodeSettings' ]; /** @@ -213,13 +223,15 @@ public function getModelName() return self::$openAPIModelName; } + const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; + const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; + const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; + const TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE = 'customer_attribute'; + const TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION = 'absolute_expiration'; const TIERS_DOWNGRADE_POLICY_ONE_DOWN = 'one_down'; const TIERS_DOWNGRADE_POLICY_BALANCE_BASED = 'balance_based'; - const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; - const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; - const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; @@ -228,11 +240,12 @@ public function getModelName() * * @return string[] */ - public function getTiersExpirationPolicyAllowableValues() + public function getProgramJoinPolicyAllowableValues() { return [ - self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, - self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, ]; } @@ -241,11 +254,13 @@ public function getTiersExpirationPolicyAllowableValues() * * @return string[] */ - public function getTiersDowngradePolicyAllowableValues() + public function getTiersExpirationPolicyAllowableValues() { return [ - self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, - self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE, + self::TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION, ]; } @@ -254,12 +269,11 @@ public function getTiersDowngradePolicyAllowableValues() * * @return string[] */ - public function getProgramJoinPolicyAllowableValues() + public function getTiersDowngradePolicyAllowableValues() { return [ - self::PROGRAM_JOIN_POLICY_NOT_JOIN, - self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, - self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, + self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, ]; } @@ -287,10 +301,12 @@ public function __construct(array $data = null) $this->container['allowSubledger'] = isset($data['allowSubledger']) ? $data['allowSubledger'] : null; $this->container['usersPerCardLimit'] = isset($data['usersPerCardLimit']) ? $data['usersPerCardLimit'] : null; $this->container['sandbox'] = isset($data['sandbox']) ? $data['sandbox'] : null; + $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; $this->container['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : null; + $this->container['tierCycleStartDate'] = isset($data['tierCycleStartDate']) ? $data['tierCycleStartDate'] : null; $this->container['tiersExpireIn'] = isset($data['tiersExpireIn']) ? $data['tiersExpireIn'] : null; $this->container['tiersDowngradePolicy'] = isset($data['tiersDowngradePolicy']) ? $data['tiersDowngradePolicy'] : null; - $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; + $this->container['cardCodeSettings'] = isset($data['cardCodeSettings']) ? $data['cardCodeSettings'] : null; } /** @@ -306,6 +322,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'usersPerCardLimit', must be bigger than or equal to 0."; } + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -322,14 +346,6 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - return $invalidProperties; } @@ -542,6 +558,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets programJoinPolicy + * + * @return string|null + */ + public function getProgramJoinPolicy() + { + return $this->container['programJoinPolicy']; + } + + /** + * Sets programJoinPolicy + * + * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * + * @return $this + */ + public function setProgramJoinPolicy($programJoinPolicy) + { + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['programJoinPolicy'] = $programJoinPolicy; + + return $this; + } + /** * Gets tiersExpirationPolicy * @@ -555,7 +604,7 @@ public function getTiersExpirationPolicy() /** * Sets tiersExpirationPolicy * - * @param string|null $tiersExpirationPolicy The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. + * @param string|null $tiersExpirationPolicy The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. * * @return $this */ @@ -575,6 +624,30 @@ public function setTiersExpirationPolicy($tiersExpirationPolicy) return $this; } + /** + * Gets tierCycleStartDate + * + * @return \DateTime|null + */ + public function getTierCycleStartDate() + { + return $this->container['tierCycleStartDate']; + } + + /** + * Sets tierCycleStartDate + * + * @param \DateTime|null $tierCycleStartDate Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. + * + * @return $this + */ + public function setTierCycleStartDate($tierCycleStartDate) + { + $this->container['tierCycleStartDate'] = $tierCycleStartDate; + + return $this; + } + /** * Gets tiersExpireIn * @@ -588,7 +661,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. + * @param string|null $tiersExpireIn The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. * * @return $this */ @@ -612,7 +685,7 @@ public function getTiersDowngradePolicy() /** * Sets tiersDowngradePolicy * - * @param string|null $tiersDowngradePolicy Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. + * @param string|null $tiersDowngradePolicy The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. * * @return $this */ @@ -633,34 +706,25 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) } /** - * Gets programJoinPolicy + * Gets cardCodeSettings * - * @return string|null + * @return \TalonOne\Client\Model\CodeGeneratorSettings|null */ - public function getProgramJoinPolicy() + public function getCardCodeSettings() { - return $this->container['programJoinPolicy']; + return $this->container['cardCodeSettings']; } /** - * Sets programJoinPolicy + * Sets cardCodeSettings * - * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $cardCodeSettings cardCodeSettings * * @return $this */ - public function setProgramJoinPolicy($programJoinPolicy) + public function setCardCodeSettings($cardCodeSettings) { - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['programJoinPolicy'] = $programJoinPolicy; + $this->container['cardCodeSettings'] = $cardCodeSettings; return $this; } diff --git a/lib/Model/BaseNotification.php b/lib/Model/BaseNotification.php index 34971007..1a8454f7 100644 --- a/lib/Model/BaseNotification.php +++ b/lib/Model/BaseNotification.php @@ -181,6 +181,7 @@ public function getModelName() const TYPE_CAMPAIGN = 'campaign'; const TYPE_LOYALTY_ADDED_DEDUCTED_POINTS = 'loyalty_added_deducted_points'; + const TYPE_CARD_ADDED_DEDUCTED_POINTS = 'card_added_deducted_points'; const TYPE_COUPON = 'coupon'; const TYPE_EXPIRING_COUPONS = 'expiring_coupons'; const TYPE_EXPIRING_POINTS = 'expiring_points'; @@ -203,6 +204,7 @@ public function getTypeAllowableValues() return [ self::TYPE_CAMPAIGN, self::TYPE_LOYALTY_ADDED_DEDUCTED_POINTS, + self::TYPE_CARD_ADDED_DEDUCTED_POINTS, self::TYPE_COUPON, self::TYPE_EXPIRING_COUPONS, self::TYPE_EXPIRING_POINTS, @@ -299,7 +301,7 @@ public function getPolicy() /** * Sets policy * - * @param object $policy policy + * @param object $policy Indicates which notification properties to apply. * * @return $this */ diff --git a/lib/Model/BaseNotificationEntity.php b/lib/Model/BaseNotificationEntity.php index 735b9edc..fc59604d 100644 --- a/lib/Model/BaseNotificationEntity.php +++ b/lib/Model/BaseNotificationEntity.php @@ -226,7 +226,7 @@ public function getPolicy() /** * Sets policy * - * @param object $policy policy + * @param object $policy Indicates which notification properties to apply. * * @return $this */ diff --git a/lib/Model/Campaign.php b/lib/Model/Campaign.php index 262582c7..63983ca1 100644 --- a/lib/Model/Campaign.php +++ b/lib/Model/Campaign.php @@ -98,7 +98,14 @@ class Campaign implements ModelInterface, ArrayAccess 'createdBy' => 'string', 'updatedBy' => 'string', 'templateId' => 'int', - 'frontendState' => 'string' + 'frontendState' => 'string', + 'storesImported' => 'bool', + 'activeRevisionId' => 'int', + 'activeRevisionVersionId' => 'int', + 'version' => 'int', + 'currentRevisionId' => 'int', + 'currentRevisionVersionId' => 'int', + 'stageRevision' => 'bool' ]; /** @@ -147,7 +154,14 @@ class Campaign implements ModelInterface, ArrayAccess 'createdBy' => null, 'updatedBy' => null, 'templateId' => null, - 'frontendState' => null + 'frontendState' => null, + 'storesImported' => null, + 'activeRevisionId' => null, + 'activeRevisionVersionId' => null, + 'version' => null, + 'currentRevisionId' => null, + 'currentRevisionVersionId' => null, + 'stageRevision' => null ]; /** @@ -217,7 +231,14 @@ public static function openAPIFormats() 'createdBy' => 'createdBy', 'updatedBy' => 'updatedBy', 'templateId' => 'templateId', - 'frontendState' => 'frontendState' + 'frontendState' => 'frontendState', + 'storesImported' => 'storesImported', + 'activeRevisionId' => 'activeRevisionId', + 'activeRevisionVersionId' => 'activeRevisionVersionId', + 'version' => 'version', + 'currentRevisionId' => 'currentRevisionId', + 'currentRevisionVersionId' => 'currentRevisionVersionId', + 'stageRevision' => 'stageRevision' ]; /** @@ -266,7 +287,14 @@ public static function openAPIFormats() 'createdBy' => 'setCreatedBy', 'updatedBy' => 'setUpdatedBy', 'templateId' => 'setTemplateId', - 'frontendState' => 'setFrontendState' + 'frontendState' => 'setFrontendState', + 'storesImported' => 'setStoresImported', + 'activeRevisionId' => 'setActiveRevisionId', + 'activeRevisionVersionId' => 'setActiveRevisionVersionId', + 'version' => 'setVersion', + 'currentRevisionId' => 'setCurrentRevisionId', + 'currentRevisionVersionId' => 'setCurrentRevisionVersionId', + 'stageRevision' => 'setStageRevision' ]; /** @@ -315,7 +343,14 @@ public static function openAPIFormats() 'createdBy' => 'getCreatedBy', 'updatedBy' => 'getUpdatedBy', 'templateId' => 'getTemplateId', - 'frontendState' => 'getFrontendState' + 'frontendState' => 'getFrontendState', + 'storesImported' => 'getStoresImported', + 'activeRevisionId' => 'getActiveRevisionId', + 'activeRevisionVersionId' => 'getActiveRevisionVersionId', + 'version' => 'getVersion', + 'currentRevisionId' => 'getCurrentRevisionId', + 'currentRevisionVersionId' => 'getCurrentRevisionVersionId', + 'stageRevision' => 'getStageRevision' ]; /** @@ -373,7 +408,6 @@ public function getModelName() const FRONTEND_STATE_EXPIRED = 'expired'; const FRONTEND_STATE_SCHEDULED = 'scheduled'; const FRONTEND_STATE_RUNNING = 'running'; - const FRONTEND_STATE_DRAFT = 'draft'; const FRONTEND_STATE_DISABLED = 'disabled'; const FRONTEND_STATE_ARCHIVED = 'archived'; @@ -434,7 +468,6 @@ public function getFrontendStateAllowableValues() self::FRONTEND_STATE_EXPIRED, self::FRONTEND_STATE_SCHEDULED, self::FRONTEND_STATE_RUNNING, - self::FRONTEND_STATE_DRAFT, self::FRONTEND_STATE_DISABLED, self::FRONTEND_STATE_ARCHIVED, ]; @@ -497,6 +530,13 @@ public function __construct(array $data = null) $this->container['updatedBy'] = isset($data['updatedBy']) ? $data['updatedBy'] : null; $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; $this->container['frontendState'] = isset($data['frontendState']) ? $data['frontendState'] : null; + $this->container['storesImported'] = isset($data['storesImported']) ? $data['storesImported'] : null; + $this->container['activeRevisionId'] = isset($data['activeRevisionId']) ? $data['activeRevisionId'] : null; + $this->container['activeRevisionVersionId'] = isset($data['activeRevisionVersionId']) ? $data['activeRevisionVersionId'] : null; + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + $this->container['currentRevisionId'] = isset($data['currentRevisionId']) ? $data['currentRevisionId'] : null; + $this->container['currentRevisionVersionId'] = isset($data['currentRevisionVersionId']) ? $data['currentRevisionVersionId'] : null; + $this->container['stageRevision'] = isset($data['stageRevision']) ? $data['stageRevision'] : false; } /** @@ -575,6 +615,9 @@ public function listInvalidProperties() ); } + if ($this->container['storesImported'] === null) { + $invalidProperties[] = "'storesImported' can't be null"; + } return $invalidProperties; } @@ -1614,6 +1657,174 @@ public function setFrontendState($frontendState) return $this; } + + /** + * Gets storesImported + * + * @return bool + */ + public function getStoresImported() + { + return $this->container['storesImported']; + } + + /** + * Sets storesImported + * + * @param bool $storesImported Indicates whether the linked stores were imported via a CSV file. + * + * @return $this + */ + public function setStoresImported($storesImported) + { + $this->container['storesImported'] = $storesImported; + + return $this; + } + + /** + * Gets activeRevisionId + * + * @return int|null + */ + public function getActiveRevisionId() + { + return $this->container['activeRevisionId']; + } + + /** + * Sets activeRevisionId + * + * @param int|null $activeRevisionId ID of the revision that was last activated on this campaign. + * + * @return $this + */ + public function setActiveRevisionId($activeRevisionId) + { + $this->container['activeRevisionId'] = $activeRevisionId; + + return $this; + } + + /** + * Gets activeRevisionVersionId + * + * @return int|null + */ + public function getActiveRevisionVersionId() + { + return $this->container['activeRevisionVersionId']; + } + + /** + * Sets activeRevisionVersionId + * + * @param int|null $activeRevisionVersionId ID of the revision version that is active on the campaign. + * + * @return $this + */ + public function setActiveRevisionVersionId($activeRevisionVersionId) + { + $this->container['activeRevisionVersionId'] = $activeRevisionVersionId; + + return $this; + } + + /** + * Gets version + * + * @return int|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int|null $version Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets currentRevisionId + * + * @return int|null + */ + public function getCurrentRevisionId() + { + return $this->container['currentRevisionId']; + } + + /** + * Sets currentRevisionId + * + * @param int|null $currentRevisionId ID of the revision currently being modified for the campaign. + * + * @return $this + */ + public function setCurrentRevisionId($currentRevisionId) + { + $this->container['currentRevisionId'] = $currentRevisionId; + + return $this; + } + + /** + * Gets currentRevisionVersionId + * + * @return int|null + */ + public function getCurrentRevisionVersionId() + { + return $this->container['currentRevisionVersionId']; + } + + /** + * Sets currentRevisionVersionId + * + * @param int|null $currentRevisionVersionId ID of the latest version applied on the current revision. + * + * @return $this + */ + public function setCurrentRevisionVersionId($currentRevisionVersionId) + { + $this->container['currentRevisionVersionId'] = $currentRevisionVersionId; + + return $this; + } + + /** + * Gets stageRevision + * + * @return bool|null + */ + public function getStageRevision() + { + return $this->container['stageRevision']; + } + + /** + * Sets stageRevision + * + * @param bool|null $stageRevision Flag for determining whether we use current revision when sending requests with staging API key. + * + * @return $this + */ + public function setStageRevision($stageRevision) + { + $this->container['stageRevision'] = $stageRevision; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CampaignCollectionEditedNotification.php b/lib/Model/CampaignCollectionEditedNotification.php new file mode 100644 index 00000000..4d2f3a83 --- /dev/null +++ b/lib/Model/CampaignCollectionEditedNotification.php @@ -0,0 +1,375 @@ + '\TalonOne\Client\Model\Campaign', + 'ruleset' => '\TalonOne\Client\Model\Ruleset', + 'collection' => '\TalonOne\Client\Model\CollectionWithoutPayload' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'campaign' => null, + 'ruleset' => null, + 'collection' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaign' => 'campaign', + 'ruleset' => 'ruleset', + 'collection' => 'collection' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaign' => 'setCampaign', + 'ruleset' => 'setRuleset', + 'collection' => 'setCollection' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaign' => 'getCampaign', + 'ruleset' => 'getRuleset', + 'collection' => 'getCollection' + ]; + + /** + * 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->container['campaign'] = isset($data['campaign']) ? $data['campaign'] : null; + $this->container['ruleset'] = isset($data['ruleset']) ? $data['ruleset'] : null; + $this->container['collection'] = isset($data['collection']) ? $data['collection'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaign'] === null) { + $invalidProperties[] = "'campaign' can't be null"; + } + if ($this->container['collection'] === null) { + $invalidProperties[] = "'collection' 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 campaign + * + * @return \TalonOne\Client\Model\Campaign + */ + public function getCampaign() + { + return $this->container['campaign']; + } + + /** + * Sets campaign + * + * @param \TalonOne\Client\Model\Campaign $campaign campaign + * + * @return $this + */ + public function setCampaign($campaign) + { + $this->container['campaign'] = $campaign; + + return $this; + } + + /** + * Gets ruleset + * + * @return \TalonOne\Client\Model\Ruleset|null + */ + public function getRuleset() + { + return $this->container['ruleset']; + } + + /** + * Sets ruleset + * + * @param \TalonOne\Client\Model\Ruleset|null $ruleset ruleset + * + * @return $this + */ + public function setRuleset($ruleset) + { + $this->container['ruleset'] = $ruleset; + + return $this; + } + + /** + * Gets collection + * + * @return \TalonOne\Client\Model\CollectionWithoutPayload + */ + public function getCollection() + { + return $this->container['collection']; + } + + /** + * Sets collection + * + * @param \TalonOne\Client\Model\CollectionWithoutPayload $collection collection + * + * @return $this + */ + public function setCollection($collection) + { + $this->container['collection'] = $collection; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/CampaignForNotification.php b/lib/Model/CampaignForNotification.php deleted file mode 100644 index f015f287..00000000 --- a/lib/Model/CampaignForNotification.php +++ /dev/null @@ -1,1658 +0,0 @@ - 'int', - 'created' => '\DateTime', - 'applicationId' => 'int', - 'userId' => 'int', - 'name' => 'string', - 'description' => 'string', - 'startTime' => '\DateTime', - 'endTime' => '\DateTime', - 'attributes' => 'object', - 'state' => 'string', - 'activeRulesetId' => 'int', - 'tags' => 'string[]', - 'features' => 'string[]', - 'couponSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', - 'referralSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', - 'limits' => '\TalonOne\Client\Model\LimitConfig[]', - 'campaignGroups' => 'int[]', - 'evaluationGroupId' => 'int', - 'type' => 'string', - 'linkedStoreIds' => 'int[]', - 'budgets' => '\TalonOne\Client\Model\CampaignBudget[]', - 'couponRedemptionCount' => 'int', - 'referralRedemptionCount' => 'int', - 'discountCount' => 'float', - 'discountEffectCount' => 'int', - 'couponCreationCount' => 'int', - 'customEffectCount' => 'int', - 'referralCreationCount' => 'int', - 'addFreeItemEffectCount' => 'int', - 'awardedGiveawaysCount' => 'int', - 'createdLoyaltyPointsCount' => 'float', - 'createdLoyaltyPointsEffectCount' => 'int', - 'redeemedLoyaltyPointsCount' => 'float', - 'redeemedLoyaltyPointsEffectCount' => 'int', - 'callApiEffectCount' => 'int', - 'reservecouponEffectCount' => 'int', - 'lastActivity' => '\DateTime', - 'updated' => '\DateTime', - 'createdBy' => 'string', - 'updatedBy' => 'string', - 'templateId' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => null, - 'created' => 'date-time', - 'applicationId' => null, - 'userId' => null, - 'name' => null, - 'description' => null, - 'startTime' => 'date-time', - 'endTime' => 'date-time', - 'attributes' => null, - 'state' => null, - 'activeRulesetId' => null, - 'tags' => null, - 'features' => null, - 'couponSettings' => null, - 'referralSettings' => null, - 'limits' => null, - 'campaignGroups' => null, - 'evaluationGroupId' => null, - 'type' => null, - 'linkedStoreIds' => null, - 'budgets' => null, - 'couponRedemptionCount' => null, - 'referralRedemptionCount' => null, - 'discountCount' => null, - 'discountEffectCount' => null, - 'couponCreationCount' => null, - 'customEffectCount' => null, - 'referralCreationCount' => null, - 'addFreeItemEffectCount' => null, - 'awardedGiveawaysCount' => null, - 'createdLoyaltyPointsCount' => null, - 'createdLoyaltyPointsEffectCount' => null, - 'redeemedLoyaltyPointsCount' => null, - 'redeemedLoyaltyPointsEffectCount' => null, - 'callApiEffectCount' => null, - 'reservecouponEffectCount' => null, - 'lastActivity' => 'date-time', - 'updated' => 'date-time', - 'createdBy' => null, - 'updatedBy' => null, - 'templateId' => null - ]; - - /** - * 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 attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'created' => 'created', - 'applicationId' => 'applicationId', - 'userId' => 'userId', - 'name' => 'name', - 'description' => 'description', - 'startTime' => 'startTime', - 'endTime' => 'endTime', - 'attributes' => 'attributes', - 'state' => 'state', - 'activeRulesetId' => 'activeRulesetId', - 'tags' => 'tags', - 'features' => 'features', - 'couponSettings' => 'couponSettings', - 'referralSettings' => 'referralSettings', - 'limits' => 'limits', - 'campaignGroups' => 'campaignGroups', - 'evaluationGroupId' => 'evaluationGroupId', - 'type' => 'type', - 'linkedStoreIds' => 'linkedStoreIds', - 'budgets' => 'budgets', - 'couponRedemptionCount' => 'couponRedemptionCount', - 'referralRedemptionCount' => 'referralRedemptionCount', - 'discountCount' => 'discountCount', - 'discountEffectCount' => 'discountEffectCount', - 'couponCreationCount' => 'couponCreationCount', - 'customEffectCount' => 'customEffectCount', - 'referralCreationCount' => 'referralCreationCount', - 'addFreeItemEffectCount' => 'addFreeItemEffectCount', - 'awardedGiveawaysCount' => 'awardedGiveawaysCount', - 'createdLoyaltyPointsCount' => 'createdLoyaltyPointsCount', - 'createdLoyaltyPointsEffectCount' => 'createdLoyaltyPointsEffectCount', - 'redeemedLoyaltyPointsCount' => 'redeemedLoyaltyPointsCount', - 'redeemedLoyaltyPointsEffectCount' => 'redeemedLoyaltyPointsEffectCount', - 'callApiEffectCount' => 'callApiEffectCount', - 'reservecouponEffectCount' => 'reservecouponEffectCount', - 'lastActivity' => 'lastActivity', - 'updated' => 'updated', - 'createdBy' => 'createdBy', - 'updatedBy' => 'updatedBy', - 'templateId' => 'templateId' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'created' => 'setCreated', - 'applicationId' => 'setApplicationId', - 'userId' => 'setUserId', - 'name' => 'setName', - 'description' => 'setDescription', - 'startTime' => 'setStartTime', - 'endTime' => 'setEndTime', - 'attributes' => 'setAttributes', - 'state' => 'setState', - 'activeRulesetId' => 'setActiveRulesetId', - 'tags' => 'setTags', - 'features' => 'setFeatures', - 'couponSettings' => 'setCouponSettings', - 'referralSettings' => 'setReferralSettings', - 'limits' => 'setLimits', - 'campaignGroups' => 'setCampaignGroups', - 'evaluationGroupId' => 'setEvaluationGroupId', - 'type' => 'setType', - 'linkedStoreIds' => 'setLinkedStoreIds', - 'budgets' => 'setBudgets', - 'couponRedemptionCount' => 'setCouponRedemptionCount', - 'referralRedemptionCount' => 'setReferralRedemptionCount', - 'discountCount' => 'setDiscountCount', - 'discountEffectCount' => 'setDiscountEffectCount', - 'couponCreationCount' => 'setCouponCreationCount', - 'customEffectCount' => 'setCustomEffectCount', - 'referralCreationCount' => 'setReferralCreationCount', - 'addFreeItemEffectCount' => 'setAddFreeItemEffectCount', - 'awardedGiveawaysCount' => 'setAwardedGiveawaysCount', - 'createdLoyaltyPointsCount' => 'setCreatedLoyaltyPointsCount', - 'createdLoyaltyPointsEffectCount' => 'setCreatedLoyaltyPointsEffectCount', - 'redeemedLoyaltyPointsCount' => 'setRedeemedLoyaltyPointsCount', - 'redeemedLoyaltyPointsEffectCount' => 'setRedeemedLoyaltyPointsEffectCount', - 'callApiEffectCount' => 'setCallApiEffectCount', - 'reservecouponEffectCount' => 'setReservecouponEffectCount', - 'lastActivity' => 'setLastActivity', - 'updated' => 'setUpdated', - 'createdBy' => 'setCreatedBy', - 'updatedBy' => 'setUpdatedBy', - 'templateId' => 'setTemplateId' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'created' => 'getCreated', - 'applicationId' => 'getApplicationId', - 'userId' => 'getUserId', - 'name' => 'getName', - 'description' => 'getDescription', - 'startTime' => 'getStartTime', - 'endTime' => 'getEndTime', - 'attributes' => 'getAttributes', - 'state' => 'getState', - 'activeRulesetId' => 'getActiveRulesetId', - 'tags' => 'getTags', - 'features' => 'getFeatures', - 'couponSettings' => 'getCouponSettings', - 'referralSettings' => 'getReferralSettings', - 'limits' => 'getLimits', - 'campaignGroups' => 'getCampaignGroups', - 'evaluationGroupId' => 'getEvaluationGroupId', - 'type' => 'getType', - 'linkedStoreIds' => 'getLinkedStoreIds', - 'budgets' => 'getBudgets', - 'couponRedemptionCount' => 'getCouponRedemptionCount', - 'referralRedemptionCount' => 'getReferralRedemptionCount', - 'discountCount' => 'getDiscountCount', - 'discountEffectCount' => 'getDiscountEffectCount', - 'couponCreationCount' => 'getCouponCreationCount', - 'customEffectCount' => 'getCustomEffectCount', - 'referralCreationCount' => 'getReferralCreationCount', - 'addFreeItemEffectCount' => 'getAddFreeItemEffectCount', - 'awardedGiveawaysCount' => 'getAwardedGiveawaysCount', - 'createdLoyaltyPointsCount' => 'getCreatedLoyaltyPointsCount', - 'createdLoyaltyPointsEffectCount' => 'getCreatedLoyaltyPointsEffectCount', - 'redeemedLoyaltyPointsCount' => 'getRedeemedLoyaltyPointsCount', - 'redeemedLoyaltyPointsEffectCount' => 'getRedeemedLoyaltyPointsEffectCount', - 'callApiEffectCount' => 'getCallApiEffectCount', - 'reservecouponEffectCount' => 'getReservecouponEffectCount', - 'lastActivity' => 'getLastActivity', - 'updated' => 'getUpdated', - 'createdBy' => 'getCreatedBy', - 'updatedBy' => 'getUpdatedBy', - 'templateId' => 'getTemplateId' - ]; - - /** - * 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; - } - - const STATE_ENABLED = 'enabled'; - const STATE_DISABLED = 'disabled'; - const STATE_ARCHIVED = 'archived'; - const STATE_DRAFT = 'draft'; - const STATE_SCHEDULED = 'scheduled'; - const STATE_RUNNING = 'running'; - const STATE_EXPIRED = 'expired'; - const FEATURES_COUPONS = 'coupons'; - const FEATURES_REFERRALS = 'referrals'; - const FEATURES_LOYALTY = 'loyalty'; - const FEATURES_GIVEAWAYS = 'giveaways'; - const FEATURES_STRIKETHROUGH = 'strikethrough'; - const TYPE_CART_ITEM = 'cartItem'; - const TYPE_ADVANCED = 'advanced'; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStateAllowableValues() - { - return [ - self::STATE_ENABLED, - self::STATE_DISABLED, - self::STATE_ARCHIVED, - self::STATE_DRAFT, - self::STATE_SCHEDULED, - self::STATE_RUNNING, - self::STATE_EXPIRED, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getFeaturesAllowableValues() - { - return [ - self::FEATURES_COUPONS, - self::FEATURES_REFERRALS, - self::FEATURES_LOYALTY, - self::FEATURES_GIVEAWAYS, - self::FEATURES_STRIKETHROUGH, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_CART_ITEM, - self::TYPE_ADVANCED, - ]; - } - - - /** - * 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->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['created'] = isset($data['created']) ? $data['created'] : null; - $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; - $this->container['userId'] = isset($data['userId']) ? $data['userId'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['startTime'] = isset($data['startTime']) ? $data['startTime'] : null; - $this->container['endTime'] = isset($data['endTime']) ? $data['endTime'] : null; - $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : 'enabled'; - $this->container['activeRulesetId'] = isset($data['activeRulesetId']) ? $data['activeRulesetId'] : null; - $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; - $this->container['features'] = isset($data['features']) ? $data['features'] : null; - $this->container['couponSettings'] = isset($data['couponSettings']) ? $data['couponSettings'] : null; - $this->container['referralSettings'] = isset($data['referralSettings']) ? $data['referralSettings'] : null; - $this->container['limits'] = isset($data['limits']) ? $data['limits'] : null; - $this->container['campaignGroups'] = isset($data['campaignGroups']) ? $data['campaignGroups'] : null; - $this->container['evaluationGroupId'] = isset($data['evaluationGroupId']) ? $data['evaluationGroupId'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : 'advanced'; - $this->container['linkedStoreIds'] = isset($data['linkedStoreIds']) ? $data['linkedStoreIds'] : null; - $this->container['budgets'] = isset($data['budgets']) ? $data['budgets'] : null; - $this->container['couponRedemptionCount'] = isset($data['couponRedemptionCount']) ? $data['couponRedemptionCount'] : null; - $this->container['referralRedemptionCount'] = isset($data['referralRedemptionCount']) ? $data['referralRedemptionCount'] : null; - $this->container['discountCount'] = isset($data['discountCount']) ? $data['discountCount'] : null; - $this->container['discountEffectCount'] = isset($data['discountEffectCount']) ? $data['discountEffectCount'] : null; - $this->container['couponCreationCount'] = isset($data['couponCreationCount']) ? $data['couponCreationCount'] : null; - $this->container['customEffectCount'] = isset($data['customEffectCount']) ? $data['customEffectCount'] : null; - $this->container['referralCreationCount'] = isset($data['referralCreationCount']) ? $data['referralCreationCount'] : null; - $this->container['addFreeItemEffectCount'] = isset($data['addFreeItemEffectCount']) ? $data['addFreeItemEffectCount'] : null; - $this->container['awardedGiveawaysCount'] = isset($data['awardedGiveawaysCount']) ? $data['awardedGiveawaysCount'] : null; - $this->container['createdLoyaltyPointsCount'] = isset($data['createdLoyaltyPointsCount']) ? $data['createdLoyaltyPointsCount'] : null; - $this->container['createdLoyaltyPointsEffectCount'] = isset($data['createdLoyaltyPointsEffectCount']) ? $data['createdLoyaltyPointsEffectCount'] : null; - $this->container['redeemedLoyaltyPointsCount'] = isset($data['redeemedLoyaltyPointsCount']) ? $data['redeemedLoyaltyPointsCount'] : null; - $this->container['redeemedLoyaltyPointsEffectCount'] = isset($data['redeemedLoyaltyPointsEffectCount']) ? $data['redeemedLoyaltyPointsEffectCount'] : null; - $this->container['callApiEffectCount'] = isset($data['callApiEffectCount']) ? $data['callApiEffectCount'] : null; - $this->container['reservecouponEffectCount'] = isset($data['reservecouponEffectCount']) ? $data['reservecouponEffectCount'] : null; - $this->container['lastActivity'] = isset($data['lastActivity']) ? $data['lastActivity'] : null; - $this->container['updated'] = isset($data['updated']) ? $data['updated'] : null; - $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; - $this->container['updatedBy'] = isset($data['updatedBy']) ? $data['updatedBy'] : null; - $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['created'] === null) { - $invalidProperties[] = "'created' can't be null"; - } - if ($this->container['applicationId'] === null) { - $invalidProperties[] = "'applicationId' can't be null"; - } - if ($this->container['userId'] === null) { - $invalidProperties[] = "'userId' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ((mb_strlen($this->container['name']) < 1)) { - $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; - } - - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' can't be null"; - } - if ($this->container['state'] === null) { - $invalidProperties[] = "'state' can't be null"; - } - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if ($this->container['tags'] === null) { - $invalidProperties[] = "'tags' can't be null"; - } - if ($this->container['features'] === null) { - $invalidProperties[] = "'features' can't be null"; - } - if ($this->container['limits'] === null) { - $invalidProperties[] = "'limits' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if ($this->container['budgets'] === null) { - $invalidProperties[] = "'budgets' 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 id - * - * @return int - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int $id Unique ID for this entity. - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets created - * - * @return \DateTime - */ - public function getCreated() - { - return $this->container['created']; - } - - /** - * Sets created - * - * @param \DateTime $created The exact moment this entity was created. - * - * @return $this - */ - public function setCreated($created) - { - $this->container['created'] = $created; - - return $this; - } - - /** - * Gets applicationId - * - * @return int - */ - public function getApplicationId() - { - return $this->container['applicationId']; - } - - /** - * Sets applicationId - * - * @param int $applicationId The ID of the application that owns this entity. - * - * @return $this - */ - public function setApplicationId($applicationId) - { - $this->container['applicationId'] = $applicationId; - - return $this; - } - - /** - * Gets userId - * - * @return int - */ - public function getUserId() - { - return $this->container['userId']; - } - - /** - * Sets userId - * - * @param int $userId The ID of the user associated with this entity. - * - * @return $this - */ - public function setUserId($userId) - { - $this->container['userId'] = $userId; - - return $this; - } - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name A user-facing name for this campaign. - * - * @return $this - */ - public function setName($name) - { - - if ((mb_strlen($name) < 1)) { - throw new \InvalidArgumentException('invalid length for $name when calling CampaignForNotification., must be bigger than or equal to 1.'); - } - - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets description - * - * @return string - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string $description A detailed description of the campaign. - * - * @return $this - */ - public function setDescription($description) - { - $this->container['description'] = $description; - - return $this; - } - - /** - * Gets startTime - * - * @return \DateTime|null - */ - public function getStartTime() - { - return $this->container['startTime']; - } - - /** - * Sets startTime - * - * @param \DateTime|null $startTime Timestamp when the campaign will become active. - * - * @return $this - */ - public function setStartTime($startTime) - { - $this->container['startTime'] = $startTime; - - return $this; - } - - /** - * Gets endTime - * - * @return \DateTime|null - */ - public function getEndTime() - { - return $this->container['endTime']; - } - - /** - * Sets endTime - * - * @param \DateTime|null $endTime Timestamp when the campaign will become inactive. - * - * @return $this - */ - public function setEndTime($endTime) - { - $this->container['endTime'] = $endTime; - - return $this; - } - - /** - * Gets attributes - * - * @return object|null - */ - public function getAttributes() - { - return $this->container['attributes']; - } - - /** - * Sets attributes - * - * @param object|null $attributes Arbitrary properties associated with this campaign. - * - * @return $this - */ - public function setAttributes($attributes) - { - $this->container['attributes'] = $attributes; - - return $this; - } - - /** - * Gets state - * - * @return string - */ - public function getState() - { - return $this->container['state']; - } - - /** - * Sets state - * - * @param string $state A disabled or archived campaign is not evaluated for rules or coupons. - * - * @return $this - */ - public function setState($state) - { - $allowedValues = $this->getStateAllowableValues(); - if (!in_array($state, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['state'] = $state; - - return $this; - } - - /** - * Gets activeRulesetId - * - * @return int|null - */ - public function getActiveRulesetId() - { - return $this->container['activeRulesetId']; - } - - /** - * Sets activeRulesetId - * - * @param int|null $activeRulesetId [ID of Ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. - * - * @return $this - */ - public function setActiveRulesetId($activeRulesetId) - { - $this->container['activeRulesetId'] = $activeRulesetId; - - return $this; - } - - /** - * Gets tags - * - * @return string[] - */ - public function getTags() - { - return $this->container['tags']; - } - - /** - * Sets tags - * - * @param string[] $tags A list of tags for the campaign. - * - * @return $this - */ - public function setTags($tags) - { - $this->container['tags'] = $tags; - - return $this; - } - - /** - * Gets features - * - * @return string[] - */ - public function getFeatures() - { - return $this->container['features']; - } - - /** - * Sets features - * - * @param string[] $features The features enabled in this campaign. - * - * @return $this - */ - public function setFeatures($features) - { - $allowedValues = $this->getFeaturesAllowableValues(); - if (array_diff($features, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'features', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['features'] = $features; - - return $this; - } - - /** - * Gets couponSettings - * - * @return \TalonOne\Client\Model\CodeGeneratorSettings|null - */ - public function getCouponSettings() - { - return $this->container['couponSettings']; - } - - /** - * Sets couponSettings - * - * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $couponSettings couponSettings - * - * @return $this - */ - public function setCouponSettings($couponSettings) - { - $this->container['couponSettings'] = $couponSettings; - - return $this; - } - - /** - * Gets referralSettings - * - * @return \TalonOne\Client\Model\CodeGeneratorSettings|null - */ - public function getReferralSettings() - { - return $this->container['referralSettings']; - } - - /** - * Sets referralSettings - * - * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $referralSettings referralSettings - * - * @return $this - */ - public function setReferralSettings($referralSettings) - { - $this->container['referralSettings'] = $referralSettings; - - return $this; - } - - /** - * Gets limits - * - * @return \TalonOne\Client\Model\LimitConfig[] - */ - public function getLimits() - { - return $this->container['limits']; - } - - /** - * Sets limits - * - * @param \TalonOne\Client\Model\LimitConfig[] $limits The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. - * - * @return $this - */ - public function setLimits($limits) - { - $this->container['limits'] = $limits; - - return $this; - } - - /** - * Gets campaignGroups - * - * @return int[]|null - */ - public function getCampaignGroups() - { - return $this->container['campaignGroups']; - } - - /** - * Sets campaignGroups - * - * @param int[]|null $campaignGroups The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. - * - * @return $this - */ - public function setCampaignGroups($campaignGroups) - { - $this->container['campaignGroups'] = $campaignGroups; - - return $this; - } - - /** - * Gets evaluationGroupId - * - * @return int|null - */ - public function getEvaluationGroupId() - { - return $this->container['evaluationGroupId']; - } - - /** - * Sets evaluationGroupId - * - * @param int|null $evaluationGroupId The ID of the campaign evaluation group the campaign belongs to. - * - * @return $this - */ - public function setEvaluationGroupId($evaluationGroupId) - { - $this->container['evaluationGroupId'] = $evaluationGroupId; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. - * - * @return $this - */ - public function setType($type) - { - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets linkedStoreIds - * - * @return int[]|null - */ - public function getLinkedStoreIds() - { - return $this->container['linkedStoreIds']; - } - - /** - * Sets linkedStoreIds - * - * @param int[]|null $linkedStoreIds A list of store IDs that are linked to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. - * - * @return $this - */ - public function setLinkedStoreIds($linkedStoreIds) - { - $this->container['linkedStoreIds'] = $linkedStoreIds; - - return $this; - } - - /** - * Gets budgets - * - * @return \TalonOne\Client\Model\CampaignBudget[] - */ - public function getBudgets() - { - return $this->container['budgets']; - } - - /** - * Sets budgets - * - * @param \TalonOne\Client\Model\CampaignBudget[] $budgets A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. - * - * @return $this - */ - public function setBudgets($budgets) - { - $this->container['budgets'] = $budgets; - - return $this; - } - - /** - * Gets couponRedemptionCount - * - * @return int|null - */ - public function getCouponRedemptionCount() - { - return $this->container['couponRedemptionCount']; - } - - /** - * Sets couponRedemptionCount - * - * @param int|null $couponRedemptionCount This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. - * - * @return $this - */ - public function setCouponRedemptionCount($couponRedemptionCount) - { - $this->container['couponRedemptionCount'] = $couponRedemptionCount; - - return $this; - } - - /** - * Gets referralRedemptionCount - * - * @return int|null - */ - public function getReferralRedemptionCount() - { - return $this->container['referralRedemptionCount']; - } - - /** - * Sets referralRedemptionCount - * - * @param int|null $referralRedemptionCount This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. - * - * @return $this - */ - public function setReferralRedemptionCount($referralRedemptionCount) - { - $this->container['referralRedemptionCount'] = $referralRedemptionCount; - - return $this; - } - - /** - * Gets discountCount - * - * @return float|null - */ - public function getDiscountCount() - { - return $this->container['discountCount']; - } - - /** - * Sets discountCount - * - * @param float|null $discountCount This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. - * - * @return $this - */ - public function setDiscountCount($discountCount) - { - $this->container['discountCount'] = $discountCount; - - return $this; - } - - /** - * Gets discountEffectCount - * - * @return int|null - */ - public function getDiscountEffectCount() - { - return $this->container['discountEffectCount']; - } - - /** - * Sets discountEffectCount - * - * @param int|null $discountEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. - * - * @return $this - */ - public function setDiscountEffectCount($discountEffectCount) - { - $this->container['discountEffectCount'] = $discountEffectCount; - - return $this; - } - - /** - * Gets couponCreationCount - * - * @return int|null - */ - public function getCouponCreationCount() - { - return $this->container['couponCreationCount']; - } - - /** - * Sets couponCreationCount - * - * @param int|null $couponCreationCount This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. - * - * @return $this - */ - public function setCouponCreationCount($couponCreationCount) - { - $this->container['couponCreationCount'] = $couponCreationCount; - - return $this; - } - - /** - * Gets customEffectCount - * - * @return int|null - */ - public function getCustomEffectCount() - { - return $this->container['customEffectCount']; - } - - /** - * Sets customEffectCount - * - * @param int|null $customEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. - * - * @return $this - */ - public function setCustomEffectCount($customEffectCount) - { - $this->container['customEffectCount'] = $customEffectCount; - - return $this; - } - - /** - * Gets referralCreationCount - * - * @return int|null - */ - public function getReferralCreationCount() - { - return $this->container['referralCreationCount']; - } - - /** - * Sets referralCreationCount - * - * @param int|null $referralCreationCount This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. - * - * @return $this - */ - public function setReferralCreationCount($referralCreationCount) - { - $this->container['referralCreationCount'] = $referralCreationCount; - - return $this; - } - - /** - * Gets addFreeItemEffectCount - * - * @return int|null - */ - public function getAddFreeItemEffectCount() - { - return $this->container['addFreeItemEffectCount']; - } - - /** - * Sets addFreeItemEffectCount - * - * @param int|null $addFreeItemEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. - * - * @return $this - */ - public function setAddFreeItemEffectCount($addFreeItemEffectCount) - { - $this->container['addFreeItemEffectCount'] = $addFreeItemEffectCount; - - return $this; - } - - /** - * Gets awardedGiveawaysCount - * - * @return int|null - */ - public function getAwardedGiveawaysCount() - { - return $this->container['awardedGiveawaysCount']; - } - - /** - * Sets awardedGiveawaysCount - * - * @param int|null $awardedGiveawaysCount This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. - * - * @return $this - */ - public function setAwardedGiveawaysCount($awardedGiveawaysCount) - { - $this->container['awardedGiveawaysCount'] = $awardedGiveawaysCount; - - return $this; - } - - /** - * Gets createdLoyaltyPointsCount - * - * @return float|null - */ - public function getCreatedLoyaltyPointsCount() - { - return $this->container['createdLoyaltyPointsCount']; - } - - /** - * Sets createdLoyaltyPointsCount - * - * @param float|null $createdLoyaltyPointsCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. - * - * @return $this - */ - public function setCreatedLoyaltyPointsCount($createdLoyaltyPointsCount) - { - $this->container['createdLoyaltyPointsCount'] = $createdLoyaltyPointsCount; - - return $this; - } - - /** - * Gets createdLoyaltyPointsEffectCount - * - * @return int|null - */ - public function getCreatedLoyaltyPointsEffectCount() - { - return $this->container['createdLoyaltyPointsEffectCount']; - } - - /** - * Sets createdLoyaltyPointsEffectCount - * - * @param int|null $createdLoyaltyPointsEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. - * - * @return $this - */ - public function setCreatedLoyaltyPointsEffectCount($createdLoyaltyPointsEffectCount) - { - $this->container['createdLoyaltyPointsEffectCount'] = $createdLoyaltyPointsEffectCount; - - return $this; - } - - /** - * Gets redeemedLoyaltyPointsCount - * - * @return float|null - */ - public function getRedeemedLoyaltyPointsCount() - { - return $this->container['redeemedLoyaltyPointsCount']; - } - - /** - * Sets redeemedLoyaltyPointsCount - * - * @param float|null $redeemedLoyaltyPointsCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. - * - * @return $this - */ - public function setRedeemedLoyaltyPointsCount($redeemedLoyaltyPointsCount) - { - $this->container['redeemedLoyaltyPointsCount'] = $redeemedLoyaltyPointsCount; - - return $this; - } - - /** - * Gets redeemedLoyaltyPointsEffectCount - * - * @return int|null - */ - public function getRedeemedLoyaltyPointsEffectCount() - { - return $this->container['redeemedLoyaltyPointsEffectCount']; - } - - /** - * Sets redeemedLoyaltyPointsEffectCount - * - * @param int|null $redeemedLoyaltyPointsEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. - * - * @return $this - */ - public function setRedeemedLoyaltyPointsEffectCount($redeemedLoyaltyPointsEffectCount) - { - $this->container['redeemedLoyaltyPointsEffectCount'] = $redeemedLoyaltyPointsEffectCount; - - return $this; - } - - /** - * Gets callApiEffectCount - * - * @return int|null - */ - public function getCallApiEffectCount() - { - return $this->container['callApiEffectCount']; - } - - /** - * Sets callApiEffectCount - * - * @param int|null $callApiEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. - * - * @return $this - */ - public function setCallApiEffectCount($callApiEffectCount) - { - $this->container['callApiEffectCount'] = $callApiEffectCount; - - return $this; - } - - /** - * Gets reservecouponEffectCount - * - * @return int|null - */ - public function getReservecouponEffectCount() - { - return $this->container['reservecouponEffectCount']; - } - - /** - * Sets reservecouponEffectCount - * - * @param int|null $reservecouponEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. - * - * @return $this - */ - public function setReservecouponEffectCount($reservecouponEffectCount) - { - $this->container['reservecouponEffectCount'] = $reservecouponEffectCount; - - return $this; - } - - /** - * Gets lastActivity - * - * @return \DateTime|null - */ - public function getLastActivity() - { - return $this->container['lastActivity']; - } - - /** - * Sets lastActivity - * - * @param \DateTime|null $lastActivity Timestamp of the most recent event received by this campaign. - * - * @return $this - */ - public function setLastActivity($lastActivity) - { - $this->container['lastActivity'] = $lastActivity; - - return $this; - } - - /** - * Gets updated - * - * @return \DateTime|null - */ - public function getUpdated() - { - return $this->container['updated']; - } - - /** - * Sets updated - * - * @param \DateTime|null $updated Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. - * - * @return $this - */ - public function setUpdated($updated) - { - $this->container['updated'] = $updated; - - return $this; - } - - /** - * Gets createdBy - * - * @return string|null - */ - public function getCreatedBy() - { - return $this->container['createdBy']; - } - - /** - * Sets createdBy - * - * @param string|null $createdBy Name of the user who created this campaign if available. - * - * @return $this - */ - public function setCreatedBy($createdBy) - { - $this->container['createdBy'] = $createdBy; - - return $this; - } - - /** - * Gets updatedBy - * - * @return string|null - */ - public function getUpdatedBy() - { - return $this->container['updatedBy']; - } - - /** - * Sets updatedBy - * - * @param string|null $updatedBy Name of the user who last updated this campaign if available. - * - * @return $this - */ - public function setUpdatedBy($updatedBy) - { - $this->container['updatedBy'] = $updatedBy; - - return $this; - } - - /** - * Gets templateId - * - * @return int|null - */ - public function getTemplateId() - { - return $this->container['templateId']; - } - - /** - * Sets templateId - * - * @param int|null $templateId The ID of the Campaign Template this Campaign was created from. - * - * @return $this - */ - public function setTemplateId($templateId) - { - $this->container['templateId'] = $templateId; - - 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 - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $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]); - } - - /** - * 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/CampaignNotificationPolicy.php b/lib/Model/CampaignNotificationPolicy.php index af429167..2c0e8ff3 100644 --- a/lib/Model/CampaignNotificationPolicy.php +++ b/lib/Model/CampaignNotificationPolicy.php @@ -57,7 +57,8 @@ class CampaignNotificationPolicy implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string' + 'name' => 'string', + 'batchingEnabled' => 'bool' ]; /** @@ -66,7 +67,8 @@ class CampaignNotificationPolicy implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'name' => null + 'name' => null, + 'batchingEnabled' => null ]; /** @@ -96,7 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'name' => 'name' + 'name' => 'name', + 'batchingEnabled' => 'batchingEnabled' ]; /** @@ -105,7 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'name' => 'setName' + 'name' => 'setName', + 'batchingEnabled' => 'setBatchingEnabled' ]; /** @@ -114,7 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'name' => 'getName' + 'name' => 'getName', + 'batchingEnabled' => 'getBatchingEnabled' ]; /** @@ -178,6 +183,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['batchingEnabled'] = isset($data['batchingEnabled']) ? $data['batchingEnabled'] : true; } /** @@ -239,6 +245,30 @@ public function setName($name) return $this; } + + /** + * Gets batchingEnabled + * + * @return bool|null + */ + public function getBatchingEnabled() + { + return $this->container['batchingEnabled']; + } + + /** + * Sets batchingEnabled + * + * @param bool|null $batchingEnabled Indicates whether batching is activated. + * + * @return $this + */ + public function setBatchingEnabled($batchingEnabled) + { + $this->container['batchingEnabled'] = $batchingEnabled; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CampaignStateChangedNotification.php b/lib/Model/CampaignStateChangedNotification.php index c030b7c0..80537f05 100644 --- a/lib/Model/CampaignStateChangedNotification.php +++ b/lib/Model/CampaignStateChangedNotification.php @@ -269,7 +269,7 @@ public function getOldState() /** * Sets oldState * - * @param string $oldState The campaign's old state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'draft', 'archived'] + * @param string $oldState The campaign's old state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] * * @return $this */ @@ -293,7 +293,7 @@ public function getNewState() /** * Sets newState * - * @param string $newState The campaign's new state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'draft', 'archived'] + * @param string $newState The campaign's new state. Can be one of the following: ['running', 'disabled', 'scheduled', 'expired', 'archived'] * * @return $this */ diff --git a/lib/Model/CampaignStateNotification.php b/lib/Model/CampaignStateNotification.php deleted file mode 100644 index 6b8adee2..00000000 --- a/lib/Model/CampaignStateNotification.php +++ /dev/null @@ -1,1721 +0,0 @@ - 'int', - 'created' => '\DateTime', - 'applicationId' => 'int', - 'userId' => 'int', - 'name' => 'string', - 'description' => 'string', - 'startTime' => '\DateTime', - 'endTime' => '\DateTime', - 'attributes' => 'object', - 'state' => 'string', - 'activeRulesetId' => 'int', - 'tags' => 'string[]', - 'features' => 'string[]', - 'couponSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', - 'referralSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', - 'limits' => '\TalonOne\Client\Model\LimitConfig[]', - 'campaignGroups' => 'int[]', - 'evaluationGroupId' => 'int', - 'type' => 'string', - 'linkedStoreIds' => 'int[]', - 'budgets' => '\TalonOne\Client\Model\CampaignBudget[]', - 'couponRedemptionCount' => 'int', - 'referralRedemptionCount' => 'int', - 'discountCount' => 'float', - 'discountEffectCount' => 'int', - 'couponCreationCount' => 'int', - 'customEffectCount' => 'int', - 'referralCreationCount' => 'int', - 'addFreeItemEffectCount' => 'int', - 'awardedGiveawaysCount' => 'int', - 'createdLoyaltyPointsCount' => 'float', - 'createdLoyaltyPointsEffectCount' => 'int', - 'redeemedLoyaltyPointsCount' => 'float', - 'redeemedLoyaltyPointsEffectCount' => 'int', - 'callApiEffectCount' => 'int', - 'reservecouponEffectCount' => 'int', - 'lastActivity' => '\DateTime', - 'updated' => '\DateTime', - 'createdBy' => 'string', - 'updatedBy' => 'string', - 'templateId' => 'int', - 'frontendState' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => null, - 'created' => 'date-time', - 'applicationId' => null, - 'userId' => null, - 'name' => null, - 'description' => null, - 'startTime' => 'date-time', - 'endTime' => 'date-time', - 'attributes' => null, - 'state' => null, - 'activeRulesetId' => null, - 'tags' => null, - 'features' => null, - 'couponSettings' => null, - 'referralSettings' => null, - 'limits' => null, - 'campaignGroups' => null, - 'evaluationGroupId' => null, - 'type' => null, - 'linkedStoreIds' => null, - 'budgets' => null, - 'couponRedemptionCount' => null, - 'referralRedemptionCount' => null, - 'discountCount' => null, - 'discountEffectCount' => null, - 'couponCreationCount' => null, - 'customEffectCount' => null, - 'referralCreationCount' => null, - 'addFreeItemEffectCount' => null, - 'awardedGiveawaysCount' => null, - 'createdLoyaltyPointsCount' => null, - 'createdLoyaltyPointsEffectCount' => null, - 'redeemedLoyaltyPointsCount' => null, - 'redeemedLoyaltyPointsEffectCount' => null, - 'callApiEffectCount' => null, - 'reservecouponEffectCount' => null, - 'lastActivity' => 'date-time', - 'updated' => 'date-time', - 'createdBy' => null, - 'updatedBy' => null, - 'templateId' => null, - 'frontendState' => null - ]; - - /** - * 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 attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'created' => 'created', - 'applicationId' => 'applicationId', - 'userId' => 'userId', - 'name' => 'name', - 'description' => 'description', - 'startTime' => 'startTime', - 'endTime' => 'endTime', - 'attributes' => 'attributes', - 'state' => 'state', - 'activeRulesetId' => 'activeRulesetId', - 'tags' => 'tags', - 'features' => 'features', - 'couponSettings' => 'couponSettings', - 'referralSettings' => 'referralSettings', - 'limits' => 'limits', - 'campaignGroups' => 'campaignGroups', - 'evaluationGroupId' => 'evaluationGroupId', - 'type' => 'type', - 'linkedStoreIds' => 'linkedStoreIds', - 'budgets' => 'budgets', - 'couponRedemptionCount' => 'couponRedemptionCount', - 'referralRedemptionCount' => 'referralRedemptionCount', - 'discountCount' => 'discountCount', - 'discountEffectCount' => 'discountEffectCount', - 'couponCreationCount' => 'couponCreationCount', - 'customEffectCount' => 'customEffectCount', - 'referralCreationCount' => 'referralCreationCount', - 'addFreeItemEffectCount' => 'addFreeItemEffectCount', - 'awardedGiveawaysCount' => 'awardedGiveawaysCount', - 'createdLoyaltyPointsCount' => 'createdLoyaltyPointsCount', - 'createdLoyaltyPointsEffectCount' => 'createdLoyaltyPointsEffectCount', - 'redeemedLoyaltyPointsCount' => 'redeemedLoyaltyPointsCount', - 'redeemedLoyaltyPointsEffectCount' => 'redeemedLoyaltyPointsEffectCount', - 'callApiEffectCount' => 'callApiEffectCount', - 'reservecouponEffectCount' => 'reservecouponEffectCount', - 'lastActivity' => 'lastActivity', - 'updated' => 'updated', - 'createdBy' => 'createdBy', - 'updatedBy' => 'updatedBy', - 'templateId' => 'templateId', - 'frontendState' => 'frontendState' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'created' => 'setCreated', - 'applicationId' => 'setApplicationId', - 'userId' => 'setUserId', - 'name' => 'setName', - 'description' => 'setDescription', - 'startTime' => 'setStartTime', - 'endTime' => 'setEndTime', - 'attributes' => 'setAttributes', - 'state' => 'setState', - 'activeRulesetId' => 'setActiveRulesetId', - 'tags' => 'setTags', - 'features' => 'setFeatures', - 'couponSettings' => 'setCouponSettings', - 'referralSettings' => 'setReferralSettings', - 'limits' => 'setLimits', - 'campaignGroups' => 'setCampaignGroups', - 'evaluationGroupId' => 'setEvaluationGroupId', - 'type' => 'setType', - 'linkedStoreIds' => 'setLinkedStoreIds', - 'budgets' => 'setBudgets', - 'couponRedemptionCount' => 'setCouponRedemptionCount', - 'referralRedemptionCount' => 'setReferralRedemptionCount', - 'discountCount' => 'setDiscountCount', - 'discountEffectCount' => 'setDiscountEffectCount', - 'couponCreationCount' => 'setCouponCreationCount', - 'customEffectCount' => 'setCustomEffectCount', - 'referralCreationCount' => 'setReferralCreationCount', - 'addFreeItemEffectCount' => 'setAddFreeItemEffectCount', - 'awardedGiveawaysCount' => 'setAwardedGiveawaysCount', - 'createdLoyaltyPointsCount' => 'setCreatedLoyaltyPointsCount', - 'createdLoyaltyPointsEffectCount' => 'setCreatedLoyaltyPointsEffectCount', - 'redeemedLoyaltyPointsCount' => 'setRedeemedLoyaltyPointsCount', - 'redeemedLoyaltyPointsEffectCount' => 'setRedeemedLoyaltyPointsEffectCount', - 'callApiEffectCount' => 'setCallApiEffectCount', - 'reservecouponEffectCount' => 'setReservecouponEffectCount', - 'lastActivity' => 'setLastActivity', - 'updated' => 'setUpdated', - 'createdBy' => 'setCreatedBy', - 'updatedBy' => 'setUpdatedBy', - 'templateId' => 'setTemplateId', - 'frontendState' => 'setFrontendState' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'created' => 'getCreated', - 'applicationId' => 'getApplicationId', - 'userId' => 'getUserId', - 'name' => 'getName', - 'description' => 'getDescription', - 'startTime' => 'getStartTime', - 'endTime' => 'getEndTime', - 'attributes' => 'getAttributes', - 'state' => 'getState', - 'activeRulesetId' => 'getActiveRulesetId', - 'tags' => 'getTags', - 'features' => 'getFeatures', - 'couponSettings' => 'getCouponSettings', - 'referralSettings' => 'getReferralSettings', - 'limits' => 'getLimits', - 'campaignGroups' => 'getCampaignGroups', - 'evaluationGroupId' => 'getEvaluationGroupId', - 'type' => 'getType', - 'linkedStoreIds' => 'getLinkedStoreIds', - 'budgets' => 'getBudgets', - 'couponRedemptionCount' => 'getCouponRedemptionCount', - 'referralRedemptionCount' => 'getReferralRedemptionCount', - 'discountCount' => 'getDiscountCount', - 'discountEffectCount' => 'getDiscountEffectCount', - 'couponCreationCount' => 'getCouponCreationCount', - 'customEffectCount' => 'getCustomEffectCount', - 'referralCreationCount' => 'getReferralCreationCount', - 'addFreeItemEffectCount' => 'getAddFreeItemEffectCount', - 'awardedGiveawaysCount' => 'getAwardedGiveawaysCount', - 'createdLoyaltyPointsCount' => 'getCreatedLoyaltyPointsCount', - 'createdLoyaltyPointsEffectCount' => 'getCreatedLoyaltyPointsEffectCount', - 'redeemedLoyaltyPointsCount' => 'getRedeemedLoyaltyPointsCount', - 'redeemedLoyaltyPointsEffectCount' => 'getRedeemedLoyaltyPointsEffectCount', - 'callApiEffectCount' => 'getCallApiEffectCount', - 'reservecouponEffectCount' => 'getReservecouponEffectCount', - 'lastActivity' => 'getLastActivity', - 'updated' => 'getUpdated', - 'createdBy' => 'getCreatedBy', - 'updatedBy' => 'getUpdatedBy', - 'templateId' => 'getTemplateId', - 'frontendState' => 'getFrontendState' - ]; - - /** - * 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; - } - - const STATE_ENABLED = 'enabled'; - const STATE_DISABLED = 'disabled'; - const STATE_ARCHIVED = 'archived'; - const FEATURES_COUPONS = 'coupons'; - const FEATURES_REFERRALS = 'referrals'; - const FEATURES_LOYALTY = 'loyalty'; - const FEATURES_GIVEAWAYS = 'giveaways'; - const FEATURES_STRIKETHROUGH = 'strikethrough'; - const TYPE_CART_ITEM = 'cartItem'; - const TYPE_ADVANCED = 'advanced'; - const FRONTEND_STATE_EXPIRED = 'expired'; - const FRONTEND_STATE_SCHEDULED = 'scheduled'; - const FRONTEND_STATE_RUNNING = 'running'; - const FRONTEND_STATE_DRAFT = 'draft'; - const FRONTEND_STATE_DISABLED = 'disabled'; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStateAllowableValues() - { - return [ - self::STATE_ENABLED, - self::STATE_DISABLED, - self::STATE_ARCHIVED, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getFeaturesAllowableValues() - { - return [ - self::FEATURES_COUPONS, - self::FEATURES_REFERRALS, - self::FEATURES_LOYALTY, - self::FEATURES_GIVEAWAYS, - self::FEATURES_STRIKETHROUGH, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_CART_ITEM, - self::TYPE_ADVANCED, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getFrontendStateAllowableValues() - { - return [ - self::FRONTEND_STATE_EXPIRED, - self::FRONTEND_STATE_SCHEDULED, - self::FRONTEND_STATE_RUNNING, - self::FRONTEND_STATE_DRAFT, - self::FRONTEND_STATE_DISABLED, - ]; - } - - - /** - * 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->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['created'] = isset($data['created']) ? $data['created'] : null; - $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; - $this->container['userId'] = isset($data['userId']) ? $data['userId'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['startTime'] = isset($data['startTime']) ? $data['startTime'] : null; - $this->container['endTime'] = isset($data['endTime']) ? $data['endTime'] : null; - $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : 'enabled'; - $this->container['activeRulesetId'] = isset($data['activeRulesetId']) ? $data['activeRulesetId'] : null; - $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; - $this->container['features'] = isset($data['features']) ? $data['features'] : null; - $this->container['couponSettings'] = isset($data['couponSettings']) ? $data['couponSettings'] : null; - $this->container['referralSettings'] = isset($data['referralSettings']) ? $data['referralSettings'] : null; - $this->container['limits'] = isset($data['limits']) ? $data['limits'] : null; - $this->container['campaignGroups'] = isset($data['campaignGroups']) ? $data['campaignGroups'] : null; - $this->container['evaluationGroupId'] = isset($data['evaluationGroupId']) ? $data['evaluationGroupId'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : 'advanced'; - $this->container['linkedStoreIds'] = isset($data['linkedStoreIds']) ? $data['linkedStoreIds'] : null; - $this->container['budgets'] = isset($data['budgets']) ? $data['budgets'] : null; - $this->container['couponRedemptionCount'] = isset($data['couponRedemptionCount']) ? $data['couponRedemptionCount'] : null; - $this->container['referralRedemptionCount'] = isset($data['referralRedemptionCount']) ? $data['referralRedemptionCount'] : null; - $this->container['discountCount'] = isset($data['discountCount']) ? $data['discountCount'] : null; - $this->container['discountEffectCount'] = isset($data['discountEffectCount']) ? $data['discountEffectCount'] : null; - $this->container['couponCreationCount'] = isset($data['couponCreationCount']) ? $data['couponCreationCount'] : null; - $this->container['customEffectCount'] = isset($data['customEffectCount']) ? $data['customEffectCount'] : null; - $this->container['referralCreationCount'] = isset($data['referralCreationCount']) ? $data['referralCreationCount'] : null; - $this->container['addFreeItemEffectCount'] = isset($data['addFreeItemEffectCount']) ? $data['addFreeItemEffectCount'] : null; - $this->container['awardedGiveawaysCount'] = isset($data['awardedGiveawaysCount']) ? $data['awardedGiveawaysCount'] : null; - $this->container['createdLoyaltyPointsCount'] = isset($data['createdLoyaltyPointsCount']) ? $data['createdLoyaltyPointsCount'] : null; - $this->container['createdLoyaltyPointsEffectCount'] = isset($data['createdLoyaltyPointsEffectCount']) ? $data['createdLoyaltyPointsEffectCount'] : null; - $this->container['redeemedLoyaltyPointsCount'] = isset($data['redeemedLoyaltyPointsCount']) ? $data['redeemedLoyaltyPointsCount'] : null; - $this->container['redeemedLoyaltyPointsEffectCount'] = isset($data['redeemedLoyaltyPointsEffectCount']) ? $data['redeemedLoyaltyPointsEffectCount'] : null; - $this->container['callApiEffectCount'] = isset($data['callApiEffectCount']) ? $data['callApiEffectCount'] : null; - $this->container['reservecouponEffectCount'] = isset($data['reservecouponEffectCount']) ? $data['reservecouponEffectCount'] : null; - $this->container['lastActivity'] = isset($data['lastActivity']) ? $data['lastActivity'] : null; - $this->container['updated'] = isset($data['updated']) ? $data['updated'] : null; - $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; - $this->container['updatedBy'] = isset($data['updatedBy']) ? $data['updatedBy'] : null; - $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; - $this->container['frontendState'] = isset($data['frontendState']) ? $data['frontendState'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['created'] === null) { - $invalidProperties[] = "'created' can't be null"; - } - if ($this->container['applicationId'] === null) { - $invalidProperties[] = "'applicationId' can't be null"; - } - if ($this->container['userId'] === null) { - $invalidProperties[] = "'userId' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ((mb_strlen($this->container['name']) < 1)) { - $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; - } - - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' can't be null"; - } - if ($this->container['state'] === null) { - $invalidProperties[] = "'state' can't be null"; - } - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if ($this->container['tags'] === null) { - $invalidProperties[] = "'tags' can't be null"; - } - if ($this->container['features'] === null) { - $invalidProperties[] = "'features' can't be null"; - } - if ($this->container['limits'] === null) { - $invalidProperties[] = "'limits' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if ($this->container['budgets'] === null) { - $invalidProperties[] = "'budgets' can't be null"; - } - if ($this->container['frontendState'] === null) { - $invalidProperties[] = "'frontendState' can't be null"; - } - $allowedValues = $this->getFrontendStateAllowableValues(); - if (!is_null($this->container['frontendState']) && !in_array($this->container['frontendState'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'frontendState', must be one of '%s'", - 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 id - * - * @return int - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int $id Unique ID for this entity. - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets created - * - * @return \DateTime - */ - public function getCreated() - { - return $this->container['created']; - } - - /** - * Sets created - * - * @param \DateTime $created The exact moment this entity was created. - * - * @return $this - */ - public function setCreated($created) - { - $this->container['created'] = $created; - - return $this; - } - - /** - * Gets applicationId - * - * @return int - */ - public function getApplicationId() - { - return $this->container['applicationId']; - } - - /** - * Sets applicationId - * - * @param int $applicationId The ID of the application that owns this entity. - * - * @return $this - */ - public function setApplicationId($applicationId) - { - $this->container['applicationId'] = $applicationId; - - return $this; - } - - /** - * Gets userId - * - * @return int - */ - public function getUserId() - { - return $this->container['userId']; - } - - /** - * Sets userId - * - * @param int $userId The ID of the user associated with this entity. - * - * @return $this - */ - public function setUserId($userId) - { - $this->container['userId'] = $userId; - - return $this; - } - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name A user-facing name for this campaign. - * - * @return $this - */ - public function setName($name) - { - - if ((mb_strlen($name) < 1)) { - throw new \InvalidArgumentException('invalid length for $name when calling CampaignStateNotification., must be bigger than or equal to 1.'); - } - - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets description - * - * @return string - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string $description A detailed description of the campaign. - * - * @return $this - */ - public function setDescription($description) - { - $this->container['description'] = $description; - - return $this; - } - - /** - * Gets startTime - * - * @return \DateTime|null - */ - public function getStartTime() - { - return $this->container['startTime']; - } - - /** - * Sets startTime - * - * @param \DateTime|null $startTime Timestamp when the campaign will become active. - * - * @return $this - */ - public function setStartTime($startTime) - { - $this->container['startTime'] = $startTime; - - return $this; - } - - /** - * Gets endTime - * - * @return \DateTime|null - */ - public function getEndTime() - { - return $this->container['endTime']; - } - - /** - * Sets endTime - * - * @param \DateTime|null $endTime Timestamp when the campaign will become inactive. - * - * @return $this - */ - public function setEndTime($endTime) - { - $this->container['endTime'] = $endTime; - - return $this; - } - - /** - * Gets attributes - * - * @return object|null - */ - public function getAttributes() - { - return $this->container['attributes']; - } - - /** - * Sets attributes - * - * @param object|null $attributes Arbitrary properties associated with this campaign. - * - * @return $this - */ - public function setAttributes($attributes) - { - $this->container['attributes'] = $attributes; - - return $this; - } - - /** - * Gets state - * - * @return string - */ - public function getState() - { - return $this->container['state']; - } - - /** - * Sets state - * - * @param string $state A disabled or archived campaign is not evaluated for rules or coupons. - * - * @return $this - */ - public function setState($state) - { - $allowedValues = $this->getStateAllowableValues(); - if (!in_array($state, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['state'] = $state; - - return $this; - } - - /** - * Gets activeRulesetId - * - * @return int|null - */ - public function getActiveRulesetId() - { - return $this->container['activeRulesetId']; - } - - /** - * Sets activeRulesetId - * - * @param int|null $activeRulesetId [ID of Ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. - * - * @return $this - */ - public function setActiveRulesetId($activeRulesetId) - { - $this->container['activeRulesetId'] = $activeRulesetId; - - return $this; - } - - /** - * Gets tags - * - * @return string[] - */ - public function getTags() - { - return $this->container['tags']; - } - - /** - * Sets tags - * - * @param string[] $tags A list of tags for the campaign. - * - * @return $this - */ - public function setTags($tags) - { - $this->container['tags'] = $tags; - - return $this; - } - - /** - * Gets features - * - * @return string[] - */ - public function getFeatures() - { - return $this->container['features']; - } - - /** - * Sets features - * - * @param string[] $features The features enabled in this campaign. - * - * @return $this - */ - public function setFeatures($features) - { - $allowedValues = $this->getFeaturesAllowableValues(); - if (array_diff($features, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'features', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['features'] = $features; - - return $this; - } - - /** - * Gets couponSettings - * - * @return \TalonOne\Client\Model\CodeGeneratorSettings|null - */ - public function getCouponSettings() - { - return $this->container['couponSettings']; - } - - /** - * Sets couponSettings - * - * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $couponSettings couponSettings - * - * @return $this - */ - public function setCouponSettings($couponSettings) - { - $this->container['couponSettings'] = $couponSettings; - - return $this; - } - - /** - * Gets referralSettings - * - * @return \TalonOne\Client\Model\CodeGeneratorSettings|null - */ - public function getReferralSettings() - { - return $this->container['referralSettings']; - } - - /** - * Sets referralSettings - * - * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $referralSettings referralSettings - * - * @return $this - */ - public function setReferralSettings($referralSettings) - { - $this->container['referralSettings'] = $referralSettings; - - return $this; - } - - /** - * Gets limits - * - * @return \TalonOne\Client\Model\LimitConfig[] - */ - public function getLimits() - { - return $this->container['limits']; - } - - /** - * Sets limits - * - * @param \TalonOne\Client\Model\LimitConfig[] $limits The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. - * - * @return $this - */ - public function setLimits($limits) - { - $this->container['limits'] = $limits; - - return $this; - } - - /** - * Gets campaignGroups - * - * @return int[]|null - */ - public function getCampaignGroups() - { - return $this->container['campaignGroups']; - } - - /** - * Sets campaignGroups - * - * @param int[]|null $campaignGroups The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. - * - * @return $this - */ - public function setCampaignGroups($campaignGroups) - { - $this->container['campaignGroups'] = $campaignGroups; - - return $this; - } - - /** - * Gets evaluationGroupId - * - * @return int|null - */ - public function getEvaluationGroupId() - { - return $this->container['evaluationGroupId']; - } - - /** - * Sets evaluationGroupId - * - * @param int|null $evaluationGroupId The ID of the campaign evaluation group the campaign belongs to. - * - * @return $this - */ - public function setEvaluationGroupId($evaluationGroupId) - { - $this->container['evaluationGroupId'] = $evaluationGroupId; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. - * - * @return $this - */ - public function setType($type) - { - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets linkedStoreIds - * - * @return int[]|null - */ - public function getLinkedStoreIds() - { - return $this->container['linkedStoreIds']; - } - - /** - * Sets linkedStoreIds - * - * @param int[]|null $linkedStoreIds A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. - * - * @return $this - */ - public function setLinkedStoreIds($linkedStoreIds) - { - $this->container['linkedStoreIds'] = $linkedStoreIds; - - return $this; - } - - /** - * Gets budgets - * - * @return \TalonOne\Client\Model\CampaignBudget[] - */ - public function getBudgets() - { - return $this->container['budgets']; - } - - /** - * Sets budgets - * - * @param \TalonOne\Client\Model\CampaignBudget[] $budgets A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. - * - * @return $this - */ - public function setBudgets($budgets) - { - $this->container['budgets'] = $budgets; - - return $this; - } - - /** - * Gets couponRedemptionCount - * - * @return int|null - */ - public function getCouponRedemptionCount() - { - return $this->container['couponRedemptionCount']; - } - - /** - * Sets couponRedemptionCount - * - * @param int|null $couponRedemptionCount This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. - * - * @return $this - */ - public function setCouponRedemptionCount($couponRedemptionCount) - { - $this->container['couponRedemptionCount'] = $couponRedemptionCount; - - return $this; - } - - /** - * Gets referralRedemptionCount - * - * @return int|null - */ - public function getReferralRedemptionCount() - { - return $this->container['referralRedemptionCount']; - } - - /** - * Sets referralRedemptionCount - * - * @param int|null $referralRedemptionCount This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. - * - * @return $this - */ - public function setReferralRedemptionCount($referralRedemptionCount) - { - $this->container['referralRedemptionCount'] = $referralRedemptionCount; - - return $this; - } - - /** - * Gets discountCount - * - * @return float|null - */ - public function getDiscountCount() - { - return $this->container['discountCount']; - } - - /** - * Sets discountCount - * - * @param float|null $discountCount This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. - * - * @return $this - */ - public function setDiscountCount($discountCount) - { - $this->container['discountCount'] = $discountCount; - - return $this; - } - - /** - * Gets discountEffectCount - * - * @return int|null - */ - public function getDiscountEffectCount() - { - return $this->container['discountEffectCount']; - } - - /** - * Sets discountEffectCount - * - * @param int|null $discountEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of times discounts were redeemed in this campaign. - * - * @return $this - */ - public function setDiscountEffectCount($discountEffectCount) - { - $this->container['discountEffectCount'] = $discountEffectCount; - - return $this; - } - - /** - * Gets couponCreationCount - * - * @return int|null - */ - public function getCouponCreationCount() - { - return $this->container['couponCreationCount']; - } - - /** - * Sets couponCreationCount - * - * @param int|null $couponCreationCount This property is **deprecated**. The count should be available under *budgets* property. Total number of coupons created by rules in this campaign. - * - * @return $this - */ - public function setCouponCreationCount($couponCreationCount) - { - $this->container['couponCreationCount'] = $couponCreationCount; - - return $this; - } - - /** - * Gets customEffectCount - * - * @return int|null - */ - public function getCustomEffectCount() - { - return $this->container['customEffectCount']; - } - - /** - * Sets customEffectCount - * - * @param int|null $customEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of custom effects triggered by rules in this campaign. - * - * @return $this - */ - public function setCustomEffectCount($customEffectCount) - { - $this->container['customEffectCount'] = $customEffectCount; - - return $this; - } - - /** - * Gets referralCreationCount - * - * @return int|null - */ - public function getReferralCreationCount() - { - return $this->container['referralCreationCount']; - } - - /** - * Sets referralCreationCount - * - * @param int|null $referralCreationCount This property is **deprecated**. The count should be available under *budgets* property. Total number of referrals created by rules in this campaign. - * - * @return $this - */ - public function setReferralCreationCount($referralCreationCount) - { - $this->container['referralCreationCount'] = $referralCreationCount; - - return $this; - } - - /** - * Gets addFreeItemEffectCount - * - * @return int|null - */ - public function getAddFreeItemEffectCount() - { - return $this->container['addFreeItemEffectCount']; - } - - /** - * Sets addFreeItemEffectCount - * - * @param int|null $addFreeItemEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of times the [add free item effect](https://docs.talon.one/docs/dev/integration-api/api-effects#addfreeitem) can be triggered in this campaign. - * - * @return $this - */ - public function setAddFreeItemEffectCount($addFreeItemEffectCount) - { - $this->container['addFreeItemEffectCount'] = $addFreeItemEffectCount; - - return $this; - } - - /** - * Gets awardedGiveawaysCount - * - * @return int|null - */ - public function getAwardedGiveawaysCount() - { - return $this->container['awardedGiveawaysCount']; - } - - /** - * Sets awardedGiveawaysCount - * - * @param int|null $awardedGiveawaysCount This property is **deprecated**. The count should be available under *budgets* property. Total number of giveaways awarded by rules in this campaign. - * - * @return $this - */ - public function setAwardedGiveawaysCount($awardedGiveawaysCount) - { - $this->container['awardedGiveawaysCount'] = $awardedGiveawaysCount; - - return $this; - } - - /** - * Gets createdLoyaltyPointsCount - * - * @return float|null - */ - public function getCreatedLoyaltyPointsCount() - { - return $this->container['createdLoyaltyPointsCount']; - } - - /** - * Sets createdLoyaltyPointsCount - * - * @param float|null $createdLoyaltyPointsCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points created by rules in this campaign. - * - * @return $this - */ - public function setCreatedLoyaltyPointsCount($createdLoyaltyPointsCount) - { - $this->container['createdLoyaltyPointsCount'] = $createdLoyaltyPointsCount; - - return $this; - } - - /** - * Gets createdLoyaltyPointsEffectCount - * - * @return int|null - */ - public function getCreatedLoyaltyPointsEffectCount() - { - return $this->container['createdLoyaltyPointsEffectCount']; - } - - /** - * Sets createdLoyaltyPointsEffectCount - * - * @param int|null $createdLoyaltyPointsEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point creation effects triggered by rules in this campaign. - * - * @return $this - */ - public function setCreatedLoyaltyPointsEffectCount($createdLoyaltyPointsEffectCount) - { - $this->container['createdLoyaltyPointsEffectCount'] = $createdLoyaltyPointsEffectCount; - - return $this; - } - - /** - * Gets redeemedLoyaltyPointsCount - * - * @return float|null - */ - public function getRedeemedLoyaltyPointsCount() - { - return $this->container['redeemedLoyaltyPointsCount']; - } - - /** - * Sets redeemedLoyaltyPointsCount - * - * @param float|null $redeemedLoyaltyPointsCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty points redeemed by rules in this campaign. - * - * @return $this - */ - public function setRedeemedLoyaltyPointsCount($redeemedLoyaltyPointsCount) - { - $this->container['redeemedLoyaltyPointsCount'] = $redeemedLoyaltyPointsCount; - - return $this; - } - - /** - * Gets redeemedLoyaltyPointsEffectCount - * - * @return int|null - */ - public function getRedeemedLoyaltyPointsEffectCount() - { - return $this->container['redeemedLoyaltyPointsEffectCount']; - } - - /** - * Sets redeemedLoyaltyPointsEffectCount - * - * @param int|null $redeemedLoyaltyPointsEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of loyalty point redemption effects triggered by rules in this campaign. - * - * @return $this - */ - public function setRedeemedLoyaltyPointsEffectCount($redeemedLoyaltyPointsEffectCount) - { - $this->container['redeemedLoyaltyPointsEffectCount'] = $redeemedLoyaltyPointsEffectCount; - - return $this; - } - - /** - * Gets callApiEffectCount - * - * @return int|null - */ - public function getCallApiEffectCount() - { - return $this->container['callApiEffectCount']; - } - - /** - * Sets callApiEffectCount - * - * @param int|null $callApiEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of webhooks triggered by rules in this campaign. - * - * @return $this - */ - public function setCallApiEffectCount($callApiEffectCount) - { - $this->container['callApiEffectCount'] = $callApiEffectCount; - - return $this; - } - - /** - * Gets reservecouponEffectCount - * - * @return int|null - */ - public function getReservecouponEffectCount() - { - return $this->container['reservecouponEffectCount']; - } - - /** - * Sets reservecouponEffectCount - * - * @param int|null $reservecouponEffectCount This property is **deprecated**. The count should be available under *budgets* property. Total number of reserve coupon effects triggered by rules in this campaign. - * - * @return $this - */ - public function setReservecouponEffectCount($reservecouponEffectCount) - { - $this->container['reservecouponEffectCount'] = $reservecouponEffectCount; - - return $this; - } - - /** - * Gets lastActivity - * - * @return \DateTime|null - */ - public function getLastActivity() - { - return $this->container['lastActivity']; - } - - /** - * Sets lastActivity - * - * @param \DateTime|null $lastActivity Timestamp of the most recent event received by this campaign. - * - * @return $this - */ - public function setLastActivity($lastActivity) - { - $this->container['lastActivity'] = $lastActivity; - - return $this; - } - - /** - * Gets updated - * - * @return \DateTime|null - */ - public function getUpdated() - { - return $this->container['updated']; - } - - /** - * Sets updated - * - * @param \DateTime|null $updated Timestamp of the most recent update to the campaign's property. Updates to external entities used in this campaign are **not** registered by this property, such as collection or coupon updates. - * - * @return $this - */ - public function setUpdated($updated) - { - $this->container['updated'] = $updated; - - return $this; - } - - /** - * Gets createdBy - * - * @return string|null - */ - public function getCreatedBy() - { - return $this->container['createdBy']; - } - - /** - * Sets createdBy - * - * @param string|null $createdBy Name of the user who created this campaign if available. - * - * @return $this - */ - public function setCreatedBy($createdBy) - { - $this->container['createdBy'] = $createdBy; - - return $this; - } - - /** - * Gets updatedBy - * - * @return string|null - */ - public function getUpdatedBy() - { - return $this->container['updatedBy']; - } - - /** - * Sets updatedBy - * - * @param string|null $updatedBy Name of the user who last updated this campaign if available. - * - * @return $this - */ - public function setUpdatedBy($updatedBy) - { - $this->container['updatedBy'] = $updatedBy; - - return $this; - } - - /** - * Gets templateId - * - * @return int|null - */ - public function getTemplateId() - { - return $this->container['templateId']; - } - - /** - * Sets templateId - * - * @param int|null $templateId The ID of the Campaign Template this Campaign was created from. - * - * @return $this - */ - public function setTemplateId($templateId) - { - $this->container['templateId'] = $templateId; - - return $this; - } - - /** - * Gets frontendState - * - * @return string - */ - public function getFrontendState() - { - return $this->container['frontendState']; - } - - /** - * Sets frontendState - * - * @param string $frontendState A campaign state described exactly as in the Campaign Manager. - * - * @return $this - */ - public function setFrontendState($frontendState) - { - $allowedValues = $this->getFrontendStateAllowableValues(); - if (!in_array($frontendState, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'frontendState', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['frontendState'] = $frontendState; - - 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 - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $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]); - } - - /** - * 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/CampaignSetV2.php b/lib/Model/CampaignStoreBudget.php similarity index 76% rename from lib/Model/CampaignSetV2.php rename to lib/Model/CampaignStoreBudget.php index e5bc6bc3..ec4c4988 100644 --- a/lib/Model/CampaignSetV2.php +++ b/lib/Model/CampaignStoreBudget.php @@ -1,6 +1,6 @@ 'int', 'created' => '\DateTime', - 'applicationId' => 'int', - 'version' => 'int', - 'set' => '\TalonOne\Client\Model\CampaignPrioritiesV2' + 'campaignId' => 'int', + 'storeId' => 'int', + 'limits' => '\TalonOne\Client\Model\LimitConfig[]' ]; /** @@ -73,9 +73,9 @@ class CampaignSetV2 implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'created' => 'date-time', - 'applicationId' => null, - 'version' => null, - 'set' => null + 'campaignId' => null, + 'storeId' => null, + 'limits' => null ]; /** @@ -107,9 +107,9 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'created' => 'created', - 'applicationId' => 'applicationId', - 'version' => 'version', - 'set' => 'set' + 'campaignId' => 'campaignId', + 'storeId' => 'storeId', + 'limits' => 'limits' ]; /** @@ -120,9 +120,9 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'created' => 'setCreated', - 'applicationId' => 'setApplicationId', - 'version' => 'setVersion', - 'set' => 'setSet' + 'campaignId' => 'setCampaignId', + 'storeId' => 'setStoreId', + 'limits' => 'setLimits' ]; /** @@ -133,9 +133,9 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'created' => 'getCreated', - 'applicationId' => 'getApplicationId', - 'version' => 'getVersion', - 'set' => 'getSet' + 'campaignId' => 'getCampaignId', + 'storeId' => 'getStoreId', + 'limits' => 'getLimits' ]; /** @@ -200,9 +200,9 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['created'] = isset($data['created']) ? $data['created'] : null; - $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : null; - $this->container['set'] = isset($data['set']) ? $data['set'] : null; + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['storeId'] = isset($data['storeId']) ? $data['storeId'] : null; + $this->container['limits'] = isset($data['limits']) ? $data['limits'] : null; } /** @@ -220,18 +220,14 @@ public function listInvalidProperties() if ($this->container['created'] === null) { $invalidProperties[] = "'created' can't be null"; } - if ($this->container['applicationId'] === null) { - $invalidProperties[] = "'applicationId' can't be null"; + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; } - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' can't be null"; + if ($this->container['storeId'] === null) { + $invalidProperties[] = "'storeId' can't be null"; } - if (($this->container['version'] < 1)) { - $invalidProperties[] = "invalid value for 'version', must be bigger than or equal to 1."; - } - - if ($this->container['set'] === null) { - $invalidProperties[] = "'set' can't be null"; + if ($this->container['limits'] === null) { + $invalidProperties[] = "'limits' can't be null"; } return $invalidProperties; } @@ -297,78 +293,73 @@ public function setCreated($created) } /** - * Gets applicationId + * Gets campaignId * * @return int */ - public function getApplicationId() + public function getCampaignId() { - return $this->container['applicationId']; + return $this->container['campaignId']; } /** - * Sets applicationId + * Sets campaignId * - * @param int $applicationId The ID of the application that owns this entity. + * @param int $campaignId The ID of the campaign that owns this entity. * * @return $this */ - public function setApplicationId($applicationId) + public function setCampaignId($campaignId) { - $this->container['applicationId'] = $applicationId; + $this->container['campaignId'] = $campaignId; return $this; } /** - * Gets version + * Gets storeId * * @return int */ - public function getVersion() + public function getStoreId() { - return $this->container['version']; + return $this->container['storeId']; } /** - * Sets version + * Sets storeId * - * @param int $version Version of the campaign set. + * @param int $storeId The ID of the store. * * @return $this */ - public function setVersion($version) + public function setStoreId($storeId) { - - if (($version < 1)) { - throw new \InvalidArgumentException('invalid value for $version when calling CampaignSetV2., must be bigger than or equal to 1.'); - } - - $this->container['version'] = $version; + $this->container['storeId'] = $storeId; return $this; } /** - * Gets set + * Gets limits * - * @return \TalonOne\Client\Model\CampaignPrioritiesV2 + * @return \TalonOne\Client\Model\LimitConfig[] */ - public function getSet() + public function getLimits() { - return $this->container['set']; + return $this->container['limits']; } /** - * Sets set + * Sets limits * - * @param \TalonOne\Client\Model\CampaignPrioritiesV2 $set set + * @param \TalonOne\Client\Model\LimitConfig[] $limits The set of budget limits for stores linked to the campaign. * * @return $this */ - public function setSet($set) + public function setLimits($limits) { - $this->container['set'] = $set; + $this->container['limits'] = $limits; return $this; } diff --git a/lib/Model/FeedNotification.php b/lib/Model/CampaignVersions.php similarity index 56% rename from lib/Model/FeedNotification.php rename to lib/Model/CampaignVersions.php index d9af7004..4f66c128 100644 --- a/lib/Model/FeedNotification.php +++ b/lib/Model/CampaignVersions.php @@ -1,6 +1,6 @@ 'string', - 'created' => '\DateTime', - 'updated' => '\DateTime', - 'articleUrl' => 'string', - 'type' => 'string', - 'body' => 'string' + 'activeRevisionId' => 'int', + 'activeRevisionVersionId' => 'int', + 'version' => 'int', + 'currentRevisionId' => 'int', + 'currentRevisionVersionId' => 'int', + 'stageRevision' => 'bool' ]; /** @@ -72,12 +71,12 @@ class FeedNotification implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'title' => null, - 'created' => 'date-time', - 'updated' => 'date-time', - 'articleUrl' => null, - 'type' => null, - 'body' => null + 'activeRevisionId' => null, + 'activeRevisionVersionId' => null, + 'version' => null, + 'currentRevisionId' => null, + 'currentRevisionVersionId' => null, + 'stageRevision' => null ]; /** @@ -107,12 +106,12 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'title' => 'title', - 'created' => 'created', - 'updated' => 'updated', - 'articleUrl' => 'articleUrl', - 'type' => 'type', - 'body' => 'body' + 'activeRevisionId' => 'activeRevisionId', + 'activeRevisionVersionId' => 'activeRevisionVersionId', + 'version' => 'version', + 'currentRevisionId' => 'currentRevisionId', + 'currentRevisionVersionId' => 'currentRevisionVersionId', + 'stageRevision' => 'stageRevision' ]; /** @@ -121,12 +120,12 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'title' => 'setTitle', - 'created' => 'setCreated', - 'updated' => 'setUpdated', - 'articleUrl' => 'setArticleUrl', - 'type' => 'setType', - 'body' => 'setBody' + 'activeRevisionId' => 'setActiveRevisionId', + 'activeRevisionVersionId' => 'setActiveRevisionVersionId', + 'version' => 'setVersion', + 'currentRevisionId' => 'setCurrentRevisionId', + 'currentRevisionVersionId' => 'setCurrentRevisionVersionId', + 'stageRevision' => 'setStageRevision' ]; /** @@ -135,12 +134,12 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'title' => 'getTitle', - 'created' => 'getCreated', - 'updated' => 'getUpdated', - 'articleUrl' => 'getArticleUrl', - 'type' => 'getType', - 'body' => 'getBody' + 'activeRevisionId' => 'getActiveRevisionId', + 'activeRevisionVersionId' => 'getActiveRevisionVersionId', + 'version' => 'getVersion', + 'currentRevisionId' => 'getCurrentRevisionId', + 'currentRevisionVersionId' => 'getCurrentRevisionVersionId', + 'stageRevision' => 'getStageRevision' ]; /** @@ -184,30 +183,9 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_FEED = 'feed'; - const TYPE_FEATURE = 'feature'; - const TYPE_ANNOUNCEMENT = 'announcement'; - const TYPE_ALERT = 'alert'; - const TYPE_TEST = 'test'; - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_FEED, - self::TYPE_FEATURE, - self::TYPE_ANNOUNCEMENT, - self::TYPE_ALERT, - self::TYPE_TEST, - ]; - } - /** * Associative array for storing property values @@ -224,12 +202,12 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['created'] = isset($data['created']) ? $data['created'] : null; - $this->container['updated'] = isset($data['updated']) ? $data['updated'] : null; - $this->container['articleUrl'] = isset($data['articleUrl']) ? $data['articleUrl'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['activeRevisionId'] = isset($data['activeRevisionId']) ? $data['activeRevisionId'] : null; + $this->container['activeRevisionVersionId'] = isset($data['activeRevisionVersionId']) ? $data['activeRevisionVersionId'] : null; + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + $this->container['currentRevisionId'] = isset($data['currentRevisionId']) ? $data['currentRevisionId'] : null; + $this->container['currentRevisionVersionId'] = isset($data['currentRevisionVersionId']) ? $data['currentRevisionVersionId'] : null; + $this->container['stageRevision'] = isset($data['stageRevision']) ? $data['stageRevision'] : false; } /** @@ -241,32 +219,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['title'] === null) { - $invalidProperties[] = "'title' can't be null"; - } - if ($this->container['created'] === null) { - $invalidProperties[] = "'created' can't be null"; - } - if ($this->container['updated'] === null) { - $invalidProperties[] = "'updated' can't be null"; - } - if ($this->container['articleUrl'] === null) { - $invalidProperties[] = "'articleUrl' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if ($this->container['body'] === null) { - $invalidProperties[] = "'body' can't be null"; - } return $invalidProperties; } @@ -283,154 +235,145 @@ public function valid() /** - * Gets title + * Gets activeRevisionId * - * @return string + * @return int|null */ - public function getTitle() + public function getActiveRevisionId() { - return $this->container['title']; + return $this->container['activeRevisionId']; } /** - * Sets title + * Sets activeRevisionId * - * @param string $title Title of the feed notification. + * @param int|null $activeRevisionId ID of the revision that was last activated on this campaign. * * @return $this */ - public function setTitle($title) + public function setActiveRevisionId($activeRevisionId) { - $this->container['title'] = $title; + $this->container['activeRevisionId'] = $activeRevisionId; return $this; } /** - * Gets created + * Gets activeRevisionVersionId * - * @return \DateTime + * @return int|null */ - public function getCreated() + public function getActiveRevisionVersionId() { - return $this->container['created']; + return $this->container['activeRevisionVersionId']; } /** - * Sets created + * Sets activeRevisionVersionId * - * @param \DateTime $created Timestamp of the moment this feed notification was created. + * @param int|null $activeRevisionVersionId ID of the revision version that is active on the campaign. * * @return $this */ - public function setCreated($created) + public function setActiveRevisionVersionId($activeRevisionVersionId) { - $this->container['created'] = $created; + $this->container['activeRevisionVersionId'] = $activeRevisionVersionId; return $this; } /** - * Gets updated + * Gets version * - * @return \DateTime + * @return int|null */ - public function getUpdated() + public function getVersion() { - return $this->container['updated']; + return $this->container['version']; } /** - * Sets updated + * Sets version * - * @param \DateTime $updated Timestamp of the moment this feed notification was last updated. + * @param int|null $version Incrementing number representing how many revisions have been activated on this campaign, starts from 0 for a new campaign. * * @return $this */ - public function setUpdated($updated) + public function setVersion($version) { - $this->container['updated'] = $updated; + $this->container['version'] = $version; return $this; } /** - * Gets articleUrl + * Gets currentRevisionId * - * @return string + * @return int|null */ - public function getArticleUrl() + public function getCurrentRevisionId() { - return $this->container['articleUrl']; + return $this->container['currentRevisionId']; } /** - * Sets articleUrl + * Sets currentRevisionId * - * @param string $articleUrl URL to the feed notification in the help center. + * @param int|null $currentRevisionId ID of the revision currently being modified for the campaign. * * @return $this */ - public function setArticleUrl($articleUrl) + public function setCurrentRevisionId($currentRevisionId) { - $this->container['articleUrl'] = $articleUrl; + $this->container['currentRevisionId'] = $currentRevisionId; return $this; } /** - * Gets type + * Gets currentRevisionVersionId * - * @return string + * @return int|null */ - public function getType() + public function getCurrentRevisionVersionId() { - return $this->container['type']; + return $this->container['currentRevisionVersionId']; } /** - * Sets type + * Sets currentRevisionVersionId * - * @param string $type The type of the feed notification. + * @param int|null $currentRevisionVersionId ID of the latest version applied on the current revision. * * @return $this */ - public function setType($type) + public function setCurrentRevisionVersionId($currentRevisionVersionId) { - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; + $this->container['currentRevisionVersionId'] = $currentRevisionVersionId; return $this; } /** - * Gets body + * Gets stageRevision * - * @return string + * @return bool|null */ - public function getBody() + public function getStageRevision() { - return $this->container['body']; + return $this->container['stageRevision']; } /** - * Sets body + * Sets stageRevision * - * @param string $body Body of the feed notification. + * @param bool|null $stageRevision Flag for determining whether we use current revision when sending requests with staging API key. * * @return $this */ - public function setBody($body) + public function setStageRevision($stageRevision) { - $this->container['body'] = $body; + $this->container['stageRevision'] = $stageRevision; return $this; } diff --git a/lib/Model/LoyaltyProgramSubledgers.php b/lib/Model/CardAddedDeductedPointsNotificationPolicy.php similarity index 70% rename from lib/Model/LoyaltyProgramSubledgers.php rename to lib/Model/CardAddedDeductedPointsNotificationPolicy.php index da7ae6e6..31808c28 100644 --- a/lib/Model/LoyaltyProgramSubledgers.php +++ b/lib/Model/CardAddedDeductedPointsNotificationPolicy.php @@ -1,6 +1,6 @@ 'int', - 'subledgerIds' => 'string[]' + 'name' => 'string', + 'scopes' => 'string[]' ]; /** @@ -68,8 +67,8 @@ class LoyaltyProgramSubledgers implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'loyaltyProgramId' => null, - 'subledgerIds' => null + 'name' => null, + 'scopes' => null ]; /** @@ -99,8 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'loyaltyProgramId' => 'loyaltyProgramId', - 'subledgerIds' => 'subledgerIds' + 'name' => 'name', + 'scopes' => 'scopes' ]; /** @@ -109,8 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'loyaltyProgramId' => 'setLoyaltyProgramId', - 'subledgerIds' => 'setSubledgerIds' + 'name' => 'setName', + 'scopes' => 'setScopes' ]; /** @@ -119,8 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'loyaltyProgramId' => 'getLoyaltyProgramId', - 'subledgerIds' => 'getSubledgerIds' + 'name' => 'getName', + 'scopes' => 'getScopes' ]; /** @@ -164,9 +163,28 @@ public function getModelName() return self::$openAPIModelName; } + const SCOPES_ALL = 'all'; + const SCOPES_CAMPAIGN_MANAGER = 'campaign_manager'; + const SCOPES_MANAGEMENT_API = 'management_api'; + const SCOPES_RULE_ENGINE = 'rule_engine'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getScopesAllowableValues() + { + return [ + self::SCOPES_ALL, + self::SCOPES_CAMPAIGN_MANAGER, + self::SCOPES_MANAGEMENT_API, + self::SCOPES_RULE_ENGINE, + ]; + } + /** * Associative array for storing property values @@ -183,8 +201,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['loyaltyProgramId'] = isset($data['loyaltyProgramId']) ? $data['loyaltyProgramId'] : null; - $this->container['subledgerIds'] = isset($data['subledgerIds']) ? $data['subledgerIds'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['scopes'] = isset($data['scopes']) ? $data['scopes'] : null; } /** @@ -196,11 +214,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['loyaltyProgramId'] === null) { - $invalidProperties[] = "'loyaltyProgramId' can't be null"; + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; } - if ($this->container['subledgerIds'] === null) { - $invalidProperties[] = "'subledgerIds' can't be null"; + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if ($this->container['scopes'] === null) { + $invalidProperties[] = "'scopes' can't be null"; } return $invalidProperties; } @@ -218,49 +240,63 @@ public function valid() /** - * Gets loyaltyProgramId + * Gets name * - * @return int + * @return string */ - public function getLoyaltyProgramId() + public function getName() { - return $this->container['loyaltyProgramId']; + return $this->container['name']; } /** - * Sets loyaltyProgramId + * Sets name * - * @param int $loyaltyProgramId The internal ID of the loyalty program. + * @param string $name Notification name. * * @return $this */ - public function setLoyaltyProgramId($loyaltyProgramId) + public function setName($name) { - $this->container['loyaltyProgramId'] = $loyaltyProgramId; + + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling CardAddedDeductedPointsNotificationPolicy., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; return $this; } /** - * Gets subledgerIds + * Gets scopes * * @return string[] */ - public function getSubledgerIds() + public function getScopes() { - return $this->container['subledgerIds']; + return $this->container['scopes']; } /** - * Sets subledgerIds + * Sets scopes * - * @param string[] $subledgerIds The list of subledger IDs. + * @param string[] $scopes scopes * * @return $this */ - public function setSubledgerIds($subledgerIds) + public function setScopes($scopes) { - $this->container['subledgerIds'] = $subledgerIds; + $allowedValues = $this->getScopesAllowableValues(); + if (array_diff($scopes, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'scopes', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['scopes'] = $scopes; return $this; } diff --git a/lib/Model/CartItem.php b/lib/Model/CartItem.php index c9510cb0..9459bafc 100644 --- a/lib/Model/CartItem.php +++ b/lib/Model/CartItem.php @@ -643,7 +643,7 @@ public function getAttributes() /** * Sets attributes * - * @param object|null $attributes Use this property to set a value for the attributes of your choice. [Attributes](https://docs.talon.one/docs/dev/concepts/attributes) represent any information to attach to this cart item. Custom _cart item_ attributes must be created in the Campaign Manager before you set them with this property. + * @param object|null $attributes Use this property to set a value for the attributes of your choice. [Attributes](https://docs.talon.one/docs/dev/concepts/attributes) represent any information to attach to this cart item. Custom _cart item_ attributes must be created in the Campaign Manager before you set them with this property. **Note:** Any previously defined attributes that you do not include in the array will be removed. * * @return $this */ diff --git a/lib/Model/CodeGeneratorSettings.php b/lib/Model/CodeGeneratorSettings.php index cf63cba7..ee4b1a5f 100644 --- a/lib/Model/CodeGeneratorSettings.php +++ b/lib/Model/CodeGeneratorSettings.php @@ -261,7 +261,7 @@ public function getCouponPattern() /** * Sets couponPattern * - * @param string $couponPattern The pattern used to generate coupon codes. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. + * @param string $couponPattern The pattern used to generate codes, such as coupon codes, referral codes, and loyalty cards. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set. * * @return $this */ diff --git a/lib/Model/Coupon.php b/lib/Model/Coupon.php index f3ba9855..da78f4cc 100644 --- a/lib/Model/Coupon.php +++ b/lib/Model/Coupon.php @@ -615,7 +615,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/CouponConstraints.php b/lib/Model/CouponConstraints.php index a6eafa37..04b12d64 100644 --- a/lib/Model/CouponConstraints.php +++ b/lib/Model/CouponConstraints.php @@ -385,7 +385,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/CouponCreationJob.php b/lib/Model/CouponCreationJob.php index f62fc815..f1df542e 100644 --- a/lib/Model/CouponCreationJob.php +++ b/lib/Model/CouponCreationJob.php @@ -664,7 +664,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/CouponDeletionFilters.php b/lib/Model/CouponDeletionFilters.php new file mode 100644 index 00000000..ed23309d --- /dev/null +++ b/lib/Model/CouponDeletionFilters.php @@ -0,0 +1,732 @@ + '\DateTime', + 'createdAfter' => '\DateTime', + 'startsAfter' => '\DateTime', + 'startsBefore' => '\DateTime', + 'valid' => 'string', + 'usable' => 'bool', + 'redeemed' => 'bool', + 'recipientIntegrationId' => 'string', + 'exactMatch' => 'bool', + 'value' => 'string', + 'batchId' => 'string', + 'referralId' => 'int', + 'expiresAfter' => '\DateTime', + 'expiresBefore' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'createdBefore' => 'date-time', + 'createdAfter' => 'date-time', + 'startsAfter' => 'date-time', + 'startsBefore' => 'date-time', + 'valid' => null, + 'usable' => null, + 'redeemed' => null, + 'recipientIntegrationId' => null, + 'exactMatch' => null, + 'value' => null, + 'batchId' => null, + 'referralId' => null, + 'expiresAfter' => 'date-time', + 'expiresBefore' => 'date-time' + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'createdBefore' => 'createdBefore', + 'createdAfter' => 'createdAfter', + 'startsAfter' => 'startsAfter', + 'startsBefore' => 'startsBefore', + 'valid' => 'valid', + 'usable' => 'usable', + 'redeemed' => 'redeemed', + 'recipientIntegrationId' => 'recipientIntegrationId', + 'exactMatch' => 'exactMatch', + 'value' => 'value', + 'batchId' => 'batchId', + 'referralId' => 'referralId', + 'expiresAfter' => 'expiresAfter', + 'expiresBefore' => 'expiresBefore' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdBefore' => 'setCreatedBefore', + 'createdAfter' => 'setCreatedAfter', + 'startsAfter' => 'setStartsAfter', + 'startsBefore' => 'setStartsBefore', + 'valid' => 'setValid', + 'usable' => 'setUsable', + 'redeemed' => 'setRedeemed', + 'recipientIntegrationId' => 'setRecipientIntegrationId', + 'exactMatch' => 'setExactMatch', + 'value' => 'setValue', + 'batchId' => 'setBatchId', + 'referralId' => 'setReferralId', + 'expiresAfter' => 'setExpiresAfter', + 'expiresBefore' => 'setExpiresBefore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdBefore' => 'getCreatedBefore', + 'createdAfter' => 'getCreatedAfter', + 'startsAfter' => 'getStartsAfter', + 'startsBefore' => 'getStartsBefore', + 'valid' => 'getValid', + 'usable' => 'getUsable', + 'redeemed' => 'getRedeemed', + 'recipientIntegrationId' => 'getRecipientIntegrationId', + 'exactMatch' => 'getExactMatch', + 'value' => 'getValue', + 'batchId' => 'getBatchId', + 'referralId' => 'getReferralId', + 'expiresAfter' => 'getExpiresAfter', + 'expiresBefore' => 'getExpiresBefore' + ]; + + /** + * 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; + } + + const VALID_EXPIRED = 'expired'; + const VALID_VALID_NOW = 'validNow'; + const VALID_VALID_FUTURE = 'validFuture'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValidAllowableValues() + { + return [ + self::VALID_EXPIRED, + self::VALID_VALID_NOW, + self::VALID_VALID_FUTURE, + ]; + } + + + /** + * 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->container['createdBefore'] = isset($data['createdBefore']) ? $data['createdBefore'] : null; + $this->container['createdAfter'] = isset($data['createdAfter']) ? $data['createdAfter'] : null; + $this->container['startsAfter'] = isset($data['startsAfter']) ? $data['startsAfter'] : null; + $this->container['startsBefore'] = isset($data['startsBefore']) ? $data['startsBefore'] : null; + $this->container['valid'] = isset($data['valid']) ? $data['valid'] : null; + $this->container['usable'] = isset($data['usable']) ? $data['usable'] : null; + $this->container['redeemed'] = isset($data['redeemed']) ? $data['redeemed'] : null; + $this->container['recipientIntegrationId'] = isset($data['recipientIntegrationId']) ? $data['recipientIntegrationId'] : null; + $this->container['exactMatch'] = isset($data['exactMatch']) ? $data['exactMatch'] : false; + $this->container['value'] = isset($data['value']) ? $data['value'] : 'false'; + $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null; + $this->container['referralId'] = isset($data['referralId']) ? $data['referralId'] : null; + $this->container['expiresAfter'] = isset($data['expiresAfter']) ? $data['expiresAfter'] : null; + $this->container['expiresBefore'] = isset($data['expiresBefore']) ? $data['expiresBefore'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getValidAllowableValues(); + if (!is_null($this->container['valid']) && !in_array($this->container['valid'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'valid', must be one of '%s'", + 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 createdBefore + * + * @return \DateTime|null + */ + public function getCreatedBefore() + { + return $this->container['createdBefore']; + } + + /** + * Sets createdBefore + * + * @param \DateTime|null $createdBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. + * + * @return $this + */ + public function setCreatedBefore($createdBefore) + { + $this->container['createdBefore'] = $createdBefore; + + return $this; + } + + /** + * Gets createdAfter + * + * @return \DateTime|null + */ + public function getCreatedAfter() + { + return $this->container['createdAfter']; + } + + /** + * Sets createdAfter + * + * @param \DateTime|null $createdAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. + * + * @return $this + */ + public function setCreatedAfter($createdAfter) + { + $this->container['createdAfter'] = $createdAfter; + + return $this; + } + + /** + * Gets startsAfter + * + * @return \DateTime|null + */ + public function getStartsAfter() + { + return $this->container['startsAfter']; + } + + /** + * Sets startsAfter + * + * @param \DateTime|null $startsAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. + * + * @return $this + */ + public function setStartsAfter($startsAfter) + { + $this->container['startsAfter'] = $startsAfter; + + return $this; + } + + /** + * Gets startsBefore + * + * @return \DateTime|null + */ + public function getStartsBefore() + { + return $this->container['startsBefore']; + } + + /** + * Sets startsBefore + * + * @param \DateTime|null $startsBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. + * + * @return $this + */ + public function setStartsBefore($startsBefore) + { + $this->container['startsBefore'] = $startsBefore; + + return $this; + } + + /** + * Gets valid + * + * @return string|null + */ + public function getValid() + { + return $this->container['valid']; + } + + /** + * Sets valid + * + * @param string|null $valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which the start date is null or in the past and the expiration date is null or in the future. - `validFuture`: Matches coupons in which the start date is set and in the future. + * + * @return $this + */ + public function setValid($valid) + { + $allowedValues = $this->getValidAllowableValues(); + if (!is_null($valid) && !in_array($valid, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'valid', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['valid'] = $valid; + + return $this; + } + + /** + * Gets usable + * + * @return bool|null + */ + public function getUsable() + { + return $this->container['usable']; + } + + /** + * Sets usable + * + * @param bool|null $usable - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned. - This field cannot be used in conjunction with the `usable` query parameter. + * + * @return $this + */ + public function setUsable($usable) + { + $this->container['usable'] = $usable; + + return $this; + } + + /** + * Gets redeemed + * + * @return bool|null + */ + public function getRedeemed() + { + return $this->container['redeemed']; + } + + /** + * Sets redeemed + * + * @param bool|null $redeemed - `true`: only coupons where `usageCounter > 0` will be returned. - `false`: only coupons where `usageCounter = 0` will be returned. **Note:** This field cannot be used in conjunction with the `usable` query parameter. + * + * @return $this + */ + public function setRedeemed($redeemed) + { + $this->container['redeemed'] = $redeemed; + + return $this; + } + + /** + * Gets recipientIntegrationId + * + * @return string|null + */ + public function getRecipientIntegrationId() + { + return $this->container['recipientIntegrationId']; + } + + /** + * Sets recipientIntegrationId + * + * @param string|null $recipientIntegrationId Filter results by match with a profile id specified in the coupon's `RecipientIntegrationId` field. + * + * @return $this + */ + public function setRecipientIntegrationId($recipientIntegrationId) + { + $this->container['recipientIntegrationId'] = $recipientIntegrationId; + + return $this; + } + + /** + * Gets exactMatch + * + * @return bool|null + */ + public function getExactMatch() + { + return $this->container['exactMatch']; + } + + /** + * Sets exactMatch + * + * @param bool|null $exactMatch Filter results to an exact case-insensitive matching against the coupon code + * + * @return $this + */ + public function setExactMatch($exactMatch) + { + $this->container['exactMatch'] = $exactMatch; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Filter results by the coupon code + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets batchId + * + * @return string|null + */ + public function getBatchId() + { + return $this->container['batchId']; + } + + /** + * Sets batchId + * + * @param string|null $batchId Filter results by batches of coupons + * + * @return $this + */ + public function setBatchId($batchId) + { + $this->container['batchId'] = $batchId; + + return $this; + } + + /** + * Gets referralId + * + * @return int|null + */ + public function getReferralId() + { + return $this->container['referralId']; + } + + /** + * Sets referralId + * + * @param int|null $referralId Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming a referral code. + * + * @return $this + */ + public function setReferralId($referralId) + { + $this->container['referralId'] = $referralId; + + return $this; + } + + /** + * Gets expiresAfter + * + * @return \DateTime|null + */ + public function getExpiresAfter() + { + return $this->container['expiresAfter']; + } + + /** + * Sets expiresAfter + * + * @param \DateTime|null $expiresAfter Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. + * + * @return $this + */ + public function setExpiresAfter($expiresAfter) + { + $this->container['expiresAfter'] = $expiresAfter; + + return $this; + } + + /** + * Gets expiresBefore + * + * @return \DateTime|null + */ + public function getExpiresBefore() + { + return $this->container['expiresBefore']; + } + + /** + * Sets expiresBefore + * + * @param \DateTime|null $expiresBefore Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. + * + * @return $this + */ + public function setExpiresBefore($expiresBefore) + { + $this->container['expiresBefore'] = $expiresBefore; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/CouponDeletionJob.php b/lib/Model/CouponDeletionJob.php new file mode 100644 index 00000000..d607dac6 --- /dev/null +++ b/lib/Model/CouponDeletionJob.php @@ -0,0 +1,669 @@ + 'int', + 'created' => '\DateTime', + 'applicationId' => 'int', + 'accountId' => 'int', + 'filters' => '\TalonOne\Client\Model\CouponDeletionFilters', + 'status' => 'string', + 'deletedAmount' => 'int', + 'failCount' => 'int', + 'errors' => 'string[]', + 'createdBy' => 'int', + 'communicated' => 'bool', + 'campaignIDs' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'created' => 'date-time', + 'applicationId' => null, + 'accountId' => null, + 'filters' => null, + 'status' => null, + 'deletedAmount' => null, + 'failCount' => null, + 'errors' => null, + 'createdBy' => null, + 'communicated' => null, + 'campaignIDs' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'created' => 'created', + 'applicationId' => 'applicationId', + 'accountId' => 'accountId', + 'filters' => 'filters', + 'status' => 'status', + 'deletedAmount' => 'deletedAmount', + 'failCount' => 'failCount', + 'errors' => 'errors', + 'createdBy' => 'createdBy', + 'communicated' => 'communicated', + 'campaignIDs' => 'campaignIDs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'created' => 'setCreated', + 'applicationId' => 'setApplicationId', + 'accountId' => 'setAccountId', + 'filters' => 'setFilters', + 'status' => 'setStatus', + 'deletedAmount' => 'setDeletedAmount', + 'failCount' => 'setFailCount', + 'errors' => 'setErrors', + 'createdBy' => 'setCreatedBy', + 'communicated' => 'setCommunicated', + 'campaignIDs' => 'setCampaignIDs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'created' => 'getCreated', + 'applicationId' => 'getApplicationId', + 'accountId' => 'getAccountId', + 'filters' => 'getFilters', + 'status' => 'getStatus', + 'deletedAmount' => 'getDeletedAmount', + 'failCount' => 'getFailCount', + 'errors' => 'getErrors', + 'createdBy' => 'getCreatedBy', + 'communicated' => 'getCommunicated', + 'campaignIDs' => 'getCampaignIDs' + ]; + + /** + * 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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['created'] = isset($data['created']) ? $data['created'] : null; + $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; + $this->container['accountId'] = isset($data['accountId']) ? $data['accountId'] : null; + $this->container['filters'] = isset($data['filters']) ? $data['filters'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['deletedAmount'] = isset($data['deletedAmount']) ? $data['deletedAmount'] : null; + $this->container['failCount'] = isset($data['failCount']) ? $data['failCount'] : null; + $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['communicated'] = isset($data['communicated']) ? $data['communicated'] : null; + $this->container['campaignIDs'] = isset($data['campaignIDs']) ? $data['campaignIDs'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['created'] === null) { + $invalidProperties[] = "'created' can't be null"; + } + if ($this->container['applicationId'] === null) { + $invalidProperties[] = "'applicationId' can't be null"; + } + if ($this->container['accountId'] === null) { + $invalidProperties[] = "'accountId' can't be null"; + } + if ($this->container['filters'] === null) { + $invalidProperties[] = "'filters' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['failCount'] === null) { + $invalidProperties[] = "'failCount' can't be null"; + } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } + if ($this->container['createdBy'] === null) { + $invalidProperties[] = "'createdBy' can't be null"; + } + if ($this->container['communicated'] === null) { + $invalidProperties[] = "'communicated' 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 id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Internal ID of this entity. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param \DateTime $created The time this entity was created. + * + * @return $this + */ + public function setCreated($created) + { + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets applicationId + * + * @return int + */ + public function getApplicationId() + { + return $this->container['applicationId']; + } + + /** + * Sets applicationId + * + * @param int $applicationId The ID of the application that owns this entity. + * + * @return $this + */ + public function setApplicationId($applicationId) + { + $this->container['applicationId'] = $applicationId; + + return $this; + } + + /** + * Gets accountId + * + * @return int + */ + public function getAccountId() + { + return $this->container['accountId']; + } + + /** + * Sets accountId + * + * @param int $accountId The ID of the account that owns this entity. + * + * @return $this + */ + public function setAccountId($accountId) + { + $this->container['accountId'] = $accountId; + + return $this; + } + + /** + * Gets filters + * + * @return \TalonOne\Client\Model\CouponDeletionFilters + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \TalonOne\Client\Model\CouponDeletionFilters $filters filters + * + * @return $this + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The current status of this request. Possible values: - `not_ready` - `pending` - `completed` - `failed` + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets deletedAmount + * + * @return int|null + */ + public function getDeletedAmount() + { + return $this->container['deletedAmount']; + } + + /** + * Sets deletedAmount + * + * @param int|null $deletedAmount The number of coupon codes that were already deleted for this request. + * + * @return $this + */ + public function setDeletedAmount($deletedAmount) + { + $this->container['deletedAmount'] = $deletedAmount; + + return $this; + } + + /** + * Gets failCount + * + * @return int + */ + public function getFailCount() + { + return $this->container['failCount']; + } + + /** + * Sets failCount + * + * @param int $failCount The number of times this job failed. + * + * @return $this + */ + public function setFailCount($failCount) + { + $this->container['failCount'] = $failCount; + + return $this; + } + + /** + * Gets errors + * + * @return string[] + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param string[] $errors An array of individual problems encountered during the request. + * + * @return $this + */ + public function setErrors($errors) + { + $this->container['errors'] = $errors; + + return $this; + } + + /** + * Gets createdBy + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param int $createdBy ID of the user who created this effect. + * + * @return $this + */ + public function setCreatedBy($createdBy) + { + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets communicated + * + * @return bool + */ + public function getCommunicated() + { + return $this->container['communicated']; + } + + /** + * Sets communicated + * + * @param bool $communicated Indicates whether the user that created this job was notified of its final state. + * + * @return $this + */ + public function setCommunicated($communicated) + { + $this->container['communicated'] = $communicated; + + return $this; + } + + /** + * Gets campaignIDs + * + * @return int[]|null + */ + public function getCampaignIDs() + { + return $this->container['campaignIDs']; + } + + /** + * Sets campaignIDs + * + * @param int[]|null $campaignIDs campaignIDs + * + * @return $this + */ + public function setCampaignIDs($campaignIDs) + { + $this->container['campaignIDs'] = $campaignIDs; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/CustomerSessionV2.php b/lib/Model/CustomerSessionV2.php index 26c4d239..14eb8a7e 100644 --- a/lib/Model/CustomerSessionV2.php +++ b/lib/Model/CustomerSessionV2.php @@ -593,7 +593,7 @@ public function getCouponCodes() /** * Sets couponCodes * - * @param string[]|null $couponCodes Any coupon codes entered. **Important**: If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. + * @param string[]|null $couponCodes Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, provide `\"couponCodes\": null` or omit the parameter entirely. * * @return $this */ @@ -617,7 +617,7 @@ public function getReferralCode() /** * Sets referralCode * - * @param string|null $referralCode Any referral code entered. **Important**: If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. + * @param string|null $referralCode Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, provide `\"referralCode\": null` or omit the parameter entirely. * * @return $this */ diff --git a/lib/Model/Effect.php b/lib/Model/Effect.php index e4bb33b6..1b314e2e 100644 --- a/lib/Model/Effect.php +++ b/lib/Model/Effect.php @@ -66,6 +66,10 @@ class Effect implements ModelInterface, ArrayAccess 'triggeredByCoupon' => 'int', 'triggeredForCatalogItem' => 'int', 'conditionIndex' => 'int', + 'evaluationGroupID' => 'int', + 'evaluationGroupMode' => 'string', + 'campaignRevisionId' => 'int', + 'campaignRevisionVersionId' => 'int', 'props' => 'object' ]; @@ -83,6 +87,10 @@ class Effect implements ModelInterface, ArrayAccess 'triggeredByCoupon' => null, 'triggeredForCatalogItem' => null, 'conditionIndex' => null, + 'evaluationGroupID' => null, + 'evaluationGroupMode' => null, + 'campaignRevisionId' => null, + 'campaignRevisionVersionId' => null, 'props' => null ]; @@ -121,6 +129,10 @@ public static function openAPIFormats() 'triggeredByCoupon' => 'triggeredByCoupon', 'triggeredForCatalogItem' => 'triggeredForCatalogItem', 'conditionIndex' => 'conditionIndex', + 'evaluationGroupID' => 'evaluationGroupID', + 'evaluationGroupMode' => 'evaluationGroupMode', + 'campaignRevisionId' => 'campaignRevisionId', + 'campaignRevisionVersionId' => 'campaignRevisionVersionId', 'props' => 'props' ]; @@ -138,6 +150,10 @@ public static function openAPIFormats() 'triggeredByCoupon' => 'setTriggeredByCoupon', 'triggeredForCatalogItem' => 'setTriggeredForCatalogItem', 'conditionIndex' => 'setConditionIndex', + 'evaluationGroupID' => 'setEvaluationGroupID', + 'evaluationGroupMode' => 'setEvaluationGroupMode', + 'campaignRevisionId' => 'setCampaignRevisionId', + 'campaignRevisionVersionId' => 'setCampaignRevisionVersionId', 'props' => 'setProps' ]; @@ -155,6 +171,10 @@ public static function openAPIFormats() 'triggeredByCoupon' => 'getTriggeredByCoupon', 'triggeredForCatalogItem' => 'getTriggeredForCatalogItem', 'conditionIndex' => 'getConditionIndex', + 'evaluationGroupID' => 'getEvaluationGroupID', + 'evaluationGroupMode' => 'getEvaluationGroupMode', + 'campaignRevisionId' => 'getCampaignRevisionId', + 'campaignRevisionVersionId' => 'getCampaignRevisionVersionId', 'props' => 'getProps' ]; @@ -226,6 +246,10 @@ public function __construct(array $data = null) $this->container['triggeredByCoupon'] = isset($data['triggeredByCoupon']) ? $data['triggeredByCoupon'] : null; $this->container['triggeredForCatalogItem'] = isset($data['triggeredForCatalogItem']) ? $data['triggeredForCatalogItem'] : null; $this->container['conditionIndex'] = isset($data['conditionIndex']) ? $data['conditionIndex'] : null; + $this->container['evaluationGroupID'] = isset($data['evaluationGroupID']) ? $data['evaluationGroupID'] : null; + $this->container['evaluationGroupMode'] = isset($data['evaluationGroupMode']) ? $data['evaluationGroupMode'] : null; + $this->container['campaignRevisionId'] = isset($data['campaignRevisionId']) ? $data['campaignRevisionId'] : null; + $this->container['campaignRevisionVersionId'] = isset($data['campaignRevisionVersionId']) ? $data['campaignRevisionVersionId'] : null; $this->container['props'] = isset($data['props']) ? $data['props'] : null; } @@ -463,6 +487,102 @@ public function setConditionIndex($conditionIndex) return $this; } + /** + * Gets evaluationGroupID + * + * @return int|null + */ + public function getEvaluationGroupID() + { + return $this->container['evaluationGroupID']; + } + + /** + * Sets evaluationGroupID + * + * @param int|null $evaluationGroupID The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). + * + * @return $this + */ + public function setEvaluationGroupID($evaluationGroupID) + { + $this->container['evaluationGroupID'] = $evaluationGroupID; + + return $this; + } + + /** + * Gets evaluationGroupMode + * + * @return string|null + */ + public function getEvaluationGroupMode() + { + return $this->container['evaluationGroupMode']; + } + + /** + * Sets evaluationGroupMode + * + * @param string|null $evaluationGroupMode The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). + * + * @return $this + */ + public function setEvaluationGroupMode($evaluationGroupMode) + { + $this->container['evaluationGroupMode'] = $evaluationGroupMode; + + return $this; + } + + /** + * Gets campaignRevisionId + * + * @return int|null + */ + public function getCampaignRevisionId() + { + return $this->container['campaignRevisionId']; + } + + /** + * Sets campaignRevisionId + * + * @param int|null $campaignRevisionId The revision ID of the campaign that was used when triggering the effect. + * + * @return $this + */ + public function setCampaignRevisionId($campaignRevisionId) + { + $this->container['campaignRevisionId'] = $campaignRevisionId; + + return $this; + } + + /** + * Gets campaignRevisionVersionId + * + * @return int|null + */ + public function getCampaignRevisionVersionId() + { + return $this->container['campaignRevisionVersionId']; + } + + /** + * Sets campaignRevisionVersionId + * + * @param int|null $campaignRevisionVersionId The revision version ID of the campaign that was used when triggering the effect. + * + * @return $this + */ + public function setCampaignRevisionVersionId($campaignRevisionVersionId) + { + $this->container['campaignRevisionVersionId'] = $campaignRevisionVersionId; + + return $this; + } + /** * Gets props * diff --git a/lib/Model/EffectEntity.php b/lib/Model/EffectEntity.php index 14397baa..f4bd4f94 100644 --- a/lib/Model/EffectEntity.php +++ b/lib/Model/EffectEntity.php @@ -65,7 +65,11 @@ class EffectEntity implements ModelInterface, ArrayAccess 'effectType' => 'string', 'triggeredByCoupon' => 'int', 'triggeredForCatalogItem' => 'int', - 'conditionIndex' => 'int' + 'conditionIndex' => 'int', + 'evaluationGroupID' => 'int', + 'evaluationGroupMode' => 'string', + 'campaignRevisionId' => 'int', + 'campaignRevisionVersionId' => 'int' ]; /** @@ -81,7 +85,11 @@ class EffectEntity implements ModelInterface, ArrayAccess 'effectType' => null, 'triggeredByCoupon' => null, 'triggeredForCatalogItem' => null, - 'conditionIndex' => null + 'conditionIndex' => null, + 'evaluationGroupID' => null, + 'evaluationGroupMode' => null, + 'campaignRevisionId' => null, + 'campaignRevisionVersionId' => null ]; /** @@ -118,7 +126,11 @@ public static function openAPIFormats() 'effectType' => 'effectType', 'triggeredByCoupon' => 'triggeredByCoupon', 'triggeredForCatalogItem' => 'triggeredForCatalogItem', - 'conditionIndex' => 'conditionIndex' + 'conditionIndex' => 'conditionIndex', + 'evaluationGroupID' => 'evaluationGroupID', + 'evaluationGroupMode' => 'evaluationGroupMode', + 'campaignRevisionId' => 'campaignRevisionId', + 'campaignRevisionVersionId' => 'campaignRevisionVersionId' ]; /** @@ -134,7 +146,11 @@ public static function openAPIFormats() 'effectType' => 'setEffectType', 'triggeredByCoupon' => 'setTriggeredByCoupon', 'triggeredForCatalogItem' => 'setTriggeredForCatalogItem', - 'conditionIndex' => 'setConditionIndex' + 'conditionIndex' => 'setConditionIndex', + 'evaluationGroupID' => 'setEvaluationGroupID', + 'evaluationGroupMode' => 'setEvaluationGroupMode', + 'campaignRevisionId' => 'setCampaignRevisionId', + 'campaignRevisionVersionId' => 'setCampaignRevisionVersionId' ]; /** @@ -150,7 +166,11 @@ public static function openAPIFormats() 'effectType' => 'getEffectType', 'triggeredByCoupon' => 'getTriggeredByCoupon', 'triggeredForCatalogItem' => 'getTriggeredForCatalogItem', - 'conditionIndex' => 'getConditionIndex' + 'conditionIndex' => 'getConditionIndex', + 'evaluationGroupID' => 'getEvaluationGroupID', + 'evaluationGroupMode' => 'getEvaluationGroupMode', + 'campaignRevisionId' => 'getCampaignRevisionId', + 'campaignRevisionVersionId' => 'getCampaignRevisionVersionId' ]; /** @@ -221,6 +241,10 @@ public function __construct(array $data = null) $this->container['triggeredByCoupon'] = isset($data['triggeredByCoupon']) ? $data['triggeredByCoupon'] : null; $this->container['triggeredForCatalogItem'] = isset($data['triggeredForCatalogItem']) ? $data['triggeredForCatalogItem'] : null; $this->container['conditionIndex'] = isset($data['conditionIndex']) ? $data['conditionIndex'] : null; + $this->container['evaluationGroupID'] = isset($data['evaluationGroupID']) ? $data['evaluationGroupID'] : null; + $this->container['evaluationGroupMode'] = isset($data['evaluationGroupMode']) ? $data['evaluationGroupMode'] : null; + $this->container['campaignRevisionId'] = isset($data['campaignRevisionId']) ? $data['campaignRevisionId'] : null; + $this->container['campaignRevisionVersionId'] = isset($data['campaignRevisionVersionId']) ? $data['campaignRevisionVersionId'] : null; } /** @@ -453,6 +477,102 @@ public function setConditionIndex($conditionIndex) return $this; } + + /** + * Gets evaluationGroupID + * + * @return int|null + */ + public function getEvaluationGroupID() + { + return $this->container['evaluationGroupID']; + } + + /** + * Sets evaluationGroupID + * + * @param int|null $evaluationGroupID The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). + * + * @return $this + */ + public function setEvaluationGroupID($evaluationGroupID) + { + $this->container['evaluationGroupID'] = $evaluationGroupID; + + return $this; + } + + /** + * Gets evaluationGroupMode + * + * @return string|null + */ + public function getEvaluationGroupMode() + { + return $this->container['evaluationGroupMode']; + } + + /** + * Sets evaluationGroupMode + * + * @param string|null $evaluationGroupMode The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). + * + * @return $this + */ + public function setEvaluationGroupMode($evaluationGroupMode) + { + $this->container['evaluationGroupMode'] = $evaluationGroupMode; + + return $this; + } + + /** + * Gets campaignRevisionId + * + * @return int|null + */ + public function getCampaignRevisionId() + { + return $this->container['campaignRevisionId']; + } + + /** + * Sets campaignRevisionId + * + * @param int|null $campaignRevisionId The revision ID of the campaign that was used when triggering the effect. + * + * @return $this + */ + public function setCampaignRevisionId($campaignRevisionId) + { + $this->container['campaignRevisionId'] = $campaignRevisionId; + + return $this; + } + + /** + * Gets campaignRevisionVersionId + * + * @return int|null + */ + public function getCampaignRevisionVersionId() + { + return $this->container['campaignRevisionVersionId']; + } + + /** + * Sets campaignRevisionVersionId + * + * @param int|null $campaignRevisionVersionId The revision version ID of the campaign that was used when triggering the effect. + * + * @return $this + */ + public function setCampaignRevisionVersionId($campaignRevisionVersionId) + { + $this->container['campaignRevisionVersionId'] = $campaignRevisionVersionId; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/Environment.php b/lib/Model/Environment.php index 812d9f11..3e928002 100644 --- a/lib/Model/Environment.php +++ b/lib/Model/Environment.php @@ -71,7 +71,8 @@ class Environment implements ModelInterface, ArrayAccess 'attributes' => '\TalonOne\Client\Model\Attribute[]', 'additionalCosts' => '\TalonOne\Client\Model\AccountAdditionalCost[]', 'audiences' => '\TalonOne\Client\Model\Audience[]', - 'collections' => '\TalonOne\Client\Model\Collection[]' + 'collections' => '\TalonOne\Client\Model\Collection[]', + 'applicationCartItemFilters' => '\TalonOne\Client\Model\ApplicationCIF[]' ]; /** @@ -93,7 +94,8 @@ class Environment implements ModelInterface, ArrayAccess 'attributes' => null, 'additionalCosts' => null, 'audiences' => null, - 'collections' => null + 'collections' => null, + 'applicationCartItemFilters' => null ]; /** @@ -136,7 +138,8 @@ public static function openAPIFormats() 'attributes' => 'attributes', 'additionalCosts' => 'additionalCosts', 'audiences' => 'audiences', - 'collections' => 'collections' + 'collections' => 'collections', + 'applicationCartItemFilters' => 'applicationCartItemFilters' ]; /** @@ -158,7 +161,8 @@ public static function openAPIFormats() 'attributes' => 'setAttributes', 'additionalCosts' => 'setAdditionalCosts', 'audiences' => 'setAudiences', - 'collections' => 'setCollections' + 'collections' => 'setCollections', + 'applicationCartItemFilters' => 'setApplicationCartItemFilters' ]; /** @@ -180,7 +184,8 @@ public static function openAPIFormats() 'attributes' => 'getAttributes', 'additionalCosts' => 'getAdditionalCosts', 'audiences' => 'getAudiences', - 'collections' => 'getCollections' + 'collections' => 'getCollections', + 'applicationCartItemFilters' => 'getApplicationCartItemFilters' ]; /** @@ -257,6 +262,7 @@ public function __construct(array $data = null) $this->container['additionalCosts'] = isset($data['additionalCosts']) ? $data['additionalCosts'] : null; $this->container['audiences'] = isset($data['audiences']) ? $data['audiences'] : null; $this->container['collections'] = isset($data['collections']) ? $data['collections'] : null; + $this->container['applicationCartItemFilters'] = isset($data['applicationCartItemFilters']) ? $data['applicationCartItemFilters'] : null; } /** @@ -639,6 +645,30 @@ public function setCollections($collections) return $this; } + + /** + * Gets applicationCartItemFilters + * + * @return \TalonOne\Client\Model\ApplicationCIF[]|null + */ + public function getApplicationCartItemFilters() + { + return $this->container['applicationCartItemFilters']; + } + + /** + * Sets applicationCartItemFilters + * + * @param \TalonOne\Client\Model\ApplicationCIF[]|null $applicationCartItemFilters The cart item filters belonging to the Application. + * + * @return $this + */ + public function setApplicationCartItemFilters($applicationCartItemFilters) + { + $this->container['applicationCartItemFilters'] = $applicationCartItemFilters; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/Event.php b/lib/Model/Event.php index d9cc511d..f0101ecc 100644 --- a/lib/Model/Event.php +++ b/lib/Model/Event.php @@ -280,9 +280,6 @@ public function listInvalidProperties() if ($this->container['effects'] === null) { $invalidProperties[] = "'effects' can't be null"; } - if ($this->container['ledgerEntries'] === null) { - $invalidProperties[] = "'ledgerEntries' can't be null"; - } return $invalidProperties; } @@ -529,7 +526,7 @@ public function setEffects($effects) /** * Gets ledgerEntries * - * @return \TalonOne\Client\Model\LedgerEntry[] + * @return \TalonOne\Client\Model\LedgerEntry[]|null */ public function getLedgerEntries() { @@ -539,7 +536,7 @@ public function getLedgerEntries() /** * Sets ledgerEntries * - * @param \TalonOne\Client\Model\LedgerEntry[] $ledgerEntries Ledger entries for the event. + * @param \TalonOne\Client\Model\LedgerEntry[]|null $ledgerEntries Ledger entries for the event. * * @return $this */ diff --git a/lib/Model/FrontendState.php b/lib/Model/FrontendState.php deleted file mode 100644 index 1e719419..00000000 --- a/lib/Model/FrontendState.php +++ /dev/null @@ -1,69 +0,0 @@ - 'float', - 'influenced' => 'float' + 'campaignID' => 'int', + 'currency' => 'string' ]; /** @@ -68,8 +67,8 @@ class ApplicationAnalyticsDataPointAvgSessionValue implements ModelInterface, Ar * @var string[] */ protected static $openAPIFormats = [ - 'total' => null, - 'influenced' => null + 'campaignID' => null, + 'currency' => null ]; /** @@ -99,8 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', - 'influenced' => 'influenced' + 'campaignID' => 'campaignID', + 'currency' => 'currency' ]; /** @@ -109,8 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', - 'influenced' => 'setInfluenced' + 'campaignID' => 'setCampaignID', + 'currency' => 'setCurrency' ]; /** @@ -119,8 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', - 'influenced' => 'getInfluenced' + 'campaignID' => 'getCampaignID', + 'currency' => 'getCurrency' ]; /** @@ -183,8 +182,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['influenced'] = isset($data['influenced']) ? $data['influenced'] : null; + $this->container['campaignID'] = isset($data['campaignID']) ? $data['campaignID'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; } /** @@ -196,6 +195,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['campaignID'] === null) { + $invalidProperties[] = "'campaignID' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } return $invalidProperties; } @@ -212,49 +217,49 @@ public function valid() /** - * Gets total + * Gets campaignID * - * @return float|null + * @return int */ - public function getTotal() + public function getCampaignID() { - return $this->container['total']; + return $this->container['campaignID']; } /** - * Sets total + * Sets campaignID * - * @param float|null $total total + * @param int $campaignID ID of the campaign. * * @return $this */ - public function setTotal($total) + public function setCampaignID($campaignID) { - $this->container['total'] = $total; + $this->container['campaignID'] = $campaignID; return $this; } /** - * Gets influenced + * Gets currency * - * @return float|null + * @return string */ - public function getInfluenced() + public function getCurrency() { - return $this->container['influenced']; + return $this->container['currency']; } /** - * Sets influenced + * Sets currency * - * @param float|null $influenced influenced + * @param string $currency Currency for the campaign. * * @return $this */ - public function setInfluenced($influenced) + public function setCurrency($currency) { - $this->container['influenced'] = $influenced; + $this->container['currency'] = $currency; return $this; } diff --git a/lib/Model/GenerateCampaignTags.php b/lib/Model/GenerateCampaignTags.php new file mode 100644 index 00000000..2b1b615a --- /dev/null +++ b/lib/Model/GenerateCampaignTags.php @@ -0,0 +1,311 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'campaignID' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignID' => 'campaignID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignID' => 'setCampaignID' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignID' => 'getCampaignID' + ]; + + /** + * 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->container['campaignID'] = isset($data['campaignID']) ? $data['campaignID'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignID'] === null) { + $invalidProperties[] = "'campaignID' 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 campaignID + * + * @return int + */ + public function getCampaignID() + { + return $this->container['campaignID']; + } + + /** + * Sets campaignID + * + * @param int $campaignID ID of the campaign. + * + * @return $this + */ + public function setCampaignID($campaignID) + { + $this->container['campaignID'] = $campaignID; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/UpdateUserLatestFeedTimestamp.php b/lib/Model/GenerateItemFilterDescription.php similarity index 82% rename from lib/Model/UpdateUserLatestFeedTimestamp.php rename to lib/Model/GenerateItemFilterDescription.php index bfd83e14..fb03044b 100644 --- a/lib/Model/UpdateUserLatestFeedTimestamp.php +++ b/lib/Model/GenerateItemFilterDescription.php @@ -1,6 +1,6 @@ '\DateTime' + 'itemFilter' => 'object[]' ]; /** @@ -67,7 +66,7 @@ class UpdateUserLatestFeedTimestamp implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'newLatestFeedTimestamp' => 'date-time' + 'itemFilter' => null ]; /** @@ -97,7 +96,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'newLatestFeedTimestamp' => 'newLatestFeedTimestamp' + 'itemFilter' => 'itemFilter' ]; /** @@ -106,7 +105,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'newLatestFeedTimestamp' => 'setNewLatestFeedTimestamp' + 'itemFilter' => 'setItemFilter' ]; /** @@ -115,7 +114,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'newLatestFeedTimestamp' => 'getNewLatestFeedTimestamp' + 'itemFilter' => 'getItemFilter' ]; /** @@ -178,7 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['newLatestFeedTimestamp'] = isset($data['newLatestFeedTimestamp']) ? $data['newLatestFeedTimestamp'] : null; + $this->container['itemFilter'] = isset($data['itemFilter']) ? $data['itemFilter'] : null; } /** @@ -190,8 +189,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['newLatestFeedTimestamp'] === null) { - $invalidProperties[] = "'newLatestFeedTimestamp' can't be null"; + if ($this->container['itemFilter'] === null) { + $invalidProperties[] = "'itemFilter' can't be null"; } return $invalidProperties; } @@ -209,25 +208,25 @@ public function valid() /** - * Gets newLatestFeedTimestamp + * Gets itemFilter * - * @return \DateTime + * @return object[] */ - public function getNewLatestFeedTimestamp() + public function getItemFilter() { - return $this->container['newLatestFeedTimestamp']; + return $this->container['itemFilter']; } /** - * Sets newLatestFeedTimestamp + * Sets itemFilter * - * @param \DateTime $newLatestFeedTimestamp New timestamp to update for the current user. + * @param object[] $itemFilter An array of item filter Talang expressions. * * @return $this */ - public function setNewLatestFeedTimestamp($newLatestFeedTimestamp) + public function setItemFilter($itemFilter) { - $this->container['newLatestFeedTimestamp'] = $newLatestFeedTimestamp; + $this->container['itemFilter'] = $itemFilter; return $this; } diff --git a/lib/Model/PriorityPosition.php b/lib/Model/GenerateLoyaltyCard.php similarity index 75% rename from lib/Model/PriorityPosition.php rename to lib/Model/GenerateLoyaltyCard.php index 911fd980..d2f26b22 100644 --- a/lib/Model/PriorityPosition.php +++ b/lib/Model/GenerateLoyaltyCard.php @@ -1,6 +1,6 @@ 'string', - 'position' => 'int' + 'status' => 'string', + 'customerProfileIds' => 'string[]' ]; /** @@ -68,8 +68,8 @@ class PriorityPosition implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'set' => null, - 'position' => null + 'status' => null, + 'customerProfileIds' => null ]; /** @@ -99,8 +99,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'set' => 'set', - 'position' => 'position' + 'status' => 'status', + 'customerProfileIds' => 'customerProfileIds' ]; /** @@ -109,8 +109,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'set' => 'setSet', - 'position' => 'setPosition' + 'status' => 'setStatus', + 'customerProfileIds' => 'setCustomerProfileIds' ]; /** @@ -119,8 +119,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'set' => 'getSet', - 'position' => 'getPosition' + 'status' => 'getStatus', + 'customerProfileIds' => 'getCustomerProfileIds' ]; /** @@ -164,9 +164,8 @@ public function getModelName() return self::$openAPIModelName; } - const SET_UNIVERSAL = 'universal'; - const SET_STACKABLE = 'stackable'; - const SET_EXCLUSIVE = 'exclusive'; + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; @@ -175,12 +174,11 @@ public function getModelName() * * @return string[] */ - public function getSetAllowableValues() + public function getStatusAllowableValues() { return [ - self::SET_UNIVERSAL, - self::SET_STACKABLE, - self::SET_EXCLUSIVE, + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, ]; } @@ -200,8 +198,8 @@ public function getSetAllowableValues() */ public function __construct(array $data = null) { - $this->container['set'] = isset($data['set']) ? $data['set'] : 'universal'; - $this->container['position'] = isset($data['position']) ? $data['position'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : 'active'; + $this->container['customerProfileIds'] = isset($data['customerProfileIds']) ? $data['customerProfileIds'] : null; } /** @@ -213,20 +211,14 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['set'] === null) { - $invalidProperties[] = "'set' can't be null"; - } - $allowedValues = $this->getSetAllowableValues(); - if (!is_null($this->container['set']) && !in_array($this->container['set'], $allowedValues, true)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'set', must be one of '%s'", + "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) ); } - if ($this->container['position'] === null) { - $invalidProperties[] = "'position' can't be null"; - } return $invalidProperties; } @@ -243,58 +235,58 @@ public function valid() /** - * Gets set + * Gets status * - * @return string + * @return string|null */ - public function getSet() + public function getStatus() { - return $this->container['set']; + return $this->container['status']; } /** - * Sets set + * Sets status * - * @param string $set The name of the priority set where the campaign is located. + * @param string|null $status Status of the loyalty card. * * @return $this */ - public function setSet($set) + public function setStatus($status) { - $allowedValues = $this->getSetAllowableValues(); - if (!in_array($set, $allowedValues, true)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'set', must be one of '%s'", + "Invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) ) ); } - $this->container['set'] = $set; + $this->container['status'] = $status; return $this; } /** - * Gets position + * Gets customerProfileIds * - * @return int + * @return string[]|null */ - public function getPosition() + public function getCustomerProfileIds() { - return $this->container['position']; + return $this->container['customerProfileIds']; } /** - * Sets position + * Sets customerProfileIds * - * @param int $position The position of the campaign in the priority order starting from 1. + * @param string[]|null $customerProfileIds Integration IDs of the customer profiles linked to the card. * * @return $this */ - public function setPosition($position) + public function setCustomerProfileIds($customerProfileIds) { - $this->container['position'] = $position; + $this->container['customerProfileIds'] = $customerProfileIds; return $this; } diff --git a/lib/Model/ApplicationAnalyticsDataPointSessionsCount.php b/lib/Model/GenerateRuleTitle.php similarity index 80% rename from lib/Model/ApplicationAnalyticsDataPointSessionsCount.php rename to lib/Model/GenerateRuleTitle.php index 3f92392c..fd83fae7 100644 --- a/lib/Model/ApplicationAnalyticsDataPointSessionsCount.php +++ b/lib/Model/GenerateRuleTitle.php @@ -1,6 +1,6 @@ 'float', - 'influenced' => 'float' + 'rule' => '\TalonOne\Client\Model\GenerateRuleTitleRule', + 'currency' => 'string' ]; /** @@ -68,8 +67,8 @@ class ApplicationAnalyticsDataPointSessionsCount implements ModelInterface, Arra * @var string[] */ protected static $openAPIFormats = [ - 'total' => null, - 'influenced' => null + 'rule' => null, + 'currency' => null ]; /** @@ -99,8 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', - 'influenced' => 'influenced' + 'rule' => 'rule', + 'currency' => 'currency' ]; /** @@ -109,8 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', - 'influenced' => 'setInfluenced' + 'rule' => 'setRule', + 'currency' => 'setCurrency' ]; /** @@ -119,8 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', - 'influenced' => 'getInfluenced' + 'rule' => 'getRule', + 'currency' => 'getCurrency' ]; /** @@ -183,8 +182,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['influenced'] = isset($data['influenced']) ? $data['influenced'] : null; + $this->container['rule'] = isset($data['rule']) ? $data['rule'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; } /** @@ -196,6 +195,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['rule'] === null) { + $invalidProperties[] = "'rule' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } return $invalidProperties; } @@ -212,49 +217,49 @@ public function valid() /** - * Gets total + * Gets rule * - * @return float|null + * @return \TalonOne\Client\Model\GenerateRuleTitleRule */ - public function getTotal() + public function getRule() { - return $this->container['total']; + return $this->container['rule']; } /** - * Sets total + * Sets rule * - * @param float|null $total total + * @param \TalonOne\Client\Model\GenerateRuleTitleRule $rule rule * * @return $this */ - public function setTotal($total) + public function setRule($rule) { - $this->container['total'] = $total; + $this->container['rule'] = $rule; return $this; } /** - * Gets influenced + * Gets currency * - * @return float|null + * @return string */ - public function getInfluenced() + public function getCurrency() { - return $this->container['influenced']; + return $this->container['currency']; } /** - * Sets influenced + * Sets currency * - * @param float|null $influenced influenced + * @param string $currency Currency for the campaign. * * @return $this */ - public function setInfluenced($influenced) + public function setCurrency($currency) { - $this->container['influenced'] = $influenced; + $this->container['currency'] = $currency; return $this; } diff --git a/lib/Model/ApplicationCampaignAnalyticsCouponsCount.php b/lib/Model/GenerateRuleTitleRule.php similarity index 81% rename from lib/Model/ApplicationCampaignAnalyticsCouponsCount.php rename to lib/Model/GenerateRuleTitleRule.php index 5f288725..8b9bb046 100644 --- a/lib/Model/ApplicationCampaignAnalyticsCouponsCount.php +++ b/lib/Model/GenerateRuleTitleRule.php @@ -1,6 +1,6 @@ 'float', - 'trend' => 'float' + 'effects' => 'object[]', + 'condition' => 'object[]' ]; /** @@ -68,8 +67,8 @@ class ApplicationCampaignAnalyticsCouponsCount implements ModelInterface, ArrayA * @var string[] */ protected static $openAPIFormats = [ - 'value' => null, - 'trend' => null + 'effects' => null, + 'condition' => null ]; /** @@ -99,8 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'value' => 'value', - 'trend' => 'trend' + 'effects' => 'effects', + 'condition' => 'condition' ]; /** @@ -109,8 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'value' => 'setValue', - 'trend' => 'setTrend' + 'effects' => 'setEffects', + 'condition' => 'setCondition' ]; /** @@ -119,8 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'value' => 'getValue', - 'trend' => 'getTrend' + 'effects' => 'getEffects', + 'condition' => 'getCondition' ]; /** @@ -183,8 +182,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['trend'] = isset($data['trend']) ? $data['trend'] : null; + $this->container['effects'] = isset($data['effects']) ? $data['effects'] : null; + $this->container['condition'] = isset($data['condition']) ? $data['condition'] : null; } /** @@ -212,49 +211,49 @@ public function valid() /** - * Gets value + * Gets effects * - * @return float|null + * @return object[]|null */ - public function getValue() + public function getEffects() { - return $this->container['value']; + return $this->container['effects']; } /** - * Sets value + * Sets effects * - * @param float|null $value value + * @param object[]|null $effects An array of effectful Talang expressions in arrays that will be evaluated when a rule matches. * * @return $this */ - public function setValue($value) + public function setEffects($effects) { - $this->container['value'] = $value; + $this->container['effects'] = $effects; return $this; } /** - * Gets trend + * Gets condition * - * @return float|null + * @return object[]|null */ - public function getTrend() + public function getCondition() { - return $this->container['trend']; + return $this->container['condition']; } /** - * Sets trend + * Sets condition * - * @param float|null $trend trend + * @param object[]|null $condition A Talang expression that will be evaluated in the context of the given event. * * @return $this */ - public function setTrend($trend) + public function setCondition($condition) { - $this->container['trend'] = $trend; + $this->container['condition'] = $condition; return $this; } diff --git a/lib/Model/IncreaseAchievementProgressEffectProps.php b/lib/Model/IncreaseAchievementProgressEffectProps.php index d8dd8661..2e9e9003 100644 --- a/lib/Model/IncreaseAchievementProgressEffectProps.php +++ b/lib/Model/IncreaseAchievementProgressEffectProps.php @@ -392,7 +392,7 @@ public function getTarget() /** * Sets target * - * @param float $target The required number of actions or the transactional milestone to complete the achievement. + * @param float $target The target value to complete the achievement. * * @return $this */ diff --git a/lib/Model/IntegrationCoupon.php b/lib/Model/IntegrationCoupon.php index 391cd255..873c5c15 100644 --- a/lib/Model/IntegrationCoupon.php +++ b/lib/Model/IntegrationCoupon.php @@ -624,7 +624,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/InventoryCoupon.php b/lib/Model/InventoryCoupon.php index dd02ca9b..7b4592c3 100644 --- a/lib/Model/InventoryCoupon.php +++ b/lib/Model/InventoryCoupon.php @@ -633,7 +633,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/InventoryReferral.php b/lib/Model/InventoryReferral.php index 8b75fc68..47da734e 100644 --- a/lib/Model/InventoryReferral.php +++ b/lib/Model/InventoryReferral.php @@ -408,7 +408,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/LoyaltyStatistics.php b/lib/Model/LoyaltyBalanceWithTier.php similarity index 51% rename from lib/Model/LoyaltyStatistics.php rename to lib/Model/LoyaltyBalanceWithTier.php index b9cc6c84..71717c0f 100644 --- a/lib/Model/LoyaltyStatistics.php +++ b/lib/Model/LoyaltyBalanceWithTier.php @@ -1,6 +1,6 @@ '\DateTime', - 'totalActivePoints' => 'float', - 'totalPendingPoints' => 'float', - 'totalSpentPoints' => 'float', - 'totalExpiredPoints' => 'float', - 'totalMembers' => 'float', - 'newMembers' => 'float', - 'spentPoints' => '\TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown', - 'earnedPoints' => '\TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown' + 'activePoints' => 'float', + 'pendingPoints' => 'float', + 'spentPoints' => 'float', + 'expiredPoints' => 'float', + 'currentTier' => '\TalonOne\Client\Model\Tier', + 'projectedTier' => '\TalonOne\Client\Model\ProjectedTier', + 'pointsToNextTier' => 'float', + 'nextTierName' => 'string' ]; /** @@ -75,15 +74,14 @@ class LoyaltyStatistics implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'date' => 'date-time', - 'totalActivePoints' => null, - 'totalPendingPoints' => null, - 'totalSpentPoints' => null, - 'totalExpiredPoints' => null, - 'totalMembers' => null, - 'newMembers' => null, + 'activePoints' => null, + 'pendingPoints' => null, 'spentPoints' => null, - 'earnedPoints' => null + 'expiredPoints' => null, + 'currentTier' => null, + 'projectedTier' => null, + 'pointsToNextTier' => null, + 'nextTierName' => null ]; /** @@ -113,15 +111,14 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'date' => 'date', - 'totalActivePoints' => 'totalActivePoints', - 'totalPendingPoints' => 'totalPendingPoints', - 'totalSpentPoints' => 'totalSpentPoints', - 'totalExpiredPoints' => 'totalExpiredPoints', - 'totalMembers' => 'totalMembers', - 'newMembers' => 'newMembers', + 'activePoints' => 'activePoints', + 'pendingPoints' => 'pendingPoints', 'spentPoints' => 'spentPoints', - 'earnedPoints' => 'earnedPoints' + 'expiredPoints' => 'expiredPoints', + 'currentTier' => 'currentTier', + 'projectedTier' => 'projectedTier', + 'pointsToNextTier' => 'pointsToNextTier', + 'nextTierName' => 'nextTierName' ]; /** @@ -130,15 +127,14 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'date' => 'setDate', - 'totalActivePoints' => 'setTotalActivePoints', - 'totalPendingPoints' => 'setTotalPendingPoints', - 'totalSpentPoints' => 'setTotalSpentPoints', - 'totalExpiredPoints' => 'setTotalExpiredPoints', - 'totalMembers' => 'setTotalMembers', - 'newMembers' => 'setNewMembers', + 'activePoints' => 'setActivePoints', + 'pendingPoints' => 'setPendingPoints', 'spentPoints' => 'setSpentPoints', - 'earnedPoints' => 'setEarnedPoints' + 'expiredPoints' => 'setExpiredPoints', + 'currentTier' => 'setCurrentTier', + 'projectedTier' => 'setProjectedTier', + 'pointsToNextTier' => 'setPointsToNextTier', + 'nextTierName' => 'setNextTierName' ]; /** @@ -147,15 +143,14 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'date' => 'getDate', - 'totalActivePoints' => 'getTotalActivePoints', - 'totalPendingPoints' => 'getTotalPendingPoints', - 'totalSpentPoints' => 'getTotalSpentPoints', - 'totalExpiredPoints' => 'getTotalExpiredPoints', - 'totalMembers' => 'getTotalMembers', - 'newMembers' => 'getNewMembers', + 'activePoints' => 'getActivePoints', + 'pendingPoints' => 'getPendingPoints', 'spentPoints' => 'getSpentPoints', - 'earnedPoints' => 'getEarnedPoints' + 'expiredPoints' => 'getExpiredPoints', + 'currentTier' => 'getCurrentTier', + 'projectedTier' => 'getProjectedTier', + 'pointsToNextTier' => 'getPointsToNextTier', + 'nextTierName' => 'getNextTierName' ]; /** @@ -218,15 +213,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['totalActivePoints'] = isset($data['totalActivePoints']) ? $data['totalActivePoints'] : null; - $this->container['totalPendingPoints'] = isset($data['totalPendingPoints']) ? $data['totalPendingPoints'] : null; - $this->container['totalSpentPoints'] = isset($data['totalSpentPoints']) ? $data['totalSpentPoints'] : null; - $this->container['totalExpiredPoints'] = isset($data['totalExpiredPoints']) ? $data['totalExpiredPoints'] : null; - $this->container['totalMembers'] = isset($data['totalMembers']) ? $data['totalMembers'] : null; - $this->container['newMembers'] = isset($data['newMembers']) ? $data['newMembers'] : null; + $this->container['activePoints'] = isset($data['activePoints']) ? $data['activePoints'] : null; + $this->container['pendingPoints'] = isset($data['pendingPoints']) ? $data['pendingPoints'] : null; $this->container['spentPoints'] = isset($data['spentPoints']) ? $data['spentPoints'] : null; - $this->container['earnedPoints'] = isset($data['earnedPoints']) ? $data['earnedPoints'] : null; + $this->container['expiredPoints'] = isset($data['expiredPoints']) ? $data['expiredPoints'] : null; + $this->container['currentTier'] = isset($data['currentTier']) ? $data['currentTier'] : null; + $this->container['projectedTier'] = isset($data['projectedTier']) ? $data['projectedTier'] : null; + $this->container['pointsToNextTier'] = isset($data['pointsToNextTier']) ? $data['pointsToNextTier'] : null; + $this->container['nextTierName'] = isset($data['nextTierName']) ? $data['nextTierName'] : null; } /** @@ -238,33 +232,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['date'] === null) { - $invalidProperties[] = "'date' can't be null"; - } - if ($this->container['totalActivePoints'] === null) { - $invalidProperties[] = "'totalActivePoints' can't be null"; - } - if ($this->container['totalPendingPoints'] === null) { - $invalidProperties[] = "'totalPendingPoints' can't be null"; - } - if ($this->container['totalSpentPoints'] === null) { - $invalidProperties[] = "'totalSpentPoints' can't be null"; - } - if ($this->container['totalExpiredPoints'] === null) { - $invalidProperties[] = "'totalExpiredPoints' can't be null"; - } - if ($this->container['totalMembers'] === null) { - $invalidProperties[] = "'totalMembers' can't be null"; - } - if ($this->container['newMembers'] === null) { - $invalidProperties[] = "'newMembers' can't be null"; - } - if ($this->container['spentPoints'] === null) { - $invalidProperties[] = "'spentPoints' can't be null"; - } - if ($this->container['earnedPoints'] === null) { - $invalidProperties[] = "'earnedPoints' can't be null"; - } return $invalidProperties; } @@ -281,217 +248,193 @@ public function valid() /** - * Gets date + * Gets activePoints * - * @return \DateTime + * @return float|null */ - public function getDate() + public function getActivePoints() { - return $this->container['date']; + return $this->container['activePoints']; } /** - * Sets date + * Sets activePoints * - * @param \DateTime $date Date at which data point was collected. + * @param float|null $activePoints Total amount of points awarded to this customer and available to spend. * * @return $this */ - public function setDate($date) + public function setActivePoints($activePoints) { - $this->container['date'] = $date; + $this->container['activePoints'] = $activePoints; return $this; } /** - * Gets totalActivePoints + * Gets pendingPoints * - * @return float + * @return float|null */ - public function getTotalActivePoints() + public function getPendingPoints() { - return $this->container['totalActivePoints']; + return $this->container['pendingPoints']; } /** - * Sets totalActivePoints + * Sets pendingPoints * - * @param float $totalActivePoints Total of active points for this loyalty program. + * @param float|null $pendingPoints Total amount of points awarded to this customer but not available until their start date. * * @return $this */ - public function setTotalActivePoints($totalActivePoints) + public function setPendingPoints($pendingPoints) { - $this->container['totalActivePoints'] = $totalActivePoints; + $this->container['pendingPoints'] = $pendingPoints; return $this; } /** - * Gets totalPendingPoints - * - * @return float - */ - public function getTotalPendingPoints() - { - return $this->container['totalPendingPoints']; - } - - /** - * Sets totalPendingPoints - * - * @param float $totalPendingPoints Total of pending points for this loyalty program. - * - * @return $this - */ - public function setTotalPendingPoints($totalPendingPoints) - { - $this->container['totalPendingPoints'] = $totalPendingPoints; - - return $this; - } - - /** - * Gets totalSpentPoints + * Gets spentPoints * - * @return float + * @return float|null */ - public function getTotalSpentPoints() + public function getSpentPoints() { - return $this->container['totalSpentPoints']; + return $this->container['spentPoints']; } /** - * Sets totalSpentPoints + * Sets spentPoints * - * @param float $totalSpentPoints Total of spent points for this loyalty program. + * @param float|null $spentPoints Total amount of points already spent by this customer. * * @return $this */ - public function setTotalSpentPoints($totalSpentPoints) + public function setSpentPoints($spentPoints) { - $this->container['totalSpentPoints'] = $totalSpentPoints; + $this->container['spentPoints'] = $spentPoints; return $this; } /** - * Gets totalExpiredPoints + * Gets expiredPoints * - * @return float + * @return float|null */ - public function getTotalExpiredPoints() + public function getExpiredPoints() { - return $this->container['totalExpiredPoints']; + return $this->container['expiredPoints']; } /** - * Sets totalExpiredPoints + * Sets expiredPoints * - * @param float $totalExpiredPoints Total of expired points for this loyalty program. + * @param float|null $expiredPoints Total amount of points awarded but never redeemed. They cannot be used anymore. * * @return $this */ - public function setTotalExpiredPoints($totalExpiredPoints) + public function setExpiredPoints($expiredPoints) { - $this->container['totalExpiredPoints'] = $totalExpiredPoints; + $this->container['expiredPoints'] = $expiredPoints; return $this; } /** - * Gets totalMembers + * Gets currentTier * - * @return float + * @return \TalonOne\Client\Model\Tier|null */ - public function getTotalMembers() + public function getCurrentTier() { - return $this->container['totalMembers']; + return $this->container['currentTier']; } /** - * Sets totalMembers + * Sets currentTier * - * @param float $totalMembers Number of loyalty program members. + * @param \TalonOne\Client\Model\Tier|null $currentTier currentTier * * @return $this */ - public function setTotalMembers($totalMembers) + public function setCurrentTier($currentTier) { - $this->container['totalMembers'] = $totalMembers; + $this->container['currentTier'] = $currentTier; return $this; } /** - * Gets newMembers + * Gets projectedTier * - * @return float + * @return \TalonOne\Client\Model\ProjectedTier|null */ - public function getNewMembers() + public function getProjectedTier() { - return $this->container['newMembers']; + return $this->container['projectedTier']; } /** - * Sets newMembers + * Sets projectedTier * - * @param float $newMembers Number of members who joined on this day. + * @param \TalonOne\Client\Model\ProjectedTier|null $projectedTier projectedTier * * @return $this */ - public function setNewMembers($newMembers) + public function setProjectedTier($projectedTier) { - $this->container['newMembers'] = $newMembers; + $this->container['projectedTier'] = $projectedTier; return $this; } /** - * Gets spentPoints + * Gets pointsToNextTier * - * @return \TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown + * @return float|null */ - public function getSpentPoints() + public function getPointsToNextTier() { - return $this->container['spentPoints']; + return $this->container['pointsToNextTier']; } /** - * Sets spentPoints + * Sets pointsToNextTier * - * @param \TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown $spentPoints spentPoints + * @param float|null $pointsToNextTier The number of points required to move up a tier. * * @return $this */ - public function setSpentPoints($spentPoints) + public function setPointsToNextTier($pointsToNextTier) { - $this->container['spentPoints'] = $spentPoints; + $this->container['pointsToNextTier'] = $pointsToNextTier; return $this; } /** - * Gets earnedPoints + * Gets nextTierName * - * @return \TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown + * @return string|null */ - public function getEarnedPoints() + public function getNextTierName() { - return $this->container['earnedPoints']; + return $this->container['nextTierName']; } /** - * Sets earnedPoints + * Sets nextTierName * - * @param \TalonOne\Client\Model\LoyaltyDashboardPointsBreakdown $earnedPoints earnedPoints + * @param string|null $nextTierName The name of the tier consecutive to the current tier. * * @return $this */ - public function setEarnedPoints($earnedPoints) + public function setNextTierName($nextTierName) { - $this->container['earnedPoints'] = $earnedPoints; + $this->container['nextTierName'] = $nextTierName; return $this; } diff --git a/lib/Model/LoyaltyBalancesWithTiers.php b/lib/Model/LoyaltyBalancesWithTiers.php new file mode 100644 index 00000000..48af569d --- /dev/null +++ b/lib/Model/LoyaltyBalancesWithTiers.php @@ -0,0 +1,339 @@ + '\TalonOne\Client\Model\LoyaltyBalanceWithTier', + 'subledgerBalances' => 'map[string,\TalonOne\Client\Model\LoyaltyBalanceWithTier]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'balance' => null, + 'subledgerBalances' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance' => 'balance', + 'subledgerBalances' => 'subledgerBalances' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance' => 'setBalance', + 'subledgerBalances' => 'setSubledgerBalances' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance' => 'getBalance', + 'subledgerBalances' => 'getSubledgerBalances' + ]; + + /** + * 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->container['balance'] = isset($data['balance']) ? $data['balance'] : null; + $this->container['subledgerBalances'] = isset($data['subledgerBalances']) ? $data['subledgerBalances'] : null; + } + + /** + * 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 balance + * + * @return \TalonOne\Client\Model\LoyaltyBalanceWithTier|null + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param \TalonOne\Client\Model\LoyaltyBalanceWithTier|null $balance balance + * + * @return $this + */ + public function setBalance($balance) + { + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets subledgerBalances + * + * @return map[string,\TalonOne\Client\Model\LoyaltyBalanceWithTier]|null + */ + public function getSubledgerBalances() + { + return $this->container['subledgerBalances']; + } + + /** + * Sets subledgerBalances + * + * @param map[string,\TalonOne\Client\Model\LoyaltyBalanceWithTier]|null $subledgerBalances Map of the loyalty balances of the subledgers of a ledger. + * + * @return $this + */ + public function setSubledgerBalances($subledgerBalances) + { + $this->container['subledgerBalances'] = $subledgerBalances; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/LoyaltyCard.php b/lib/Model/LoyaltyCard.php index d872fc50..e43c532a 100644 --- a/lib/Model/LoyaltyCard.php +++ b/lib/Model/LoyaltyCard.php @@ -62,6 +62,7 @@ class LoyaltyCard implements ModelInterface, ArrayAccess 'created' => '\DateTime', 'programID' => 'int', 'status' => 'string', + 'blockReason' => 'string', 'identifier' => 'string', 'usersPerCardLimit' => 'int', 'profiles' => '\TalonOne\Client\Model\LoyaltyCardProfileRegistration[]', @@ -69,7 +70,8 @@ class LoyaltyCard implements ModelInterface, ArrayAccess 'subledgers' => 'map[string,\TalonOne\Client\Model\LedgerInfo]', 'modified' => '\DateTime', 'oldCardIdentifier' => 'string', - 'newCardIdentifier' => 'string' + 'newCardIdentifier' => 'string', + 'batchId' => 'string' ]; /** @@ -82,6 +84,7 @@ class LoyaltyCard implements ModelInterface, ArrayAccess 'created' => 'date-time', 'programID' => null, 'status' => null, + 'blockReason' => null, 'identifier' => null, 'usersPerCardLimit' => null, 'profiles' => null, @@ -89,7 +92,8 @@ class LoyaltyCard implements ModelInterface, ArrayAccess 'subledgers' => null, 'modified' => 'date-time', 'oldCardIdentifier' => null, - 'newCardIdentifier' => null + 'newCardIdentifier' => null, + 'batchId' => null ]; /** @@ -123,6 +127,7 @@ public static function openAPIFormats() 'created' => 'created', 'programID' => 'programID', 'status' => 'status', + 'blockReason' => 'blockReason', 'identifier' => 'identifier', 'usersPerCardLimit' => 'usersPerCardLimit', 'profiles' => 'profiles', @@ -130,7 +135,8 @@ public static function openAPIFormats() 'subledgers' => 'subledgers', 'modified' => 'modified', 'oldCardIdentifier' => 'oldCardIdentifier', - 'newCardIdentifier' => 'newCardIdentifier' + 'newCardIdentifier' => 'newCardIdentifier', + 'batchId' => 'batchId' ]; /** @@ -143,6 +149,7 @@ public static function openAPIFormats() 'created' => 'setCreated', 'programID' => 'setProgramID', 'status' => 'setStatus', + 'blockReason' => 'setBlockReason', 'identifier' => 'setIdentifier', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'profiles' => 'setProfiles', @@ -150,7 +157,8 @@ public static function openAPIFormats() 'subledgers' => 'setSubledgers', 'modified' => 'setModified', 'oldCardIdentifier' => 'setOldCardIdentifier', - 'newCardIdentifier' => 'setNewCardIdentifier' + 'newCardIdentifier' => 'setNewCardIdentifier', + 'batchId' => 'setBatchId' ]; /** @@ -163,6 +171,7 @@ public static function openAPIFormats() 'created' => 'getCreated', 'programID' => 'getProgramID', 'status' => 'getStatus', + 'blockReason' => 'getBlockReason', 'identifier' => 'getIdentifier', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'profiles' => 'getProfiles', @@ -170,7 +179,8 @@ public static function openAPIFormats() 'subledgers' => 'getSubledgers', 'modified' => 'getModified', 'oldCardIdentifier' => 'getOldCardIdentifier', - 'newCardIdentifier' => 'getNewCardIdentifier' + 'newCardIdentifier' => 'getNewCardIdentifier', + 'batchId' => 'getBatchId' ]; /** @@ -237,6 +247,7 @@ public function __construct(array $data = null) $this->container['created'] = isset($data['created']) ? $data['created'] : null; $this->container['programID'] = isset($data['programID']) ? $data['programID'] : null; $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['blockReason'] = isset($data['blockReason']) ? $data['blockReason'] : null; $this->container['identifier'] = isset($data['identifier']) ? $data['identifier'] : null; $this->container['usersPerCardLimit'] = isset($data['usersPerCardLimit']) ? $data['usersPerCardLimit'] : null; $this->container['profiles'] = isset($data['profiles']) ? $data['profiles'] : null; @@ -245,6 +256,7 @@ public function __construct(array $data = null) $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; $this->container['oldCardIdentifier'] = isset($data['oldCardIdentifier']) ? $data['oldCardIdentifier'] : null; $this->container['newCardIdentifier'] = isset($data['newCardIdentifier']) ? $data['newCardIdentifier'] : null; + $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null; } /** @@ -390,7 +402,7 @@ public function getStatus() /** * Sets status * - * @param string $status Status of the loyalty card. Can be one of: ['active', 'inactive'] + * @param string $status Status of the loyalty card. Can be `active` or `inactive`. * * @return $this */ @@ -401,6 +413,30 @@ public function setStatus($status) return $this; } + /** + * Gets blockReason + * + * @return string|null + */ + public function getBlockReason() + { + return $this->container['blockReason']; + } + + /** + * Sets blockReason + * + * @param string|null $blockReason Reason for transferring and blocking the loyalty card. + * + * @return $this + */ + public function setBlockReason($blockReason) + { + $this->container['blockReason'] = $blockReason; + + return $this; + } + /** * Gets identifier * @@ -609,6 +645,30 @@ public function setNewCardIdentifier($newCardIdentifier) return $this; } + + /** + * Gets batchId + * + * @return string|null + */ + public function getBatchId() + { + return $this->container['batchId']; + } + + /** + * Sets batchId + * + * @param string|null $batchId The ID of the batch in which the loyalty card was created. + * + * @return $this + */ + public function setBatchId($batchId) + { + $this->container['batchId'] = $batchId; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/LoyaltyCardBatch.php b/lib/Model/LoyaltyCardBatch.php new file mode 100644 index 00000000..167c618e --- /dev/null +++ b/lib/Model/LoyaltyCardBatch.php @@ -0,0 +1,426 @@ + 'int', + 'batchId' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'numberOfCards' => null, + 'batchId' => null, + 'status' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'numberOfCards' => 'numberOfCards', + 'batchId' => 'batchId', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'numberOfCards' => 'setNumberOfCards', + 'batchId' => 'setBatchId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'numberOfCards' => 'getNumberOfCards', + 'batchId' => 'getBatchId', + 'status' => 'getStatus' + ]; + + /** + * 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; + } + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + + + /** + * 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->container['numberOfCards'] = isset($data['numberOfCards']) ? $data['numberOfCards'] : null; + $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : 'active'; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['numberOfCards'] === null) { + $invalidProperties[] = "'numberOfCards' can't be null"; + } + if (!is_null($this->container['batchId']) && (mb_strlen($this->container['batchId']) > 20)) { + $invalidProperties[] = "invalid value for 'batchId', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['batchId']) && (mb_strlen($this->container['batchId']) < 4)) { + $invalidProperties[] = "invalid value for 'batchId', the character length must be bigger than or equal to 4."; + } + + if (!is_null($this->container['batchId']) && !preg_match("/^[A-Za-z0-9_-]*$/", $this->container['batchId'])) { + $invalidProperties[] = "invalid value for 'batchId', must be conform to the pattern /^[A-Za-z0-9_-]*$/."; + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + 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 numberOfCards + * + * @return int + */ + public function getNumberOfCards() + { + return $this->container['numberOfCards']; + } + + /** + * Sets numberOfCards + * + * @param int $numberOfCards Number of loyalty cards in the batch. + * + * @return $this + */ + public function setNumberOfCards($numberOfCards) + { + $this->container['numberOfCards'] = $numberOfCards; + + return $this; + } + + /** + * Gets batchId + * + * @return string|null + */ + public function getBatchId() + { + return $this->container['batchId']; + } + + /** + * Sets batchId + * + * @param string|null $batchId ID of the loyalty card batch. + * + * @return $this + */ + public function setBatchId($batchId) + { + if (!is_null($batchId) && (mb_strlen($batchId) > 20)) { + throw new \InvalidArgumentException('invalid length for $batchId when calling LoyaltyCardBatch., must be smaller than or equal to 20.'); + } + if (!is_null($batchId) && (mb_strlen($batchId) < 4)) { + throw new \InvalidArgumentException('invalid length for $batchId when calling LoyaltyCardBatch., must be bigger than or equal to 4.'); + } + if (!is_null($batchId) && (!preg_match("/^[A-Za-z0-9_-]*$/", $batchId))) { + throw new \InvalidArgumentException("invalid value for $batchId when calling LoyaltyCardBatch., must conform to the pattern /^[A-Za-z0-9_-]*$/."); + } + + $this->container['batchId'] = $batchId; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Status of the loyalty cards in the batch. + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/LoyaltyCardBatchResponse.php b/lib/Model/LoyaltyCardBatchResponse.php new file mode 100644 index 00000000..9ce2217f --- /dev/null +++ b/lib/Model/LoyaltyCardBatchResponse.php @@ -0,0 +1,344 @@ + 'int', + 'batchId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'numberOfCardsGenerated' => null, + 'batchId' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'numberOfCardsGenerated' => 'numberOfCardsGenerated', + 'batchId' => 'batchId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'numberOfCardsGenerated' => 'setNumberOfCardsGenerated', + 'batchId' => 'setBatchId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'numberOfCardsGenerated' => 'getNumberOfCardsGenerated', + 'batchId' => 'getBatchId' + ]; + + /** + * 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->container['numberOfCardsGenerated'] = isset($data['numberOfCardsGenerated']) ? $data['numberOfCardsGenerated'] : null; + $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['numberOfCardsGenerated'] === null) { + $invalidProperties[] = "'numberOfCardsGenerated' can't be null"; + } + if ($this->container['batchId'] === null) { + $invalidProperties[] = "'batchId' 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 numberOfCardsGenerated + * + * @return int + */ + public function getNumberOfCardsGenerated() + { + return $this->container['numberOfCardsGenerated']; + } + + /** + * Sets numberOfCardsGenerated + * + * @param int $numberOfCardsGenerated Number of loyalty cards in the batch. + * + * @return $this + */ + public function setNumberOfCardsGenerated($numberOfCardsGenerated) + { + $this->container['numberOfCardsGenerated'] = $numberOfCardsGenerated; + + return $this; + } + + /** + * Gets batchId + * + * @return string + */ + public function getBatchId() + { + return $this->container['batchId']; + } + + /** + * Sets batchId + * + * @param string $batchId ID of the loyalty card batch. + * + * @return $this + */ + public function setBatchId($batchId) + { + $this->container['batchId'] = $batchId; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/LoyaltyProgram.php b/lib/Model/LoyaltyProgram.php index 8bbaedf6..438803d8 100644 --- a/lib/Model/LoyaltyProgram.php +++ b/lib/Model/LoyaltyProgram.php @@ -68,10 +68,12 @@ class LoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'programJoinPolicy' => 'string', 'tiersExpirationPolicy' => 'string', + 'tierCycleStartDate' => '\DateTime', 'tiersExpireIn' => 'string', 'tiersDowngradePolicy' => 'string', - 'programJoinPolicy' => 'string', + 'cardCodeSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'accountID' => 'int', 'name' => 'string', 'tiers' => '\TalonOne\Client\Model\LoyaltyTier[]', @@ -79,7 +81,9 @@ class LoyaltyProgram implements ModelInterface, ArrayAccess 'cardBased' => 'bool', 'canUpdateTiers' => 'bool', 'canUpdateJoinPolicy' => 'bool', - 'canUpgradeToAdvancedTiers' => 'bool' + 'canUpdateTierExpirationPolicy' => 'bool', + 'canUpgradeToAdvancedTiers' => 'bool', + 'canUpdateSubledgers' => 'bool' ]; /** @@ -98,10 +102,12 @@ class LoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'programJoinPolicy' => null, 'tiersExpirationPolicy' => null, + 'tierCycleStartDate' => 'date-time', 'tiersExpireIn' => null, 'tiersDowngradePolicy' => null, - 'programJoinPolicy' => null, + 'cardCodeSettings' => null, 'accountID' => null, 'name' => null, 'tiers' => null, @@ -109,7 +115,9 @@ class LoyaltyProgram implements ModelInterface, ArrayAccess 'cardBased' => null, 'canUpdateTiers' => null, 'canUpdateJoinPolicy' => null, - 'canUpgradeToAdvancedTiers' => null + 'canUpdateTierExpirationPolicy' => null, + 'canUpgradeToAdvancedTiers' => null, + 'canUpdateSubledgers' => null ]; /** @@ -149,10 +157,12 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'programJoinPolicy' => 'programJoinPolicy', 'tiersExpirationPolicy' => 'tiersExpirationPolicy', + 'tierCycleStartDate' => 'tierCycleStartDate', 'tiersExpireIn' => 'tiersExpireIn', 'tiersDowngradePolicy' => 'tiersDowngradePolicy', - 'programJoinPolicy' => 'programJoinPolicy', + 'cardCodeSettings' => 'cardCodeSettings', 'accountID' => 'accountID', 'name' => 'name', 'tiers' => 'tiers', @@ -160,7 +170,9 @@ public static function openAPIFormats() 'cardBased' => 'cardBased', 'canUpdateTiers' => 'canUpdateTiers', 'canUpdateJoinPolicy' => 'canUpdateJoinPolicy', - 'canUpgradeToAdvancedTiers' => 'canUpgradeToAdvancedTiers' + 'canUpdateTierExpirationPolicy' => 'canUpdateTierExpirationPolicy', + 'canUpgradeToAdvancedTiers' => 'canUpgradeToAdvancedTiers', + 'canUpdateSubledgers' => 'canUpdateSubledgers' ]; /** @@ -179,10 +191,12 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'programJoinPolicy' => 'setProgramJoinPolicy', 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', + 'tierCycleStartDate' => 'setTierCycleStartDate', 'tiersExpireIn' => 'setTiersExpireIn', 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', - 'programJoinPolicy' => 'setProgramJoinPolicy', + 'cardCodeSettings' => 'setCardCodeSettings', 'accountID' => 'setAccountID', 'name' => 'setName', 'tiers' => 'setTiers', @@ -190,7 +204,9 @@ public static function openAPIFormats() 'cardBased' => 'setCardBased', 'canUpdateTiers' => 'setCanUpdateTiers', 'canUpdateJoinPolicy' => 'setCanUpdateJoinPolicy', - 'canUpgradeToAdvancedTiers' => 'setCanUpgradeToAdvancedTiers' + 'canUpdateTierExpirationPolicy' => 'setCanUpdateTierExpirationPolicy', + 'canUpgradeToAdvancedTiers' => 'setCanUpgradeToAdvancedTiers', + 'canUpdateSubledgers' => 'setCanUpdateSubledgers' ]; /** @@ -209,10 +225,12 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'programJoinPolicy' => 'getProgramJoinPolicy', 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', + 'tierCycleStartDate' => 'getTierCycleStartDate', 'tiersExpireIn' => 'getTiersExpireIn', 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', - 'programJoinPolicy' => 'getProgramJoinPolicy', + 'cardCodeSettings' => 'getCardCodeSettings', 'accountID' => 'getAccountID', 'name' => 'getName', 'tiers' => 'getTiers', @@ -220,7 +238,9 @@ public static function openAPIFormats() 'cardBased' => 'getCardBased', 'canUpdateTiers' => 'getCanUpdateTiers', 'canUpdateJoinPolicy' => 'getCanUpdateJoinPolicy', - 'canUpgradeToAdvancedTiers' => 'getCanUpgradeToAdvancedTiers' + 'canUpdateTierExpirationPolicy' => 'getCanUpdateTierExpirationPolicy', + 'canUpgradeToAdvancedTiers' => 'getCanUpgradeToAdvancedTiers', + 'canUpdateSubledgers' => 'getCanUpdateSubledgers' ]; /** @@ -264,13 +284,15 @@ public function getModelName() return self::$openAPIModelName; } + const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; + const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; + const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; + const TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE = 'customer_attribute'; + const TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION = 'absolute_expiration'; const TIERS_DOWNGRADE_POLICY_ONE_DOWN = 'one_down'; const TIERS_DOWNGRADE_POLICY_BALANCE_BASED = 'balance_based'; - const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; - const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; - const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; @@ -279,11 +301,12 @@ public function getModelName() * * @return string[] */ - public function getTiersExpirationPolicyAllowableValues() + public function getProgramJoinPolicyAllowableValues() { return [ - self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, - self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, ]; } @@ -292,11 +315,13 @@ public function getTiersExpirationPolicyAllowableValues() * * @return string[] */ - public function getTiersDowngradePolicyAllowableValues() + public function getTiersExpirationPolicyAllowableValues() { return [ - self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, - self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE, + self::TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION, ]; } @@ -305,12 +330,11 @@ public function getTiersDowngradePolicyAllowableValues() * * @return string[] */ - public function getProgramJoinPolicyAllowableValues() + public function getTiersDowngradePolicyAllowableValues() { return [ - self::PROGRAM_JOIN_POLICY_NOT_JOIN, - self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, - self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, + self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, ]; } @@ -340,10 +364,12 @@ public function __construct(array $data = null) $this->container['allowSubledger'] = isset($data['allowSubledger']) ? $data['allowSubledger'] : null; $this->container['usersPerCardLimit'] = isset($data['usersPerCardLimit']) ? $data['usersPerCardLimit'] : null; $this->container['sandbox'] = isset($data['sandbox']) ? $data['sandbox'] : null; + $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; $this->container['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : null; + $this->container['tierCycleStartDate'] = isset($data['tierCycleStartDate']) ? $data['tierCycleStartDate'] : null; $this->container['tiersExpireIn'] = isset($data['tiersExpireIn']) ? $data['tiersExpireIn'] : null; $this->container['tiersDowngradePolicy'] = isset($data['tiersDowngradePolicy']) ? $data['tiersDowngradePolicy'] : null; - $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; + $this->container['cardCodeSettings'] = isset($data['cardCodeSettings']) ? $data['cardCodeSettings'] : null; $this->container['accountID'] = isset($data['accountID']) ? $data['accountID'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['tiers'] = isset($data['tiers']) ? $data['tiers'] : null; @@ -351,7 +377,9 @@ public function __construct(array $data = null) $this->container['cardBased'] = isset($data['cardBased']) ? $data['cardBased'] : false; $this->container['canUpdateTiers'] = isset($data['canUpdateTiers']) ? $data['canUpdateTiers'] : false; $this->container['canUpdateJoinPolicy'] = isset($data['canUpdateJoinPolicy']) ? $data['canUpdateJoinPolicy'] : null; + $this->container['canUpdateTierExpirationPolicy'] = isset($data['canUpdateTierExpirationPolicy']) ? $data['canUpdateTierExpirationPolicy'] : null; $this->container['canUpgradeToAdvancedTiers'] = isset($data['canUpgradeToAdvancedTiers']) ? $data['canUpgradeToAdvancedTiers'] : false; + $this->container['canUpdateSubledgers'] = isset($data['canUpdateSubledgers']) ? $data['canUpdateSubledgers'] : false; } /** @@ -394,6 +422,14 @@ public function listInvalidProperties() if ($this->container['sandbox'] === null) { $invalidProperties[] = "'sandbox' can't be null"; } + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -410,14 +446,6 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - if ($this->container['accountID'] === null) { $invalidProperties[] = "'accountID' can't be null"; } @@ -694,6 +722,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets programJoinPolicy + * + * @return string|null + */ + public function getProgramJoinPolicy() + { + return $this->container['programJoinPolicy']; + } + + /** + * Sets programJoinPolicy + * + * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * + * @return $this + */ + public function setProgramJoinPolicy($programJoinPolicy) + { + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['programJoinPolicy'] = $programJoinPolicy; + + return $this; + } + /** * Gets tiersExpirationPolicy * @@ -707,7 +768,7 @@ public function getTiersExpirationPolicy() /** * Sets tiersExpirationPolicy * - * @param string|null $tiersExpirationPolicy The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. + * @param string|null $tiersExpirationPolicy The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. * * @return $this */ @@ -727,6 +788,30 @@ public function setTiersExpirationPolicy($tiersExpirationPolicy) return $this; } + /** + * Gets tierCycleStartDate + * + * @return \DateTime|null + */ + public function getTierCycleStartDate() + { + return $this->container['tierCycleStartDate']; + } + + /** + * Sets tierCycleStartDate + * + * @param \DateTime|null $tierCycleStartDate Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. + * + * @return $this + */ + public function setTierCycleStartDate($tierCycleStartDate) + { + $this->container['tierCycleStartDate'] = $tierCycleStartDate; + + return $this; + } + /** * Gets tiersExpireIn * @@ -740,7 +825,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. + * @param string|null $tiersExpireIn The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. * * @return $this */ @@ -764,7 +849,7 @@ public function getTiersDowngradePolicy() /** * Sets tiersDowngradePolicy * - * @param string|null $tiersDowngradePolicy Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. + * @param string|null $tiersDowngradePolicy The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. * * @return $this */ @@ -785,34 +870,25 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) } /** - * Gets programJoinPolicy + * Gets cardCodeSettings * - * @return string|null + * @return \TalonOne\Client\Model\CodeGeneratorSettings|null */ - public function getProgramJoinPolicy() + public function getCardCodeSettings() { - return $this->container['programJoinPolicy']; + return $this->container['cardCodeSettings']; } /** - * Sets programJoinPolicy + * Sets cardCodeSettings * - * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $cardCodeSettings cardCodeSettings * * @return $this */ - public function setProgramJoinPolicy($programJoinPolicy) + public function setCardCodeSettings($cardCodeSettings) { - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['programJoinPolicy'] = $programJoinPolicy; + $this->container['cardCodeSettings'] = $cardCodeSettings; return $this; } @@ -979,7 +1055,7 @@ public function getCanUpdateJoinPolicy() /** * Sets canUpdateJoinPolicy * - * @param bool|null $canUpdateJoinPolicy Indicates whether the program join policy can be updated. The join policy can be updated when this value is set to `true`. + * @param bool|null $canUpdateJoinPolicy `True` if the program join policy can be updated. * * @return $this */ @@ -990,6 +1066,30 @@ public function setCanUpdateJoinPolicy($canUpdateJoinPolicy) return $this; } + /** + * Gets canUpdateTierExpirationPolicy + * + * @return bool|null + */ + public function getCanUpdateTierExpirationPolicy() + { + return $this->container['canUpdateTierExpirationPolicy']; + } + + /** + * Sets canUpdateTierExpirationPolicy + * + * @param bool|null $canUpdateTierExpirationPolicy `True` if the tier expiration policy can be updated. + * + * @return $this + */ + public function setCanUpdateTierExpirationPolicy($canUpdateTierExpirationPolicy) + { + $this->container['canUpdateTierExpirationPolicy'] = $canUpdateTierExpirationPolicy; + + return $this; + } + /** * Gets canUpgradeToAdvancedTiers * @@ -1013,6 +1113,30 @@ public function setCanUpgradeToAdvancedTiers($canUpgradeToAdvancedTiers) return $this; } + + /** + * Gets canUpdateSubledgers + * + * @return bool|null + */ + public function getCanUpdateSubledgers() + { + return $this->container['canUpdateSubledgers']; + } + + /** + * Sets canUpdateSubledgers + * + * @param bool|null $canUpdateSubledgers `True` if the `allowSubledger` property can be updated in the loyalty program. + * + * @return $this + */ + public function setCanUpdateSubledgers($canUpdateSubledgers) + { + $this->container['canUpdateSubledgers'] = $canUpdateSubledgers; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/MessageLogResponse.php b/lib/Model/MessageLogResponse.php index 1a13459e..e0cb1fa5 100644 --- a/lib/Model/MessageLogResponse.php +++ b/lib/Model/MessageLogResponse.php @@ -202,19 +202,10 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['createdAt'] === null) { - $invalidProperties[] = "'createdAt' can't be null"; - } - if ($this->container['response'] === null) { - $invalidProperties[] = "'response' can't be null"; - } - if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['response'])) { + if (!is_null($this->container['response']) && !preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['response'])) { $invalidProperties[] = "invalid value for 'response', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } return $invalidProperties; } @@ -233,7 +224,7 @@ public function valid() /** * Gets createdAt * - * @return \DateTime + * @return \DateTime|null */ public function getCreatedAt() { @@ -243,7 +234,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt Timestamp when the response was received. + * @param \DateTime|null $createdAt Timestamp when the response was received. * * @return $this */ @@ -257,7 +248,7 @@ public function setCreatedAt($createdAt) /** * Gets response * - * @return string + * @return string|null */ public function getResponse() { @@ -267,14 +258,14 @@ public function getResponse() /** * Sets response * - * @param string $response Raw response data. + * @param string|null $response Raw response data. * * @return $this */ public function setResponse($response) { - if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $response))) { + if (!is_null($response) && (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $response))) { throw new \InvalidArgumentException("invalid value for $response when calling MessageLogResponse., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); } @@ -286,7 +277,7 @@ public function setResponse($response) /** * Gets status * - * @return int + * @return int|null */ public function getStatus() { @@ -296,7 +287,7 @@ public function getStatus() /** * Sets status * - * @param int $status HTTP status code of the response. + * @param int|null $status HTTP status code of the response. * * @return $this */ diff --git a/lib/Model/NewAppWideCouponDeletionJob.php b/lib/Model/NewAppWideCouponDeletionJob.php new file mode 100644 index 00000000..839b1af7 --- /dev/null +++ b/lib/Model/NewAppWideCouponDeletionJob.php @@ -0,0 +1,344 @@ + '\TalonOne\Client\Model\CouponDeletionFilters', + 'campaignids' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'filters' => null, + 'campaignids' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'filters' => 'filters', + 'campaignids' => 'campaignids' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filters' => 'setFilters', + 'campaignids' => 'setCampaignids' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filters' => 'getFilters', + 'campaignids' => 'getCampaignids' + ]; + + /** + * 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->container['filters'] = isset($data['filters']) ? $data['filters'] : null; + $this->container['campaignids'] = isset($data['campaignids']) ? $data['campaignids'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['filters'] === null) { + $invalidProperties[] = "'filters' can't be null"; + } + if ($this->container['campaignids'] === null) { + $invalidProperties[] = "'campaignids' 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 filters + * + * @return \TalonOne\Client\Model\CouponDeletionFilters + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \TalonOne\Client\Model\CouponDeletionFilters $filters filters + * + * @return $this + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets campaignids + * + * @return int[] + */ + public function getCampaignids() + { + return $this->container['campaignids']; + } + + /** + * Sets campaignids + * + * @param int[] $campaignids campaignids + * + * @return $this + */ + public function setCampaignids($campaignids) + { + $this->container['campaignids'] = $campaignids; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/NewApplication.php b/lib/Model/NewApplication.php index dc475f6d..810ab701 100644 --- a/lib/Model/NewApplication.php +++ b/lib/Model/NewApplication.php @@ -71,7 +71,8 @@ class NewApplication implements ModelInterface, ArrayAccess 'sandbox' => 'bool', 'enablePartialDiscounts' => 'bool', 'defaultDiscountAdditionalCostPerItemScope' => 'string', - 'key' => 'string' + 'key' => 'string', + 'enableCampaignStateManagement' => 'bool' ]; /** @@ -94,7 +95,8 @@ class NewApplication implements ModelInterface, ArrayAccess 'sandbox' => null, 'enablePartialDiscounts' => null, 'defaultDiscountAdditionalCostPerItemScope' => null, - 'key' => null + 'key' => null, + 'enableCampaignStateManagement' => null ]; /** @@ -138,7 +140,8 @@ public static function openAPIFormats() 'sandbox' => 'sandbox', 'enablePartialDiscounts' => 'enablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'defaultDiscountAdditionalCostPerItemScope', - 'key' => 'key' + 'key' => 'key', + 'enableCampaignStateManagement' => 'enableCampaignStateManagement' ]; /** @@ -161,7 +164,8 @@ public static function openAPIFormats() 'sandbox' => 'setSandbox', 'enablePartialDiscounts' => 'setEnablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'setDefaultDiscountAdditionalCostPerItemScope', - 'key' => 'setKey' + 'key' => 'setKey', + 'enableCampaignStateManagement' => 'setEnableCampaignStateManagement' ]; /** @@ -184,7 +188,8 @@ public static function openAPIFormats() 'sandbox' => 'getSandbox', 'enablePartialDiscounts' => 'getEnablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'getDefaultDiscountAdditionalCostPerItemScope', - 'key' => 'getKey' + 'key' => 'getKey', + 'enableCampaignStateManagement' => 'getEnableCampaignStateManagement' ]; /** @@ -313,6 +318,7 @@ public function __construct(array $data = null) $this->container['enablePartialDiscounts'] = isset($data['enablePartialDiscounts']) ? $data['enablePartialDiscounts'] : null; $this->container['defaultDiscountAdditionalCostPerItemScope'] = isset($data['defaultDiscountAdditionalCostPerItemScope']) ? $data['defaultDiscountAdditionalCostPerItemScope'] : null; $this->container['key'] = isset($data['key']) ? $data['key'] : null; + $this->container['enableCampaignStateManagement'] = isset($data['enableCampaignStateManagement']) ? $data['enableCampaignStateManagement'] : null; } /** @@ -794,6 +800,30 @@ public function setKey($key) return $this; } + + /** + * Gets enableCampaignStateManagement + * + * @return bool|null + */ + public function getEnableCampaignStateManagement() + { + return $this->container['enableCampaignStateManagement']; + } + + /** + * Sets enableCampaignStateManagement + * + * @param bool|null $enableCampaignStateManagement Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. + * + * @return $this + */ + public function setEnableCampaignStateManagement($enableCampaignStateManagement) + { + $this->container['enableCampaignStateManagement'] = $enableCampaignStateManagement; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/NewApplicationCIF.php b/lib/Model/NewApplicationCIF.php new file mode 100644 index 00000000..155dc18f --- /dev/null +++ b/lib/Model/NewApplicationCIF.php @@ -0,0 +1,461 @@ + 'string', + 'description' => 'string', + 'activeExpressionId' => 'int', + 'modifiedBy' => 'int', + 'createdBy' => 'int', + 'modified' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'activeExpressionId' => null, + 'modifiedBy' => null, + 'createdBy' => null, + 'modified' => 'date-time' + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'activeExpressionId' => 'activeExpressionId', + 'modifiedBy' => 'modifiedBy', + 'createdBy' => 'createdBy', + 'modified' => 'modified' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'activeExpressionId' => 'setActiveExpressionId', + 'modifiedBy' => 'setModifiedBy', + 'createdBy' => 'setCreatedBy', + 'modified' => 'setModified' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'activeExpressionId' => 'getActiveExpressionId', + 'modifiedBy' => 'getModifiedBy', + 'createdBy' => 'getCreatedBy', + 'modified' => 'getModified' + ]; + + /** + * 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->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['activeExpressionId'] = isset($data['activeExpressionId']) ? $data['activeExpressionId'] : null; + $this->container['modifiedBy'] = isset($data['modifiedBy']) ? $data['modifiedBy'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; + } + + /** + * 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the Application cart item filter used in API requests. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description of the Application cart item filter. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets activeExpressionId + * + * @return int|null + */ + public function getActiveExpressionId() + { + return $this->container['activeExpressionId']; + } + + /** + * Sets activeExpressionId + * + * @param int|null $activeExpressionId The ID of the expression that the Application cart item filter uses. + * + * @return $this + */ + public function setActiveExpressionId($activeExpressionId) + { + $this->container['activeExpressionId'] = $activeExpressionId; + + return $this; + } + + /** + * Gets modifiedBy + * + * @return int|null + */ + public function getModifiedBy() + { + return $this->container['modifiedBy']; + } + + /** + * Sets modifiedBy + * + * @param int|null $modifiedBy The ID of the user who last updated the Application cart item filter. + * + * @return $this + */ + public function setModifiedBy($modifiedBy) + { + $this->container['modifiedBy'] = $modifiedBy; + + return $this; + } + + /** + * Gets createdBy + * + * @return int|null + */ + public function getCreatedBy() + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param int|null $createdBy The ID of the user who created the Application cart item filter. + * + * @return $this + */ + public function setCreatedBy($createdBy) + { + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets modified + * + * @return \DateTime|null + */ + public function getModified() + { + return $this->container['modified']; + } + + /** + * Sets modified + * + * @param \DateTime|null $modified Timestamp of the most recent update to the Application cart item filter. + * + * @return $this + */ + public function setModified($modified) + { + $this->container['modified'] = $modified; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ApplicationCampaignAnalyticsAvgSessionValue.php b/lib/Model/NewApplicationCIFExpression.php similarity index 74% rename from lib/Model/ApplicationCampaignAnalyticsAvgSessionValue.php rename to lib/Model/NewApplicationCIFExpression.php index 64c481fb..a95416cd 100644 --- a/lib/Model/ApplicationCampaignAnalyticsAvgSessionValue.php +++ b/lib/Model/NewApplicationCIFExpression.php @@ -1,6 +1,6 @@ 'float', - 'uplift' => 'float', - 'trend' => 'float' + 'cartItemFilterId' => 'int', + 'createdBy' => 'int', + 'expression' => 'object[]' ]; /** @@ -69,9 +68,9 @@ class ApplicationCampaignAnalyticsAvgSessionValue implements ModelInterface, Arr * @var string[] */ protected static $openAPIFormats = [ - 'value' => null, - 'uplift' => null, - 'trend' => null + 'cartItemFilterId' => null, + 'createdBy' => null, + 'expression' => null ]; /** @@ -101,9 +100,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'value' => 'value', - 'uplift' => 'uplift', - 'trend' => 'trend' + 'cartItemFilterId' => 'cartItemFilterId', + 'createdBy' => 'createdBy', + 'expression' => 'expression' ]; /** @@ -112,9 +111,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'value' => 'setValue', - 'uplift' => 'setUplift', - 'trend' => 'setTrend' + 'cartItemFilterId' => 'setCartItemFilterId', + 'createdBy' => 'setCreatedBy', + 'expression' => 'setExpression' ]; /** @@ -123,9 +122,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'value' => 'getValue', - 'uplift' => 'getUplift', - 'trend' => 'getTrend' + 'cartItemFilterId' => 'getCartItemFilterId', + 'createdBy' => 'getCreatedBy', + 'expression' => 'getExpression' ]; /** @@ -188,9 +187,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['uplift'] = isset($data['uplift']) ? $data['uplift'] : null; - $this->container['trend'] = isset($data['trend']) ? $data['trend'] : null; + $this->container['cartItemFilterId'] = isset($data['cartItemFilterId']) ? $data['cartItemFilterId'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['expression'] = isset($data['expression']) ? $data['expression'] : null; } /** @@ -218,73 +217,73 @@ public function valid() /** - * Gets value + * Gets cartItemFilterId * - * @return float|null + * @return int|null */ - public function getValue() + public function getCartItemFilterId() { - return $this->container['value']; + return $this->container['cartItemFilterId']; } /** - * Sets value + * Sets cartItemFilterId * - * @param float|null $value value + * @param int|null $cartItemFilterId The ID of the Application cart item filter. * * @return $this */ - public function setValue($value) + public function setCartItemFilterId($cartItemFilterId) { - $this->container['value'] = $value; + $this->container['cartItemFilterId'] = $cartItemFilterId; return $this; } /** - * Gets uplift + * Gets createdBy * - * @return float|null + * @return int|null */ - public function getUplift() + public function getCreatedBy() { - return $this->container['uplift']; + return $this->container['createdBy']; } /** - * Sets uplift + * Sets createdBy * - * @param float|null $uplift uplift + * @param int|null $createdBy The ID of the user who created the Application cart item filter. * * @return $this */ - public function setUplift($uplift) + public function setCreatedBy($createdBy) { - $this->container['uplift'] = $uplift; + $this->container['createdBy'] = $createdBy; return $this; } /** - * Gets trend + * Gets expression * - * @return float|null + * @return object[]|null */ - public function getTrend() + public function getExpression() { - return $this->container['trend']; + return $this->container['expression']; } /** - * Sets trend + * Sets expression * - * @param float|null $trend trend + * @param object[]|null $expression Arbitrary additional JSON data associated with the Application cart item filter. * * @return $this */ - public function setTrend($trend) + public function setExpression($expression) { - $this->container['trend'] = $trend; + $this->container['expression'] = $expression; return $this; } diff --git a/lib/Model/NewAttribute.php b/lib/Model/NewAttribute.php index 126f9cbd..33b38bf6 100644 --- a/lib/Model/NewAttribute.php +++ b/lib/Model/NewAttribute.php @@ -219,7 +219,6 @@ public function getModelName() return self::$openAPIModelName; } - const ENTITY_ACCOUNT = 'Account'; const ENTITY_APPLICATION = 'Application'; const ENTITY_CAMPAIGN = 'Campaign'; const ENTITY_CUSTOMER_PROFILE = 'CustomerProfile'; @@ -252,7 +251,6 @@ public function getModelName() public function getEntityAllowableValues() { return [ - self::ENTITY_ACCOUNT, self::ENTITY_APPLICATION, self::ENTITY_CAMPAIGN, self::ENTITY_CUSTOMER_PROFILE, diff --git a/lib/Model/NewBaseNotification.php b/lib/Model/NewBaseNotification.php index 84fb3d5e..a104ac00 100644 --- a/lib/Model/NewBaseNotification.php +++ b/lib/Model/NewBaseNotification.php @@ -236,7 +236,7 @@ public function getPolicy() /** * Sets policy * - * @param object $policy policy + * @param object $policy Indicates which notification properties to apply. * * @return $this */ diff --git a/lib/Model/NewCouponCreationJob.php b/lib/Model/NewCouponCreationJob.php index 1856a439..7d01dbca 100644 --- a/lib/Model/NewCouponCreationJob.php +++ b/lib/Model/NewCouponCreationJob.php @@ -421,7 +421,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/NewCouponDeletionJob.php b/lib/Model/NewCouponDeletionJob.php new file mode 100644 index 00000000..db9e3d0b --- /dev/null +++ b/lib/Model/NewCouponDeletionJob.php @@ -0,0 +1,311 @@ + '\TalonOne\Client\Model\CouponDeletionFilters' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'filters' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'filters' => 'filters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filters' => 'setFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filters' => 'getFilters' + ]; + + /** + * 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->container['filters'] = isset($data['filters']) ? $data['filters'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['filters'] === null) { + $invalidProperties[] = "'filters' 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 filters + * + * @return \TalonOne\Client\Model\CouponDeletionFilters + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \TalonOne\Client\Model\CouponDeletionFilters $filters filters + * + * @return $this + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/NewCoupons.php b/lib/Model/NewCoupons.php index c472280b..cc0d19d0 100644 --- a/lib/Model/NewCoupons.php +++ b/lib/Model/NewCoupons.php @@ -458,7 +458,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/NewCouponsForMultipleRecipients.php b/lib/Model/NewCouponsForMultipleRecipients.php index 56b28008..08e1b6a4 100644 --- a/lib/Model/NewCouponsForMultipleRecipients.php +++ b/lib/Model/NewCouponsForMultipleRecipients.php @@ -424,7 +424,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/NewCustomerSessionV2.php b/lib/Model/NewCustomerSessionV2.php index 8fcd5e3b..150a4fe0 100644 --- a/lib/Model/NewCustomerSessionV2.php +++ b/lib/Model/NewCustomerSessionV2.php @@ -396,7 +396,7 @@ public function getCouponCodes() /** * Sets couponCodes * - * @param string[]|null $couponCodes Any coupon codes entered. **Important**: If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. + * @param string[]|null $couponCodes Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, provide `\"couponCodes\": null` or omit the parameter entirely. * * @return $this */ @@ -420,7 +420,7 @@ public function getReferralCode() /** * Sets referralCode * - * @param string|null $referralCode Any referral code entered. **Important**: If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. + * @param string|null $referralCode Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, provide `\"referralCode\": null` or omit the parameter entirely. * * @return $this */ diff --git a/lib/Model/NewLoyaltyProgram.php b/lib/Model/NewLoyaltyProgram.php index f61c70e1..9381d7a6 100644 --- a/lib/Model/NewLoyaltyProgram.php +++ b/lib/Model/NewLoyaltyProgram.php @@ -66,10 +66,12 @@ class NewLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'programJoinPolicy' => 'string', 'tiersExpirationPolicy' => 'string', + 'tierCycleStartDate' => '\DateTime', 'tiersExpireIn' => 'string', 'tiersDowngradePolicy' => 'string', - 'programJoinPolicy' => 'string', + 'cardCodeSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'name' => 'string', 'tiers' => '\TalonOne\Client\Model\NewLoyaltyTier[]', 'timezone' => 'string', @@ -90,10 +92,12 @@ class NewLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'programJoinPolicy' => null, 'tiersExpirationPolicy' => null, + 'tierCycleStartDate' => 'date-time', 'tiersExpireIn' => null, 'tiersDowngradePolicy' => null, - 'programJoinPolicy' => null, + 'cardCodeSettings' => null, 'name' => null, 'tiers' => null, 'timezone' => null, @@ -135,10 +139,12 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'programJoinPolicy' => 'programJoinPolicy', 'tiersExpirationPolicy' => 'tiersExpirationPolicy', + 'tierCycleStartDate' => 'tierCycleStartDate', 'tiersExpireIn' => 'tiersExpireIn', 'tiersDowngradePolicy' => 'tiersDowngradePolicy', - 'programJoinPolicy' => 'programJoinPolicy', + 'cardCodeSettings' => 'cardCodeSettings', 'name' => 'name', 'tiers' => 'tiers', 'timezone' => 'timezone', @@ -159,10 +165,12 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'programJoinPolicy' => 'setProgramJoinPolicy', 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', + 'tierCycleStartDate' => 'setTierCycleStartDate', 'tiersExpireIn' => 'setTiersExpireIn', 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', - 'programJoinPolicy' => 'setProgramJoinPolicy', + 'cardCodeSettings' => 'setCardCodeSettings', 'name' => 'setName', 'tiers' => 'setTiers', 'timezone' => 'setTimezone', @@ -183,10 +191,12 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'programJoinPolicy' => 'getProgramJoinPolicy', 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', + 'tierCycleStartDate' => 'getTierCycleStartDate', 'tiersExpireIn' => 'getTiersExpireIn', 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', - 'programJoinPolicy' => 'getProgramJoinPolicy', + 'cardCodeSettings' => 'getCardCodeSettings', 'name' => 'getName', 'tiers' => 'getTiers', 'timezone' => 'getTimezone', @@ -234,13 +244,15 @@ public function getModelName() return self::$openAPIModelName; } + const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; + const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; + const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; + const TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE = 'customer_attribute'; + const TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION = 'absolute_expiration'; const TIERS_DOWNGRADE_POLICY_ONE_DOWN = 'one_down'; const TIERS_DOWNGRADE_POLICY_BALANCE_BASED = 'balance_based'; - const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; - const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; - const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; @@ -249,11 +261,12 @@ public function getModelName() * * @return string[] */ - public function getTiersExpirationPolicyAllowableValues() + public function getProgramJoinPolicyAllowableValues() { return [ - self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, - self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, ]; } @@ -262,11 +275,13 @@ public function getTiersExpirationPolicyAllowableValues() * * @return string[] */ - public function getTiersDowngradePolicyAllowableValues() + public function getTiersExpirationPolicyAllowableValues() { return [ - self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, - self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE, + self::TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION, ]; } @@ -275,12 +290,11 @@ public function getTiersDowngradePolicyAllowableValues() * * @return string[] */ - public function getProgramJoinPolicyAllowableValues() + public function getTiersDowngradePolicyAllowableValues() { return [ - self::PROGRAM_JOIN_POLICY_NOT_JOIN, - self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, - self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, + self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, ]; } @@ -308,10 +322,12 @@ public function __construct(array $data = null) $this->container['allowSubledger'] = isset($data['allowSubledger']) ? $data['allowSubledger'] : null; $this->container['usersPerCardLimit'] = isset($data['usersPerCardLimit']) ? $data['usersPerCardLimit'] : null; $this->container['sandbox'] = isset($data['sandbox']) ? $data['sandbox'] : null; + $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; $this->container['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : null; + $this->container['tierCycleStartDate'] = isset($data['tierCycleStartDate']) ? $data['tierCycleStartDate'] : null; $this->container['tiersExpireIn'] = isset($data['tiersExpireIn']) ? $data['tiersExpireIn'] : null; $this->container['tiersDowngradePolicy'] = isset($data['tiersDowngradePolicy']) ? $data['tiersDowngradePolicy'] : null; - $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; + $this->container['cardCodeSettings'] = isset($data['cardCodeSettings']) ? $data['cardCodeSettings'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['tiers'] = isset($data['tiers']) ? $data['tiers'] : null; $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; @@ -346,6 +362,14 @@ public function listInvalidProperties() if ($this->container['sandbox'] === null) { $invalidProperties[] = "'sandbox' can't be null"; } + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -362,14 +386,6 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } @@ -595,6 +611,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets programJoinPolicy + * + * @return string|null + */ + public function getProgramJoinPolicy() + { + return $this->container['programJoinPolicy']; + } + + /** + * Sets programJoinPolicy + * + * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * + * @return $this + */ + public function setProgramJoinPolicy($programJoinPolicy) + { + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['programJoinPolicy'] = $programJoinPolicy; + + return $this; + } + /** * Gets tiersExpirationPolicy * @@ -608,7 +657,7 @@ public function getTiersExpirationPolicy() /** * Sets tiersExpirationPolicy * - * @param string|null $tiersExpirationPolicy The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. + * @param string|null $tiersExpirationPolicy The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. * * @return $this */ @@ -628,6 +677,30 @@ public function setTiersExpirationPolicy($tiersExpirationPolicy) return $this; } + /** + * Gets tierCycleStartDate + * + * @return \DateTime|null + */ + public function getTierCycleStartDate() + { + return $this->container['tierCycleStartDate']; + } + + /** + * Sets tierCycleStartDate + * + * @param \DateTime|null $tierCycleStartDate Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. + * + * @return $this + */ + public function setTierCycleStartDate($tierCycleStartDate) + { + $this->container['tierCycleStartDate'] = $tierCycleStartDate; + + return $this; + } + /** * Gets tiersExpireIn * @@ -641,7 +714,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. + * @param string|null $tiersExpireIn The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. * * @return $this */ @@ -665,7 +738,7 @@ public function getTiersDowngradePolicy() /** * Sets tiersDowngradePolicy * - * @param string|null $tiersDowngradePolicy Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. + * @param string|null $tiersDowngradePolicy The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. * * @return $this */ @@ -686,34 +759,25 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) } /** - * Gets programJoinPolicy + * Gets cardCodeSettings * - * @return string|null + * @return \TalonOne\Client\Model\CodeGeneratorSettings|null */ - public function getProgramJoinPolicy() + public function getCardCodeSettings() { - return $this->container['programJoinPolicy']; + return $this->container['cardCodeSettings']; } /** - * Sets programJoinPolicy + * Sets cardCodeSettings * - * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $cardCodeSettings cardCodeSettings * * @return $this */ - public function setProgramJoinPolicy($programJoinPolicy) + public function setCardCodeSettings($cardCodeSettings) { - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['programJoinPolicy'] = $programJoinPolicy; + $this->container['cardCodeSettings'] = $cardCodeSettings; return $this; } diff --git a/lib/Model/NewNotificationTest.php b/lib/Model/NewNotificationTest.php index a8e1322f..113c8f30 100644 --- a/lib/Model/NewNotificationTest.php +++ b/lib/Model/NewNotificationTest.php @@ -185,6 +185,7 @@ public function getModelName() const TYPE_CAMPAIGN = 'campaign'; const TYPE_LOYALTY_ADDED_DEDUCTED_POINTS = 'loyalty_added_deducted_points'; + const TYPE_CARD_ADDED_DEDUCTED_POINTS = 'card_added_deducted_points'; const TYPE_COUPON = 'coupon'; const TYPE_EXPIRING_COUPONS = 'expiring_coupons'; const TYPE_EXPIRING_POINTS = 'expiring_points'; @@ -212,6 +213,7 @@ public function getTypeAllowableValues() return [ self::TYPE_CAMPAIGN, self::TYPE_LOYALTY_ADDED_DEDUCTED_POINTS, + self::TYPE_CARD_ADDED_DEDUCTED_POINTS, self::TYPE_COUPON, self::TYPE_EXPIRING_COUPONS, self::TYPE_EXPIRING_POINTS, diff --git a/lib/Model/NewOutgoingIntegrationWebhook.php b/lib/Model/NewOutgoingIntegrationWebhook.php index 27f94d74..4915d85e 100644 --- a/lib/Model/NewOutgoingIntegrationWebhook.php +++ b/lib/Model/NewOutgoingIntegrationWebhook.php @@ -58,6 +58,7 @@ class NewOutgoingIntegrationWebhook implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'title' => 'string', + 'description' => 'string', 'applicationIds' => 'int[]' ]; @@ -68,6 +69,7 @@ class NewOutgoingIntegrationWebhook implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'title' => null, + 'description' => null, 'applicationIds' => null ]; @@ -99,6 +101,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'title' => 'title', + 'description' => 'description', 'applicationIds' => 'applicationIds' ]; @@ -109,6 +112,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'title' => 'setTitle', + 'description' => 'setDescription', 'applicationIds' => 'setApplicationIds' ]; @@ -119,6 +123,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'title' => 'getTitle', + 'description' => 'getDescription', 'applicationIds' => 'getApplicationIds' ]; @@ -183,6 +188,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['applicationIds'] = isset($data['applicationIds']) ? $data['applicationIds'] : null; } @@ -240,6 +246,30 @@ public function setTitle($title) return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the webhook. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** * Gets applicationIds * diff --git a/lib/Model/NewReferral.php b/lib/Model/NewReferral.php index 2d57bbb4..c172930b 100644 --- a/lib/Model/NewReferral.php +++ b/lib/Model/NewReferral.php @@ -296,7 +296,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/NewReferralsForMultipleAdvocates.php b/lib/Model/NewReferralsForMultipleAdvocates.php index 419d4a03..e8dfddc0 100644 --- a/lib/Model/NewReferralsForMultipleAdvocates.php +++ b/lib/Model/NewReferralsForMultipleAdvocates.php @@ -309,7 +309,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/NewRevisionVersion.php b/lib/Model/NewRevisionVersion.php new file mode 100644 index 00000000..766eb86f --- /dev/null +++ b/lib/Model/NewRevisionVersion.php @@ -0,0 +1,649 @@ + 'string', + 'startTime' => '\DateTime', + 'endTime' => '\DateTime', + 'attributes' => 'object', + 'description' => 'string', + 'activeRulesetId' => 'int', + 'tags' => 'string[]', + 'couponSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', + 'referralSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', + 'limits' => '\TalonOne\Client\Model\LimitConfig[]', + 'features' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'startTime' => 'date-time', + 'endTime' => 'date-time', + 'attributes' => null, + 'description' => null, + 'activeRulesetId' => null, + 'tags' => null, + 'couponSettings' => null, + 'referralSettings' => null, + 'limits' => null, + 'features' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'startTime' => 'startTime', + 'endTime' => 'endTime', + 'attributes' => 'attributes', + 'description' => 'description', + 'activeRulesetId' => 'activeRulesetId', + 'tags' => 'tags', + 'couponSettings' => 'couponSettings', + 'referralSettings' => 'referralSettings', + 'limits' => 'limits', + 'features' => 'features' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'startTime' => 'setStartTime', + 'endTime' => 'setEndTime', + 'attributes' => 'setAttributes', + 'description' => 'setDescription', + 'activeRulesetId' => 'setActiveRulesetId', + 'tags' => 'setTags', + 'couponSettings' => 'setCouponSettings', + 'referralSettings' => 'setReferralSettings', + 'limits' => 'setLimits', + 'features' => 'setFeatures' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'startTime' => 'getStartTime', + 'endTime' => 'getEndTime', + 'attributes' => 'getAttributes', + 'description' => 'getDescription', + 'activeRulesetId' => 'getActiveRulesetId', + 'tags' => 'getTags', + 'couponSettings' => 'getCouponSettings', + 'referralSettings' => 'getReferralSettings', + 'limits' => 'getLimits', + 'features' => 'getFeatures' + ]; + + /** + * 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; + } + + const FEATURES_COUPONS = 'coupons'; + const FEATURES_REFERRALS = 'referrals'; + const FEATURES_LOYALTY = 'loyalty'; + const FEATURES_GIVEAWAYS = 'giveaways'; + const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFeaturesAllowableValues() + { + return [ + self::FEATURES_COUPONS, + self::FEATURES_REFERRALS, + self::FEATURES_LOYALTY, + self::FEATURES_GIVEAWAYS, + self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, + ]; + } + + + /** + * 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->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['startTime'] = isset($data['startTime']) ? $data['startTime'] : null; + $this->container['endTime'] = isset($data['endTime']) ? $data['endTime'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['activeRulesetId'] = isset($data['activeRulesetId']) ? $data['activeRulesetId'] : null; + $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; + $this->container['couponSettings'] = isset($data['couponSettings']) ? $data['couponSettings'] : null; + $this->container['referralSettings'] = isset($data['referralSettings']) ? $data['referralSettings'] : null; + $this->container['limits'] = isset($data['limits']) ? $data['limits'] : null; + $this->container['features'] = isset($data['features']) ? $data['features'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + 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 A user-facing name for this campaign. + * + * @return $this + */ + public function setName($name) + { + + if (!is_null($name) && (mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling NewRevisionVersion., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets startTime + * + * @return \DateTime|null + */ + public function getStartTime() + { + return $this->container['startTime']; + } + + /** + * Sets startTime + * + * @param \DateTime|null $startTime Timestamp when the campaign will become active. + * + * @return $this + */ + public function setStartTime($startTime) + { + $this->container['startTime'] = $startTime; + + return $this; + } + + /** + * Gets endTime + * + * @return \DateTime|null + */ + public function getEndTime() + { + return $this->container['endTime']; + } + + /** + * Sets endTime + * + * @param \DateTime|null $endTime Timestamp when the campaign will become inactive. + * + * @return $this + */ + public function setEndTime($endTime) + { + $this->container['endTime'] = $endTime; + + return $this; + } + + /** + * Gets attributes + * + * @return object|null + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object|null $attributes Arbitrary properties associated with this campaign. + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A detailed description of the campaign. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets activeRulesetId + * + * @return int|null + */ + public function getActiveRulesetId() + { + return $this->container['activeRulesetId']; + } + + /** + * Sets activeRulesetId + * + * @param int|null $activeRulesetId The ID of the ruleset this campaign template will use. + * + * @return $this + */ + public function setActiveRulesetId($activeRulesetId) + { + $this->container['activeRulesetId'] = $activeRulesetId; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags A list of tags for the campaign template. + * + * @return $this + */ + public function setTags($tags) + { + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets couponSettings + * + * @return \TalonOne\Client\Model\CodeGeneratorSettings|null + */ + public function getCouponSettings() + { + return $this->container['couponSettings']; + } + + /** + * Sets couponSettings + * + * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $couponSettings couponSettings + * + * @return $this + */ + public function setCouponSettings($couponSettings) + { + $this->container['couponSettings'] = $couponSettings; + + return $this; + } + + /** + * Gets referralSettings + * + * @return \TalonOne\Client\Model\CodeGeneratorSettings|null + */ + public function getReferralSettings() + { + return $this->container['referralSettings']; + } + + /** + * Sets referralSettings + * + * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $referralSettings referralSettings + * + * @return $this + */ + public function setReferralSettings($referralSettings) + { + $this->container['referralSettings'] = $referralSettings; + + return $this; + } + + /** + * Gets limits + * + * @return \TalonOne\Client\Model\LimitConfig[]|null + */ + public function getLimits() + { + return $this->container['limits']; + } + + /** + * Sets limits + * + * @param \TalonOne\Client\Model\LimitConfig[]|null $limits The set of limits that will operate for this campaign version. + * + * @return $this + */ + public function setLimits($limits) + { + $this->container['limits'] = $limits; + + return $this; + } + + /** + * Gets features + * + * @return string[]|null + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param string[]|null $features A list of features for the campaign template. + * + * @return $this + */ + public function setFeatures($features) + { + $allowedValues = $this->getFeaturesAllowableValues(); + if (!is_null($features) && array_diff($features, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'features', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['features'] = $features; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/NewWebhook.php b/lib/Model/NewWebhook.php index c7dec6ad..e086a9a4 100644 --- a/lib/Model/NewWebhook.php +++ b/lib/Model/NewWebhook.php @@ -60,6 +60,7 @@ class NewWebhook implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'applicationIds' => 'int[]', 'title' => 'string', + 'description' => 'string', 'verb' => 'string', 'url' => 'string', 'headers' => 'string[]', @@ -76,6 +77,7 @@ class NewWebhook implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'applicationIds' => null, 'title' => null, + 'description' => null, 'verb' => null, 'url' => null, 'headers' => null, @@ -113,6 +115,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'applicationIds' => 'applicationIds', 'title' => 'title', + 'description' => 'description', 'verb' => 'verb', 'url' => 'url', 'headers' => 'headers', @@ -129,6 +132,7 @@ public static function openAPIFormats() protected static $setters = [ 'applicationIds' => 'setApplicationIds', 'title' => 'setTitle', + 'description' => 'setDescription', 'verb' => 'setVerb', 'url' => 'setUrl', 'headers' => 'setHeaders', @@ -145,6 +149,7 @@ public static function openAPIFormats() protected static $getters = [ 'applicationIds' => 'getApplicationIds', 'title' => 'getTitle', + 'description' => 'getDescription', 'verb' => 'getVerb', 'url' => 'getUrl', 'headers' => 'getHeaders', @@ -236,6 +241,7 @@ public function __construct(array $data = null) { $this->container['applicationIds'] = isset($data['applicationIds']) ? $data['applicationIds'] : null; $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['verb'] = isset($data['verb']) ? $data['verb'] : null; $this->container['url'] = isset($data['url']) ? $data['url'] : null; $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null; @@ -354,6 +360,30 @@ public function setTitle($title) return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the webhook. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** * Gets verb * diff --git a/lib/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.php b/lib/Model/OktaEvent.php similarity index 79% rename from lib/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.php rename to lib/Model/OktaEvent.php index d77e2f63..fe45d157 100644 --- a/lib/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.php +++ b/lib/Model/OktaEvent.php @@ -1,6 +1,6 @@ 'float', - 'influenced' => 'float' + 'eventType' => 'string', + 'target' => '\TalonOne\Client\Model\OktaEventTarget[]' ]; /** @@ -68,8 +68,8 @@ class ApplicationAnalyticsDataPointAvgItemsPerSession implements ModelInterface, * @var string[] */ protected static $openAPIFormats = [ - 'total' => null, - 'influenced' => null + 'eventType' => null, + 'target' => null ]; /** @@ -99,8 +99,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', - 'influenced' => 'influenced' + 'eventType' => 'eventType', + 'target' => 'target' ]; /** @@ -109,8 +109,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', - 'influenced' => 'setInfluenced' + 'eventType' => 'setEventType', + 'target' => 'setTarget' ]; /** @@ -119,8 +119,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', - 'influenced' => 'getInfluenced' + 'eventType' => 'getEventType', + 'target' => 'getTarget' ]; /** @@ -183,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['influenced'] = isset($data['influenced']) ? $data['influenced'] : null; + $this->container['eventType'] = isset($data['eventType']) ? $data['eventType'] : null; + $this->container['target'] = isset($data['target']) ? $data['target'] : null; } /** @@ -196,6 +196,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['eventType'] === null) { + $invalidProperties[] = "'eventType' can't be null"; + } + if ($this->container['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } return $invalidProperties; } @@ -212,49 +218,49 @@ public function valid() /** - * Gets total + * Gets eventType * - * @return float|null + * @return string */ - public function getTotal() + public function getEventType() { - return $this->container['total']; + return $this->container['eventType']; } /** - * Sets total + * Sets eventType * - * @param float|null $total total + * @param string $eventType Event type defining an action. * * @return $this */ - public function setTotal($total) + public function setEventType($eventType) { - $this->container['total'] = $total; + $this->container['eventType'] = $eventType; return $this; } /** - * Gets influenced + * Gets target * - * @return float|null + * @return \TalonOne\Client\Model\OktaEventTarget[] */ - public function getInfluenced() + public function getTarget() { - return $this->container['influenced']; + return $this->container['target']; } /** - * Sets influenced + * Sets target * - * @param float|null $influenced influenced + * @param \TalonOne\Client\Model\OktaEventTarget[] $target target * * @return $this */ - public function setInfluenced($influenced) + public function setTarget($target) { - $this->container['influenced'] = $influenced; + $this->container['target'] = $target; return $this; } diff --git a/lib/Model/OutgoingIntegrationWebhookTemplates.php b/lib/Model/OktaEventPayload.php similarity index 92% rename from lib/Model/OutgoingIntegrationWebhookTemplates.php rename to lib/Model/OktaEventPayload.php index 2a3b4f16..f6efba83 100644 --- a/lib/Model/OutgoingIntegrationWebhookTemplates.php +++ b/lib/Model/OktaEventPayload.php @@ -1,6 +1,6 @@ '\TalonOne\Client\Model\OutgoingIntegrationWebhookTemplate[]' + 'data' => '\TalonOne\Client\Model\OktaEventPayloadData' ]; /** @@ -189,6 +190,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } return $invalidProperties; } @@ -207,7 +211,7 @@ public function valid() /** * Gets data * - * @return \TalonOne\Client\Model\OutgoingIntegrationWebhookTemplate[]|null + * @return \TalonOne\Client\Model\OktaEventPayloadData */ public function getData() { @@ -217,7 +221,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\OutgoingIntegrationWebhookTemplate[]|null $data The list of webhook templates for a given outgoing integration type. + * @param \TalonOne\Client\Model\OktaEventPayloadData $data data * * @return $this */ diff --git a/lib/Model/OktaEventPayloadData.php b/lib/Model/OktaEventPayloadData.php new file mode 100644 index 00000000..bcb5a98b --- /dev/null +++ b/lib/Model/OktaEventPayloadData.php @@ -0,0 +1,312 @@ + '\TalonOne\Client\Model\OktaEvent[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'events' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'events' => 'events' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'events' => 'setEvents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'events' => 'getEvents' + ]; + + /** + * 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->container['events'] = isset($data['events']) ? $data['events'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['events'] === null) { + $invalidProperties[] = "'events' 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 events + * + * @return \TalonOne\Client\Model\OktaEvent[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \TalonOne\Client\Model\OktaEvent[] $events events + * + * @return $this + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/OktaEventTarget.php b/lib/Model/OktaEventTarget.php new file mode 100644 index 00000000..2d77e958 --- /dev/null +++ b/lib/Model/OktaEventTarget.php @@ -0,0 +1,378 @@ + 'string', + 'alternateId' => 'string', + 'displayName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'type' => null, + 'alternateId' => null, + 'displayName' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'alternateId' => 'alternateId', + 'displayName' => 'displayName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'alternateId' => 'setAlternateId', + 'displayName' => 'setDisplayName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'alternateId' => 'getAlternateId', + 'displayName' => 'getDisplayName' + ]; + + /** + * 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->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['alternateId'] = isset($data['alternateId']) ? $data['alternateId'] : null; + $this->container['displayName'] = isset($data['displayName']) ? $data['displayName'] : null; + } + + /** + * 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['alternateId'] === null) { + $invalidProperties[] = "'alternateId' can't be null"; + } + if ($this->container['displayName'] === null) { + $invalidProperties[] = "'displayName' 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 string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of the event target. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets alternateId + * + * @return string + */ + public function getAlternateId() + { + return $this->container['alternateId']; + } + + /** + * Sets alternateId + * + * @param string $alternateId Identifier of the event target, depending on its type. + * + * @return $this + */ + public function setAlternateId($alternateId) + { + $this->container['alternateId'] = $alternateId; + + return $this; + } + + /** + * Gets displayName + * + * @return string + */ + public function getDisplayName() + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string $displayName Display name of the event target. + * + * @return $this + */ + public function setDisplayName($displayName) + { + $this->container['displayName'] = $displayName; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ProjectedTier.php b/lib/Model/ProjectedTier.php new file mode 100644 index 00000000..1bf481e8 --- /dev/null +++ b/lib/Model/ProjectedTier.php @@ -0,0 +1,371 @@ + 'float', + 'stayInTierPoints' => 'float', + 'projectedTierName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'projectedActivePoints' => null, + 'stayInTierPoints' => null, + 'projectedTierName' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'projectedActivePoints' => 'projectedActivePoints', + 'stayInTierPoints' => 'stayInTierPoints', + 'projectedTierName' => 'projectedTierName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'projectedActivePoints' => 'setProjectedActivePoints', + 'stayInTierPoints' => 'setStayInTierPoints', + 'projectedTierName' => 'setProjectedTierName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'projectedActivePoints' => 'getProjectedActivePoints', + 'stayInTierPoints' => 'getStayInTierPoints', + 'projectedTierName' => 'getProjectedTierName' + ]; + + /** + * 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->container['projectedActivePoints'] = isset($data['projectedActivePoints']) ? $data['projectedActivePoints'] : null; + $this->container['stayInTierPoints'] = isset($data['stayInTierPoints']) ? $data['stayInTierPoints'] : null; + $this->container['projectedTierName'] = isset($data['projectedTierName']) ? $data['projectedTierName'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['projectedActivePoints'] === null) { + $invalidProperties[] = "'projectedActivePoints' 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 projectedActivePoints + * + * @return float + */ + public function getProjectedActivePoints() + { + return $this->container['projectedActivePoints']; + } + + /** + * Sets projectedActivePoints + * + * @param float $projectedActivePoints The active points of the customer when their current tier expires. + * + * @return $this + */ + public function setProjectedActivePoints($projectedActivePoints) + { + $this->container['projectedActivePoints'] = $projectedActivePoints; + + return $this; + } + + /** + * Gets stayInTierPoints + * + * @return float|null + */ + public function getStayInTierPoints() + { + return $this->container['stayInTierPoints']; + } + + /** + * Sets stayInTierPoints + * + * @param float|null $stayInTierPoints The number of points the customer needs to stay in the current tier. **Note**: This is included in the response when the customer is projected to be downgraded. + * + * @return $this + */ + public function setStayInTierPoints($stayInTierPoints) + { + $this->container['stayInTierPoints'] = $stayInTierPoints; + + return $this; + } + + /** + * Gets projectedTierName + * + * @return string|null + */ + public function getProjectedTierName() + { + return $this->container['projectedTierName']; + } + + /** + * Sets projectedTierName + * + * @param string|null $projectedTierName The name of the tier the user will enter once their current tier expires. + * + * @return $this + */ + public function setProjectedTierName($projectedTierName) + { + $this->container['projectedTierName'] = $projectedTierName; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/Referral.php b/lib/Model/Referral.php index 6b5a2379..92104aa4 100644 --- a/lib/Model/Referral.php +++ b/lib/Model/Referral.php @@ -399,7 +399,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/ReferralConstraints.php b/lib/Model/ReferralConstraints.php index b60ed5f9..982e0a71 100644 --- a/lib/Model/ReferralConstraints.php +++ b/lib/Model/ReferralConstraints.php @@ -261,7 +261,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/RejectCouponEffectProps.php b/lib/Model/RejectCouponEffectProps.php index c3f47988..054b65f5 100644 --- a/lib/Model/RejectCouponEffectProps.php +++ b/lib/Model/RejectCouponEffectProps.php @@ -62,7 +62,8 @@ class RejectCouponEffectProps implements ModelInterface, ArrayAccess 'rejectionReason' => 'string', 'conditionIndex' => 'int', 'effectIndex' => 'int', - 'details' => 'string' + 'details' => 'string', + 'campaignExclusionReason' => 'string' ]; /** @@ -75,7 +76,8 @@ class RejectCouponEffectProps implements ModelInterface, ArrayAccess 'rejectionReason' => null, 'conditionIndex' => null, 'effectIndex' => null, - 'details' => null + 'details' => null, + 'campaignExclusionReason' => null ]; /** @@ -109,7 +111,8 @@ public static function openAPIFormats() 'rejectionReason' => 'rejectionReason', 'conditionIndex' => 'conditionIndex', 'effectIndex' => 'effectIndex', - 'details' => 'details' + 'details' => 'details', + 'campaignExclusionReason' => 'campaignExclusionReason' ]; /** @@ -122,7 +125,8 @@ public static function openAPIFormats() 'rejectionReason' => 'setRejectionReason', 'conditionIndex' => 'setConditionIndex', 'effectIndex' => 'setEffectIndex', - 'details' => 'setDetails' + 'details' => 'setDetails', + 'campaignExclusionReason' => 'setCampaignExclusionReason' ]; /** @@ -135,7 +139,8 @@ public static function openAPIFormats() 'rejectionReason' => 'getRejectionReason', 'conditionIndex' => 'getConditionIndex', 'effectIndex' => 'getEffectIndex', - 'details' => 'getDetails' + 'details' => 'getDetails', + 'campaignExclusionReason' => 'getCampaignExclusionReason' ]; /** @@ -203,6 +208,7 @@ public function __construct(array $data = null) $this->container['conditionIndex'] = isset($data['conditionIndex']) ? $data['conditionIndex'] : null; $this->container['effectIndex'] = isset($data['effectIndex']) ? $data['effectIndex'] : null; $this->container['details'] = isset($data['details']) ? $data['details'] : null; + $this->container['campaignExclusionReason'] = isset($data['campaignExclusionReason']) ? $data['campaignExclusionReason'] : null; } /** @@ -354,6 +360,30 @@ public function setDetails($details) return $this; } + + /** + * Gets campaignExclusionReason + * + * @return string|null + */ + public function getCampaignExclusionReason() + { + return $this->container['campaignExclusionReason']; + } + + /** + * Sets campaignExclusionReason + * + * @param string|null $campaignExclusionReason The reason why the campaign was not applied. + * + * @return $this + */ + public function setCampaignExclusionReason($campaignExclusionReason) + { + $this->container['campaignExclusionReason'] = $campaignExclusionReason; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/RejectReferralEffectProps.php b/lib/Model/RejectReferralEffectProps.php index 4c16b116..9a7c0cbd 100644 --- a/lib/Model/RejectReferralEffectProps.php +++ b/lib/Model/RejectReferralEffectProps.php @@ -62,7 +62,8 @@ class RejectReferralEffectProps implements ModelInterface, ArrayAccess 'rejectionReason' => 'string', 'conditionIndex' => 'int', 'effectIndex' => 'int', - 'details' => 'string' + 'details' => 'string', + 'campaignExclusionReason' => 'string' ]; /** @@ -75,7 +76,8 @@ class RejectReferralEffectProps implements ModelInterface, ArrayAccess 'rejectionReason' => null, 'conditionIndex' => null, 'effectIndex' => null, - 'details' => null + 'details' => null, + 'campaignExclusionReason' => null ]; /** @@ -109,7 +111,8 @@ public static function openAPIFormats() 'rejectionReason' => 'rejectionReason', 'conditionIndex' => 'conditionIndex', 'effectIndex' => 'effectIndex', - 'details' => 'details' + 'details' => 'details', + 'campaignExclusionReason' => 'campaignExclusionReason' ]; /** @@ -122,7 +125,8 @@ public static function openAPIFormats() 'rejectionReason' => 'setRejectionReason', 'conditionIndex' => 'setConditionIndex', 'effectIndex' => 'setEffectIndex', - 'details' => 'setDetails' + 'details' => 'setDetails', + 'campaignExclusionReason' => 'setCampaignExclusionReason' ]; /** @@ -135,7 +139,8 @@ public static function openAPIFormats() 'rejectionReason' => 'getRejectionReason', 'conditionIndex' => 'getConditionIndex', 'effectIndex' => 'getEffectIndex', - 'details' => 'getDetails' + 'details' => 'getDetails', + 'campaignExclusionReason' => 'getCampaignExclusionReason' ]; /** @@ -203,6 +208,7 @@ public function __construct(array $data = null) $this->container['conditionIndex'] = isset($data['conditionIndex']) ? $data['conditionIndex'] : null; $this->container['effectIndex'] = isset($data['effectIndex']) ? $data['effectIndex'] : null; $this->container['details'] = isset($data['details']) ? $data['details'] : null; + $this->container['campaignExclusionReason'] = isset($data['campaignExclusionReason']) ? $data['campaignExclusionReason'] : null; } /** @@ -354,6 +360,30 @@ public function setDetails($details) return $this; } + + /** + * Gets campaignExclusionReason + * + * @return string|null + */ + public function getCampaignExclusionReason() + { + return $this->container['campaignExclusionReason']; + } + + /** + * Sets campaignExclusionReason + * + * @param string|null $campaignExclusionReason The reason why the campaign was not applied. + * + * @return $this + */ + public function setCampaignExclusionReason($campaignExclusionReason) + { + $this->container['campaignExclusionReason'] = $campaignExclusionReason; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/Revision.php b/lib/Model/Revision.php new file mode 100644 index 00000000..bad4c8ba --- /dev/null +++ b/lib/Model/Revision.php @@ -0,0 +1,597 @@ + 'int', + 'activateAt' => '\DateTime', + 'accountId' => 'int', + 'applicationId' => 'int', + 'campaignId' => 'int', + 'created' => '\DateTime', + 'createdBy' => 'int', + 'activatedAt' => '\DateTime', + 'activatedBy' => 'int', + 'currentVersion' => '\TalonOne\Client\Model\RevisionVersion' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'activateAt' => 'date-time', + 'accountId' => null, + 'applicationId' => null, + 'campaignId' => null, + 'created' => 'date-time', + 'createdBy' => null, + 'activatedAt' => 'date-time', + 'activatedBy' => null, + 'currentVersion' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'activateAt' => 'activateAt', + 'accountId' => 'accountId', + 'applicationId' => 'applicationId', + 'campaignId' => 'campaignId', + 'created' => 'created', + 'createdBy' => 'createdBy', + 'activatedAt' => 'activatedAt', + 'activatedBy' => 'activatedBy', + 'currentVersion' => 'currentVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'activateAt' => 'setActivateAt', + 'accountId' => 'setAccountId', + 'applicationId' => 'setApplicationId', + 'campaignId' => 'setCampaignId', + 'created' => 'setCreated', + 'createdBy' => 'setCreatedBy', + 'activatedAt' => 'setActivatedAt', + 'activatedBy' => 'setActivatedBy', + 'currentVersion' => 'setCurrentVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'activateAt' => 'getActivateAt', + 'accountId' => 'getAccountId', + 'applicationId' => 'getApplicationId', + 'campaignId' => 'getCampaignId', + 'created' => 'getCreated', + 'createdBy' => 'getCreatedBy', + 'activatedAt' => 'getActivatedAt', + 'activatedBy' => 'getActivatedBy', + 'currentVersion' => 'getCurrentVersion' + ]; + + /** + * 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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['activateAt'] = isset($data['activateAt']) ? $data['activateAt'] : null; + $this->container['accountId'] = isset($data['accountId']) ? $data['accountId'] : null; + $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['created'] = isset($data['created']) ? $data['created'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['activatedAt'] = isset($data['activatedAt']) ? $data['activatedAt'] : null; + $this->container['activatedBy'] = isset($data['activatedBy']) ? $data['activatedBy'] : null; + $this->container['currentVersion'] = isset($data['currentVersion']) ? $data['currentVersion'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['accountId'] === null) { + $invalidProperties[] = "'accountId' can't be null"; + } + if ($this->container['applicationId'] === null) { + $invalidProperties[] = "'applicationId' can't be null"; + } + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['created'] === null) { + $invalidProperties[] = "'created' can't be null"; + } + if ($this->container['createdBy'] === null) { + $invalidProperties[] = "'createdBy' 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 id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets activateAt + * + * @return \DateTime|null + */ + public function getActivateAt() + { + return $this->container['activateAt']; + } + + /** + * Sets activateAt + * + * @param \DateTime|null $activateAt activateAt + * + * @return $this + */ + public function setActivateAt($activateAt) + { + $this->container['activateAt'] = $activateAt; + + return $this; + } + + /** + * Gets accountId + * + * @return int + */ + public function getAccountId() + { + return $this->container['accountId']; + } + + /** + * Sets accountId + * + * @param int $accountId accountId + * + * @return $this + */ + public function setAccountId($accountId) + { + $this->container['accountId'] = $accountId; + + return $this; + } + + /** + * Gets applicationId + * + * @return int + */ + public function getApplicationId() + { + return $this->container['applicationId']; + } + + /** + * Sets applicationId + * + * @param int $applicationId applicationId + * + * @return $this + */ + public function setApplicationId($applicationId) + { + $this->container['applicationId'] = $applicationId; + + return $this; + } + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId campaignId + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param \DateTime $created created + * + * @return $this + */ + public function setCreated($created) + { + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets createdBy + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param int $createdBy createdBy + * + * @return $this + */ + public function setCreatedBy($createdBy) + { + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets activatedAt + * + * @return \DateTime|null + */ + public function getActivatedAt() + { + return $this->container['activatedAt']; + } + + /** + * Sets activatedAt + * + * @param \DateTime|null $activatedAt activatedAt + * + * @return $this + */ + public function setActivatedAt($activatedAt) + { + $this->container['activatedAt'] = $activatedAt; + + return $this; + } + + /** + * Gets activatedBy + * + * @return int|null + */ + public function getActivatedBy() + { + return $this->container['activatedBy']; + } + + /** + * Sets activatedBy + * + * @param int|null $activatedBy activatedBy + * + * @return $this + */ + public function setActivatedBy($activatedBy) + { + $this->container['activatedBy'] = $activatedBy; + + return $this; + } + + /** + * Gets currentVersion + * + * @return \TalonOne\Client\Model\RevisionVersion|null + */ + public function getCurrentVersion() + { + return $this->container['currentVersion']; + } + + /** + * Sets currentVersion + * + * @param \TalonOne\Client\Model\RevisionVersion|null $currentVersion currentVersion + * + * @return $this + */ + public function setCurrentVersion($currentVersion) + { + $this->container['currentVersion'] = $currentVersion; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/CampaignSetIDs.php b/lib/Model/RevisionActivation.php similarity index 88% rename from lib/Model/CampaignSetIDs.php rename to lib/Model/RevisionActivation.php index 48e9fd47..4b3624da 100644 --- a/lib/Model/CampaignSetIDs.php +++ b/lib/Model/RevisionActivation.php @@ -1,6 +1,6 @@ 'int' + 'activateAt' => '\DateTime' ]; /** @@ -67,7 +66,7 @@ class CampaignSetIDs implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'campaignId' => null + 'activateAt' => 'date-time' ]; /** @@ -97,7 +96,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'campaignId' => 'campaignId' + 'activateAt' => 'activateAt' ]; /** @@ -106,7 +105,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'campaignId' => 'setCampaignId' + 'activateAt' => 'setActivateAt' ]; /** @@ -115,7 +114,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'campaignId' => 'getCampaignId' + 'activateAt' => 'getActivateAt' ]; /** @@ -178,7 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['activateAt'] = isset($data['activateAt']) ? $data['activateAt'] : null; } /** @@ -206,25 +205,25 @@ public function valid() /** - * Gets campaignId + * Gets activateAt * - * @return int|null + * @return \DateTime|null */ - public function getCampaignId() + public function getActivateAt() { - return $this->container['campaignId']; + return $this->container['activateAt']; } /** - * Sets campaignId + * Sets activateAt * - * @param int|null $campaignId ID of the campaign + * @param \DateTime|null $activateAt activateAt * * @return $this */ - public function setCampaignId($campaignId) + public function setActivateAt($activateAt) { - $this->container['campaignId'] = $campaignId; + $this->container['activateAt'] = $activateAt; return $this; } diff --git a/lib/Model/BaseCampaignForNotification.php b/lib/Model/RevisionVersion.php similarity index 66% rename from lib/Model/BaseCampaignForNotification.php rename to lib/Model/RevisionVersion.php index f6b2002d..78a6a4af 100644 --- a/lib/Model/BaseCampaignForNotification.php +++ b/lib/Model/RevisionVersion.php @@ -1,6 +1,6 @@ 'int', + 'accountId' => 'int', + 'applicationId' => 'int', + 'campaignId' => 'int', + 'created' => '\DateTime', + 'createdBy' => 'int', + 'revisionId' => 'int', + 'version' => 'int', 'name' => 'string', - 'description' => 'string', 'startTime' => '\DateTime', 'endTime' => '\DateTime', 'attributes' => 'object', - 'state' => 'string', + 'description' => 'string', 'activeRulesetId' => 'int', 'tags' => 'string[]', - 'features' => 'string[]', 'couponSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'referralSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'limits' => '\TalonOne\Client\Model\LimitConfig[]', - 'campaignGroups' => 'int[]', - 'evaluationGroupId' => 'int', - 'type' => 'string', - 'linkedStoreIds' => 'int[]' + 'features' => 'string[]' ]; /** @@ -81,22 +85,25 @@ class BaseCampaignForNotification implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ + 'id' => null, + 'accountId' => null, + 'applicationId' => null, + 'campaignId' => null, + 'created' => 'date-time', + 'createdBy' => null, + 'revisionId' => null, + 'version' => null, 'name' => null, - 'description' => null, 'startTime' => 'date-time', 'endTime' => 'date-time', 'attributes' => null, - 'state' => null, + 'description' => null, 'activeRulesetId' => null, 'tags' => null, - 'features' => null, 'couponSettings' => null, 'referralSettings' => null, 'limits' => null, - 'campaignGroups' => null, - 'evaluationGroupId' => null, - 'type' => null, - 'linkedStoreIds' => null + 'features' => null ]; /** @@ -126,22 +133,25 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', + 'accountId' => 'accountId', + 'applicationId' => 'applicationId', + 'campaignId' => 'campaignId', + 'created' => 'created', + 'createdBy' => 'createdBy', + 'revisionId' => 'revisionId', + 'version' => 'version', 'name' => 'name', - 'description' => 'description', 'startTime' => 'startTime', 'endTime' => 'endTime', 'attributes' => 'attributes', - 'state' => 'state', + 'description' => 'description', 'activeRulesetId' => 'activeRulesetId', 'tags' => 'tags', - 'features' => 'features', 'couponSettings' => 'couponSettings', 'referralSettings' => 'referralSettings', 'limits' => 'limits', - 'campaignGroups' => 'campaignGroups', - 'evaluationGroupId' => 'evaluationGroupId', - 'type' => 'type', - 'linkedStoreIds' => 'linkedStoreIds' + 'features' => 'features' ]; /** @@ -150,22 +160,25 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'id' => 'setId', + 'accountId' => 'setAccountId', + 'applicationId' => 'setApplicationId', + 'campaignId' => 'setCampaignId', + 'created' => 'setCreated', + 'createdBy' => 'setCreatedBy', + 'revisionId' => 'setRevisionId', + 'version' => 'setVersion', 'name' => 'setName', - 'description' => 'setDescription', 'startTime' => 'setStartTime', 'endTime' => 'setEndTime', 'attributes' => 'setAttributes', - 'state' => 'setState', + 'description' => 'setDescription', 'activeRulesetId' => 'setActiveRulesetId', 'tags' => 'setTags', - 'features' => 'setFeatures', 'couponSettings' => 'setCouponSettings', 'referralSettings' => 'setReferralSettings', 'limits' => 'setLimits', - 'campaignGroups' => 'setCampaignGroups', - 'evaluationGroupId' => 'setEvaluationGroupId', - 'type' => 'setType', - 'linkedStoreIds' => 'setLinkedStoreIds' + 'features' => 'setFeatures' ]; /** @@ -174,22 +187,25 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'id' => 'getId', + 'accountId' => 'getAccountId', + 'applicationId' => 'getApplicationId', + 'campaignId' => 'getCampaignId', + 'created' => 'getCreated', + 'createdBy' => 'getCreatedBy', + 'revisionId' => 'getRevisionId', + 'version' => 'getVersion', 'name' => 'getName', - 'description' => 'getDescription', 'startTime' => 'getStartTime', 'endTime' => 'getEndTime', 'attributes' => 'getAttributes', - 'state' => 'getState', + 'description' => 'getDescription', 'activeRulesetId' => 'getActiveRulesetId', 'tags' => 'getTags', - 'features' => 'getFeatures', 'couponSettings' => 'getCouponSettings', 'referralSettings' => 'getReferralSettings', 'limits' => 'getLimits', - 'campaignGroups' => 'getCampaignGroups', - 'evaluationGroupId' => 'getEvaluationGroupId', - 'type' => 'getType', - 'linkedStoreIds' => 'getLinkedStoreIds' + 'features' => 'getFeatures' ]; /** @@ -233,41 +249,15 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_ENABLED = 'enabled'; - const STATE_DISABLED = 'disabled'; - const STATE_ARCHIVED = 'archived'; - const STATE_DRAFT = 'draft'; - const STATE_SCHEDULED = 'scheduled'; - const STATE_RUNNING = 'running'; - const STATE_EXPIRED = 'expired'; const FEATURES_COUPONS = 'coupons'; const FEATURES_REFERRALS = 'referrals'; const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; - const TYPE_CART_ITEM = 'cartItem'; - const TYPE_ADVANCED = 'advanced'; + const FEATURES_ACHIEVEMENTS = 'achievements'; - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStateAllowableValues() - { - return [ - self::STATE_ENABLED, - self::STATE_DISABLED, - self::STATE_ARCHIVED, - self::STATE_DRAFT, - self::STATE_SCHEDULED, - self::STATE_RUNNING, - self::STATE_EXPIRED, - ]; - } - /** * Gets allowable values of the enum * @@ -281,19 +271,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_CART_ITEM, - self::TYPE_ADVANCED, + self::FEATURES_ACHIEVEMENTS, ]; } @@ -313,22 +291,25 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['accountId'] = isset($data['accountId']) ? $data['accountId'] : null; + $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['created'] = isset($data['created']) ? $data['created'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['revisionId'] = isset($data['revisionId']) ? $data['revisionId'] : null; + $this->container['version'] = isset($data['version']) ? $data['version'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['startTime'] = isset($data['startTime']) ? $data['startTime'] : null; $this->container['endTime'] = isset($data['endTime']) ? $data['endTime'] : null; $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : 'enabled'; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['activeRulesetId'] = isset($data['activeRulesetId']) ? $data['activeRulesetId'] : null; $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; - $this->container['features'] = isset($data['features']) ? $data['features'] : null; $this->container['couponSettings'] = isset($data['couponSettings']) ? $data['couponSettings'] : null; $this->container['referralSettings'] = isset($data['referralSettings']) ? $data['referralSettings'] : null; $this->container['limits'] = isset($data['limits']) ? $data['limits'] : null; - $this->container['campaignGroups'] = isset($data['campaignGroups']) ? $data['campaignGroups'] : null; - $this->container['evaluationGroupId'] = isset($data['evaluationGroupId']) ? $data['evaluationGroupId'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : 'advanced'; - $this->container['linkedStoreIds'] = isset($data['linkedStoreIds']) ? $data['linkedStoreIds'] : null; + $this->container['features'] = isset($data['features']) ? $data['features'] : null; } /** @@ -340,39 +321,32 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['name']) < 1)) { - $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + if ($this->container['accountId'] === null) { + $invalidProperties[] = "'accountId' can't be null"; } - - if ($this->container['state'] === null) { - $invalidProperties[] = "'state' can't be null"; + if ($this->container['applicationId'] === null) { + $invalidProperties[] = "'applicationId' can't be null"; } - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ); + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; } - - if ($this->container['tags'] === null) { - $invalidProperties[] = "'tags' can't be null"; + if ($this->container['created'] === null) { + $invalidProperties[] = "'created' can't be null"; } - if ($this->container['features'] === null) { - $invalidProperties[] = "'features' can't be null"; + if ($this->container['createdBy'] === null) { + $invalidProperties[] = "'createdBy' can't be null"; } - if ($this->container['limits'] === null) { - $invalidProperties[] = "'limits' can't be null"; + if ($this->container['revisionId'] === null) { + $invalidProperties[] = "'revisionId' can't be null"; } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ); + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; } return $invalidProperties; @@ -391,54 +365,222 @@ public function valid() /** - * Gets name + * Gets id * - * @return string + * @return int */ - public function getName() + public function getId() { - return $this->container['name']; + return $this->container['id']; } /** - * Sets name + * Sets id * - * @param string $name A user-facing name for this campaign. + * @param int $id Unique ID for this entity. Not to be confused with the Integration ID, which is set by your integration layer and used in most endpoints. * * @return $this */ - public function setName($name) + public function setId($id) { + $this->container['id'] = $id; - if ((mb_strlen($name) < 1)) { - throw new \InvalidArgumentException('invalid length for $name when calling BaseCampaignForNotification., must be bigger than or equal to 1.'); - } + return $this; + } - $this->container['name'] = $name; + /** + * Gets accountId + * + * @return int + */ + public function getAccountId() + { + return $this->container['accountId']; + } + + /** + * Sets accountId + * + * @param int $accountId accountId + * + * @return $this + */ + public function setAccountId($accountId) + { + $this->container['accountId'] = $accountId; return $this; } /** - * Gets description + * Gets applicationId + * + * @return int + */ + public function getApplicationId() + { + return $this->container['applicationId']; + } + + /** + * Sets applicationId + * + * @param int $applicationId applicationId + * + * @return $this + */ + public function setApplicationId($applicationId) + { + $this->container['applicationId'] = $applicationId; + + return $this; + } + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId campaignId + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param \DateTime $created created + * + * @return $this + */ + public function setCreated($created) + { + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets createdBy + * + * @return int + */ + public function getCreatedBy() + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param int $createdBy createdBy + * + * @return $this + */ + public function setCreatedBy($createdBy) + { + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets revisionId + * + * @return int + */ + public function getRevisionId() + { + return $this->container['revisionId']; + } + + /** + * Sets revisionId + * + * @param int $revisionId revisionId + * + * @return $this + */ + public function setRevisionId($revisionId) + { + $this->container['revisionId'] = $revisionId; + + return $this; + } + + /** + * Gets version + * + * @return int + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int $version version + * + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets name * * @return string|null */ - public function getDescription() + public function getName() { - return $this->container['description']; + return $this->container['name']; } /** - * Sets description + * Sets name * - * @param string|null $description A detailed description of the campaign. + * @param string|null $name A user-facing name for this campaign. * * @return $this */ - public function setDescription($description) + public function setName($name) { - $this->container['description'] = $description; + + if (!is_null($name) && (mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling RevisionVersion., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; return $this; } @@ -516,34 +658,25 @@ public function setAttributes($attributes) } /** - * Gets state + * Gets description * - * @return string + * @return string|null */ - public function getState() + public function getDescription() { - return $this->container['state']; + return $this->container['description']; } /** - * Sets state + * Sets description * - * @param string $state A disabled or archived campaign is not evaluated for rules or coupons. + * @param string|null $description A detailed description of the campaign. * * @return $this */ - public function setState($state) + public function setDescription($description) { - $allowedValues = $this->getStateAllowableValues(); - if (!in_array($state, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['state'] = $state; + $this->container['description'] = $description; return $this; } @@ -561,7 +694,7 @@ public function getActiveRulesetId() /** * Sets activeRulesetId * - * @param int|null $activeRulesetId [ID of Ruleset](https://docs.talon.one/management-api#operation/getRulesets) this campaign applies on customer session evaluation. + * @param int|null $activeRulesetId The ID of the ruleset this campaign template will use. * * @return $this */ @@ -575,7 +708,7 @@ public function setActiveRulesetId($activeRulesetId) /** * Gets tags * - * @return string[] + * @return string[]|null */ public function getTags() { @@ -585,7 +718,7 @@ public function getTags() /** * Sets tags * - * @param string[] $tags A list of tags for the campaign. + * @param string[]|null $tags A list of tags for the campaign template. * * @return $this */ @@ -596,39 +729,6 @@ public function setTags($tags) return $this; } - /** - * Gets features - * - * @return string[] - */ - public function getFeatures() - { - return $this->container['features']; - } - - /** - * Sets features - * - * @param string[] $features The features enabled in this campaign. - * - * @return $this - */ - public function setFeatures($features) - { - $allowedValues = $this->getFeaturesAllowableValues(); - if (array_diff($features, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'features', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['features'] = $features; - - return $this; - } - /** * Gets couponSettings * @@ -680,7 +780,7 @@ public function setReferralSettings($referralSettings) /** * Gets limits * - * @return \TalonOne\Client\Model\LimitConfig[] + * @return \TalonOne\Client\Model\LimitConfig[]|null */ public function getLimits() { @@ -690,7 +790,7 @@ public function getLimits() /** * Sets limits * - * @param \TalonOne\Client\Model\LimitConfig[] $limits The set of [budget limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets) for this campaign. + * @param \TalonOne\Client\Model\LimitConfig[]|null $limits The set of limits that will operate for this campaign version. * * @return $this */ @@ -702,106 +802,34 @@ public function setLimits($limits) } /** - * Gets campaignGroups - * - * @return int[]|null - */ - public function getCampaignGroups() - { - return $this->container['campaignGroups']; - } - - /** - * Sets campaignGroups - * - * @param int[]|null $campaignGroups The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. - * - * @return $this - */ - public function setCampaignGroups($campaignGroups) - { - $this->container['campaignGroups'] = $campaignGroups; - - return $this; - } - - /** - * Gets evaluationGroupId - * - * @return int|null - */ - public function getEvaluationGroupId() - { - return $this->container['evaluationGroupId']; - } - - /** - * Sets evaluationGroupId - * - * @param int|null $evaluationGroupId The ID of the campaign evaluation group the campaign belongs to. - * - * @return $this - */ - public function setEvaluationGroupId($evaluationGroupId) - { - $this->container['evaluationGroupId'] = $evaluationGroupId; - - return $this; - } - - /** - * Gets type + * Gets features * - * @return string|null + * @return string[]|null */ - public function getType() + public function getFeatures() { - return $this->container['type']; + return $this->container['features']; } /** - * Sets type + * Sets features * - * @param string|null $type The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. + * @param string[]|null $features A list of features for the campaign template. * * @return $this */ - public function setType($type) + public function setFeatures($features) { - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues, true)) { + $allowedValues = $this->getFeaturesAllowableValues(); + if (!is_null($features) && array_diff($features, $allowedValues)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'type', must be one of '%s'", + "Invalid value for 'features', must be one of '%s'", implode("', '", $allowedValues) ) ); } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets linkedStoreIds - * - * @return int[]|null - */ - public function getLinkedStoreIds() - { - return $this->container['linkedStoreIds']; - } - - /** - * Sets linkedStoreIds - * - * @param int[]|null $linkedStoreIds A list of store IDs that are linked to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. - * - * @return $this - */ - public function setLinkedStoreIds($linkedStoreIds) - { - $this->container['linkedStoreIds'] = $linkedStoreIds; + $this->container['features'] = $features; return $this; } diff --git a/lib/Model/RoleV2PermissionsRoles.php b/lib/Model/RoleV2PermissionsRoles.php deleted file mode 100644 index c11b0bb2..00000000 --- a/lib/Model/RoleV2PermissionsRoles.php +++ /dev/null @@ -1,368 +0,0 @@ - 'map[string,\TalonOne\Client\Model\RoleV2ApplicationDetails]', - 'loyaltyPrograms' => 'map[string,string]', - 'campaignAccessGroups' => 'map[string,string]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'applications' => null, - 'loyaltyPrograms' => null, - 'campaignAccessGroups' => null - ]; - - /** - * 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 attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'applications' => 'applications', - 'loyaltyPrograms' => 'loyaltyPrograms', - 'campaignAccessGroups' => 'campaignAccessGroups' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'applications' => 'setApplications', - 'loyaltyPrograms' => 'setLoyaltyPrograms', - 'campaignAccessGroups' => 'setCampaignAccessGroups' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'applications' => 'getApplications', - 'loyaltyPrograms' => 'getLoyaltyPrograms', - 'campaignAccessGroups' => 'getCampaignAccessGroups' - ]; - - /** - * 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->container['applications'] = isset($data['applications']) ? $data['applications'] : null; - $this->container['loyaltyPrograms'] = isset($data['loyaltyPrograms']) ? $data['loyaltyPrograms'] : null; - $this->container['campaignAccessGroups'] = isset($data['campaignAccessGroups']) ? $data['campaignAccessGroups'] : null; - } - - /** - * 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 applications - * - * @return map[string,\TalonOne\Client\Model\RoleV2ApplicationDetails]|null - */ - public function getApplications() - { - return $this->container['applications']; - } - - /** - * Sets applications - * - * @param map[string,\TalonOne\Client\Model\RoleV2ApplicationDetails]|null $applications applications - * - * @return $this - */ - public function setApplications($applications) - { - $this->container['applications'] = $applications; - - return $this; - } - - /** - * Gets loyaltyPrograms - * - * @return map[string,string]|null - */ - public function getLoyaltyPrograms() - { - return $this->container['loyaltyPrograms']; - } - - /** - * Sets loyaltyPrograms - * - * @param map[string,string]|null $loyaltyPrograms loyaltyPrograms - * - * @return $this - */ - public function setLoyaltyPrograms($loyaltyPrograms) - { - $this->container['loyaltyPrograms'] = $loyaltyPrograms; - - return $this; - } - - /** - * Gets campaignAccessGroups - * - * @return map[string,string]|null - */ - public function getCampaignAccessGroups() - { - return $this->container['campaignAccessGroups']; - } - - /** - * Sets campaignAccessGroups - * - * @param map[string,string]|null $campaignAccessGroups campaignAccessGroups - * - * @return $this - */ - public function setCampaignAccessGroups($campaignAccessGroups) - { - $this->container['campaignAccessGroups'] = $campaignAccessGroups; - - 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 - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $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]); - } - - /** - * 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/RollbackIncreasedAchievementProgressEffectProps.php b/lib/Model/RollbackIncreasedAchievementProgressEffectProps.php new file mode 100644 index 00000000..13aacd70 --- /dev/null +++ b/lib/Model/RollbackIncreasedAchievementProgressEffectProps.php @@ -0,0 +1,477 @@ + 'int', + 'achievementName' => 'string', + 'progressTrackerId' => 'int', + 'decreaseProgressBy' => 'float', + 'currentProgress' => 'float', + 'target' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'achievementId' => null, + 'achievementName' => null, + 'progressTrackerId' => null, + 'decreaseProgressBy' => null, + 'currentProgress' => null, + 'target' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'achievementId' => 'achievementId', + 'achievementName' => 'achievementName', + 'progressTrackerId' => 'progressTrackerId', + 'decreaseProgressBy' => 'decreaseProgressBy', + 'currentProgress' => 'currentProgress', + 'target' => 'target' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'achievementId' => 'setAchievementId', + 'achievementName' => 'setAchievementName', + 'progressTrackerId' => 'setProgressTrackerId', + 'decreaseProgressBy' => 'setDecreaseProgressBy', + 'currentProgress' => 'setCurrentProgress', + 'target' => 'setTarget' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'achievementId' => 'getAchievementId', + 'achievementName' => 'getAchievementName', + 'progressTrackerId' => 'getProgressTrackerId', + 'decreaseProgressBy' => 'getDecreaseProgressBy', + 'currentProgress' => 'getCurrentProgress', + 'target' => 'getTarget' + ]; + + /** + * 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->container['achievementId'] = isset($data['achievementId']) ? $data['achievementId'] : null; + $this->container['achievementName'] = isset($data['achievementName']) ? $data['achievementName'] : null; + $this->container['progressTrackerId'] = isset($data['progressTrackerId']) ? $data['progressTrackerId'] : null; + $this->container['decreaseProgressBy'] = isset($data['decreaseProgressBy']) ? $data['decreaseProgressBy'] : null; + $this->container['currentProgress'] = isset($data['currentProgress']) ? $data['currentProgress'] : null; + $this->container['target'] = isset($data['target']) ? $data['target'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['achievementId'] === null) { + $invalidProperties[] = "'achievementId' can't be null"; + } + if ($this->container['achievementName'] === null) { + $invalidProperties[] = "'achievementName' can't be null"; + } + if ($this->container['progressTrackerId'] === null) { + $invalidProperties[] = "'progressTrackerId' can't be null"; + } + if ($this->container['decreaseProgressBy'] === null) { + $invalidProperties[] = "'decreaseProgressBy' can't be null"; + } + if ($this->container['currentProgress'] === null) { + $invalidProperties[] = "'currentProgress' can't be null"; + } + if ($this->container['target'] === null) { + $invalidProperties[] = "'target' 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 achievementId + * + * @return int + */ + public function getAchievementId() + { + return $this->container['achievementId']; + } + + /** + * Sets achievementId + * + * @param int $achievementId The internal ID of the achievement. + * + * @return $this + */ + public function setAchievementId($achievementId) + { + $this->container['achievementId'] = $achievementId; + + return $this; + } + + /** + * Gets achievementName + * + * @return string + */ + public function getAchievementName() + { + return $this->container['achievementName']; + } + + /** + * Sets achievementName + * + * @param string $achievementName The name of the achievement. + * + * @return $this + */ + public function setAchievementName($achievementName) + { + $this->container['achievementName'] = $achievementName; + + return $this; + } + + /** + * Gets progressTrackerId + * + * @return int + */ + public function getProgressTrackerId() + { + return $this->container['progressTrackerId']; + } + + /** + * Sets progressTrackerId + * + * @param int $progressTrackerId The internal ID of the achievement progress tracker. + * + * @return $this + */ + public function setProgressTrackerId($progressTrackerId) + { + $this->container['progressTrackerId'] = $progressTrackerId; + + return $this; + } + + /** + * Gets decreaseProgressBy + * + * @return float + */ + public function getDecreaseProgressBy() + { + return $this->container['decreaseProgressBy']; + } + + /** + * Sets decreaseProgressBy + * + * @param float $decreaseProgressBy The value by which the customer's current progress in the achievement is decreased. + * + * @return $this + */ + public function setDecreaseProgressBy($decreaseProgressBy) + { + $this->container['decreaseProgressBy'] = $decreaseProgressBy; + + return $this; + } + + /** + * Gets currentProgress + * + * @return float + */ + public function getCurrentProgress() + { + return $this->container['currentProgress']; + } + + /** + * Sets currentProgress + * + * @param float $currentProgress The current progress of the customer in the achievement. + * + * @return $this + */ + public function setCurrentProgress($currentProgress) + { + $this->container['currentProgress'] = $currentProgress; + + return $this; + } + + /** + * Gets target + * + * @return float + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param float $target The target value to complete the achievement. + * + * @return $this + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/RuleFailureReason.php b/lib/Model/RuleFailureReason.php index 782f35bb..c656e773 100644 --- a/lib/Model/RuleFailureReason.php +++ b/lib/Model/RuleFailureReason.php @@ -69,7 +69,9 @@ class RuleFailureReason implements ModelInterface, ArrayAccess 'ruleName' => 'string', 'conditionIndex' => 'int', 'effectIndex' => 'int', - 'details' => 'string' + 'details' => 'string', + 'evaluationGroupID' => 'int', + 'evaluationGroupMode' => 'string' ]; /** @@ -89,7 +91,9 @@ class RuleFailureReason implements ModelInterface, ArrayAccess 'ruleName' => null, 'conditionIndex' => null, 'effectIndex' => null, - 'details' => null + 'details' => null, + 'evaluationGroupID' => null, + 'evaluationGroupMode' => null ]; /** @@ -130,7 +134,9 @@ public static function openAPIFormats() 'ruleName' => 'ruleName', 'conditionIndex' => 'conditionIndex', 'effectIndex' => 'effectIndex', - 'details' => 'details' + 'details' => 'details', + 'evaluationGroupID' => 'evaluationGroupID', + 'evaluationGroupMode' => 'evaluationGroupMode' ]; /** @@ -150,7 +156,9 @@ public static function openAPIFormats() 'ruleName' => 'setRuleName', 'conditionIndex' => 'setConditionIndex', 'effectIndex' => 'setEffectIndex', - 'details' => 'setDetails' + 'details' => 'setDetails', + 'evaluationGroupID' => 'setEvaluationGroupID', + 'evaluationGroupMode' => 'setEvaluationGroupMode' ]; /** @@ -170,7 +178,9 @@ public static function openAPIFormats() 'ruleName' => 'getRuleName', 'conditionIndex' => 'getConditionIndex', 'effectIndex' => 'getEffectIndex', - 'details' => 'getDetails' + 'details' => 'getDetails', + 'evaluationGroupID' => 'getEvaluationGroupID', + 'evaluationGroupMode' => 'getEvaluationGroupMode' ]; /** @@ -245,6 +255,8 @@ public function __construct(array $data = null) $this->container['conditionIndex'] = isset($data['conditionIndex']) ? $data['conditionIndex'] : null; $this->container['effectIndex'] = isset($data['effectIndex']) ? $data['effectIndex'] : null; $this->container['details'] = isset($data['details']) ? $data['details'] : null; + $this->container['evaluationGroupID'] = isset($data['evaluationGroupID']) ? $data['evaluationGroupID'] : null; + $this->container['evaluationGroupMode'] = isset($data['evaluationGroupMode']) ? $data['evaluationGroupMode'] : null; } /** @@ -573,6 +585,54 @@ public function setDetails($details) return $this; } + + /** + * Gets evaluationGroupID + * + * @return int|null + */ + public function getEvaluationGroupID() + { + return $this->container['evaluationGroupID']; + } + + /** + * Sets evaluationGroupID + * + * @param int|null $evaluationGroupID The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation). + * + * @return $this + */ + public function setEvaluationGroupID($evaluationGroupID) + { + $this->container['evaluationGroupID'] = $evaluationGroupID; + + return $this; + } + + /** + * Gets evaluationGroupMode + * + * @return string|null + */ + public function getEvaluationGroupMode() + { + return $this->container['evaluationGroupMode']; + } + + /** + * Sets evaluationGroupMode + * + * @param string|null $evaluationGroupMode The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign- + * + * @return $this + */ + public function setEvaluationGroupMode($evaluationGroupMode) + { + $this->container['evaluationGroupMode'] = $evaluationGroupMode; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/SSOConfig.php b/lib/Model/SSOConfig.php index ee799390..1bbfa5c9 100644 --- a/lib/Model/SSOConfig.php +++ b/lib/Model/SSOConfig.php @@ -57,7 +57,8 @@ class SSOConfig implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'enforced' => 'bool' + 'enforced' => 'bool', + 'newAcsUrl' => 'string' ]; /** @@ -66,7 +67,8 @@ class SSOConfig implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'enforced' => null + 'enforced' => null, + 'newAcsUrl' => null ]; /** @@ -96,7 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'enforced' => 'enforced' + 'enforced' => 'enforced', + 'newAcsUrl' => 'newAcsUrl' ]; /** @@ -105,7 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'enforced' => 'setEnforced' + 'enforced' => 'setEnforced', + 'newAcsUrl' => 'setNewAcsUrl' ]; /** @@ -114,7 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'enforced' => 'getEnforced' + 'enforced' => 'getEnforced', + 'newAcsUrl' => 'getNewAcsUrl' ]; /** @@ -178,6 +183,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['enforced'] = isset($data['enforced']) ? $data['enforced'] : null; + $this->container['newAcsUrl'] = isset($data['newAcsUrl']) ? $data['newAcsUrl'] : null; } /** @@ -230,6 +236,30 @@ public function setEnforced($enforced) return $this; } + + /** + * Gets newAcsUrl + * + * @return string|null + */ + public function getNewAcsUrl() + { + return $this->container['newAcsUrl']; + } + + /** + * Sets newAcsUrl + * + * @param string|null $newAcsUrl Assertion Consumer Service (ACS) URL for setting up a new SAML connection with an identity provider like Okta or Microsoft Entra ID. + * + * @return $this + */ + public function setNewAcsUrl($newAcsUrl) + { + $this->container['newAcsUrl'] = $newAcsUrl; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/NewCampaignSetV2.php b/lib/Model/ScimBaseUser.php similarity index 70% rename from lib/Model/NewCampaignSetV2.php rename to lib/Model/ScimBaseUser.php index 651263ab..f8230a77 100644 --- a/lib/Model/NewCampaignSetV2.php +++ b/lib/Model/ScimBaseUser.php @@ -1,6 +1,6 @@ 'int', - 'version' => 'int', - 'set' => '\TalonOne\Client\Model\CampaignPrioritiesV2' + 'active' => 'bool', + 'displayName' => 'string', + 'userName' => 'string', + 'name' => '\TalonOne\Client\Model\ScimBaseUserName' ]; /** @@ -69,9 +70,10 @@ class NewCampaignSetV2 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'applicationId' => null, - 'version' => null, - 'set' => null + 'active' => null, + 'displayName' => null, + 'userName' => null, + 'name' => null ]; /** @@ -101,9 +103,10 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'applicationId' => 'applicationId', - 'version' => 'version', - 'set' => 'set' + 'active' => 'active', + 'displayName' => 'displayName', + 'userName' => 'userName', + 'name' => 'name' ]; /** @@ -112,9 +115,10 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'applicationId' => 'setApplicationId', - 'version' => 'setVersion', - 'set' => 'setSet' + 'active' => 'setActive', + 'displayName' => 'setDisplayName', + 'userName' => 'setUserName', + 'name' => 'setName' ]; /** @@ -123,9 +127,10 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'applicationId' => 'getApplicationId', - 'version' => 'getVersion', - 'set' => 'getSet' + 'active' => 'getActive', + 'displayName' => 'getDisplayName', + 'userName' => 'getUserName', + 'name' => 'getName' ]; /** @@ -188,9 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : null; - $this->container['set'] = isset($data['set']) ? $data['set'] : null; + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + $this->container['displayName'] = isset($data['displayName']) ? $data['displayName'] : null; + $this->container['userName'] = isset($data['userName']) ? $data['userName'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** @@ -202,19 +208,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['applicationId'] === null) { - $invalidProperties[] = "'applicationId' can't be null"; - } - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' can't be null"; - } - if (($this->container['version'] < 1)) { - $invalidProperties[] = "invalid value for 'version', must be bigger than or equal to 1."; - } - - if ($this->container['set'] === null) { - $invalidProperties[] = "'set' can't be null"; - } return $invalidProperties; } @@ -231,78 +224,97 @@ public function valid() /** - * Gets applicationId + * Gets active * - * @return int + * @return bool|null */ - public function getApplicationId() + public function getActive() { - return $this->container['applicationId']; + return $this->container['active']; } /** - * Sets applicationId + * Sets active * - * @param int $applicationId The ID of the application that owns this entity. + * @param bool|null $active Status of the user. * * @return $this */ - public function setApplicationId($applicationId) + public function setActive($active) { - $this->container['applicationId'] = $applicationId; + $this->container['active'] = $active; return $this; } /** - * Gets version + * Gets displayName * - * @return int + * @return string|null */ - public function getVersion() + public function getDisplayName() { - return $this->container['version']; + return $this->container['displayName']; } /** - * Sets version + * Sets displayName * - * @param int $version Version of the campaign set. + * @param string|null $displayName Display name of the user. * * @return $this */ - public function setVersion($version) + public function setDisplayName($displayName) { + $this->container['displayName'] = $displayName; - if (($version < 1)) { - throw new \InvalidArgumentException('invalid value for $version when calling NewCampaignSetV2., must be bigger than or equal to 1.'); - } + return $this; + } + + /** + * Gets userName + * + * @return string|null + */ + public function getUserName() + { + return $this->container['userName']; + } - $this->container['version'] = $version; + /** + * Sets userName + * + * @param string|null $userName Unique identifier of the user. This is usually an email address. + * + * @return $this + */ + public function setUserName($userName) + { + $this->container['userName'] = $userName; return $this; } /** - * Gets set + * Gets name * - * @return \TalonOne\Client\Model\CampaignPrioritiesV2 + * @return \TalonOne\Client\Model\ScimBaseUserName|null */ - public function getSet() + public function getName() { - return $this->container['set']; + return $this->container['name']; } /** - * Sets set + * Sets name * - * @param \TalonOne\Client\Model\CampaignPrioritiesV2 $set set + * @param \TalonOne\Client\Model\ScimBaseUserName|null $name name * * @return $this */ - public function setSet($set) + public function setName($name) { - $this->container['set'] = $set; + $this->container['name'] = $name; return $this; } diff --git a/lib/Model/ScimBaseUserName.php b/lib/Model/ScimBaseUserName.php new file mode 100644 index 00000000..5cf8599b --- /dev/null +++ b/lib/Model/ScimBaseUserName.php @@ -0,0 +1,309 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'formatted' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'formatted' => 'formatted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'formatted' => 'setFormatted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'formatted' => 'getFormatted' + ]; + + /** + * 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->container['formatted'] = isset($data['formatted']) ? $data['formatted'] : null; + } + + /** + * 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 formatted + * + * @return string|null + */ + public function getFormatted() + { + return $this->container['formatted']; + } + + /** + * Sets formatted + * + * @param string|null $formatted The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. + * + * @return $this + */ + public function setFormatted($formatted) + { + $this->container['formatted'] = $formatted; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/CampaignPrioritiesChangedNotification.php b/lib/Model/ScimNewUser.php similarity index 70% rename from lib/Model/CampaignPrioritiesChangedNotification.php rename to lib/Model/ScimNewUser.php index b5115490..794a9533 100644 --- a/lib/Model/CampaignPrioritiesChangedNotification.php +++ b/lib/Model/ScimNewUser.php @@ -1,6 +1,6 @@ 'int', - 'oldPriorities' => '\TalonOne\Client\Model\CampaignSet', - 'priorities' => '\TalonOne\Client\Model\CampaignSet' + 'active' => 'bool', + 'displayName' => 'string', + 'userName' => 'string', + 'name' => '\TalonOne\Client\Model\ScimBaseUserName' ]; /** @@ -69,9 +70,10 @@ class CampaignPrioritiesChangedNotification implements ModelInterface, ArrayAcce * @var string[] */ protected static $openAPIFormats = [ - 'applicationId' => null, - 'oldPriorities' => null, - 'priorities' => null + 'active' => null, + 'displayName' => null, + 'userName' => null, + 'name' => null ]; /** @@ -101,9 +103,10 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'applicationId' => 'applicationId', - 'oldPriorities' => 'oldPriorities', - 'priorities' => 'priorities' + 'active' => 'active', + 'displayName' => 'displayName', + 'userName' => 'userName', + 'name' => 'name' ]; /** @@ -112,9 +115,10 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'applicationId' => 'setApplicationId', - 'oldPriorities' => 'setOldPriorities', - 'priorities' => 'setPriorities' + 'active' => 'setActive', + 'displayName' => 'setDisplayName', + 'userName' => 'setUserName', + 'name' => 'setName' ]; /** @@ -123,9 +127,10 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'applicationId' => 'getApplicationId', - 'oldPriorities' => 'getOldPriorities', - 'priorities' => 'getPriorities' + 'active' => 'getActive', + 'displayName' => 'getDisplayName', + 'userName' => 'getUserName', + 'name' => 'getName' ]; /** @@ -188,9 +193,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; - $this->container['oldPriorities'] = isset($data['oldPriorities']) ? $data['oldPriorities'] : null; - $this->container['priorities'] = isset($data['priorities']) ? $data['priorities'] : null; + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + $this->container['displayName'] = isset($data['displayName']) ? $data['displayName'] : null; + $this->container['userName'] = isset($data['userName']) ? $data['userName'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** @@ -202,12 +208,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['applicationId'] === null) { - $invalidProperties[] = "'applicationId' can't be null"; - } - if ($this->container['priorities'] === null) { - $invalidProperties[] = "'priorities' can't be null"; - } return $invalidProperties; } @@ -224,73 +224,97 @@ public function valid() /** - * Gets applicationId + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Status of the user. + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets displayName * - * @return int + * @return string|null */ - public function getApplicationId() + public function getDisplayName() { - return $this->container['applicationId']; + return $this->container['displayName']; } /** - * Sets applicationId + * Sets displayName * - * @param int $applicationId The ID of the Application whose campaigns' priorities changed. + * @param string|null $displayName Display name of the user. * * @return $this */ - public function setApplicationId($applicationId) + public function setDisplayName($displayName) { - $this->container['applicationId'] = $applicationId; + $this->container['displayName'] = $displayName; return $this; } /** - * Gets oldPriorities + * Gets userName * - * @return \TalonOne\Client\Model\CampaignSet|null + * @return string|null */ - public function getOldPriorities() + public function getUserName() { - return $this->container['oldPriorities']; + return $this->container['userName']; } /** - * Sets oldPriorities + * Sets userName * - * @param \TalonOne\Client\Model\CampaignSet|null $oldPriorities oldPriorities + * @param string|null $userName Unique identifier of the user. This is usually an email address. * * @return $this */ - public function setOldPriorities($oldPriorities) + public function setUserName($userName) { - $this->container['oldPriorities'] = $oldPriorities; + $this->container['userName'] = $userName; return $this; } /** - * Gets priorities + * Gets name * - * @return \TalonOne\Client\Model\CampaignSet + * @return \TalonOne\Client\Model\ScimBaseUserName|null */ - public function getPriorities() + public function getName() { - return $this->container['priorities']; + return $this->container['name']; } /** - * Sets priorities + * Sets name * - * @param \TalonOne\Client\Model\CampaignSet $priorities priorities + * @param \TalonOne\Client\Model\ScimBaseUserName|null $name name * * @return $this */ - public function setPriorities($priorities) + public function setName($name) { - $this->container['priorities'] = $priorities; + $this->container['name'] = $name; return $this; } diff --git a/lib/Model/ScimPatchOperation.php b/lib/Model/ScimPatchOperation.php new file mode 100644 index 00000000..e470dfe6 --- /dev/null +++ b/lib/Model/ScimPatchOperation.php @@ -0,0 +1,406 @@ + 'string', + 'path' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'op' => null, + 'path' => null, + 'value' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'op' => 'op', + 'path' => 'path', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'op' => 'setOp', + 'path' => 'setPath', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'op' => 'getOp', + 'path' => 'getPath', + '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; + } + + const OP_ADD = 'add'; + const OP_REMOVE = 'remove'; + const OP_REPLACE = 'replace'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOpAllowableValues() + { + return [ + self::OP_ADD, + self::OP_REMOVE, + self::OP_REPLACE, + ]; + } + + + /** + * 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->container['op'] = isset($data['op']) ? $data['op'] : null; + $this->container['path'] = isset($data['path']) ? $data['path'] : null; + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['op'] === null) { + $invalidProperties[] = "'op' can't be null"; + } + $allowedValues = $this->getOpAllowableValues(); + if (!is_null($this->container['op']) && !in_array($this->container['op'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'op', must be one of '%s'", + 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 op + * + * @return string + */ + public function getOp() + { + return $this->container['op']; + } + + /** + * Sets op + * + * @param string $op The method that should be used in the operation. + * + * @return $this + */ + public function setOp($op) + { + $allowedValues = $this->getOpAllowableValues(); + if (!in_array($op, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'op', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['op'] = $op; + + return $this; + } + + /** + * Gets path + * + * @return string|null + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string|null $path The path specifying the attribute that should be updated. + * + * @return $this + */ + public function setPath($path) + { + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value that should be updated. Required if `op` is `add` or `replace`. + * + * @return $this + */ + public function setValue($value) + { + $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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/AccountDashboardStatisticApiCalls.php b/lib/Model/ScimPatchRequest.php similarity index 80% rename from lib/Model/AccountDashboardStatisticApiCalls.php rename to lib/Model/ScimPatchRequest.php index 3442e041..426a6fd2 100644 --- a/lib/Model/AccountDashboardStatisticApiCalls.php +++ b/lib/Model/ScimPatchRequest.php @@ -1,6 +1,6 @@ 'float', - 'datetime' => '\DateTime' + 'schemas' => 'string[]', + 'operations' => '\TalonOne\Client\Model\ScimPatchOperation[]' ]; /** @@ -67,8 +68,8 @@ class AccountDashboardStatisticApiCalls implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'total' => null, - 'datetime' => 'date-time' + 'schemas' => null, + 'operations' => null ]; /** @@ -98,8 +99,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', - 'datetime' => 'datetime' + 'schemas' => 'schemas', + 'operations' => 'Operations' ]; /** @@ -108,8 +109,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', - 'datetime' => 'setDatetime' + 'schemas' => 'setSchemas', + 'operations' => 'setOperations' ]; /** @@ -118,8 +119,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', - 'datetime' => 'getDatetime' + 'schemas' => 'getSchemas', + 'operations' => 'getOperations' ]; /** @@ -182,8 +183,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['datetime'] = isset($data['datetime']) ? $data['datetime'] : null; + $this->container['schemas'] = isset($data['schemas']) ? $data['schemas'] : null; + $this->container['operations'] = isset($data['operations']) ? $data['operations'] : null; } /** @@ -195,11 +196,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' can't be null"; - } - if ($this->container['datetime'] === null) { - $invalidProperties[] = "'datetime' can't be null"; + if ($this->container['operations'] === null) { + $invalidProperties[] = "'operations' can't be null"; } return $invalidProperties; } @@ -217,49 +215,49 @@ public function valid() /** - * Gets total + * Gets schemas * - * @return float + * @return string[]|null */ - public function getTotal() + public function getSchemas() { - return $this->container['total']; + return $this->container['schemas']; } /** - * Sets total + * Sets schemas * - * @param float $total Total number of API calls received. + * @param string[]|null $schemas SCIM schema for the given resource. * * @return $this */ - public function setTotal($total) + public function setSchemas($schemas) { - $this->container['total'] = $total; + $this->container['schemas'] = $schemas; return $this; } /** - * Gets datetime + * Gets operations * - * @return \DateTime + * @return \TalonOne\Client\Model\ScimPatchOperation[] */ - public function getDatetime() + public function getOperations() { - return $this->container['datetime']; + return $this->container['operations']; } /** - * Sets datetime + * Sets operations * - * @param \DateTime $datetime Values aggregated for the specified date. + * @param \TalonOne\Client\Model\ScimPatchOperation[] $operations operations * * @return $this */ - public function setDatetime($datetime) + public function setOperations($operations) { - $this->container['datetime'] = $datetime; + $this->container['operations'] = $operations; return $this; } diff --git a/lib/Model/ScimResource.php b/lib/Model/ScimResource.php new file mode 100644 index 00000000..5fa2595d --- /dev/null +++ b/lib/Model/ScimResource.php @@ -0,0 +1,369 @@ + 'string', + 'name' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'description' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'description' => 'getDescription' + ]; + + /** + * 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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + } + + /** + * 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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id ID of the resource. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the resource. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Human-readable description of the resource. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ScimResourceTypesListResponse.php b/lib/Model/ScimResourceTypesListResponse.php new file mode 100644 index 00000000..ba36cfe2 --- /dev/null +++ b/lib/Model/ScimResourceTypesListResponse.php @@ -0,0 +1,312 @@ + '\TalonOne\Client\Model\ScimResource[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'resources' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'resources' => 'Resources' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'resources' => 'setResources' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'resources' => 'getResources' + ]; + + /** + * 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->container['resources'] = isset($data['resources']) ? $data['resources'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['resources'] === null) { + $invalidProperties[] = "'resources' 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 resources + * + * @return \TalonOne\Client\Model\ScimResource[] + */ + public function getResources() + { + return $this->container['resources']; + } + + /** + * Sets resources + * + * @param \TalonOne\Client\Model\ScimResource[] $resources resources + * + * @return $this + */ + public function setResources($resources) + { + $this->container['resources'] = $resources; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ScimSchemaResource.php b/lib/Model/ScimSchemaResource.php new file mode 100644 index 00000000..faa7c82d --- /dev/null +++ b/lib/Model/ScimSchemaResource.php @@ -0,0 +1,399 @@ + 'string', + 'name' => 'string', + 'description' => 'string', + 'attributes' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'description' => null, + 'attributes' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'description' => 'description', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'description' => 'setDescription', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'description' => 'getDescription', + '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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + } + + /** + * 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 id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id ID of the resource. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the resource. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Human-readable description of the schema resource. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets attributes + * + * @return object[]|null + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object[]|null $attributes attributes + * + * @return $this + */ + public function setAttributes($attributes) + { + $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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ApplicationCampaignAnalyticsSessionsCount.php b/lib/Model/ScimSchemasListResponse.php similarity index 74% rename from lib/Model/ApplicationCampaignAnalyticsSessionsCount.php rename to lib/Model/ScimSchemasListResponse.php index a816a5ef..a46e4648 100644 --- a/lib/Model/ApplicationCampaignAnalyticsSessionsCount.php +++ b/lib/Model/ScimSchemasListResponse.php @@ -1,6 +1,6 @@ 'float', - 'influenceRate' => 'float', - 'trend' => 'float' + 'resources' => '\TalonOne\Client\Model\ScimSchemaResource[]', + 'schemas' => 'string[]', + 'totalResults' => 'int' ]; /** @@ -69,9 +69,9 @@ class ApplicationCampaignAnalyticsSessionsCount implements ModelInterface, Array * @var string[] */ protected static $openAPIFormats = [ - 'value' => null, - 'influenceRate' => null, - 'trend' => null + 'resources' => null, + 'schemas' => null, + 'totalResults' => null ]; /** @@ -101,9 +101,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'value' => 'value', - 'influenceRate' => 'influence_rate', - 'trend' => 'trend' + 'resources' => 'Resources', + 'schemas' => 'schemas', + 'totalResults' => 'totalResults' ]; /** @@ -112,9 +112,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'value' => 'setValue', - 'influenceRate' => 'setInfluenceRate', - 'trend' => 'setTrend' + 'resources' => 'setResources', + 'schemas' => 'setSchemas', + 'totalResults' => 'setTotalResults' ]; /** @@ -123,9 +123,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'value' => 'getValue', - 'influenceRate' => 'getInfluenceRate', - 'trend' => 'getTrend' + 'resources' => 'getResources', + 'schemas' => 'getSchemas', + 'totalResults' => 'getTotalResults' ]; /** @@ -188,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['influenceRate'] = isset($data['influenceRate']) ? $data['influenceRate'] : null; - $this->container['trend'] = isset($data['trend']) ? $data['trend'] : null; + $this->container['resources'] = isset($data['resources']) ? $data['resources'] : null; + $this->container['schemas'] = isset($data['schemas']) ? $data['schemas'] : null; + $this->container['totalResults'] = isset($data['totalResults']) ? $data['totalResults'] : null; } /** @@ -202,6 +202,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['resources'] === null) { + $invalidProperties[] = "'resources' can't be null"; + } return $invalidProperties; } @@ -218,73 +221,73 @@ public function valid() /** - * Gets value + * Gets resources * - * @return float|null + * @return \TalonOne\Client\Model\ScimSchemaResource[] */ - public function getValue() + public function getResources() { - return $this->container['value']; + return $this->container['resources']; } /** - * Sets value + * Sets resources * - * @param float|null $value value + * @param \TalonOne\Client\Model\ScimSchemaResource[] $resources resources * * @return $this */ - public function setValue($value) + public function setResources($resources) { - $this->container['value'] = $value; + $this->container['resources'] = $resources; return $this; } /** - * Gets influenceRate + * Gets schemas * - * @return float|null + * @return string[]|null */ - public function getInfluenceRate() + public function getSchemas() { - return $this->container['influenceRate']; + return $this->container['schemas']; } /** - * Sets influenceRate + * Sets schemas * - * @param float|null $influenceRate influenceRate + * @param string[]|null $schemas SCIM schema for the given resource. * * @return $this */ - public function setInfluenceRate($influenceRate) + public function setSchemas($schemas) { - $this->container['influenceRate'] = $influenceRate; + $this->container['schemas'] = $schemas; return $this; } /** - * Gets trend + * Gets totalResults * - * @return float|null + * @return int|null */ - public function getTrend() + public function getTotalResults() { - return $this->container['trend']; + return $this->container['totalResults']; } /** - * Sets trend + * Sets totalResults * - * @param float|null $trend trend + * @param int|null $totalResults Number of total results in the response. * * @return $this */ - public function setTrend($trend) + public function setTotalResults($totalResults) { - $this->container['trend'] = $trend; + $this->container['totalResults'] = $totalResults; return $this; } diff --git a/lib/Model/ScimServiceProviderConfigResponse.php b/lib/Model/ScimServiceProviderConfigResponse.php new file mode 100644 index 00000000..0d4f1d51 --- /dev/null +++ b/lib/Model/ScimServiceProviderConfigResponse.php @@ -0,0 +1,459 @@ + '\TalonOne\Client\Model\ScimServiceProviderConfigResponseBulk', + 'changePassword' => '\TalonOne\Client\Model\ScimServiceProviderConfigResponseChangePassword', + 'documentationUri' => 'string', + 'filter' => '\TalonOne\Client\Model\ScimServiceProviderConfigResponseFilter', + 'patch' => '\TalonOne\Client\Model\ScimServiceProviderConfigResponsePatch', + 'schemas' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'bulk' => null, + 'changePassword' => null, + 'documentationUri' => null, + 'filter' => null, + 'patch' => null, + 'schemas' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bulk' => 'bulk', + 'changePassword' => 'changePassword', + 'documentationUri' => 'documentationUri', + 'filter' => 'filter', + 'patch' => 'patch', + 'schemas' => 'schemas' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bulk' => 'setBulk', + 'changePassword' => 'setChangePassword', + 'documentationUri' => 'setDocumentationUri', + 'filter' => 'setFilter', + 'patch' => 'setPatch', + 'schemas' => 'setSchemas' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bulk' => 'getBulk', + 'changePassword' => 'getChangePassword', + 'documentationUri' => 'getDocumentationUri', + 'filter' => 'getFilter', + 'patch' => 'getPatch', + 'schemas' => 'getSchemas' + ]; + + /** + * 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->container['bulk'] = isset($data['bulk']) ? $data['bulk'] : null; + $this->container['changePassword'] = isset($data['changePassword']) ? $data['changePassword'] : null; + $this->container['documentationUri'] = isset($data['documentationUri']) ? $data['documentationUri'] : null; + $this->container['filter'] = isset($data['filter']) ? $data['filter'] : null; + $this->container['patch'] = isset($data['patch']) ? $data['patch'] : null; + $this->container['schemas'] = isset($data['schemas']) ? $data['schemas'] : null; + } + + /** + * 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 bulk + * + * @return \TalonOne\Client\Model\ScimServiceProviderConfigResponseBulk|null + */ + public function getBulk() + { + return $this->container['bulk']; + } + + /** + * Sets bulk + * + * @param \TalonOne\Client\Model\ScimServiceProviderConfigResponseBulk|null $bulk bulk + * + * @return $this + */ + public function setBulk($bulk) + { + $this->container['bulk'] = $bulk; + + return $this; + } + + /** + * Gets changePassword + * + * @return \TalonOne\Client\Model\ScimServiceProviderConfigResponseChangePassword|null + */ + public function getChangePassword() + { + return $this->container['changePassword']; + } + + /** + * Sets changePassword + * + * @param \TalonOne\Client\Model\ScimServiceProviderConfigResponseChangePassword|null $changePassword changePassword + * + * @return $this + */ + public function setChangePassword($changePassword) + { + $this->container['changePassword'] = $changePassword; + + return $this; + } + + /** + * Gets documentationUri + * + * @return string|null + */ + public function getDocumentationUri() + { + return $this->container['documentationUri']; + } + + /** + * Sets documentationUri + * + * @param string|null $documentationUri The URI that points to the SCIM service provider's documentation, providing further details about the service's capabilities and usage. + * + * @return $this + */ + public function setDocumentationUri($documentationUri) + { + $this->container['documentationUri'] = $documentationUri; + + return $this; + } + + /** + * Gets filter + * + * @return \TalonOne\Client\Model\ScimServiceProviderConfigResponseFilter|null + */ + public function getFilter() + { + return $this->container['filter']; + } + + /** + * Sets filter + * + * @param \TalonOne\Client\Model\ScimServiceProviderConfigResponseFilter|null $filter filter + * + * @return $this + */ + public function setFilter($filter) + { + $this->container['filter'] = $filter; + + return $this; + } + + /** + * Gets patch + * + * @return \TalonOne\Client\Model\ScimServiceProviderConfigResponsePatch|null + */ + public function getPatch() + { + return $this->container['patch']; + } + + /** + * Sets patch + * + * @param \TalonOne\Client\Model\ScimServiceProviderConfigResponsePatch|null $patch patch + * + * @return $this + */ + public function setPatch($patch) + { + $this->container['patch'] = $patch; + + return $this; + } + + /** + * Gets schemas + * + * @return string[]|null + */ + public function getSchemas() + { + return $this->container['schemas']; + } + + /** + * Sets schemas + * + * @param string[]|null $schemas A list of SCIM schemas that define the structure and data types supported by the service provider. + * + * @return $this + */ + public function setSchemas($schemas) + { + $this->container['schemas'] = $schemas; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/CampaignPrioritiesV2.php b/lib/Model/ScimServiceProviderConfigResponseBulk.php similarity index 72% rename from lib/Model/CampaignPrioritiesV2.php rename to lib/Model/ScimServiceProviderConfigResponseBulk.php index 3ef31c1f..26a9a8c9 100644 --- a/lib/Model/CampaignPrioritiesV2.php +++ b/lib/Model/ScimServiceProviderConfigResponseBulk.php @@ -1,6 +1,6 @@ '\TalonOne\Client\Model\CampaignSetIDs[]', - 'stackable' => '\TalonOne\Client\Model\CampaignSetIDs[]', - 'universal' => '\TalonOne\Client\Model\CampaignSetIDs[]' + 'maxOperations' => 'int', + 'maxPayloadSize' => 'int', + 'supported' => 'bool' ]; /** @@ -68,9 +69,9 @@ class CampaignPrioritiesV2 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'exclusive' => null, - 'stackable' => null, - 'universal' => null + 'maxOperations' => null, + 'maxPayloadSize' => null, + 'supported' => null ]; /** @@ -100,9 +101,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'exclusive' => 'exclusive', - 'stackable' => 'stackable', - 'universal' => 'universal' + 'maxOperations' => 'maxOperations', + 'maxPayloadSize' => 'maxPayloadSize', + 'supported' => 'supported' ]; /** @@ -111,9 +112,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'exclusive' => 'setExclusive', - 'stackable' => 'setStackable', - 'universal' => 'setUniversal' + 'maxOperations' => 'setMaxOperations', + 'maxPayloadSize' => 'setMaxPayloadSize', + 'supported' => 'setSupported' ]; /** @@ -122,9 +123,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'exclusive' => 'getExclusive', - 'stackable' => 'getStackable', - 'universal' => 'getUniversal' + 'maxOperations' => 'getMaxOperations', + 'maxPayloadSize' => 'getMaxPayloadSize', + 'supported' => 'getSupported' ]; /** @@ -187,9 +188,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['exclusive'] = isset($data['exclusive']) ? $data['exclusive'] : null; - $this->container['stackable'] = isset($data['stackable']) ? $data['stackable'] : null; - $this->container['universal'] = isset($data['universal']) ? $data['universal'] : null; + $this->container['maxOperations'] = isset($data['maxOperations']) ? $data['maxOperations'] : null; + $this->container['maxPayloadSize'] = isset($data['maxPayloadSize']) ? $data['maxPayloadSize'] : null; + $this->container['supported'] = isset($data['supported']) ? $data['supported'] : null; } /** @@ -217,73 +218,73 @@ public function valid() /** - * Gets exclusive + * Gets maxOperations * - * @return \TalonOne\Client\Model\CampaignSetIDs[]|null + * @return int|null */ - public function getExclusive() + public function getMaxOperations() { - return $this->container['exclusive']; + return $this->container['maxOperations']; } /** - * Sets exclusive + * Sets maxOperations * - * @param \TalonOne\Client\Model\CampaignSetIDs[]|null $exclusive exclusive + * @param int|null $maxOperations The maximum number of individual operations that can be included in a single bulk request. * * @return $this */ - public function setExclusive($exclusive) + public function setMaxOperations($maxOperations) { - $this->container['exclusive'] = $exclusive; + $this->container['maxOperations'] = $maxOperations; return $this; } /** - * Gets stackable + * Gets maxPayloadSize * - * @return \TalonOne\Client\Model\CampaignSetIDs[]|null + * @return int|null */ - public function getStackable() + public function getMaxPayloadSize() { - return $this->container['stackable']; + return $this->container['maxPayloadSize']; } /** - * Sets stackable + * Sets maxPayloadSize * - * @param \TalonOne\Client\Model\CampaignSetIDs[]|null $stackable stackable + * @param int|null $maxPayloadSize The maximum size, in bytes, of the entire payload for a bulk operation request. * * @return $this */ - public function setStackable($stackable) + public function setMaxPayloadSize($maxPayloadSize) { - $this->container['stackable'] = $stackable; + $this->container['maxPayloadSize'] = $maxPayloadSize; return $this; } /** - * Gets universal + * Gets supported * - * @return \TalonOne\Client\Model\CampaignSetIDs[]|null + * @return bool|null */ - public function getUniversal() + public function getSupported() { - return $this->container['universal']; + return $this->container['supported']; } /** - * Sets universal + * Sets supported * - * @param \TalonOne\Client\Model\CampaignSetIDs[]|null $universal universal + * @param bool|null $supported Indicates whether the SCIM service provider supports bulk operations. * * @return $this */ - public function setUniversal($universal) + public function setSupported($supported) { - $this->container['universal'] = $universal; + $this->container['supported'] = $supported; return $this; } diff --git a/lib/Model/ScimServiceProviderConfigResponseChangePassword.php b/lib/Model/ScimServiceProviderConfigResponseChangePassword.php new file mode 100644 index 00000000..6b37ad55 --- /dev/null +++ b/lib/Model/ScimServiceProviderConfigResponseChangePassword.php @@ -0,0 +1,309 @@ + 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'supported' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'supported' => 'supported' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'supported' => 'setSupported' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'supported' => 'getSupported' + ]; + + /** + * 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->container['supported'] = isset($data['supported']) ? $data['supported'] : null; + } + + /** + * 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 supported + * + * @return bool|null + */ + public function getSupported() + { + return $this->container['supported']; + } + + /** + * Sets supported + * + * @param bool|null $supported Indicates whether the service provider supports password changes via the SCIM API. + * + * @return $this + */ + public function setSupported($supported) + { + $this->container['supported'] = $supported; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ScimServiceProviderConfigResponseFilter.php b/lib/Model/ScimServiceProviderConfigResponseFilter.php new file mode 100644 index 00000000..aa413894 --- /dev/null +++ b/lib/Model/ScimServiceProviderConfigResponseFilter.php @@ -0,0 +1,339 @@ + 'int', + 'supported' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'maxResults' => null, + 'supported' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'maxResults' => 'maxResults', + 'supported' => 'supported' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'maxResults' => 'setMaxResults', + 'supported' => 'setSupported' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'maxResults' => 'getMaxResults', + 'supported' => 'getSupported' + ]; + + /** + * 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->container['maxResults'] = isset($data['maxResults']) ? $data['maxResults'] : null; + $this->container['supported'] = isset($data['supported']) ? $data['supported'] : null; + } + + /** + * 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 maxResults + * + * @return int|null + */ + public function getMaxResults() + { + return $this->container['maxResults']; + } + + /** + * Sets maxResults + * + * @param int|null $maxResults The maximum number of resources that can be returned in a single filtered query response. + * + * @return $this + */ + public function setMaxResults($maxResults) + { + $this->container['maxResults'] = $maxResults; + + return $this; + } + + /** + * Gets supported + * + * @return bool|null + */ + public function getSupported() + { + return $this->container['supported']; + } + + /** + * Sets supported + * + * @param bool|null $supported Indicates whether the SCIM service provider supports filtering operations. + * + * @return $this + */ + public function setSupported($supported) + { + $this->container['supported'] = $supported; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ScimServiceProviderConfigResponsePatch.php b/lib/Model/ScimServiceProviderConfigResponsePatch.php new file mode 100644 index 00000000..8165acef --- /dev/null +++ b/lib/Model/ScimServiceProviderConfigResponsePatch.php @@ -0,0 +1,309 @@ + 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'supported' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'supported' => 'supported' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'supported' => 'setSupported' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'supported' => 'getSupported' + ]; + + /** + * 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->container['supported'] = isset($data['supported']) ? $data['supported'] : null; + } + + /** + * 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 supported + * + * @return bool|null + */ + public function getSupported() + { + return $this->container['supported']; + } + + /** + * Sets supported + * + * @param bool|null $supported Indicates whether the service provider supports patch operations for modifying resources. + * + * @return $this + */ + public function setSupported($supported) + { + $this->container['supported'] = $supported; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ScimUser.php b/lib/Model/ScimUser.php new file mode 100644 index 00000000..bdccbf97 --- /dev/null +++ b/lib/Model/ScimUser.php @@ -0,0 +1,432 @@ + 'bool', + 'displayName' => 'string', + 'userName' => 'string', + 'name' => '\TalonOne\Client\Model\ScimBaseUserName', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'active' => null, + 'displayName' => null, + 'userName' => null, + 'name' => null, + 'id' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'displayName' => 'displayName', + 'userName' => 'userName', + 'name' => 'name', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'displayName' => 'setDisplayName', + 'userName' => 'setUserName', + 'name' => 'setName', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'displayName' => 'getDisplayName', + 'userName' => 'getUserName', + 'name' => 'getName', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + $this->container['displayName'] = isset($data['displayName']) ? $data['displayName'] : null; + $this->container['userName'] = isset($data['userName']) ? $data['userName'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Status of the user. + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets displayName + * + * @return string|null + */ + public function getDisplayName() + { + return $this->container['displayName']; + } + + /** + * Sets displayName + * + * @param string|null $displayName Display name of the user. + * + * @return $this + */ + public function setDisplayName($displayName) + { + $this->container['displayName'] = $displayName; + + return $this; + } + + /** + * Gets userName + * + * @return string|null + */ + public function getUserName() + { + return $this->container['userName']; + } + + /** + * Sets userName + * + * @param string|null $userName Unique identifier of the user. This is usually an email address. + * + * @return $this + */ + public function setUserName($userName) + { + $this->container['userName'] = $userName; + + return $this; + } + + /** + * Gets name + * + * @return \TalonOne\Client\Model\ScimBaseUserName|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \TalonOne\Client\Model\ScimBaseUserName|null $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id ID of the user. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/ScimUsersListResponse.php b/lib/Model/ScimUsersListResponse.php new file mode 100644 index 00000000..479f587b --- /dev/null +++ b/lib/Model/ScimUsersListResponse.php @@ -0,0 +1,372 @@ + '\TalonOne\Client\Model\ScimUser[]', + 'schemas' => 'string[]', + 'totalResults' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'resources' => null, + 'schemas' => null, + 'totalResults' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'resources' => 'Resources', + 'schemas' => 'schemas', + 'totalResults' => 'totalResults' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'resources' => 'setResources', + 'schemas' => 'setSchemas', + 'totalResults' => 'setTotalResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'resources' => 'getResources', + 'schemas' => 'getSchemas', + 'totalResults' => 'getTotalResults' + ]; + + /** + * 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->container['resources'] = isset($data['resources']) ? $data['resources'] : null; + $this->container['schemas'] = isset($data['schemas']) ? $data['schemas'] : null; + $this->container['totalResults'] = isset($data['totalResults']) ? $data['totalResults'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['resources'] === null) { + $invalidProperties[] = "'resources' 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 resources + * + * @return \TalonOne\Client\Model\ScimUser[] + */ + public function getResources() + { + return $this->container['resources']; + } + + /** + * Sets resources + * + * @param \TalonOne\Client\Model\ScimUser[] $resources resources + * + * @return $this + */ + public function setResources($resources) + { + $this->container['resources'] = $resources; + + return $this; + } + + /** + * Gets schemas + * + * @return string[]|null + */ + public function getSchemas() + { + return $this->container['schemas']; + } + + /** + * Sets schemas + * + * @param string[]|null $schemas SCIM schema for the given resource. + * + * @return $this + */ + public function setSchemas($schemas) + { + $this->container['schemas'] = $schemas; + + return $this; + } + + /** + * Gets totalResults + * + * @return int|null + */ + public function getTotalResults() + { + return $this->container['totalResults']; + } + + /** + * Sets totalResults + * + * @param int|null $totalResults Number of total results in the response. + * + * @return $this + */ + public function setTotalResults($totalResults) + { + $this->container['totalResults'] = $totalResults; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/Tier.php b/lib/Model/Tier.php index 973875be..6b8baedc 100644 --- a/lib/Model/Tier.php +++ b/lib/Model/Tier.php @@ -59,6 +59,7 @@ class Tier implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'int', 'name' => 'string', + 'startDate' => '\DateTime', 'expiryDate' => '\DateTime', 'downgradePolicy' => 'string' ]; @@ -71,6 +72,7 @@ class Tier implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'name' => null, + 'startDate' => 'date-time', 'expiryDate' => 'date-time', 'downgradePolicy' => null ]; @@ -104,6 +106,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'name' => 'name', + 'startDate' => 'startDate', 'expiryDate' => 'expiryDate', 'downgradePolicy' => 'downgradePolicy' ]; @@ -116,6 +119,7 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'name' => 'setName', + 'startDate' => 'setStartDate', 'expiryDate' => 'setExpiryDate', 'downgradePolicy' => 'setDowngradePolicy' ]; @@ -128,6 +132,7 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'name' => 'getName', + 'startDate' => 'getStartDate', 'expiryDate' => 'getExpiryDate', 'downgradePolicy' => 'getDowngradePolicy' ]; @@ -209,6 +214,7 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null; $this->container['expiryDate'] = isset($data['expiryDate']) ? $data['expiryDate'] : null; $this->container['downgradePolicy'] = isset($data['downgradePolicy']) ? $data['downgradePolicy'] : null; } @@ -299,6 +305,30 @@ public function setName($name) return $this; } + /** + * Gets startDate + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime|null $startDate Date and time when the customer moved to this tier. This value uses the loyalty program's time zone setting. + * + * @return $this + */ + public function setStartDate($startDate) + { + $this->container['startDate'] = $startDate; + + return $this; + } + /** * Gets expiryDate * @@ -336,7 +366,7 @@ public function getDowngradePolicy() /** * Sets downgradePolicy * - * @param string|null $downgradePolicy Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. + * @param string|null $downgradePolicy The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. * * @return $this */ diff --git a/lib/Model/TransferLoyaltyCard.php b/lib/Model/TransferLoyaltyCard.php index d50c5a88..4917a821 100644 --- a/lib/Model/TransferLoyaltyCard.php +++ b/lib/Model/TransferLoyaltyCard.php @@ -57,7 +57,8 @@ class TransferLoyaltyCard implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'newCardIdentifier' => 'string' + 'newCardIdentifier' => 'string', + 'blockReason' => 'string' ]; /** @@ -66,7 +67,8 @@ class TransferLoyaltyCard implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'newCardIdentifier' => null + 'newCardIdentifier' => null, + 'blockReason' => null ]; /** @@ -96,7 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'newCardIdentifier' => 'newCardIdentifier' + 'newCardIdentifier' => 'newCardIdentifier', + 'blockReason' => 'blockReason' ]; /** @@ -105,7 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'newCardIdentifier' => 'setNewCardIdentifier' + 'newCardIdentifier' => 'setNewCardIdentifier', + 'blockReason' => 'setBlockReason' ]; /** @@ -114,7 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'newCardIdentifier' => 'getNewCardIdentifier' + 'newCardIdentifier' => 'getNewCardIdentifier', + 'blockReason' => 'getBlockReason' ]; /** @@ -178,6 +183,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['newCardIdentifier'] = isset($data['newCardIdentifier']) ? $data['newCardIdentifier'] : null; + $this->container['blockReason'] = isset($data['blockReason']) ? $data['blockReason'] : null; } /** @@ -238,6 +244,30 @@ public function setNewCardIdentifier($newCardIdentifier) return $this; } + + /** + * Gets blockReason + * + * @return string|null + */ + public function getBlockReason() + { + return $this->container['blockReason']; + } + + /** + * Sets blockReason + * + * @param string|null $blockReason Reason for transferring and blocking the loyalty card. + * + * @return $this + */ + public function setBlockReason($blockReason) + { + $this->container['blockReason'] = $blockReason; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UpdateApplication.php b/lib/Model/UpdateApplication.php index 71bf2190..21ad5d85 100644 --- a/lib/Model/UpdateApplication.php +++ b/lib/Model/UpdateApplication.php @@ -71,7 +71,9 @@ class UpdateApplication implements ModelInterface, ArrayAccess 'sandbox' => 'bool', 'enablePartialDiscounts' => 'bool', 'defaultDiscountAdditionalCostPerItemScope' => 'string', - 'defaultEvaluationGroupId' => 'int' + 'defaultEvaluationGroupId' => 'int', + 'defaultCartItemFilterId' => 'int', + 'enableCampaignStateManagement' => 'bool' ]; /** @@ -94,7 +96,9 @@ class UpdateApplication implements ModelInterface, ArrayAccess 'sandbox' => null, 'enablePartialDiscounts' => null, 'defaultDiscountAdditionalCostPerItemScope' => null, - 'defaultEvaluationGroupId' => null + 'defaultEvaluationGroupId' => null, + 'defaultCartItemFilterId' => null, + 'enableCampaignStateManagement' => null ]; /** @@ -138,7 +142,9 @@ public static function openAPIFormats() 'sandbox' => 'sandbox', 'enablePartialDiscounts' => 'enablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'defaultDiscountAdditionalCostPerItemScope', - 'defaultEvaluationGroupId' => 'defaultEvaluationGroupId' + 'defaultEvaluationGroupId' => 'defaultEvaluationGroupId', + 'defaultCartItemFilterId' => 'defaultCartItemFilterId', + 'enableCampaignStateManagement' => 'enableCampaignStateManagement' ]; /** @@ -161,7 +167,9 @@ public static function openAPIFormats() 'sandbox' => 'setSandbox', 'enablePartialDiscounts' => 'setEnablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'setDefaultDiscountAdditionalCostPerItemScope', - 'defaultEvaluationGroupId' => 'setDefaultEvaluationGroupId' + 'defaultEvaluationGroupId' => 'setDefaultEvaluationGroupId', + 'defaultCartItemFilterId' => 'setDefaultCartItemFilterId', + 'enableCampaignStateManagement' => 'setEnableCampaignStateManagement' ]; /** @@ -184,7 +192,9 @@ public static function openAPIFormats() 'sandbox' => 'getSandbox', 'enablePartialDiscounts' => 'getEnablePartialDiscounts', 'defaultDiscountAdditionalCostPerItemScope' => 'getDefaultDiscountAdditionalCostPerItemScope', - 'defaultEvaluationGroupId' => 'getDefaultEvaluationGroupId' + 'defaultEvaluationGroupId' => 'getDefaultEvaluationGroupId', + 'defaultCartItemFilterId' => 'getDefaultCartItemFilterId', + 'enableCampaignStateManagement' => 'getEnableCampaignStateManagement' ]; /** @@ -313,6 +323,8 @@ public function __construct(array $data = null) $this->container['enablePartialDiscounts'] = isset($data['enablePartialDiscounts']) ? $data['enablePartialDiscounts'] : null; $this->container['defaultDiscountAdditionalCostPerItemScope'] = isset($data['defaultDiscountAdditionalCostPerItemScope']) ? $data['defaultDiscountAdditionalCostPerItemScope'] : null; $this->container['defaultEvaluationGroupId'] = isset($data['defaultEvaluationGroupId']) ? $data['defaultEvaluationGroupId'] : null; + $this->container['defaultCartItemFilterId'] = isset($data['defaultCartItemFilterId']) ? $data['defaultCartItemFilterId'] : null; + $this->container['enableCampaignStateManagement'] = isset($data['enableCampaignStateManagement']) ? $data['enableCampaignStateManagement'] : null; } /** @@ -785,6 +797,54 @@ public function setDefaultEvaluationGroupId($defaultEvaluationGroupId) return $this; } + + /** + * Gets defaultCartItemFilterId + * + * @return int|null + */ + public function getDefaultCartItemFilterId() + { + return $this->container['defaultCartItemFilterId']; + } + + /** + * Sets defaultCartItemFilterId + * + * @param int|null $defaultCartItemFilterId The ID of the default Cart-Item-Filter for this application. + * + * @return $this + */ + public function setDefaultCartItemFilterId($defaultCartItemFilterId) + { + $this->container['defaultCartItemFilterId'] = $defaultCartItemFilterId; + + return $this; + } + + /** + * Gets enableCampaignStateManagement + * + * @return bool|null + */ + public function getEnableCampaignStateManagement() + { + return $this->container['enableCampaignStateManagement']; + } + + /** + * Sets enableCampaignStateManagement + * + * @param bool|null $enableCampaignStateManagement Indicates whether the campaign staging and revisions feature is enabled for the Application. **Important:** After this feature is enabled, it cannot be disabled. + * + * @return $this + */ + public function setEnableCampaignStateManagement($enableCampaignStateManagement) + { + $this->container['enableCampaignStateManagement'] = $enableCampaignStateManagement; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UpdateApplicationCIF.php b/lib/Model/UpdateApplicationCIF.php new file mode 100644 index 00000000..f3aad8ee --- /dev/null +++ b/lib/Model/UpdateApplicationCIF.php @@ -0,0 +1,398 @@ + 'string', + 'activeExpressionId' => 'int', + 'modifiedBy' => 'int', + 'modified' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'description' => null, + 'activeExpressionId' => null, + 'modifiedBy' => null, + 'modified' => 'date-time' + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'activeExpressionId' => 'activeExpressionId', + 'modifiedBy' => 'modifiedBy', + 'modified' => 'modified' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'activeExpressionId' => 'setActiveExpressionId', + 'modifiedBy' => 'setModifiedBy', + 'modified' => 'setModified' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'activeExpressionId' => 'getActiveExpressionId', + 'modifiedBy' => 'getModifiedBy', + 'modified' => 'getModified' + ]; + + /** + * 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->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['activeExpressionId'] = isset($data['activeExpressionId']) ? $data['activeExpressionId'] : null; + $this->container['modifiedBy'] = isset($data['modifiedBy']) ? $data['modifiedBy'] : null; + $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; + } + + /** + * 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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description of the Application cart item filter. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets activeExpressionId + * + * @return int|null + */ + public function getActiveExpressionId() + { + return $this->container['activeExpressionId']; + } + + /** + * Sets activeExpressionId + * + * @param int|null $activeExpressionId The ID of the expression that the Application cart item filter uses. + * + * @return $this + */ + public function setActiveExpressionId($activeExpressionId) + { + $this->container['activeExpressionId'] = $activeExpressionId; + + return $this; + } + + /** + * Gets modifiedBy + * + * @return int|null + */ + public function getModifiedBy() + { + return $this->container['modifiedBy']; + } + + /** + * Sets modifiedBy + * + * @param int|null $modifiedBy The ID of the user who last updated the Application cart item filter. + * + * @return $this + */ + public function setModifiedBy($modifiedBy) + { + $this->container['modifiedBy'] = $modifiedBy; + + return $this; + } + + /** + * Gets modified + * + * @return \DateTime|null + */ + public function getModified() + { + return $this->container['modified']; + } + + /** + * Sets modified + * + * @param \DateTime|null $modified Timestamp of the most recent update to the Application cart item filter. + * + * @return $this + */ + public function setModified($modified) + { + $this->container['modified'] = $modified; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $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]); + } + + /** + * 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/UpdateCampaign.php b/lib/Model/UpdateCampaign.php index f82e6145..a6361b29 100644 --- a/lib/Model/UpdateCampaign.php +++ b/lib/Model/UpdateCampaign.php @@ -786,7 +786,7 @@ public function getLinkedStoreIds() /** * Sets linkedStoreIds * - * @param int[]|null $linkedStoreIds A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. + * @param int[]|null $linkedStoreIds A list of store IDs that you want to link to the campaign. **Note:** - Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. - If you linked stores to the campaign by uploading a CSV file, you cannot use this property and it should be empty. - Use of this property is limited to 50 stores. To link more than 50 stores, upload them via a CSV file. * * @return $this */ diff --git a/lib/Model/UpdateCoupon.php b/lib/Model/UpdateCoupon.php index 1d27603a..1ca58185 100644 --- a/lib/Model/UpdateCoupon.php +++ b/lib/Model/UpdateCoupon.php @@ -420,7 +420,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/UpdateCouponBatch.php b/lib/Model/UpdateCouponBatch.php index 722252f5..f309a1af 100644 --- a/lib/Model/UpdateCouponBatch.php +++ b/lib/Model/UpdateCouponBatch.php @@ -398,7 +398,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the coupon. Coupon never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/UpdateLoyaltyCard.php b/lib/Model/UpdateLoyaltyCard.php index 3d3bdb91..fc8bcce2 100644 --- a/lib/Model/UpdateLoyaltyCard.php +++ b/lib/Model/UpdateLoyaltyCard.php @@ -57,7 +57,8 @@ class UpdateLoyaltyCard implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'status' => 'string' + 'status' => 'string', + 'blockReason' => 'string' ]; /** @@ -66,7 +67,8 @@ class UpdateLoyaltyCard implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'status' => null + 'status' => null, + 'blockReason' => null ]; /** @@ -96,7 +98,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'status' => 'status' + 'status' => 'status', + 'blockReason' => 'blockReason' ]; /** @@ -105,7 +108,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'status' => 'setStatus' + 'status' => 'setStatus', + 'blockReason' => 'setBlockReason' ]; /** @@ -114,7 +118,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'status' => 'getStatus' + 'status' => 'getStatus', + 'blockReason' => 'getBlockReason' ]; /** @@ -178,6 +183,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['blockReason'] = isset($data['blockReason']) ? $data['blockReason'] : null; } /** @@ -220,7 +226,7 @@ public function getStatus() /** * Sets status * - * @param string $status Status of the loyalty card. Can be one of: ['active', 'inactive'] + * @param string $status Status of the loyalty card. Can be `active` or `inactive`. * * @return $this */ @@ -230,6 +236,30 @@ public function setStatus($status) return $this; } + + /** + * Gets blockReason + * + * @return string|null + */ + public function getBlockReason() + { + return $this->container['blockReason']; + } + + /** + * Sets blockReason + * + * @param string|null $blockReason Reason for transferring and blocking the loyalty card. + * + * @return $this + */ + public function setBlockReason($blockReason) + { + $this->container['blockReason'] = $blockReason; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UpdateLoyaltyProgram.php b/lib/Model/UpdateLoyaltyProgram.php index 567ce454..9b0508cc 100644 --- a/lib/Model/UpdateLoyaltyProgram.php +++ b/lib/Model/UpdateLoyaltyProgram.php @@ -66,10 +66,12 @@ class UpdateLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'programJoinPolicy' => 'string', 'tiersExpirationPolicy' => 'string', + 'tierCycleStartDate' => '\DateTime', 'tiersExpireIn' => 'string', 'tiersDowngradePolicy' => 'string', - 'programJoinPolicy' => 'string', + 'cardCodeSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'tiers' => '\TalonOne\Client\Model\NewLoyaltyTier[]' ]; @@ -87,10 +89,12 @@ class UpdateLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'programJoinPolicy' => null, 'tiersExpirationPolicy' => null, + 'tierCycleStartDate' => 'date-time', 'tiersExpireIn' => null, 'tiersDowngradePolicy' => null, - 'programJoinPolicy' => null, + 'cardCodeSettings' => null, 'tiers' => null ]; @@ -129,10 +133,12 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'programJoinPolicy' => 'programJoinPolicy', 'tiersExpirationPolicy' => 'tiersExpirationPolicy', + 'tierCycleStartDate' => 'tierCycleStartDate', 'tiersExpireIn' => 'tiersExpireIn', 'tiersDowngradePolicy' => 'tiersDowngradePolicy', - 'programJoinPolicy' => 'programJoinPolicy', + 'cardCodeSettings' => 'cardCodeSettings', 'tiers' => 'tiers' ]; @@ -150,10 +156,12 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'programJoinPolicy' => 'setProgramJoinPolicy', 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', + 'tierCycleStartDate' => 'setTierCycleStartDate', 'tiersExpireIn' => 'setTiersExpireIn', 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', - 'programJoinPolicy' => 'setProgramJoinPolicy', + 'cardCodeSettings' => 'setCardCodeSettings', 'tiers' => 'setTiers' ]; @@ -171,10 +179,12 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'programJoinPolicy' => 'getProgramJoinPolicy', 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', + 'tierCycleStartDate' => 'getTierCycleStartDate', 'tiersExpireIn' => 'getTiersExpireIn', 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', - 'programJoinPolicy' => 'getProgramJoinPolicy', + 'cardCodeSettings' => 'getCardCodeSettings', 'tiers' => 'getTiers' ]; @@ -219,13 +229,15 @@ public function getModelName() return self::$openAPIModelName; } + const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; + const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; + const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; + const TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE = 'customer_attribute'; + const TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION = 'absolute_expiration'; const TIERS_DOWNGRADE_POLICY_ONE_DOWN = 'one_down'; const TIERS_DOWNGRADE_POLICY_BALANCE_BASED = 'balance_based'; - const PROGRAM_JOIN_POLICY_NOT_JOIN = 'not_join'; - const PROGRAM_JOIN_POLICY_POINTS_ACTIVATED = 'points_activated'; - const PROGRAM_JOIN_POLICY_POINTS_EARNED = 'points_earned'; @@ -234,11 +246,12 @@ public function getModelName() * * @return string[] */ - public function getTiersExpirationPolicyAllowableValues() + public function getProgramJoinPolicyAllowableValues() { return [ - self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, - self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, ]; } @@ -247,11 +260,13 @@ public function getTiersExpirationPolicyAllowableValues() * * @return string[] */ - public function getTiersDowngradePolicyAllowableValues() + public function getTiersExpirationPolicyAllowableValues() { return [ - self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, - self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + self::TIERS_EXPIRATION_POLICY_CUSTOMER_ATTRIBUTE, + self::TIERS_EXPIRATION_POLICY_ABSOLUTE_EXPIRATION, ]; } @@ -260,12 +275,11 @@ public function getTiersDowngradePolicyAllowableValues() * * @return string[] */ - public function getProgramJoinPolicyAllowableValues() + public function getTiersDowngradePolicyAllowableValues() { return [ - self::PROGRAM_JOIN_POLICY_NOT_JOIN, - self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, - self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + self::TIERS_DOWNGRADE_POLICY_ONE_DOWN, + self::TIERS_DOWNGRADE_POLICY_BALANCE_BASED, ]; } @@ -293,10 +307,12 @@ public function __construct(array $data = null) $this->container['allowSubledger'] = isset($data['allowSubledger']) ? $data['allowSubledger'] : null; $this->container['usersPerCardLimit'] = isset($data['usersPerCardLimit']) ? $data['usersPerCardLimit'] : null; $this->container['sandbox'] = isset($data['sandbox']) ? $data['sandbox'] : null; + $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; $this->container['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : null; + $this->container['tierCycleStartDate'] = isset($data['tierCycleStartDate']) ? $data['tierCycleStartDate'] : null; $this->container['tiersExpireIn'] = isset($data['tiersExpireIn']) ? $data['tiersExpireIn'] : null; $this->container['tiersDowngradePolicy'] = isset($data['tiersDowngradePolicy']) ? $data['tiersDowngradePolicy'] : null; - $this->container['programJoinPolicy'] = isset($data['programJoinPolicy']) ? $data['programJoinPolicy'] : null; + $this->container['cardCodeSettings'] = isset($data['cardCodeSettings']) ? $data['cardCodeSettings'] : null; $this->container['tiers'] = isset($data['tiers']) ? $data['tiers'] : null; } @@ -313,6 +329,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'usersPerCardLimit', must be bigger than or equal to 0."; } + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -329,14 +353,6 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($this->container['programJoinPolicy']) && !in_array($this->container['programJoinPolicy'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - return $invalidProperties; } @@ -549,6 +565,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets programJoinPolicy + * + * @return string|null + */ + public function getProgramJoinPolicy() + { + return $this->container['programJoinPolicy']; + } + + /** + * Sets programJoinPolicy + * + * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * + * @return $this + */ + public function setProgramJoinPolicy($programJoinPolicy) + { + $allowedValues = $this->getProgramJoinPolicyAllowableValues(); + if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'programJoinPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['programJoinPolicy'] = $programJoinPolicy; + + return $this; + } + /** * Gets tiersExpirationPolicy * @@ -562,7 +611,7 @@ public function getTiersExpirationPolicy() /** * Sets tiersExpirationPolicy * - * @param string|null $tiersExpirationPolicy The policy that defines which date is used to calculate the expiration date of a customer's current tier. - `tier_start_date`: The tier expiration date is calculated based on when the customer joined the current tier. - `program_join_date`: The tier expiration date is calculated based on when the customer joined the loyalty program. + * @param string|null $tiersExpirationPolicy The policy that defines how tier expiration, used to reevaluate the customer's current tier, is determined. - `tier_start_date`: The tier expiration is relative to when the customer joined the current tier. - `program_join_date`: The tier expiration is relative to when the customer joined the loyalty program. - `customer_attribute`: The tier expiration is determined by a custom customer attribute. - `absolute_expiration`: The tier is reevaluated at the start of each tier cycle. For this policy, it is required to provide a `tierCycleStartDate`. * * @return $this */ @@ -582,6 +631,30 @@ public function setTiersExpirationPolicy($tiersExpirationPolicy) return $this; } + /** + * Gets tierCycleStartDate + * + * @return \DateTime|null + */ + public function getTierCycleStartDate() + { + return $this->container['tierCycleStartDate']; + } + + /** + * Sets tierCycleStartDate + * + * @param \DateTime|null $tierCycleStartDate Timestamp at which the tier cycle starts for all customers in the loyalty program. **Note**: This is only required when the tier expiration policy is set to `absolute_expiration`. + * + * @return $this + */ + public function setTierCycleStartDate($tierCycleStartDate) + { + $this->container['tierCycleStartDate'] = $tierCycleStartDate; + + return $this; + } + /** * Gets tiersExpireIn * @@ -595,7 +668,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time after which the tier expires. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. + * @param string|null $tiersExpireIn The amount of time after which the tier expires and is reevaluated. The time format is an **integer** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can round certain units up or down: - `_D` for rounding down days only. Signifies the start of the day. - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. * * @return $this */ @@ -619,7 +692,7 @@ public function getTiersDowngradePolicy() /** * Sets tiersDowngradePolicy * - * @param string|null $tiersDowngradePolicy Customers's tier downgrade policy. - `one_down`: Once the tier expires and if the user doesn't have enough points to stay in the tier, the user is downgraded one tier down. - `balance_based`: Once the tier expires, the user's tier is evaluated based on the amount of active points the user has at this instant. + * @param string|null $tiersDowngradePolicy The policy that defines how customer tiers are downgraded in the loyalty program after tier reevaluation. - `one_down`: If the customer doesn't have enough points to stay in the current tier, they are downgraded by one tier. - `balance_based`: The customer's tier is reevaluated based on the amount of active points they have at the moment. * * @return $this */ @@ -640,34 +713,25 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) } /** - * Gets programJoinPolicy + * Gets cardCodeSettings * - * @return string|null + * @return \TalonOne\Client\Model\CodeGeneratorSettings|null */ - public function getProgramJoinPolicy() + public function getCardCodeSettings() { - return $this->container['programJoinPolicy']; + return $this->container['cardCodeSettings']; } /** - * Sets programJoinPolicy + * Sets cardCodeSettings * - * @param string|null $programJoinPolicy The policy that defines when the customer joins the loyalty program. - `not_join`: The customer does not join the loyalty program but can still earn and spend loyalty points. **Note**: The customer does not have a program join date. - `points_activated`: The customer joins the loyalty program only when their earned loyalty points become active for the first time. - `points_earned`: The customer joins the loyalty program when they earn loyalty points for the first time. + * @param \TalonOne\Client\Model\CodeGeneratorSettings|null $cardCodeSettings cardCodeSettings * * @return $this */ - public function setProgramJoinPolicy($programJoinPolicy) + public function setCardCodeSettings($cardCodeSettings) { - $allowedValues = $this->getProgramJoinPolicyAllowableValues(); - if (!is_null($programJoinPolicy) && !in_array($programJoinPolicy, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'programJoinPolicy', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['programJoinPolicy'] = $programJoinPolicy; + $this->container['cardCodeSettings'] = $cardCodeSettings; return $this; } diff --git a/lib/Model/UpdateReferral.php b/lib/Model/UpdateReferral.php index c54346da..aadda518 100644 --- a/lib/Model/UpdateReferral.php +++ b/lib/Model/UpdateReferral.php @@ -305,7 +305,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/UpdateReferralBatch.php b/lib/Model/UpdateReferralBatch.php index 12a86108..f497dfdb 100644 --- a/lib/Model/UpdateReferralBatch.php +++ b/lib/Model/UpdateReferralBatch.php @@ -324,7 +324,7 @@ public function getExpiryDate() /** * Sets expiryDate * - * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted, zero, or negative. + * @param \DateTime|null $expiryDate Expiration date of the referral code. Referral never expires if this is omitted. * * @return $this */ diff --git a/lib/Model/User.php b/lib/Model/User.php index 18ffc53d..6b95678d 100644 --- a/lib/Model/User.php +++ b/lib/Model/User.php @@ -73,7 +73,8 @@ class User implements ModelInterface, ArrayAccess 'applicationNotificationSubscriptions' => 'object', 'lastSignedIn' => '\DateTime', 'lastAccessed' => '\DateTime', - 'latestFeedTimestamp' => '\DateTime' + 'latestFeedTimestamp' => '\DateTime', + 'additionalAttributes' => 'object' ]; /** @@ -97,7 +98,8 @@ class User implements ModelInterface, ArrayAccess 'applicationNotificationSubscriptions' => null, 'lastSignedIn' => 'date-time', 'lastAccessed' => 'date-time', - 'latestFeedTimestamp' => 'date-time' + 'latestFeedTimestamp' => 'date-time', + 'additionalAttributes' => null ]; /** @@ -142,7 +144,8 @@ public static function openAPIFormats() 'applicationNotificationSubscriptions' => 'applicationNotificationSubscriptions', 'lastSignedIn' => 'lastSignedIn', 'lastAccessed' => 'lastAccessed', - 'latestFeedTimestamp' => 'latestFeedTimestamp' + 'latestFeedTimestamp' => 'latestFeedTimestamp', + 'additionalAttributes' => 'additionalAttributes' ]; /** @@ -166,7 +169,8 @@ public static function openAPIFormats() 'applicationNotificationSubscriptions' => 'setApplicationNotificationSubscriptions', 'lastSignedIn' => 'setLastSignedIn', 'lastAccessed' => 'setLastAccessed', - 'latestFeedTimestamp' => 'setLatestFeedTimestamp' + 'latestFeedTimestamp' => 'setLatestFeedTimestamp', + 'additionalAttributes' => 'setAdditionalAttributes' ]; /** @@ -190,7 +194,8 @@ public static function openAPIFormats() 'applicationNotificationSubscriptions' => 'getApplicationNotificationSubscriptions', 'lastSignedIn' => 'getLastSignedIn', 'lastAccessed' => 'getLastAccessed', - 'latestFeedTimestamp' => 'getLatestFeedTimestamp' + 'latestFeedTimestamp' => 'getLatestFeedTimestamp', + 'additionalAttributes' => 'getAdditionalAttributes' ]; /** @@ -286,6 +291,7 @@ public function __construct(array $data = null) $this->container['lastSignedIn'] = isset($data['lastSignedIn']) ? $data['lastSignedIn'] : null; $this->container['lastAccessed'] = isset($data['lastAccessed']) ? $data['lastAccessed'] : null; $this->container['latestFeedTimestamp'] = isset($data['latestFeedTimestamp']) ? $data['latestFeedTimestamp'] : null; + $this->container['additionalAttributes'] = isset($data['additionalAttributes']) ? $data['additionalAttributes'] : null; } /** @@ -739,6 +745,30 @@ public function setLatestFeedTimestamp($latestFeedTimestamp) return $this; } + + /** + * Gets additionalAttributes + * + * @return object|null + */ + public function getAdditionalAttributes() + { + return $this->container['additionalAttributes']; + } + + /** + * Sets additionalAttributes + * + * @param object|null $additionalAttributes Additional user attributes, created and used by external identity providers. + * + * @return $this + */ + public function setAdditionalAttributes($additionalAttributes) + { + $this->container['additionalAttributes'] = $additionalAttributes; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UserFeedNotifications.php b/lib/Model/UserFeedNotifications.php deleted file mode 100644 index 977d5663..00000000 --- a/lib/Model/UserFeedNotifications.php +++ /dev/null @@ -1,345 +0,0 @@ - '\DateTime', - 'notifications' => '\TalonOne\Client\Model\FeedNotification[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'lastUpdate' => 'date-time', - 'notifications' => null - ]; - - /** - * 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 attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'lastUpdate' => 'lastUpdate', - 'notifications' => 'notifications' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'lastUpdate' => 'setLastUpdate', - 'notifications' => 'setNotifications' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'lastUpdate' => 'getLastUpdate', - 'notifications' => 'getNotifications' - ]; - - /** - * 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->container['lastUpdate'] = isset($data['lastUpdate']) ? $data['lastUpdate'] : null; - $this->container['notifications'] = isset($data['notifications']) ? $data['notifications'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['lastUpdate'] === null) { - $invalidProperties[] = "'lastUpdate' can't be null"; - } - if ($this->container['notifications'] === null) { - $invalidProperties[] = "'notifications' 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 lastUpdate - * - * @return \DateTime - */ - public function getLastUpdate() - { - return $this->container['lastUpdate']; - } - - /** - * Sets lastUpdate - * - * @param \DateTime $lastUpdate Timestamp of the last request for this list. - * - * @return $this - */ - public function setLastUpdate($lastUpdate) - { - $this->container['lastUpdate'] = $lastUpdate; - - return $this; - } - - /** - * Gets notifications - * - * @return \TalonOne\Client\Model\FeedNotification[] - */ - public function getNotifications() - { - return $this->container['notifications']; - } - - /** - * Sets notifications - * - * @param \TalonOne\Client\Model\FeedNotification[] $notifications List of all notifications to notify the user about. - * - * @return $this - */ - public function setNotifications($notifications) - { - $this->container['notifications'] = $notifications; - - 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 - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $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]); - } - - /** - * 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/Webhook.php b/lib/Model/Webhook.php index 0e6ecd8f..260d5923 100644 --- a/lib/Model/Webhook.php +++ b/lib/Model/Webhook.php @@ -63,6 +63,7 @@ class Webhook implements ModelInterface, ArrayAccess 'modified' => '\DateTime', 'applicationIds' => 'int[]', 'title' => 'string', + 'description' => 'string', 'verb' => 'string', 'url' => 'string', 'headers' => 'string[]', @@ -82,6 +83,7 @@ class Webhook implements ModelInterface, ArrayAccess 'modified' => 'date-time', 'applicationIds' => null, 'title' => null, + 'description' => null, 'verb' => null, 'url' => null, 'headers' => null, @@ -122,6 +124,7 @@ public static function openAPIFormats() 'modified' => 'modified', 'applicationIds' => 'applicationIds', 'title' => 'title', + 'description' => 'description', 'verb' => 'verb', 'url' => 'url', 'headers' => 'headers', @@ -141,6 +144,7 @@ public static function openAPIFormats() 'modified' => 'setModified', 'applicationIds' => 'setApplicationIds', 'title' => 'setTitle', + 'description' => 'setDescription', 'verb' => 'setVerb', 'url' => 'setUrl', 'headers' => 'setHeaders', @@ -160,6 +164,7 @@ public static function openAPIFormats() 'modified' => 'getModified', 'applicationIds' => 'getApplicationIds', 'title' => 'getTitle', + 'description' => 'getDescription', 'verb' => 'getVerb', 'url' => 'getUrl', 'headers' => 'getHeaders', @@ -254,6 +259,7 @@ public function __construct(array $data = null) $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; $this->container['applicationIds'] = isset($data['applicationIds']) ? $data['applicationIds'] : null; $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['verb'] = isset($data['verb']) ? $data['verb'] : null; $this->container['url'] = isset($data['url']) ? $data['url'] : null; $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null; @@ -453,6 +459,30 @@ public function setTitle($title) return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the webhook. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** * Gets verb * diff --git a/lib/Model/WebhookWithOutgoingIntegrationDetails.php b/lib/Model/WebhookWithOutgoingIntegrationDetails.php index a7db831d..2e9980a2 100644 --- a/lib/Model/WebhookWithOutgoingIntegrationDetails.php +++ b/lib/Model/WebhookWithOutgoingIntegrationDetails.php @@ -63,6 +63,7 @@ class WebhookWithOutgoingIntegrationDetails implements ModelInterface, ArrayAcce 'modified' => '\DateTime', 'applicationIds' => 'int[]', 'title' => 'string', + 'description' => 'string', 'verb' => 'string', 'url' => 'string', 'headers' => 'string[]', @@ -85,6 +86,7 @@ class WebhookWithOutgoingIntegrationDetails implements ModelInterface, ArrayAcce 'modified' => 'date-time', 'applicationIds' => null, 'title' => null, + 'description' => null, 'verb' => null, 'url' => null, 'headers' => null, @@ -128,6 +130,7 @@ public static function openAPIFormats() 'modified' => 'modified', 'applicationIds' => 'applicationIds', 'title' => 'title', + 'description' => 'description', 'verb' => 'verb', 'url' => 'url', 'headers' => 'headers', @@ -150,6 +153,7 @@ public static function openAPIFormats() 'modified' => 'setModified', 'applicationIds' => 'setApplicationIds', 'title' => 'setTitle', + 'description' => 'setDescription', 'verb' => 'setVerb', 'url' => 'setUrl', 'headers' => 'setHeaders', @@ -172,6 +176,7 @@ public static function openAPIFormats() 'modified' => 'getModified', 'applicationIds' => 'getApplicationIds', 'title' => 'getTitle', + 'description' => 'getDescription', 'verb' => 'getVerb', 'url' => 'getUrl', 'headers' => 'getHeaders', @@ -269,6 +274,7 @@ public function __construct(array $data = null) $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; $this->container['applicationIds'] = isset($data['applicationIds']) ? $data['applicationIds'] : null; $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['verb'] = isset($data['verb']) ? $data['verb'] : null; $this->container['url'] = isset($data['url']) ? $data['url'] : null; $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null; @@ -471,6 +477,30 @@ public function setTitle($title) return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the webhook. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** * Gets verb * diff --git a/test/Api/IntegrationApiTest.php b/test/Api/IntegrationApiTest.php index 40210d7f..55896313 100644 --- a/test/Api/IntegrationApiTest.php +++ b/test/Api/IntegrationApiTest.php @@ -152,6 +152,16 @@ public function testDeleteCustomerData() { } + /** + * Test case for generateLoyaltyCard + * + * Generate loyalty card. + * + */ + public function testGenerateLoyaltyCard() + { + } + /** * Test case for getCustomerInventory * diff --git a/test/Api/ManagementApiTest.php b/test/Api/ManagementApiTest.php index 4e8d214a..2a54b1fd 100644 --- a/test/Api/ManagementApiTest.php +++ b/test/Api/ManagementApiTest.php @@ -75,7 +75,7 @@ public static function tearDownAfterClass() /** * Test case for activateUserByEmail * - * Activate user by email address. + * Enable user by email address. * */ public function testActivateUserByEmail() @@ -152,6 +152,16 @@ public function testCreateAttribute() { } + /** + * Test case for createBatchLoyaltyCards + * + * Create loyalty cards. + * + */ + public function testCreateBatchLoyaltyCards() + { + } + /** * Test case for createCampaignFromTemplate * @@ -192,6 +202,16 @@ public function testCreateCouponsAsync() { } + /** + * Test case for createCouponsDeletionJob + * + * Creates a coupon deletion job. + * + */ + public function testCreateCouponsDeletionJob() + { + } + /** * Test case for createCouponsForMultipleRecipients * @@ -255,7 +275,7 @@ public function testCreateStore() /** * Test case for deactivateUserByEmail * - * Deactivate user by email address. + * Disable user by email address. * */ public function testDeactivateUserByEmail() @@ -392,6 +412,16 @@ public function testDestroySession() { } + /** + * Test case for disconnectCampaignStores + * + * Disconnect stores. + * + */ + public function testDisconnectCampaignStores() + { + } + /** * Test case for exportAccountCollectionItems * @@ -422,6 +452,16 @@ public function testExportAudiencesMemberships() { } + /** + * Test case for exportCampaignStores + * + * Export stores. + * + */ + public function testExportCampaignStores() + { + } + /** * Test case for exportCollectionItems * @@ -512,6 +552,16 @@ public function testExportLoyaltyCardLedger() { } + /** + * Test case for exportLoyaltyCards + * + * Export loyalty cards. + * + */ + public function testExportLoyaltyCards() + { + } + /** * Test case for exportLoyaltyLedger * @@ -1202,6 +1252,16 @@ public function testImportAudiencesMemberships() { } + /** + * Test case for importCampaignStores + * + * Import stores. + * + */ + public function testImportCampaignStores() + { + } + /** * Test case for importCollection * @@ -1362,6 +1422,16 @@ public function testNotificationActivation() { } + /** + * Test case for oktaEventHandlerChallenge + * + * Validate Okta API ownership. + * + */ + public function testOktaEventHandlerChallenge() + { + } + /** * Test case for postAddedDeductedPointsNotification * @@ -1412,6 +1482,96 @@ public function testResetPassword() { } + /** + * Test case for scimCreateUser + * + * Create SCIM user. + * + */ + public function testScimCreateUser() + { + } + + /** + * Test case for scimDeleteUser + * + * Delete SCIM user. + * + */ + public function testScimDeleteUser() + { + } + + /** + * Test case for scimGetResourceTypes + * + * List supported SCIM resource types. + * + */ + public function testScimGetResourceTypes() + { + } + + /** + * Test case for scimGetSchemas + * + * List supported SCIM schemas. + * + */ + public function testScimGetSchemas() + { + } + + /** + * Test case for scimGetServiceProviderConfig + * + * Get SCIM service provider configuration. + * + */ + public function testScimGetServiceProviderConfig() + { + } + + /** + * Test case for scimGetUser + * + * Get SCIM user. + * + */ + public function testScimGetUser() + { + } + + /** + * Test case for scimGetUsers + * + * List SCIM users. + * + */ + public function testScimGetUsers() + { + } + + /** + * Test case for scimPatchUser + * + * Update SCIM user attributes. + * + */ + public function testScimPatchUser() + { + } + + /** + * Test case for scimReplaceUserAttributes + * + * Update SCIM user. + * + */ + public function testScimReplaceUserAttributes() + { + } + /** * Test case for searchCouponsAdvancedApplicationWideWithoutTotalCount * diff --git a/test/Model/AchievementProgressTest.php b/test/Model/AchievementProgressTest.php index 0d703f8e..16b971ad 100644 --- a/test/Model/AchievementProgressTest.php +++ b/test/Model/AchievementProgressTest.php @@ -99,6 +99,13 @@ public function testPropertyTitle() { } + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + } + /** * Test attribute "campaignId" */ diff --git a/test/Model/AdditionalCampaignPropertiesTest.php b/test/Model/AdditionalCampaignPropertiesTest.php index e3f4c952..ab189129 100644 --- a/test/Model/AdditionalCampaignPropertiesTest.php +++ b/test/Model/AdditionalCampaignPropertiesTest.php @@ -231,4 +231,11 @@ public function testPropertyTemplateId() public function testPropertyFrontendState() { } + + /** + * Test attribute "storesImported" + */ + public function testPropertyStoresImported() + { + } } diff --git a/test/Model/ApplicationAnalyticsDataPointTotalRevenueTest.php b/test/Model/AnalyticsDataPointTest.php similarity index 84% rename from test/Model/ApplicationAnalyticsDataPointTotalRevenueTest.php rename to test/Model/AnalyticsDataPointTest.php index 496e38fb..7da59b69 100644 --- a/test/Model/ApplicationAnalyticsDataPointTotalRevenueTest.php +++ b/test/Model/AnalyticsDataPointTest.php @@ -1,6 +1,6 @@