diff --git a/README.md b/README.md index 1ec88091..6dade98f 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: 6.0.0 +- Package version: 7.0.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen ## Requirements @@ -221,6 +221,7 @@ Class | Method | HTTP request | Description *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 *ManagementApi* | [**createAccountCollection**](docs/Api/ManagementApi.md#createaccountcollection) | **POST** /v1/collections | Create account-level collection +*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* | [**createCampaignFromTemplate**](docs/Api/ManagementApi.md#createcampaignfromtemplate) | **POST** /v1/applications/{applicationId}/create_campaign_from_template | Create campaign from campaign template @@ -228,11 +229,15 @@ Class | Method | HTTP request | Description *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* | [**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* | [**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 *ManagementApi* | [**deleteCampaign**](docs/Api/ManagementApi.md#deletecampaign) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId} | Delete campaign *ManagementApi* | [**deleteCollection**](docs/Api/ManagementApi.md#deletecollection) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} | Delete campaign-level collection *ManagementApi* | [**deleteCoupon**](docs/Api/ManagementApi.md#deletecoupon) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} | Delete coupon @@ -240,8 +245,12 @@ Class | Method | HTTP request | Description *ManagementApi* | [**deleteLoyaltyCard**](docs/Api/ManagementApi.md#deleteloyaltycard) | **DELETE** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Delete loyalty card *ManagementApi* | [**deleteReferral**](docs/Api/ManagementApi.md#deletereferral) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} | Delete referral *ManagementApi* | [**deleteStore**](docs/Api/ManagementApi.md#deletestore) | **DELETE** /v1/applications/{applicationId}/stores/{storeId} | Delete store +*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* | [**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* | [**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 @@ -258,6 +267,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**getAccount**](docs/Api/ManagementApi.md#getaccount) | **GET** /v1/accounts/{accountId} | Get account details *ManagementApi* | [**getAccountAnalytics**](docs/Api/ManagementApi.md#getaccountanalytics) | **GET** /v1/accounts/{accountId}/analytics | Get account analytics *ManagementApi* | [**getAccountCollection**](docs/Api/ManagementApi.md#getaccountcollection) | **GET** /v1/collections/{collectionId} | Get account-level collection +*ManagementApi* | [**getAchievement**](docs/Api/ManagementApi.md#getachievement) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Get achievement *ManagementApi* | [**getAdditionalCost**](docs/Api/ManagementApi.md#getadditionalcost) | **GET** /v1/additional_costs/{additionalCostId} | Get additional cost *ManagementApi* | [**getAdditionalCosts**](docs/Api/ManagementApi.md#getadditionalcosts) | **GET** /v1/additional_costs | List additional costs *ManagementApi* | [**getAllAccessLogs**](docs/Api/ManagementApi.md#getallaccesslogs) | **GET** /v1/access_logs | List access logs @@ -275,10 +285,14 @@ Class | Method | HTTP request | Description *ManagementApi* | [**getApplications**](docs/Api/ManagementApi.md#getapplications) | **GET** /v1/applications | List Applications *ManagementApi* | [**getAttribute**](docs/Api/ManagementApi.md#getattribute) | **GET** /v1/attributes/{attributeId} | Get custom attribute *ManagementApi* | [**getAttributes**](docs/Api/ManagementApi.md#getattributes) | **GET** /v1/attributes | List custom attributes +*ManagementApi* | [**getAudienceMemberships**](docs/Api/ManagementApi.md#getaudiencememberships) | **GET** /v1/audiences/{audienceId}/memberships | List audience members *ManagementApi* | [**getAudiences**](docs/Api/ManagementApi.md#getaudiences) | **GET** /v1/audiences | List audiences +*ManagementApi* | [**getAudiencesAnalytics**](docs/Api/ManagementApi.md#getaudiencesanalytics) | **GET** /v1/audiences/analytics | List audience analytics *ManagementApi* | [**getCampaign**](docs/Api/ManagementApi.md#getcampaign) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId} | Get campaign *ManagementApi* | [**getCampaignAnalytics**](docs/Api/ManagementApi.md#getcampaignanalytics) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/analytics | Get analytics of campaigns *ManagementApi* | [**getCampaignByAttributes**](docs/Api/ManagementApi.md#getcampaignbyattributes) | **POST** /v1/applications/{applicationId}/campaigns_search | List campaigns that match the given attributes +*ManagementApi* | [**getCampaignGroup**](docs/Api/ManagementApi.md#getcampaigngroup) | **GET** /v1/campaign_groups/{campaignGroupId} | Get campaign access group +*ManagementApi* | [**getCampaignGroups**](docs/Api/ManagementApi.md#getcampaigngroups) | **GET** /v1/campaign_groups | List campaign access groups *ManagementApi* | [**getCampaignTemplates**](docs/Api/ManagementApi.md#getcampaigntemplates) | **GET** /v1/campaign_templates | List campaign templates *ManagementApi* | [**getCampaigns**](docs/Api/ManagementApi.md#getcampaigns) | **GET** /v1/applications/{applicationId}/campaigns | List campaigns *ManagementApi* | [**getChanges**](docs/Api/ManagementApi.md#getchanges) | **GET** /v1/changes | Get audit logs for an account @@ -289,6 +303,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**getCustomerActivityReportsWithoutTotalCount**](docs/Api/ManagementApi.md#getcustomeractivityreportswithouttotalcount) | **GET** /v1/applications/{applicationId}/customer_activity_reports/no_total | Get Activity Reports for Application Customers *ManagementApi* | [**getCustomerAnalytics**](docs/Api/ManagementApi.md#getcustomeranalytics) | **GET** /v1/applications/{applicationId}/customers/{customerId}/analytics | Get customer's analytics report *ManagementApi* | [**getCustomerProfile**](docs/Api/ManagementApi.md#getcustomerprofile) | **GET** /v1/customers/{customerId} | Get customer profile +*ManagementApi* | [**getCustomerProfileAchievementProgress**](docs/Api/ManagementApi.md#getcustomerprofileachievementprogress) | **GET** /v1/applications/{applicationId}/achievement_progress/{integrationId} | List customer achievements *ManagementApi* | [**getCustomerProfiles**](docs/Api/ManagementApi.md#getcustomerprofiles) | **GET** /v1/customers/no_total | List customer profiles *ManagementApi* | [**getCustomersByAttributes**](docs/Api/ManagementApi.md#getcustomersbyattributes) | **POST** /v1/customer_search/no_total | List customer profiles matching the given attributes *ManagementApi* | [**getEventTypes**](docs/Api/ManagementApi.md#geteventtypes) | **GET** /v1/event_types | List event types @@ -314,6 +329,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**getWebhooks**](docs/Api/ManagementApi.md#getwebhooks) | **GET** /v1/webhooks | List webhooks *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* | [**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 @@ -322,6 +338,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**importPoolGiveaways**](docs/Api/ManagementApi.md#importpoolgiveaways) | **POST** /v1/giveaways/pools/{poolId}/import | Import giveaway codes into a giveaway pool *ManagementApi* | [**importReferrals**](docs/Api/ManagementApi.md#importreferrals) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals | Import referrals *ManagementApi* | [**listAccountCollections**](docs/Api/ManagementApi.md#listaccountcollections) | **GET** /v1/collections | List collections in account +*ManagementApi* | [**listAchievements**](docs/Api/ManagementApi.md#listachievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements | List achievements *ManagementApi* | [**listCatalogItems**](docs/Api/ManagementApi.md#listcatalogitems) | **GET** /v1/catalogs/{catalogId}/items | List items in a catalog *ManagementApi* | [**listCollections**](docs/Api/ManagementApi.md#listcollections) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections | List collections in campaign *ManagementApi* | [**listCollectionsInApplication**](docs/Api/ManagementApi.md#listcollectionsinapplication) | **GET** /v1/applications/{applicationId}/collections | List collections in Application @@ -336,6 +353,7 @@ Class | Method | HTTP request | Description *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 *ManagementApi* | [**updateAccountCollection**](docs/Api/ManagementApi.md#updateaccountcollection) | **PUT** /v1/collections/{collectionId} | Update account-level collection +*ManagementApi* | [**updateAchievement**](docs/Api/ManagementApi.md#updateachievement) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Update achievement *ManagementApi* | [**updateAdditionalCost**](docs/Api/ManagementApi.md#updateadditionalcost) | **PUT** /v1/additional_costs/{additionalCostId} | Update additional cost *ManagementApi* | [**updateAttribute**](docs/Api/ManagementApi.md#updateattribute) | **PUT** /v1/attributes/{attributeId} | Update custom attribute *ManagementApi* | [**updateCampaign**](docs/Api/ManagementApi.md#updatecampaign) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId} | Update campaign @@ -344,7 +362,9 @@ Class | Method | HTTP request | Description *ManagementApi* | [**updateCouponBatch**](docs/Api/ManagementApi.md#updatecouponbatch) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Update coupons *ManagementApi* | [**updateLoyaltyCard**](docs/Api/ManagementApi.md#updateloyaltycard) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Update loyalty card status *ManagementApi* | [**updateReferral**](docs/Api/ManagementApi.md#updatereferral) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} | Update referral +*ManagementApi* | [**updateRoleV2**](docs/Api/ManagementApi.md#updaterolev2) | **PUT** /v2/roles/{roleId} | Update role *ManagementApi* | [**updateStore**](docs/Api/ManagementApi.md#updatestore) | **PUT** /v1/applications/{applicationId}/stores/{storeId} | Update store +*ManagementApi* | [**updateUser**](docs/Api/ManagementApi.md#updateuser) | **PUT** /v1/users/{userId} | Update user ## Documentation For Models @@ -357,7 +377,6 @@ Class | Method | HTTP request | Description - [AccountAdditionalCost](docs/Model/AccountAdditionalCost.md) - [AccountAnalytics](docs/Model/AccountAnalytics.md) - [AccountDashboardStatistic](docs/Model/AccountDashboardStatistic.md) - - [AccountDashboardStatisticApiCalls](docs/Model/AccountDashboardStatisticApiCalls.md) - [AccountDashboardStatisticCampaigns](docs/Model/AccountDashboardStatisticCampaigns.md) - [AccountDashboardStatisticDiscount](docs/Model/AccountDashboardStatisticDiscount.md) - [AccountDashboardStatisticLoyaltyPoints](docs/Model/AccountDashboardStatisticLoyaltyPoints.md) @@ -365,6 +384,9 @@ Class | Method | HTTP request | Description - [AccountDashboardStatisticRevenue](docs/Model/AccountDashboardStatisticRevenue.md) - [AccountEntity](docs/Model/AccountEntity.md) - [AccountLimits](docs/Model/AccountLimits.md) + - [Achievement](docs/Model/Achievement.md) + - [AchievementAdditionalProperties](docs/Model/AchievementAdditionalProperties.md) + - [AchievementProgress](docs/Model/AchievementProgress.md) - [AddFreeItemEffectProps](docs/Model/AddFreeItemEffectProps.md) - [AddItemCatalogAction](docs/Model/AddItemCatalogAction.md) - [AddLoyaltyPoints](docs/Model/AddLoyaltyPoints.md) @@ -375,7 +397,19 @@ Class | Method | HTTP request | Description - [AdditionalCost](docs/Model/AdditionalCost.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) + - [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) @@ -397,7 +431,6 @@ Class | Method | HTTP request | Description - [AudienceMembership](docs/Model/AudienceMembership.md) - [AwardGiveawayEffectProps](docs/Model/AwardGiveawayEffectProps.md) - [BaseCampaign](docs/Model/BaseCampaign.md) - - [BaseCampaignForNotification](docs/Model/BaseCampaignForNotification.md) - [BaseLoyaltyProgram](docs/Model/BaseLoyaltyProgram.md) - [BaseNotification](docs/Model/BaseNotification.md) - [BaseNotificationEntity](docs/Model/BaseNotificationEntity.md) @@ -422,7 +455,6 @@ Class | Method | HTTP request | Description - [CampaignEvaluationGroup](docs/Model/CampaignEvaluationGroup.md) - [CampaignEvaluationPosition](docs/Model/CampaignEvaluationPosition.md) - [CampaignEvaluationTreeChangedNotification](docs/Model/CampaignEvaluationTreeChangedNotification.md) - - [CampaignForNotification](docs/Model/CampaignForNotification.md) - [CampaignGroup](docs/Model/CampaignGroup.md) - [CampaignGroupEntity](docs/Model/CampaignGroupEntity.md) - [CampaignNotification](docs/Model/CampaignNotification.md) @@ -434,10 +466,11 @@ Class | Method | HTTP request | Description - [CampaignSetLeafNode](docs/Model/CampaignSetLeafNode.md) - [CampaignSetNode](docs/Model/CampaignSetNode.md) - [CampaignStateChangedNotification](docs/Model/CampaignStateChangedNotification.md) - - [CampaignStateNotification](docs/Model/CampaignStateNotification.md) - [CampaignTemplate](docs/Model/CampaignTemplate.md) - [CampaignTemplateCollection](docs/Model/CampaignTemplateCollection.md) - [CampaignTemplateParams](docs/Model/CampaignTemplateParams.md) + - [CardExpiringPointsNotificationPolicy](docs/Model/CardExpiringPointsNotificationPolicy.md) + - [CardExpiringPointsNotificationTrigger](docs/Model/CardExpiringPointsNotificationTrigger.md) - [CardLedgerPointsEntryIntegrationAPI](docs/Model/CardLedgerPointsEntryIntegrationAPI.md) - [CardLedgerTransactionLogEntry](docs/Model/CardLedgerTransactionLogEntry.md) - [CardLedgerTransactionLogEntryIntegrationAPI](docs/Model/CardLedgerTransactionLogEntryIntegrationAPI.md) @@ -449,6 +482,7 @@ Class | Method | HTTP request | Description - [CatalogSyncRequest](docs/Model/CatalogSyncRequest.md) - [CatalogsStrikethroughNotificationPolicy](docs/Model/CatalogsStrikethroughNotificationPolicy.md) - [Change](docs/Model/Change.md) + - [ChangeLoyaltyTierLevelEffectProps](docs/Model/ChangeLoyaltyTierLevelEffectProps.md) - [ChangeProfilePassword](docs/Model/ChangeProfilePassword.md) - [CodeGeneratorSettings](docs/Model/CodeGeneratorSettings.md) - [Collection](docs/Model/Collection.md) @@ -464,6 +498,7 @@ Class | Method | HTTP request | Description - [CouponSearch](docs/Model/CouponSearch.md) - [CouponValue](docs/Model/CouponValue.md) - [CouponsNotificationPolicy](docs/Model/CouponsNotificationPolicy.md) + - [CreateAchievement](docs/Model/CreateAchievement.md) - [CreateApplicationAPIKey](docs/Model/CreateApplicationAPIKey.md) - [CreateManagementKey](docs/Model/CreateManagementKey.md) - [CreateTemplateCampaign](docs/Model/CreateTemplateCampaign.md) @@ -482,8 +517,10 @@ Class | Method | HTTP request | Description - [CustomerProfileUpdateV2Response](docs/Model/CustomerProfileUpdateV2Response.md) - [CustomerSession](docs/Model/CustomerSession.md) - [CustomerSessionV2](docs/Model/CustomerSessionV2.md) + - [DeactivateUserRequest](docs/Model/DeactivateUserRequest.md) - [DeductLoyaltyPoints](docs/Model/DeductLoyaltyPoints.md) - [DeductLoyaltyPointsEffectProps](docs/Model/DeductLoyaltyPointsEffectProps.md) + - [DeleteUserRequest](docs/Model/DeleteUserRequest.md) - [Effect](docs/Model/Effect.md) - [EffectEntity](docs/Model/EffectEntity.md) - [EmailEntity](docs/Model/EmailEntity.md) @@ -499,6 +536,8 @@ Class | Method | HTTP request | Description - [Event](docs/Model/Event.md) - [EventType](docs/Model/EventType.md) - [EventV2](docs/Model/EventV2.md) + - [ExpiringCouponsNotificationPolicy](docs/Model/ExpiringCouponsNotificationPolicy.md) + - [ExpiringCouponsNotificationTrigger](docs/Model/ExpiringCouponsNotificationTrigger.md) - [ExpiringPointsNotificationPolicy](docs/Model/ExpiringPointsNotificationPolicy.md) - [ExpiringPointsNotificationTrigger](docs/Model/ExpiringPointsNotificationTrigger.md) - [Export](docs/Model/Export.md) @@ -506,11 +545,13 @@ Class | Method | HTTP request | Description - [FeaturesFeed](docs/Model/FeaturesFeed.md) - [FuncArgDef](docs/Model/FuncArgDef.md) - [FunctionDef](docs/Model/FunctionDef.md) + - [GetIntegrationCouponRequest](docs/Model/GetIntegrationCouponRequest.md) - [Giveaway](docs/Model/Giveaway.md) - [GiveawaysPool](docs/Model/GiveawaysPool.md) - [IdentifiableEntity](docs/Model/IdentifiableEntity.md) - [Import](docs/Model/Import.md) - [ImportEntity](docs/Model/ImportEntity.md) + - [IncreaseAchievementProgressEffectProps](docs/Model/IncreaseAchievementProgressEffectProps.md) - [InlineResponse200](docs/Model/InlineResponse200.md) - [InlineResponse2001](docs/Model/InlineResponse2001.md) - [InlineResponse20010](docs/Model/InlineResponse20010.md) @@ -550,6 +591,10 @@ Class | Method | HTTP request | Description - [InlineResponse20041](docs/Model/InlineResponse20041.md) - [InlineResponse20042](docs/Model/InlineResponse20042.md) - [InlineResponse20043](docs/Model/InlineResponse20043.md) + - [InlineResponse20044](docs/Model/InlineResponse20044.md) + - [InlineResponse20045](docs/Model/InlineResponse20045.md) + - [InlineResponse20046](docs/Model/InlineResponse20046.md) + - [InlineResponse20047](docs/Model/InlineResponse20047.md) - [InlineResponse2005](docs/Model/InlineResponse2005.md) - [InlineResponse2006](docs/Model/InlineResponse2006.md) - [InlineResponse2007](docs/Model/InlineResponse2007.md) @@ -599,6 +644,10 @@ Class | Method | HTTP request | Description - [LoyaltyTier](docs/Model/LoyaltyTier.md) - [ManagementKey](docs/Model/ManagementKey.md) - [ManagerConfig](docs/Model/ManagerConfig.md) + - [MessageLogEntries](docs/Model/MessageLogEntries.md) + - [MessageLogEntry](docs/Model/MessageLogEntry.md) + - [MessageLogRequest](docs/Model/MessageLogRequest.md) + - [MessageLogResponse](docs/Model/MessageLogResponse.md) - [Meta](docs/Model/Meta.md) - [ModelReturn](docs/Model/ModelReturn.md) - [MultiApplicationEntity](docs/Model/MultiApplicationEntity.md) @@ -644,6 +693,7 @@ Class | Method | HTTP request | Description - [NewLoyaltyTier](docs/Model/NewLoyaltyTier.md) - [NewManagementKey](docs/Model/NewManagementKey.md) - [NewMultipleAudiencesItem](docs/Model/NewMultipleAudiencesItem.md) + - [NewNotificationTest](docs/Model/NewNotificationTest.md) - [NewNotificationWebhook](docs/Model/NewNotificationWebhook.md) - [NewOutgoingIntegrationWebhook](docs/Model/NewOutgoingIntegrationWebhook.md) - [NewPassword](docs/Model/NewPassword.md) @@ -662,6 +712,8 @@ Class | Method | HTTP request | Description - [NewWebhook](docs/Model/NewWebhook.md) - [Notification](docs/Model/Notification.md) - [NotificationActivation](docs/Model/NotificationActivation.md) + - [NotificationListItem](docs/Model/NotificationListItem.md) + - [NotificationTest](docs/Model/NotificationTest.md) - [OneTimeCode](docs/Model/OneTimeCode.md) - [OutgoingIntegrationBrazePolicy](docs/Model/OutgoingIntegrationBrazePolicy.md) - [OutgoingIntegrationCleverTapPolicy](docs/Model/OutgoingIntegrationCleverTapPolicy.md) @@ -677,6 +729,7 @@ Class | Method | HTTP request | Description - [PatchManyItemsCatalogAction](docs/Model/PatchManyItemsCatalogAction.md) - [PendingPointsNotificationPolicy](docs/Model/PendingPointsNotificationPolicy.md) - [Picklist](docs/Model/Picklist.md) + - [Product](docs/Model/Product.md) - [ProfileAudiencesChanges](docs/Model/ProfileAudiencesChanges.md) - [RedeemReferralEffectProps](docs/Model/RedeemReferralEffectProps.md) - [Referral](docs/Model/Referral.md) @@ -711,6 +764,7 @@ Class | Method | HTTP request | Description - [Ruleset](docs/Model/Ruleset.md) - [SSOConfig](docs/Model/SSOConfig.md) - [SamlConnection](docs/Model/SamlConnection.md) + - [SamlConnectionInternal](docs/Model/SamlConnectionInternal.md) - [SamlConnectionMetadata](docs/Model/SamlConnectionMetadata.md) - [SamlLoginEndpoint](docs/Model/SamlLoginEndpoint.md) - [Session](docs/Model/Session.md) @@ -738,12 +792,15 @@ Class | Method | HTTP request | Description - [TierUpgradeNotificationPolicy](docs/Model/TierUpgradeNotificationPolicy.md) - [TierWillDowngradeNotificationPolicy](docs/Model/TierWillDowngradeNotificationPolicy.md) - [TierWillDowngradeNotificationTrigger](docs/Model/TierWillDowngradeNotificationTrigger.md) + - [TimePoint](docs/Model/TimePoint.md) - [TrackEventV2Response](docs/Model/TrackEventV2Response.md) - [TransferLoyaltyCard](docs/Model/TransferLoyaltyCard.md) - [TriggerWebhookEffectProps](docs/Model/TriggerWebhookEffectProps.md) - [TwoFAConfig](docs/Model/TwoFAConfig.md) - [UpdateAccount](docs/Model/UpdateAccount.md) + - [UpdateAchievement](docs/Model/UpdateAchievement.md) - [UpdateApplication](docs/Model/UpdateApplication.md) + - [UpdateApplicationAPIKey](docs/Model/UpdateApplicationAPIKey.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 8109d8a2..02656c75 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "talon-one/talon-one-client", "type": "library", - "version": "6.0.0", + "version": "7.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 ce37b73f..99a1e220 100644 --- a/docs/Api/IntegrationApi.md +++ b/docs/Api/IntegrationApi.md @@ -318,7 +318,7 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi( new GuzzleHttp\Client(), $config ); -$audienceId = 56; // int | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). +$audienceId = 56; // int | The ID of the audience. try { $apiInstance->deleteAudienceMembershipsV2($audienceId); @@ -333,7 +333,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **audienceId** | **int**| The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). | + **audienceId** | **int**| The ID of the audience. | ### Return type @@ -380,7 +380,7 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi( new GuzzleHttp\Client(), $config ); -$audienceId = 56; // int | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). +$audienceId = 56; // int | The ID of the audience. try { $apiInstance->deleteAudienceV2($audienceId); @@ -395,7 +395,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **audienceId** | **int**| The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). | + **audienceId** | **int**| The ID of the audience. | ### Return type @@ -543,7 +543,7 @@ void (empty response body) ## getCustomerInventory -> \TalonOne\Client\Model\CustomerInventory getCustomerInventory($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways) +> \TalonOne\Client\Model\CustomerInventory getCustomerInventory($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways, $achievements) List customer data @@ -574,9 +574,10 @@ $referrals = True; // bool | Set to `true` to include referral information in th $coupons = True; // bool | Set to `true` to include coupon information in the response. $loyalty = True; // bool | Set to `true` to include loyalty information in the response. $giveaways = True; // bool | Set to `true` to include giveaways information in the response. +$achievements = True; // bool | Set to `true` to include achievement information in the response. try { - $result = $apiInstance->getCustomerInventory($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways); + $result = $apiInstance->getCustomerInventory($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways, $achievements); print_r($result); } catch (Exception $e) { echo 'Exception when calling IntegrationApi->getCustomerInventory: ', $e->getMessage(), PHP_EOL; @@ -595,6 +596,7 @@ Name | Type | Description | Notes **coupons** | **bool**| Set to `true` to include coupon information in the response. | [optional] **loyalty** | **bool**| Set to `true` to include loyalty information in the response. | [optional] **giveaways** | **bool**| Set to `true` to include giveaways information in the response. | [optional] + **achievements** | **bool**| Set to `true` to include achievement information in the response. | [optional] ### Return type @@ -706,7 +708,7 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi( ); $loyaltyProgramId = 56; // int | 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. $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. +$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. try { $result = $apiInstance->getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate); @@ -724,7 +726,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **loyaltyProgramId** | **int**| 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. | **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. | [optional] + **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] ### Return type @@ -773,7 +775,7 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi( ); $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. $loyaltyCardId = 'loyaltyCardId_example'; // string | 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. -$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. +$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. try { $result = $apiInstance->getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDate); @@ -791,7 +793,7 @@ 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. | **loyaltyCardId** | **string**| 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. | - **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. | [optional] + **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] ### Return type @@ -842,7 +844,7 @@ $loyaltyProgramId = 56; // int | Identifier of the card-based loyalty program co $loyaltyCardId = 'loyaltyCardId_example'; // string | 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. $status = 'active'; // string | Filter points based on their status. $subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. -$pageSize = 50; // int | The number of items in this response. +$pageSize = 50; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. try { @@ -863,7 +865,7 @@ Name | Type | Description | Notes **loyaltyCardId** | **string**| 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. | **status** | **string**| Filter points based on their status. | [optional] [default to 'active'] **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 50] + **pageSize** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] ### Return type @@ -915,9 +917,9 @@ $loyaltyProgramId = 56; // int | Identifier of the card-based loyalty program co $loyaltyCardId = 'loyaltyCardId_example'; // string | 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. $subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. $loyaltyTransactionType = 'loyaltyTransactionType_example'; // string | 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. -$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$pageSize = 1000; // int | The number of items in this response. +$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$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. try { @@ -938,9 +940,9 @@ Name | Type | Description | Notes **loyaltyCardId** | **string**| 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. | **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] **loyaltyTransactionType** | **string**| 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] - **startDate** | **\DateTime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **endDate** | **\DateTime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **startDate** | **\DateTime**| 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] + **endDate** | **\DateTime**| 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] + **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] ### Return type @@ -992,7 +994,7 @@ $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. $status = 'active'; // string | Filter points based on their status. $subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. -$pageSize = 50; // int | The number of items in this response. +$pageSize = 50; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. try { @@ -1013,7 +1015,7 @@ 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. | **status** | **string**| Filter points based on their status. | [optional] [default to 'active'] **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 50] + **pageSize** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] ### Return type @@ -1065,9 +1067,9 @@ $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. $subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. $loyaltyTransactionType = 'loyaltyTransactionType_example'; // string | 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. -$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$pageSize = 50; // int | The number of items in this response. +$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$pageSize = 50; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. try { @@ -1088,9 +1090,9 @@ 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. | **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] **loyaltyTransactionType** | **string**| 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] - **startDate** | **\DateTime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **endDate** | **\DateTime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 50] + **startDate** | **\DateTime**| 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] + **endDate** | **\DateTime**| 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] + **pageSize** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] ### Return type @@ -1377,7 +1379,7 @@ Name | Type | Description | Notes Sync cart item catalog -Perform one or more of the following sync actions on this cart item catalog, up to 1000 actions: - Add an item to the catalog. - Edit the attributes of an item in the catalog. - Edit the attributes of more than one item in the catalog. - Remove an item from the catalog. - Remove more than one item from the catalog. **Note:** For more information, see [our documentation on 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-cart-item-catalogs#displaying-the-details-and-content-of-a-catalog) 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\": \"shoe\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100 }, \"type\": \"ADD\" } ] } ```
Editing the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\" }, \"type\": \"PATCH\" } ] } ```
Editing the attributes of several items at once
```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 at once
```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 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\" } ] } ```
### Example @@ -1530,7 +1532,7 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi( new GuzzleHttp\Client(), $config ); -$audienceId = 56; // int | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). +$audienceId = 56; // int | The ID of the audience. $body = new \stdClass; // object | body try { @@ -1546,7 +1548,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **audienceId** | **int**| The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). | + **audienceId** | **int**| The ID of the audience. | **body** | **object**| body | ### Return type @@ -1594,7 +1596,7 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi( new GuzzleHttp\Client(), $config ); -$audienceId = 56; // int | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). +$audienceId = 56; // int | The ID of the audience. $body = new \TalonOne\Client\Model\UpdateAudience(); // \TalonOne\Client\Model\UpdateAudience | body try { @@ -1611,7 +1613,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **audienceId** | **int**| The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). | + **audienceId** | **int**| The ID of the audience. | **body** | [**\TalonOne\Client\Model\UpdateAudience**](../Model/UpdateAudience.md)| body | ### Return type @@ -1638,7 +1640,7 @@ Name | Type | Description | Notes Update multiple customer profiles' audiences -Update the specified customer profiles with the specified audiences. Use this endpoint when customers join or leave audiences. The limit of customer profiles per request is 1000. **Note:** You can also add customer profiles to or remove them from an audience using the [Update audience](https://docs.talon.one/docs/product/rules/effects/using-effects#updating-an-audience) effect. +Add customer profiles to or remove them from an audience. The endpoint supports 1000 audience actions (`add` or `remove`) per request. **Note:** You can also do this using the [Update audience](https://docs.talon.one/docs/product/rules/effects/using-effects#updating-an-audience) effect. ### Example @@ -1830,7 +1832,7 @@ Name | Type | Description | Notes ## updateCustomerSessionV2 -> \TalonOne\Client\Model\IntegrationStateV2 updateCustomerSessionV2($customerSessionId, $body, $dry) +> \TalonOne\Client\Model\IntegrationStateV2 updateCustomerSessionV2($customerSessionId, $body, $dry, $now) Update customer session @@ -1858,9 +1860,10 @@ $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). +$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 { - $result = $apiInstance->updateCustomerSessionV2($customerSessionId, $body, $dry); + $result = $apiInstance->updateCustomerSessionV2($customerSessionId, $body, $dry, $now); print_r($result); } catch (Exception $e) { echo 'Exception when calling IntegrationApi->updateCustomerSessionV2: ', $e->getMessage(), PHP_EOL; @@ -1876,6 +1879,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] + **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 150f224d..4bfc6497 100644 --- a/docs/Api/ManagementApi.md +++ b/docs/Api/ManagementApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**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 [**createAccountCollection**](ManagementApi.md#createAccountCollection) | **POST** /v1/collections | Create account-level collection +[**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 [**createCampaignFromTemplate**](ManagementApi.md#createCampaignFromTemplate) | **POST** /v1/applications/{applicationId}/create_campaign_from_template | Create campaign from campaign template @@ -15,11 +16,15 @@ Method | HTTP request | Description [**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 [**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 [**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 [**deleteCampaign**](ManagementApi.md#deleteCampaign) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId} | Delete campaign [**deleteCollection**](ManagementApi.md#deleteCollection) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId} | Delete campaign-level collection [**deleteCoupon**](ManagementApi.md#deleteCoupon) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} | Delete coupon @@ -27,8 +32,12 @@ Method | HTTP request | Description [**deleteLoyaltyCard**](ManagementApi.md#deleteLoyaltyCard) | **DELETE** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Delete loyalty card [**deleteReferral**](ManagementApi.md#deleteReferral) | **DELETE** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} | Delete referral [**deleteStore**](ManagementApi.md#deleteStore) | **DELETE** /v1/applications/{applicationId}/stores/{storeId} | Delete store +[**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 [**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 [**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 @@ -45,6 +54,7 @@ Method | HTTP request | Description [**getAccount**](ManagementApi.md#getAccount) | **GET** /v1/accounts/{accountId} | Get account details [**getAccountAnalytics**](ManagementApi.md#getAccountAnalytics) | **GET** /v1/accounts/{accountId}/analytics | Get account analytics [**getAccountCollection**](ManagementApi.md#getAccountCollection) | **GET** /v1/collections/{collectionId} | Get account-level collection +[**getAchievement**](ManagementApi.md#getAchievement) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Get achievement [**getAdditionalCost**](ManagementApi.md#getAdditionalCost) | **GET** /v1/additional_costs/{additionalCostId} | Get additional cost [**getAdditionalCosts**](ManagementApi.md#getAdditionalCosts) | **GET** /v1/additional_costs | List additional costs [**getAllAccessLogs**](ManagementApi.md#getAllAccessLogs) | **GET** /v1/access_logs | List access logs @@ -62,10 +72,14 @@ Method | HTTP request | Description [**getApplications**](ManagementApi.md#getApplications) | **GET** /v1/applications | List Applications [**getAttribute**](ManagementApi.md#getAttribute) | **GET** /v1/attributes/{attributeId} | Get custom attribute [**getAttributes**](ManagementApi.md#getAttributes) | **GET** /v1/attributes | List custom attributes +[**getAudienceMemberships**](ManagementApi.md#getAudienceMemberships) | **GET** /v1/audiences/{audienceId}/memberships | List audience members [**getAudiences**](ManagementApi.md#getAudiences) | **GET** /v1/audiences | List audiences +[**getAudiencesAnalytics**](ManagementApi.md#getAudiencesAnalytics) | **GET** /v1/audiences/analytics | List audience analytics [**getCampaign**](ManagementApi.md#getCampaign) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId} | Get campaign [**getCampaignAnalytics**](ManagementApi.md#getCampaignAnalytics) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/analytics | Get analytics of campaigns [**getCampaignByAttributes**](ManagementApi.md#getCampaignByAttributes) | **POST** /v1/applications/{applicationId}/campaigns_search | List campaigns that match the given attributes +[**getCampaignGroup**](ManagementApi.md#getCampaignGroup) | **GET** /v1/campaign_groups/{campaignGroupId} | Get campaign access group +[**getCampaignGroups**](ManagementApi.md#getCampaignGroups) | **GET** /v1/campaign_groups | List campaign access groups [**getCampaignTemplates**](ManagementApi.md#getCampaignTemplates) | **GET** /v1/campaign_templates | List campaign templates [**getCampaigns**](ManagementApi.md#getCampaigns) | **GET** /v1/applications/{applicationId}/campaigns | List campaigns [**getChanges**](ManagementApi.md#getChanges) | **GET** /v1/changes | Get audit logs for an account @@ -76,6 +90,7 @@ Method | HTTP request | Description [**getCustomerActivityReportsWithoutTotalCount**](ManagementApi.md#getCustomerActivityReportsWithoutTotalCount) | **GET** /v1/applications/{applicationId}/customer_activity_reports/no_total | Get Activity Reports for Application Customers [**getCustomerAnalytics**](ManagementApi.md#getCustomerAnalytics) | **GET** /v1/applications/{applicationId}/customers/{customerId}/analytics | Get customer's analytics report [**getCustomerProfile**](ManagementApi.md#getCustomerProfile) | **GET** /v1/customers/{customerId} | Get customer profile +[**getCustomerProfileAchievementProgress**](ManagementApi.md#getCustomerProfileAchievementProgress) | **GET** /v1/applications/{applicationId}/achievement_progress/{integrationId} | List customer achievements [**getCustomerProfiles**](ManagementApi.md#getCustomerProfiles) | **GET** /v1/customers/no_total | List customer profiles [**getCustomersByAttributes**](ManagementApi.md#getCustomersByAttributes) | **POST** /v1/customer_search/no_total | List customer profiles matching the given attributes [**getEventTypes**](ManagementApi.md#getEventTypes) | **GET** /v1/event_types | List event types @@ -101,6 +116,7 @@ Method | HTTP request | Description [**getWebhooks**](ManagementApi.md#getWebhooks) | **GET** /v1/webhooks | List webhooks [**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 [**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 @@ -109,6 +125,7 @@ Method | HTTP request | Description [**importPoolGiveaways**](ManagementApi.md#importPoolGiveaways) | **POST** /v1/giveaways/pools/{poolId}/import | Import giveaway codes into a giveaway pool [**importReferrals**](ManagementApi.md#importReferrals) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals | Import referrals [**listAccountCollections**](ManagementApi.md#listAccountCollections) | **GET** /v1/collections | List collections in account +[**listAchievements**](ManagementApi.md#listAchievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements | List achievements [**listCatalogItems**](ManagementApi.md#listCatalogItems) | **GET** /v1/catalogs/{catalogId}/items | List items in a catalog [**listCollections**](ManagementApi.md#listCollections) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/collections | List collections in campaign [**listCollectionsInApplication**](ManagementApi.md#listCollectionsInApplication) | **GET** /v1/applications/{applicationId}/collections | List collections in Application @@ -123,6 +140,7 @@ Method | HTTP request | Description [**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 [**updateAccountCollection**](ManagementApi.md#updateAccountCollection) | **PUT** /v1/collections/{collectionId} | Update account-level collection +[**updateAchievement**](ManagementApi.md#updateAchievement) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId} | Update achievement [**updateAdditionalCost**](ManagementApi.md#updateAdditionalCost) | **PUT** /v1/additional_costs/{additionalCostId} | Update additional cost [**updateAttribute**](ManagementApi.md#updateAttribute) | **PUT** /v1/attributes/{attributeId} | Update custom attribute [**updateCampaign**](ManagementApi.md#updateCampaign) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId} | Update campaign @@ -131,7 +149,9 @@ Method | HTTP request | Description [**updateCouponBatch**](ManagementApi.md#updateCouponBatch) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Update coupons [**updateLoyaltyCard**](ManagementApi.md#updateLoyaltyCard) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Update loyalty card status [**updateReferral**](ManagementApi.md#updateReferral) | **PUT** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId} | Update referral +[**updateRoleV2**](ManagementApi.md#updateRoleV2) | **PUT** /v2/roles/{roleId} | Update role [**updateStore**](ManagementApi.md#updateStore) | **PUT** /v1/applications/{applicationId}/stores/{storeId} | Update store +[**updateUser**](ManagementApi.md#updateUser) | **PUT** /v1/users/{userId} | Update user @@ -417,6 +437,78 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## createAchievement + +> \TalonOne\Client\Model\Achievement createAchievement($applicationId, $campaignId, $body) + +Create achievement + +Create a new achievement in 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. +$body = new \TalonOne\Client\Model\CreateAchievement(); // \TalonOne\Client\Model\CreateAchievement | body + +try { + $result = $apiInstance->createAchievement($applicationId, $campaignId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->createAchievement: ', $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\CreateAchievement**](../Model/CreateAchievement.md)| body | + +### Return type + +[**\TalonOne\Client\Model\Achievement**](../Model/Achievement.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) + + ## createAdditionalCost > \TalonOne\Client\Model\AccountAdditionalCost createAdditionalCost($body) @@ -915,13 +1007,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## createPasswordRecoveryEmail +## createInviteEmail -> \TalonOne\Client\Model\NewPasswordEmail createPasswordRecoveryEmail($body) +> \TalonOne\Client\Model\NewInviteEmail createInviteEmail($body) -Request a password reset +Resend invitation email -Send an email with a password recovery link to the email address of an existing account. **Note:** The password recovery link expires 30 minutes after this endpoint is triggered. +Resend an email invitation to an existing user. **Note:** The invitation token is valid for 24 hours after the email has been sent. ### Example @@ -947,13 +1039,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$body = new \TalonOne\Client\Model\NewPasswordEmail(); // \TalonOne\Client\Model\NewPasswordEmail | body +$body = new \TalonOne\Client\Model\NewInviteEmail(); // \TalonOne\Client\Model\NewInviteEmail | body try { - $result = $apiInstance->createPasswordRecoveryEmail($body); + $result = $apiInstance->createInviteEmail($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->createPasswordRecoveryEmail: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->createInviteEmail: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -963,11 +1055,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\TalonOne\Client\Model\NewPasswordEmail**](../Model/NewPasswordEmail.md)| body | + **body** | [**\TalonOne\Client\Model\NewInviteEmail**](../Model/NewInviteEmail.md)| body | ### Return type -[**\TalonOne\Client\Model\NewPasswordEmail**](../Model/NewPasswordEmail.md) +[**\TalonOne\Client\Model\NewInviteEmail**](../Model/NewInviteEmail.md) ### Authorization @@ -983,13 +1075,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## createSession +## createInviteV2 -> \TalonOne\Client\Model\Session createSession($body) +> \TalonOne\Client\Model\User createInviteV2($body) -Create session +Invite user -Create a session to use the Management API endpoints. Use the value of the `token` property provided in the response as bearer token in other API calls. A token is valid for 3 months. In accordance with best pratices, use your generated token for all your API requests. Do **not** regenerate a token for each request. This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup.

Granular API key

Instead of using a session, you can also use the Management API key feature in the Campaign Manager to decide which endpoints can be used with a given key.
+Create a new user in the account and send an invitation to their email address. **Note**: The invitation token is valid for 24 hours after the email has been sent. You can resend an invitation to a user with the [Resend invitation email](https://docs.talon.one/management-api#tag/Accounts-and-users/operation/createInviteEmail) endpoint. ### Example @@ -1015,13 +1107,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$body = new \TalonOne\Client\Model\LoginParams(); // \TalonOne\Client\Model\LoginParams | body +$body = new \TalonOne\Client\Model\NewInvitation(); // \TalonOne\Client\Model\NewInvitation | body try { - $result = $apiInstance->createSession($body); + $result = $apiInstance->createInviteV2($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->createSession: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->createInviteV2: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1031,11 +1123,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\TalonOne\Client\Model\LoginParams**](../Model/LoginParams.md)| body | + **body** | [**\TalonOne\Client\Model\NewInvitation**](../Model/NewInvitation.md)| body | ### Return type -[**\TalonOne\Client\Model\Session**](../Model/Session.md) +[**\TalonOne\Client\Model\User**](../Model/User.md) ### Authorization @@ -1051,13 +1143,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## createStore +## createPasswordRecoveryEmail -> \TalonOne\Client\Model\Store createStore($applicationId, $body) +> \TalonOne\Client\Model\NewPasswordEmail createPasswordRecoveryEmail($body) -Create store +Request a password reset -Create a new store in a specific Application. +Send an email with a password recovery link to the email address of an existing account. **Note:** The password recovery link expires 30 minutes after this endpoint is triggered. ### Example @@ -1083,14 +1175,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$body = new \TalonOne\Client\Model\NewStore(); // \TalonOne\Client\Model\NewStore | body +$body = new \TalonOne\Client\Model\NewPasswordEmail(); // \TalonOne\Client\Model\NewPasswordEmail | body try { - $result = $apiInstance->createStore($applicationId, $body); + $result = $apiInstance->createPasswordRecoveryEmail($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->createStore: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->createPasswordRecoveryEmail: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1100,12 +1191,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **body** | [**\TalonOne\Client\Model\NewStore**](../Model/NewStore.md)| body | + **body** | [**\TalonOne\Client\Model\NewPasswordEmail**](../Model/NewPasswordEmail.md)| body | ### Return type -[**\TalonOne\Client\Model\Store**](../Model/Store.md) +[**\TalonOne\Client\Model\NewPasswordEmail**](../Model/NewPasswordEmail.md) ### Authorization @@ -1121,13 +1211,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## deductLoyaltyCardPoints +## createSession -> deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body) +> \TalonOne\Client\Model\Session createSession($body) -Deduct points from card +Create session -Deduct points from the given loyalty card in the specified card-based loyalty program. +Create a session to use the Management API endpoints. Use the value of the `token` property provided in the response as bearer token in other API calls. A token is valid for 3 months. In accordance with best pratices, use your generated token for all your API requests. Do **not** regenerate a token for each request. This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup.

Granular API key

Instead of using a session, you can also use the Management API key feature in the Campaign Manager to decide which endpoints can be used with a given key.
### Example @@ -1153,14 +1243,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$loyaltyCardId = 'loyaltyCardId_example'; // string | 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. -$body = new \TalonOne\Client\Model\DeductLoyaltyPoints(); // \TalonOne\Client\Model\DeductLoyaltyPoints | body +$body = new \TalonOne\Client\Model\LoginParams(); // \TalonOne\Client\Model\LoginParams | body try { - $apiInstance->deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body); + $result = $apiInstance->createSession($body); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deductLoyaltyCardPoints: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->createSession: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1170,13 +1259,11 @@ try { 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. | - **loyaltyCardId** | **string**| 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. | - **body** | [**\TalonOne\Client\Model\DeductLoyaltyPoints**](../Model/DeductLoyaltyPoints.md)| body | + **body** | [**\TalonOne\Client\Model\LoginParams**](../Model/LoginParams.md)| body | ### Return type -void (empty response body) +[**\TalonOne\Client\Model\Session**](../Model/Session.md) ### Authorization @@ -1192,13 +1279,13 @@ void (empty response body) [[Back to README]](../../README.md) -## deleteAccountCollection +## createStore -> deleteAccountCollection($collectionId) +> \TalonOne\Client\Model\Store createStore($applicationId, $body) -Delete account-level collection +Create store -Delete a given account-level collection. +Create a new store in a specific Application. ### Example @@ -1224,12 +1311,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$body = new \TalonOne\Client\Model\NewStore(); // \TalonOne\Client\Model\NewStore | body try { - $apiInstance->deleteAccountCollection($collectionId); + $result = $apiInstance->createStore($applicationId, $body); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteAccountCollection: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->createStore: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1239,11 +1328,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **body** | [**\TalonOne\Client\Model\NewStore**](../Model/NewStore.md)| body | ### Return type -void (empty response body) +[**\TalonOne\Client\Model\Store**](../Model/Store.md) ### Authorization @@ -1251,7 +1341,7 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -1259,13 +1349,13 @@ void (empty response body) [[Back to README]](../../README.md) -## deleteCampaign +## deactivateUserByEmail -> deleteCampaign($applicationId, $campaignId) +> deactivateUserByEmail($body) -Delete campaign +Deactivate user by email address -Delete the given campaign. +Deactivate a specific user by their email address. ### Example @@ -1291,13 +1381,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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\DeactivateUserRequest(); // \TalonOne\Client\Model\DeactivateUserRequest | body try { - $apiInstance->deleteCampaign($applicationId, $campaignId); + $apiInstance->deactivateUserByEmail($body); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteCampaign: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deactivateUserByEmail: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1307,8 +1396,7 @@ try { 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\DeactivateUserRequest**](../Model/DeactivateUserRequest.md)| body | ### Return type @@ -1320,7 +1408,7 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -1328,13 +1416,13 @@ void (empty response body) [[Back to README]](../../README.md) -## deleteCollection +## deductLoyaltyCardPoints -> deleteCollection($applicationId, $campaignId, $collectionId) +> deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body) -Delete campaign-level collection +Deduct points from card -Delete a given campaign-level collection. +Deduct points from the given loyalty card in the specified card-based loyalty program. ### Example @@ -1360,14 +1448,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. +$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. +$loyaltyCardId = 'loyaltyCardId_example'; // string | 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. +$body = new \TalonOne\Client\Model\DeductLoyaltyPoints(); // \TalonOne\Client\Model\DeductLoyaltyPoints | body try { - $apiInstance->deleteCollection($applicationId, $campaignId, $collectionId); + $apiInstance->deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteCollection: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deductLoyaltyCardPoints: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1377,9 +1465,9 @@ try { 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. | - **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | + **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. | + **loyaltyCardId** | **string**| 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. | + **body** | [**\TalonOne\Client\Model\DeductLoyaltyPoints**](../Model/DeductLoyaltyPoints.md)| body | ### Return type @@ -1391,7 +1479,7 @@ void (empty response body) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -1399,13 +1487,13 @@ void (empty response body) [[Back to README]](../../README.md) -## deleteCoupon +## deleteAccountCollection -> deleteCoupon($applicationId, $campaignId, $couponId) +> deleteAccountCollection($collectionId) -Delete coupon +Delete account-level collection -Delete the specified coupon. +Delete a given account-level collection. ### Example @@ -1431,14 +1519,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$couponId = 'couponId_example'; // string | 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. +$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. try { - $apiInstance->deleteCoupon($applicationId, $campaignId, $couponId); + $apiInstance->deleteAccountCollection($collectionId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteCoupon: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteAccountCollection: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1448,9 +1534,7 @@ try { 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. | - **couponId** | **string**| 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. | + **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | ### Return type @@ -1463,20 +1547,20 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: 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) -## deleteCoupons +## deleteAchievement -> deleteCoupons($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch) +> deleteAchievement($applicationId, $campaignId, $achievementId) -Delete coupons +Delete achievement -Deletes all the coupons matching the specified criteria. +Delete the specified achievement. ### Example @@ -1504,24 +1588,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. -$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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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. -$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. -$exactMatch = false; // bool | Filter results to an exact case-insensitive matching against the coupon code +$achievementId = 56; // int | 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. try { - $apiInstance->deleteCoupons($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); + $apiInstance->deleteAchievement($applicationId, $campaignId, $achievementId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteCoupons: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteAchievement: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1533,19 +1605,7 @@ 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. | - **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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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] - **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] - **exactMatch** | **bool**| Filter results to an exact case-insensitive matching against the coupon code | [optional] [default to false] + **achievementId** | **int**| 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. | ### Return type @@ -1558,20 +1618,20 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: 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) -## deleteLoyaltyCard +## deleteCampaign -> deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId) +> deleteCampaign($applicationId, $campaignId) -Delete loyalty card +Delete campaign -Delete the given loyalty card. +Delete the given campaign. ### Example @@ -1597,13 +1657,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$loyaltyCardId = 'loyaltyCardId_example'; // string | 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. +$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->deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId); + $apiInstance->deleteCampaign($applicationId, $campaignId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteLoyaltyCard: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteCampaign: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1613,8 +1673,8 @@ try { 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. | - **loyaltyCardId** | **string**| 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. | + **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 @@ -1627,20 +1687,20 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **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) -## deleteReferral +## deleteCollection -> deleteReferral($applicationId, $campaignId, $referralId) +> deleteCollection($applicationId, $campaignId, $collectionId) -Delete referral +Delete campaign-level collection -Delete the specified referral. +Delete a given campaign-level collection. ### Example @@ -1668,12 +1728,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. -$referralId = 'referralId_example'; // string | The ID of the referral code. +$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. try { - $apiInstance->deleteReferral($applicationId, $campaignId, $referralId); + $apiInstance->deleteCollection($applicationId, $campaignId, $collectionId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteReferral: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteCollection: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1685,7 +1745,7 @@ 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. | - **referralId** | **string**| The ID of the referral code. | + **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | ### Return type @@ -1698,20 +1758,20 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: 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) -## deleteStore +## deleteCoupon -> deleteStore($applicationId, $storeId) +> deleteCoupon($applicationId, $campaignId, $couponId) -Delete store +Delete coupon -Delete the specified store. +Delete the specified coupon. ### Example @@ -1738,12 +1798,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$storeId = 'storeId_example'; // string | The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. +$campaignId = 56; // int | The ID of the campaign. It is displayed in your Talon.One deployment URL. +$couponId = 'couponId_example'; // string | 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. try { - $apiInstance->deleteStore($applicationId, $storeId); + $apiInstance->deleteCoupon($applicationId, $campaignId, $couponId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->deleteStore: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteCoupon: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1754,7 +1815,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **storeId** | **string**| The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. | + **campaignId** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | + **couponId** | **string**| 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. | ### Return type @@ -1767,20 +1829,20 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **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) -## destroySession +## deleteCoupons -> destroySession() +> deleteCoupons($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch) -Destroy session +Delete coupons -Destroys the session. +Deletes all the coupons matching the specified criteria. ### Example @@ -1806,18 +1868,50 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. +$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. +$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. +$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. +$exactMatch = false; // bool | Filter results to an exact case-insensitive matching against the coupon code try { - $apiInstance->destroySession(); + $apiInstance->deleteCoupons($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->destroySession: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteCoupons: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters -This endpoint does not need any parameter. + +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. | + **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] + **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] + **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] + **exactMatch** | **bool**| Filter results to an exact case-insensitive matching against the coupon code | [optional] [default to false] ### Return type @@ -1837,13 +1931,13 @@ void (empty response body) [[Back to README]](../../README.md) -## exportAccountCollectionItems +## deleteLoyaltyCard -> string exportAccountCollectionItems($collectionId) +> deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId) -Export account-level collection's items +Delete loyalty card -Download a CSV file containing items from a given account-level collection. **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/). +Delete the given loyalty card. ### Example @@ -1869,13 +1963,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. +$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. +$loyaltyCardId = 'loyaltyCardId_example'; // string | 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. try { - $result = $apiInstance->exportAccountCollectionItems($collectionId); - print_r($result); + $apiInstance->deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportAccountCollectionItems: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteLoyaltyCard: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1885,11 +1979,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | + **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. | + **loyaltyCardId** | **string**| 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. | ### Return type -**string** +void (empty response body) ### Authorization @@ -1898,20 +1993,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/csv +- **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) -## exportCollectionItems +## deleteReferral -> string exportCollectionItems($applicationId, $campaignId, $collectionId) +> deleteReferral($applicationId, $campaignId, $referralId) -Export campaign-level collection's items +Delete referral -Download a CSV file containing items from a given campaign-level collection. **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/). +Delete the specified referral. ### Example @@ -1939,13 +2034,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. -$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. +$referralId = 'referralId_example'; // string | The ID of the referral code. try { - $result = $apiInstance->exportCollectionItems($applicationId, $campaignId, $collectionId); - print_r($result); + $apiInstance->deleteReferral($applicationId, $campaignId, $referralId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportCollectionItems: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteReferral: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1957,11 +2051,11 @@ 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. | - **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | + **referralId** | **string**| The ID of the referral code. | ### Return type -**string** +void (empty response body) ### Authorization @@ -1970,20 +2064,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/csv +- **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) -## exportCoupons +## deleteStore -> string exportCoupons($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly) +> deleteStore($applicationId, $storeId) -Export coupons +Delete store -Download a CSV file containing the coupons that match the given properties. **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 can contain the following columns: - `accountid`: The ID of your deployment. - `applicationid`: The ID of the Application this coupon is related to. - `attributes`: A json object describing _custom_ referral attribute names and their values. - `batchid`: The ID of the batch this coupon is part of. - `campaignid`: The ID of the campaign this coupon is related to. - `counter`: The number of times this coupon has been redeemed. - `created`: The creation date of the coupon code. - `deleted`: Whether the coupon code is deleted. - `deleted_changelogid`: The ID of the delete event in the logs. - `discount_counter`: The amount of discount given by this coupon. - `discount_limitval`: The maximum discount amount that can be given be this coupon. - `expirydate`: The end date in RFC3339 of the code redemption period. - `id`: The internal ID of the coupon code. - `importid`: The ID of the import job that created this coupon. - `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. - `limits`: The limits set on this coupon. - `limitval`: The maximum number of redemptions of this code. - `recipientintegrationid`: The integration ID of the customer considered as recipient of the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon is reserved. - `reservation_counter`: How many times this coupon has been reserved. - `reservation_limitval`: The maximum of number of reservations this coupon can have. - `startdate`: The start date in RFC3339 of the code redemption period. - `value`: The coupon code. +Delete the specified store. ### Example @@ -2010,26 +2104,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $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. -$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. -$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 timezone. 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 timezone. 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`. -$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. -$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. -$valuesOnly = false; // bool | Filter results to only return the coupon codes (`value` column) without the associated coupon data. +$storeId = 'storeId_example'; // string | The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. try { - $result = $apiInstance->exportCoupons($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); - print_r($result); + $apiInstance->deleteStore($applicationId, $storeId); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportCoupons: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->deleteStore: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2040,20 +2120,946 @@ try { 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] - **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] - **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 timezone. 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 timezone. 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] - **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] - **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] - **valuesOnly** | **bool**| Filter results to only return the coupon codes (`value` column) without the associated coupon data. | [optional] [default to false] + **storeId** | **string**| The ID of the store. You can get this ID with the [List stores](#tag/Stores/operation/listStores) endpoint. | + +### 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) + + +## deleteUser + +> deleteUser($userId) + +Delete user + +Delete a specific user. + +### 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->deleteUser($userId); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->deleteUser: ', $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) + + +## deleteUserByEmail + +> deleteUserByEmail($body) + +Delete user by email address + +Delete a specific user by their email address. + +### 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\DeleteUserRequest(); // \TalonOne\Client\Model\DeleteUserRequest | body + +try { + $apiInstance->deleteUserByEmail($body); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->deleteUserByEmail: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\TalonOne\Client\Model\DeleteUserRequest**](../Model/DeleteUserRequest.md)| body | + +### Return type + +void (empty response body) + +### Authorization + +[management_key](../../README.md#management_key), [manager_auth](../../README.md#manager_auth) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## destroySession + +> destroySession() + +Destroy session + +Destroys the session. + +### 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->destroySession(); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->destroySession: ', $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) + + +## exportAccountCollectionItems + +> string exportAccountCollectionItems($collectionId) + +Export account-level collection's items + +Download a CSV file containing items from a given account-level collection. **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/). + +### 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 +); +$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. + +try { + $result = $apiInstance->exportAccountCollectionItems($collectionId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportAccountCollectionItems: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | + +### 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) + + +## exportAchievements + +> string exportAchievements($applicationId, $campaignId, $achievementId) + +Export achievement customer data + +Download a CSV file containing a list of all the customers who have participated in and are currently participating in the given achievement. The CSV file contains the following columns: - `profileIntegrationID`: The integration ID of the customer profile participating in the achievement. - `title`: The display name of the achievement in the Campaign Manager. - `target`: The required number of actions or the transactional milestone to complete the achievement. - `progress`: The current progress of the customer in the achievement. - `status`: The status of the achievement. Can be one of: ['inprogress', 'completed', 'expired']. - `startDate`: The date on which the customer profile started the achievement in RFC3339. - `endDate`: The date on which the achievement ends and resets for the customer profile in RFC3339. - `completionDate`: The date on which the customer profile completed the achievement in RFC3339. + +### 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. +$achievementId = 56; // int | 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. + +try { + $result = $apiInstance->exportAchievements($applicationId, $campaignId, $achievementId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportAchievements: ', $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. | + **achievementId** | **int**| 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. | + +### 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) + + +## exportAudiencesMemberships + +> string exportAudiencesMemberships($audienceId) + +Export audience members + +Download a CSV file containing the integration IDs of the members of an audience. **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 file contains the following column: - `profileintegrationid`: The integration ID of the customer profile. + +### 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 +); +$audienceId = 56; // int | The ID of the audience. + +try { + $result = $apiInstance->exportAudiencesMemberships($audienceId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportAudiencesMemberships: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **audienceId** | **int**| The ID of the audience. | + +### 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) + +Export campaign-level collection's items + +Download a CSV file containing items from a given campaign-level collection. **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/). + +### 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. +$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. + +try { + $result = $apiInstance->exportCollectionItems($applicationId, $campaignId, $collectionId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportCollectionItems: ', $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. | + **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | + +### 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) + + +## exportCoupons + +> string exportCoupons($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly) + +Export coupons + +Download a CSV file containing the coupons that match the given properties. **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 can contain the following columns: - `accountid`: The ID of your deployment. - `applicationid`: The ID of the Application this coupon is related to. - `attributes`: A json object describing _custom_ referral attribute names and their values. - `batchid`: The ID of the batch this coupon is part of. - `campaignid`: The ID of the campaign this coupon is related to. - `counter`: The number of times this coupon has been redeemed. - `created`: The creation date of the coupon code. - `deleted`: Whether the coupon code is deleted. - `deleted_changelogid`: The ID of the delete event in the logs. - `discount_counter`: The amount of discount given by this coupon. - `discount_limitval`: The maximum discount amount that can be given be this coupon. - `expirydate`: The end date in RFC3339 of the code redemption period. - `id`: The internal ID of the coupon code. - `importid`: The ID of the import job that created this coupon. - `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. - `limits`: The limits set on this coupon. - `limitval`: The maximum number of redemptions of this code. - `recipientintegrationid`: The integration ID of the customer considered as recipient of the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon is reserved. - `reservation_counter`: How many times this coupon has been reserved. - `reservation_limitval`: The maximum of number of reservations this coupon can have. - `startdate`: The start date in RFC3339 of the code redemption period. - `value`: The coupon 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 +); +$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. +$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. +$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. +$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`. +$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. +$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. +$valuesOnly = false; // bool | Filter results to only return the coupon codes (`value` column) without the associated coupon data. + +try { + $result = $apiInstance->exportCoupons($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportCoupons: ', $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** | **float**| Filter results by campaign. | [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] + **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] + **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] + **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] + **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] + **valuesOnly** | **bool**| Filter results to only return the coupon codes (`value` column) without the associated coupon data. | [optional] [default to false] + +### 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) + + +## exportCustomerSessions + +> string exportCustomerSessions($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState) + +Export customer sessions + +Download a CSV file containing the customer sessions that match the request. **Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/product/server-infrastructure-and-data-retention#data-retention-policy). **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/). - `id`: The internal ID of the session. - `firstsession`: Whether this is a first session. - `integrationid`: The integration ID of the session. - `applicationid`: The ID of the Application. - `profileid`: The internal ID of the customer profile. - `profileintegrationid`: The integration ID of the customer profile. - `created`: The timestamp when the session was created. - `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) of the session. - `cartitems`: The cart items in the session. - `discounts`: The discounts in the session. - `total`: The total value of cart items and additional costs in the session, before any discounts are applied. - `attributes`: The attributes set in the session. - `closedat`: Timestamp when the session was closed. - `cancelledat`: Timestamp when the session was cancelled. - `referral`: The referral code in the session. - `identifiers`: The identifiers in the session. - `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. - `updated`: Timestamp of the last session update. - `store_integration_id`: The integration ID of the store. - `coupons`: Coupon codes in the session. + +### 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. +$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. +$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. +$profileIntegrationId = 'profileIntegrationId_example'; // string | Only return sessions for the customer that matches this customer integration ID. +$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. +$customerSessionState = 'customerSessionState_example'; // string | Filter results by state. + +try { + $result = $apiInstance->exportCustomerSessions($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportCustomerSessions: ', $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. | + **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] + **createdAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] + **profileIntegrationId** | **string**| Only return sessions for the customer that matches this customer integration ID. | [optional] + **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] + **customerSessionState** | **string**| Filter results by state. | [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) + + +## exportCustomersTiers + +> string exportCustomersTiers($loyaltyProgramId, $subledgerIds, $tierNames) + +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. + +### 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 = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. +$subledgerIds = array('subledgerIds_example'); // string[] | An array of subledgers IDs to filter the export by. +$tierNames = array('tierNames_example'); // string[] | An array of tier names to filter the export by. + +try { + $result = $apiInstance->exportCustomersTiers($loyaltyProgramId, $subledgerIds, $tierNames); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportCustomersTiers: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyaltyProgramId** | **string**| The identifier for the loyalty program. | + **subledgerIds** | [**string[]**](../Model/string.md)| An array of subledgers IDs to filter the export by. | [optional] + **tierNames** | [**string[]**](../Model/string.md)| An array of tier names to filter the export by. | [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) + + +## exportEffects + +> string exportEffects($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat) + +Export triggered effects + +Download a CSV file containing the triggered effects that match the given attributes. **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: - `applicationid`: The ID of the Application. - `campaignid`: The ID of the campaign. - `couponid`: The ID of the coupon, when applicable to the effect. - `created`: The timestamp of the effect. - `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/events). - `eventid`: The internal ID of the effect. - `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). - `profileintegrationid`: The ID of the customer profile, when applicable. - `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. - `ruleindex`: The index of the rule. - `rulesetid`: The ID of the rule set. - `sessionid`: The internal ID of the session that triggered the effect. - `profileid`: The internal ID of the customer profile. - `sessionintegrationid`: The integration ID of the session. - `total_revenue`: The total revenue. - `store_integration_id`: The integration ID of the store. You choose this ID when you create a 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 = 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. +$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. + +try { + $result = $apiInstance->exportEffects($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportEffects: ', $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** | **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] + **dateFormat** | **string**| Determines the format of dates in the export document. | [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) + + +## exportLoyaltyBalance + +> string exportLoyaltyBalance($loyaltyProgramId, $endDate) + +Export customer loyalty balance to CSV + +⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer 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/). + +### 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 = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. +$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. + +try { + $result = $apiInstance->exportLoyaltyBalance($loyaltyProgramId, $endDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportLoyaltyBalance: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyaltyProgramId** | **string**| The identifier for the loyalty program. | + **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] + +### 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) + + +## exportLoyaltyBalances + +> string exportLoyaltyBalances($loyaltyProgramId, $endDate) + +Export customer loyalty balances + +Download a CSV file containing the balance of each customer 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: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export. + +### 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 = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. +$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. + +try { + $result = $apiInstance->exportLoyaltyBalances($loyaltyProgramId, $endDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->exportLoyaltyBalances: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyaltyProgramId** | **string**| The identifier for the loyalty program. | + **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] ### Return type @@ -2073,13 +3079,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## exportCustomerSessions +## exportLoyaltyCardBalances -> string exportCustomerSessions($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState) +> string exportLoyaltyCardBalances($loyaltyProgramId, $endDate) -Export customer sessions +Export all card transaction logs -Download a CSV file containing the customer sessions that match the request. **Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/product/server-infrastructure-and-data-retention#data-retention-policy). **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/). - `id`: The internal ID of the session. - `firstsession`: Whether this is a first session. - `integrationid`: The integration ID of the session. - `applicationid`: The ID of the Application. - `profileid`: The internal ID of the customer profile. - `profileintegrationid`: The integration ID of the customer profile. - `created`: The timestamp when the session was created. - `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) of the session. - `cartitems`: The cart items in the session. - `discounts`: The discounts in the session. - `total`: The total value of cart items and additional costs in the session, before any discounts are applied. - `attributes`: The attributes set in the session. - `closedat`: Timestamp when the session was closed. - `cancelledat`: Timestamp when the session was cancelled. - `referral`: The referral code in the session. - `identifiers`: The identifiers in the session. - `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. - `updated`: Timestamp of the last session update. - `store_integration_id`: The integration ID of the store. - `coupons`: Coupon codes in the session. +Download a CSV file containing the balances of all cards 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 CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The alphanumeric identifier of the loyalty card. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. ### Example @@ -2105,18 +3111,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. -$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. -$profileIntegrationId = 'profileIntegrationId_example'; // string | Only return sessions for the customer that matches this customer integration ID. -$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. -$customerSessionState = 'customerSessionState_example'; // string | Filter results by state. +$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. +$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. try { - $result = $apiInstance->exportCustomerSessions($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + $result = $apiInstance->exportLoyaltyCardBalances($loyaltyProgramId, $endDate); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportCustomerSessions: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->exportLoyaltyCardBalances: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2126,12 +3128,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] - **createdAfter** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string. | [optional] - **profileIntegrationId** | **string**| Only return sessions for the customer that matches this customer integration ID. | [optional] - **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] - **customerSessionState** | **string**| Filter results by state. | [optional] + **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. | + **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] ### Return type @@ -2151,13 +3149,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## exportCustomersTiers +## exportLoyaltyCardLedger -> string exportCustomersTiers($loyaltyProgramId, $subledgerIds, $tierNames) +> string exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat) -Export customers' tier data +Export card's ledger log -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 a loyalty card ledger log of 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/). ### Example @@ -2183,15 +3181,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$loyaltyProgramId = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. -$subledgerIds = array('subledgerIds_example'); // string[] | An array of subledgers IDs to filter the export by. -$tierNames = array('tierNames_example'); // string[] | An array of tier names to filter the export by. +$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. +$loyaltyCardId = 'loyaltyCardId_example'; // string | 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. +$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. try { - $result = $apiInstance->exportCustomersTiers($loyaltyProgramId, $subledgerIds, $tierNames); + $result = $apiInstance->exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportCustomersTiers: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->exportLoyaltyCardLedger: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2201,9 +3201,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loyaltyProgramId** | **string**| The identifier for the loyalty program. | - **subledgerIds** | [**string[]**](../Model/string.md)| An array of subledgers IDs to filter the export by. | [optional] - **tierNames** | [**string[]**](../Model/string.md)| An array of tier names to filter the export by. | [optional] + **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. | + **loyaltyCardId** | **string**| 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. | + **rangeStart** | **\DateTime**| 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. | + **rangeEnd** | **\DateTime**| 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. | + **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] ### Return type @@ -2223,13 +3225,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## exportEffects +## exportLoyaltyLedger -> string exportEffects($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat) +> string exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat) -Export triggered effects +Export customer's transaction logs -Download a CSV file containing the triggered effects that match the given attributes. **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: - `applicationid`: The ID of the Application. - `campaignid`: The ID of the campaign. - `couponid`: The ID of the coupon, when applicable to the effect. - `created`: The timestamp of the effect. - `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/events). - `eventid`: The internal ID of the effect. - `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). - `profileintegrationid`: The ID of the customer profile, when applicable. - `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. - `ruleindex`: The index of the rule. - `rulesetid`: The ID of the rule set. - `sessionid`: The internal ID of the session that triggered the effect. - `profileid`: The internal ID of the customer profile. - `sessionintegrationid`: The integration ID of the session. - `total_revenue`: The total revenue. - `store_integration_id`: The integration ID of the store. You choose this ID when you create a store. +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. ### Example @@ -2255,17 +3257,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$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 timezone. 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 timezone. Talon.One will convert to UTC internally. +$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$loyaltyProgramId = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. +$integrationId = 'integrationId_example'; // string | The identifier of the profile. $dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. try { - $result = $apiInstance->exportEffects($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + $result = $apiInstance->exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportEffects: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->exportLoyaltyLedger: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2275,10 +3277,10 @@ try { 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 timezone. 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 timezone. Talon.One will convert to UTC internally. | [optional] + **rangeStart** | **\DateTime**| 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. | + **rangeEnd** | **\DateTime**| 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. | + **loyaltyProgramId** | **string**| The identifier for the loyalty program. | + **integrationId** | **string**| The identifier of the profile. | **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] ### Return type @@ -2299,13 +3301,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## exportLoyaltyBalance +## exportPoolGiveaways -> string exportLoyaltyBalance($loyaltyProgramId, $endDate) +> string exportPoolGiveaways($poolId, $createdBefore, $createdAfter) -Export customer loyalty balance to CSV +Export giveaway codes of a giveaway pool -⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer 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/). +Download a CSV file containing the giveaway codes of a specific giveaway pool. **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: - `id`: The internal ID of the giveaway. - `poolid`: The internal ID of the giveaway pool. - `code`: The giveaway code. - `startdate`: The validity start date in RFC3339 of the giveaway (can be empty). - `enddate`: The validity end date in RFC3339 of the giveaway (can be empty). - `attributes`: Any custom attributes associated with the giveaway code (can be empty). - `used`: An indication of whether the giveaway is already awarded. - `importid`: The ID of the import which created the giveaway. - `created`: The creation time of the giveaway code. - `profileintegrationid`: The third-party integration ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded. - `profileid`: The internal ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded or an internal ID does not exist. ### Example @@ -2331,14 +3333,15 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$loyaltyProgramId = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. -$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. +$poolId = 56; // int | The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. +$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. +$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. try { - $result = $apiInstance->exportLoyaltyBalance($loyaltyProgramId, $endDate); + $result = $apiInstance->exportPoolGiveaways($poolId, $createdBefore, $createdAfter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportLoyaltyBalance: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->exportPoolGiveaways: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2348,8 +3351,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loyaltyProgramId** | **string**| The identifier for the loyalty program. | - **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. | [optional] + **poolId** | **int**| The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. | + **createdBefore** | **\DateTime**| Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. | [optional] + **createdAfter** | **\DateTime**| Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. | [optional] ### Return type @@ -2369,13 +3373,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## exportLoyaltyBalances +## exportReferrals -> string exportLoyaltyBalances($loyaltyProgramId, $endDate) +> string exportReferrals($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat) -Export customer loyalty balances +Export referrals -Download a CSV file containing the balance of each customer 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: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export. +Download a CSV file containing the referrals that match the given parameters. **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: - `code`: The referral code. - `advocateprofileintegrationid`: The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values. ### Example @@ -2401,14 +3405,20 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$loyaltyProgramId = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. -$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. +$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 referral 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 referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. +$valid = 'valid_example'; // string | - `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. +$usable = 'usable_example'; // string | - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. +$batchId = 'batchId_example'; // string | Filter results by batches of referrals +$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. try { - $result = $apiInstance->exportLoyaltyBalances($loyaltyProgramId, $endDate); + $result = $apiInstance->exportReferrals($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportLoyaltyBalances: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->exportReferrals: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2418,8 +3428,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loyaltyProgramId** | **string**| The identifier for the loyalty program. | - **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. | [optional] + **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 referral 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 referral creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **valid** | **string**| - `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] + **usable** | **string**| - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. | [optional] + **batchId** | **string**| Filter results by batches of referrals | [optional] + **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] ### Return type @@ -2439,13 +3455,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## exportLoyaltyCardBalances +## getAccessLogsWithoutTotalCount -> string exportLoyaltyCardBalances($loyaltyProgramId, $endDate) +> \TalonOne\Client\Model\InlineResponse20019 getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) -Export all card transaction logs +Get access logs for Application -Download a CSV file containing the balances of all cards 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 CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The alphanumeric identifier of the loyalty card. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. +Retrieve the list of API calls sent to the specified Application. ### Example @@ -2471,14 +3487,21 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$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. +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$path = 'path_example'; // string | Only return results where the request path matches the given regular expression. +$method = 'method_example'; // string | Only return results where the request method matches the given regular expression. +$status = 'status_example'; // string | Filter results by HTTP status codes. +$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. try { - $result = $apiInstance->exportLoyaltyCardBalances($loyaltyProgramId, $endDate); + $result = $apiInstance->getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportLoyaltyCardBalances: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAccessLogsWithoutTotalCount: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2488,12 +3511,19 @@ try { 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. | - **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. | [optional] + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **rangeStart** | **\DateTime**| 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. | + **rangeEnd** | **\DateTime**| 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. | + **path** | **string**| Only return results where the request path matches the given regular expression. | [optional] + **method** | **string**| Only return results where the request method matches the given regular expression. | [optional] + **status** | **string**| Filter results by HTTP status codes. | [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] + **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] ### Return type -**string** +[**\TalonOne\Client\Model\InlineResponse20019**](../Model/InlineResponse20019.md) ### Authorization @@ -2502,20 +3532,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/csv +- **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) -## exportLoyaltyCardLedger +## getAccount -> string exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat) +> \TalonOne\Client\Model\Account getAccount($accountId) -Export card's ledger log +Get account details -Download a CSV file containing a loyalty card ledger log of 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/). +Return the details of your companies Talon.One account. ### Example @@ -2541,17 +3571,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$loyaltyCardId = 'loyaltyCardId_example'; // string | 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. -$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from after this timestamp. This must be an RFC3339 timestamp string. -$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from before this timestamp. This must be an RFC3339 timestamp string. -$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. +$accountId = 56; // int | 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. try { - $result = $apiInstance->exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + $result = $apiInstance->getAccount($accountId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportLoyaltyCardLedger: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAccount: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2561,15 +3587,11 @@ try { 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. | - **loyaltyCardId** | **string**| 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. | - **rangeStart** | **\DateTime**| Only return results from after this timestamp. This must be an RFC3339 timestamp string. | - **rangeEnd** | **\DateTime**| Only return results from before this timestamp. This must be an RFC3339 timestamp string. | - **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] + **accountId** | **int**| 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. | ### Return type -**string** +[**\TalonOne\Client\Model\Account**](../Model/Account.md) ### Authorization @@ -2578,20 +3600,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/csv +- **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) -## exportLoyaltyLedger +## getAccountAnalytics -> string exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat) +> \TalonOne\Client\Model\AccountAnalytics getAccountAnalytics($accountId) -Export customer's transaction logs +Get account analytics -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. +Return the analytics of your Talon.One account. ### Example @@ -2617,17 +3639,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from after this timestamp. This must be an RFC3339 timestamp string. -$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from before this timestamp. This must be an RFC3339 timestamp string. -$loyaltyProgramId = 'loyaltyProgramId_example'; // string | The identifier for the loyalty program. -$integrationId = 'integrationId_example'; // string | The identifier of the profile. -$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. +$accountId = 56; // int | 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. try { - $result = $apiInstance->exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + $result = $apiInstance->getAccountAnalytics($accountId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportLoyaltyLedger: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAccountAnalytics: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2637,15 +3655,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **rangeStart** | **\DateTime**| Only return results from after this timestamp. This must be an RFC3339 timestamp string. | - **rangeEnd** | **\DateTime**| Only return results from before this timestamp. This must be an RFC3339 timestamp string. | - **loyaltyProgramId** | **string**| The identifier for the loyalty program. | - **integrationId** | **string**| The identifier of the profile. | - **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] + **accountId** | **int**| 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. | ### Return type -**string** +[**\TalonOne\Client\Model\AccountAnalytics**](../Model/AccountAnalytics.md) ### Authorization @@ -2654,20 +3668,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/csv +- **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) -## exportPoolGiveaways +## getAccountCollection -> string exportPoolGiveaways($poolId, $createdBefore, $createdAfter) +> \TalonOne\Client\Model\Collection getAccountCollection($collectionId) -Export giveaway codes of a giveaway pool +Get account-level collection -Download a CSV file containing the giveaway codes of a specific giveaway pool. **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: - `id`: The internal ID of the giveaway. - `poolid`: The internal ID of the giveaway pool. - `code`: The giveaway code. - `startdate`: The validity start date in RFC3339 of the giveaway (can be empty). - `enddate`: The validity end date in RFC3339 of the giveaway (can be empty). - `attributes`: Any custom attributes associated with the giveaway code (can be empty). - `used`: An indication of whether the giveaway is already awarded. - `importid`: The ID of the import which created the giveaway. - `created`: The creation time of the giveaway code. - `profileintegrationid`: The third-party integration ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded. - `profileid`: The internal ID of the customer profile that was awarded the giveaway. Can be empty if the giveaway was not awarded or an internal ID does not exist. +Retrieve a given account-level collection. ### Example @@ -2693,15 +3707,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$poolId = 56; // int | The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. -$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. -$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. +$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. try { - $result = $apiInstance->exportPoolGiveaways($poolId, $createdBefore, $createdAfter); + $result = $apiInstance->getAccountCollection($collectionId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportPoolGiveaways: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAccountCollection: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2711,13 +3723,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **poolId** | **int**| The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. | - **createdBefore** | **\DateTime**| Timestamp that filters the results to only contain giveaways created before this date. Must be an RFC3339 timestamp string. | [optional] - **createdAfter** | **\DateTime**| Timestamp that filters the results to only contain giveaways created after this date. Must be an RFC3339 timestamp string. | [optional] + **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | ### Return type -**string** +[**\TalonOne\Client\Model\Collection**](../Model/Collection.md) ### Authorization @@ -2726,20 +3736,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/csv +- **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) -## exportReferrals +## getAchievement -> string exportReferrals($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat) +> \TalonOne\Client\Model\Achievement getAchievement($applicationId, $campaignId, $achievementId) -Export referrals +Get achievement -Download a CSV file containing the referrals that match the given parameters. **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: - `code`: The referral code. - `advocateprofileintegrationid`: The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values. +Get the details of a specific achievement. ### Example @@ -2766,19 +3776,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $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 referral creation timestamp. You can use any timezone. 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 referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally. -$valid = 'valid_example'; // string | - `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. -$usable = 'usable_example'; // string | - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. -$batchId = 'batchId_example'; // string | Filter results by batches of referrals -$dateFormat = 'dateFormat_example'; // string | Determines the format of dates in the export document. +$campaignId = 56; // int | The ID of the campaign. It is displayed in your Talon.One deployment URL. +$achievementId = 56; // int | 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. try { - $result = $apiInstance->exportReferrals($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); + $result = $apiInstance->getAchievement($applicationId, $campaignId, $achievementId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->exportReferrals: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAchievement: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2789,17 +3794,12 @@ try { 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 referral creation timestamp. You can use any timezone. 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 referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally. | [optional] - **valid** | **string**| - `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] - **usable** | **string**| - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned. | [optional] - **batchId** | **string**| Filter results by batches of referrals | [optional] - **dateFormat** | **string**| Determines the format of dates in the export document. | [optional] + **campaignId** | **int**| The ID of the campaign. It is displayed in your Talon.One deployment URL. | + **achievementId** | **int**| 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. | ### Return type -**string** +[**\TalonOne\Client\Model\Achievement**](../Model/Achievement.md) ### Authorization @@ -2808,20 +3808,20 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/csv +- **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) -## getAccessLogsWithoutTotalCount +## getAdditionalCost -> \TalonOne\Client\Model\InlineResponse20019 getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) +> \TalonOne\Client\Model\AccountAdditionalCost getAdditionalCost($additionalCostId) -Get access logs for Application +Get additional cost -Retrieve the list of API calls sent to the specified Application. +Returns the additional cost. ### Example @@ -2847,21 +3847,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from after this timestamp. This must be an RFC3339 timestamp string. -$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from before this timestamp. This must be an RFC3339 timestamp string. -$path = 'path_example'; // string | Only return results where the request path matches the given regular expression. -$method = 'method_example'; // string | Only return results where the request method matches the given regular expression. -$status = 'status_example'; // string | Filter results by HTTP status codes. -$pageSize = 1000; // int | The number of items in this 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. +$additionalCostId = 56; // int | 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**. try { - $result = $apiInstance->getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $result = $apiInstance->getAdditionalCost($additionalCostId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAccessLogsWithoutTotalCount: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAdditionalCost: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2871,19 +3863,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **rangeStart** | **\DateTime**| Only return results from after this timestamp. This must be an RFC3339 timestamp string. | - **rangeEnd** | **\DateTime**| Only return results from before this timestamp. This must be an RFC3339 timestamp string. | - **path** | **string**| Only return results where the request path matches the given regular expression. | [optional] - **method** | **string**| Only return results where the request method matches the given regular expression. | [optional] - **status** | **string**| Filter results by HTTP status codes. | [optional] - **pageSize** | **int**| The number of items in this 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] + **additionalCostId** | **int**| 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**. | ### Return type -[**\TalonOne\Client\Model\InlineResponse20019**](../Model/InlineResponse20019.md) +[**\TalonOne\Client\Model\AccountAdditionalCost**](../Model/AccountAdditionalCost.md) ### Authorization @@ -2899,13 +3883,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAccount +## getAdditionalCosts -> \TalonOne\Client\Model\Account getAccount($accountId) +> \TalonOne\Client\Model\InlineResponse20036 getAdditionalCosts($pageSize, $skip, $sort) -Get account details +List additional costs -Return the details of your companies Talon.One account. +Returns all the defined additional costs for the account. ### Example @@ -2931,13 +3915,15 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$accountId = 56; // int | 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. +$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. try { - $result = $apiInstance->getAccount($accountId); + $result = $apiInstance->getAdditionalCosts($pageSize, $skip, $sort); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAccount: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAdditionalCosts: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2947,11 +3933,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **accountId** | **int**| 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. | + **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] ### Return type -[**\TalonOne\Client\Model\Account**](../Model/Account.md) +[**\TalonOne\Client\Model\InlineResponse20036**](../Model/InlineResponse20036.md) ### Authorization @@ -2967,13 +3955,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAccountAnalytics +## getAllAccessLogs -> \TalonOne\Client\Model\AccountAnalytics getAccountAnalytics($accountId) +> \TalonOne\Client\Model\InlineResponse20020 getAllAccessLogs($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) -Get account analytics +List access logs -Return the analytics of your Talon.One account. +Fetches the access logs for the entire account. Sensitive requests (logins) are _always_ filtered from the logs. ### Example @@ -2999,13 +3987,20 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$accountId = 56; // int | 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. +$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$path = 'path_example'; // string | Only return results where the request path matches the given regular expression. +$method = 'method_example'; // string | Only return results where the request method matches the given regular expression. +$status = 'status_example'; // string | Filter results by HTTP status codes. +$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. try { - $result = $apiInstance->getAccountAnalytics($accountId); + $result = $apiInstance->getAllAccessLogs($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAccountAnalytics: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAllAccessLogs: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3015,11 +4010,18 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **accountId** | **int**| 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. | + **rangeStart** | **\DateTime**| 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] + **rangeEnd** | **\DateTime**| 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] + **path** | **string**| Only return results where the request path matches the given regular expression. | [optional] + **method** | **string**| Only return results where the request method matches the given regular expression. | [optional] + **status** | **string**| Filter results by HTTP status codes. | [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] + **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] ### Return type -[**\TalonOne\Client\Model\AccountAnalytics**](../Model/AccountAnalytics.md) +[**\TalonOne\Client\Model\InlineResponse20020**](../Model/InlineResponse20020.md) ### Authorization @@ -3035,13 +4037,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAccountCollection +## getAllRoles -> \TalonOne\Client\Model\Collection getAccountCollection($collectionId) +> \TalonOne\Client\Model\InlineResponse20044 getAllRoles() -Get account-level collection +List roles -Retrieve a given account-level collection. +List all roles. ### Example @@ -3067,27 +4069,23 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. try { - $result = $apiInstance->getAccountCollection($collectionId); + $result = $apiInstance->getAllRoles(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAccountCollection: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAllRoles: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | +This endpoint does not need any parameter. ### Return type -[**\TalonOne\Client\Model\Collection**](../Model/Collection.md) +[**\TalonOne\Client\Model\InlineResponse20044**](../Model/InlineResponse20044.md) ### Authorization @@ -3103,13 +4101,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAdditionalCost +## getApplication -> \TalonOne\Client\Model\AccountAdditionalCost getAdditionalCost($additionalCostId) +> \TalonOne\Client\Model\Application getApplication($applicationId) -Get additional cost +Get Application -Returns the additional cost. +Get the application specified by the ID. ### Example @@ -3135,13 +4133,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$additionalCostId = 56; // int | 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**. +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. try { - $result = $apiInstance->getAdditionalCost($additionalCostId); + $result = $apiInstance->getApplication($applicationId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAdditionalCost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplication: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3151,11 +4149,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **additionalCostId** | **int**| 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**. | + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | ### Return type -[**\TalonOne\Client\Model\AccountAdditionalCost**](../Model/AccountAdditionalCost.md) +[**\TalonOne\Client\Model\Application**](../Model/Application.md) ### Authorization @@ -3171,13 +4169,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAdditionalCosts +## getApplicationApiHealth -> \TalonOne\Client\Model\InlineResponse20034 getAdditionalCosts($pageSize, $skip, $sort) +> \TalonOne\Client\Model\ApplicationApiHealth getApplicationApiHealth($applicationId) -List additional costs +Get Application health -Returns all the defined additional costs for the account. +Display the health of the Application and show the last time the Application was used. You can also display this information from the **Settings** of an Application, in the **Developer Settings** menu. See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status). ### Example @@ -3203,15 +4201,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this 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. +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. try { - $result = $apiInstance->getAdditionalCosts($pageSize, $skip, $sort); + $result = $apiInstance->getApplicationApiHealth($applicationId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAdditionalCosts: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationApiHealth: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3221,13 +4217,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this 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] + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | ### Return type -[**\TalonOne\Client\Model\InlineResponse20034**](../Model/InlineResponse20034.md) +[**\TalonOne\Client\Model\ApplicationApiHealth**](../Model/ApplicationApiHealth.md) ### Authorization @@ -3243,13 +4237,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAllAccessLogs +## getApplicationCustomer -> \TalonOne\Client\Model\InlineResponse20020 getAllAccessLogs($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) +> \TalonOne\Client\Model\ApplicationCustomer getApplicationCustomer($applicationId, $customerId) -List access logs +Get application's customer -Fetches the access logs for the entire account. Sensitive requests (logins) are _always_ filtered from the logs. +Retrieve the customers of the specified application. ### Example @@ -3275,20 +4269,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from after this timestamp. This must be an RFC3339 timestamp string. -$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from before this timestamp. This must be an RFC3339 timestamp string. -$path = 'path_example'; // string | Only return results where the request path matches the given regular expression. -$method = 'method_example'; // string | Only return results where the request method matches the given regular expression. -$status = 'status_example'; // string | Filter results by HTTP status codes. -$pageSize = 1000; // int | The number of items in this 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. +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$customerId = 56; // int | 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. try { - $result = $apiInstance->getAllAccessLogs($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $result = $apiInstance->getApplicationCustomer($applicationId, $customerId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAllAccessLogs: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationCustomer: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3298,18 +4286,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **rangeStart** | **\DateTime**| Only return results from after this timestamp. This must be an RFC3339 timestamp string. | - **rangeEnd** | **\DateTime**| Only return results from before this timestamp. This must be an RFC3339 timestamp string. | - **path** | **string**| Only return results where the request path matches the given regular expression. | [optional] - **method** | **string**| Only return results where the request method matches the given regular expression. | [optional] - **status** | **string**| Filter results by HTTP status codes. | [optional] - **pageSize** | **int**| The number of items in this 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] + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **customerId** | **int**| 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. | ### Return type -[**\TalonOne\Client\Model\InlineResponse20020**](../Model/InlineResponse20020.md) +[**\TalonOne\Client\Model\ApplicationCustomer**](../Model/ApplicationCustomer.md) ### Authorization @@ -3325,13 +4307,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAllRoles +## getApplicationCustomerFriends -> \TalonOne\Client\Model\InlineResponse20042 getAllRoles() +> \TalonOne\Client\Model\InlineResponse20033 getApplicationCustomerFriends($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) -List roles +List friends referred by customer profile -List all roles. +List the friends referred by the specified customer profile in this Application. ### Example @@ -3357,23 +4339,37 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); +$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$integrationId = 'integrationId_example'; // string | The Integration ID of the Advocate's Profile. +$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. +$withTotalResultSize = True; // bool | 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. try { - $result = $apiInstance->getAllRoles(); + $result = $apiInstance->getApplicationCustomerFriends($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAllRoles: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationCustomerFriends: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **integrationId** | **string**| The Integration ID of the Advocate's Profile. | + **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] + **withTotalResultSize** | **bool**| 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] ### Return type -[**\TalonOne\Client\Model\InlineResponse20042**](../Model/InlineResponse20042.md) +[**\TalonOne\Client\Model\InlineResponse20033**](../Model/InlineResponse20033.md) ### Authorization @@ -3389,13 +4385,13 @@ This endpoint does not need any parameter. [[Back to README]](../../README.md) -## getApplication +## getApplicationCustomers -> \TalonOne\Client\Model\Application getApplication($applicationId) +> \TalonOne\Client\Model\InlineResponse20022 getApplicationCustomers($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) -Get Application +List application's customers -Get the application specified by the ID. +List all the customers of the specified application. ### Example @@ -3422,12 +4418,16 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$integrationId = 'integrationId_example'; // string | Filter results performing an exact matching against the profile integration identifier. +$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. +$withTotalResultSize = True; // bool | 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. try { - $result = $apiInstance->getApplication($applicationId); + $result = $apiInstance->getApplicationCustomers($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplication: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationCustomers: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3438,10 +4438,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **integrationId** | **string**| Filter results performing an exact matching against the profile integration identifier. | [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] + **withTotalResultSize** | **bool**| 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] ### Return type -[**\TalonOne\Client\Model\Application**](../Model/Application.md) +[**\TalonOne\Client\Model\InlineResponse20022**](../Model/InlineResponse20022.md) ### Authorization @@ -3457,13 +4461,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationApiHealth +## getApplicationCustomersByAttributes -> \TalonOne\Client\Model\ApplicationApiHealth getApplicationApiHealth($applicationId) +> \TalonOne\Client\Model\InlineResponse20023 getApplicationCustomersByAttributes($applicationId, $body, $pageSize, $skip, $withTotalResultSize) -Get Application health +List application customers matching the given attributes -Display the health of the Application and show the last time the Application was used. You can also display this information from the **Settings** of an Application, in the **Developer Settings** menu. See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status). +Get a list of the application customers matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. ### Example @@ -3490,12 +4494,16 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. +$body = new \TalonOne\Client\Model\CustomerProfileSearchQuery(); // \TalonOne\Client\Model\CustomerProfileSearchQuery | body +$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. +$withTotalResultSize = True; // bool | 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. try { - $result = $apiInstance->getApplicationApiHealth($applicationId); + $result = $apiInstance->getApplicationCustomersByAttributes($applicationId, $body, $pageSize, $skip, $withTotalResultSize); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationApiHealth: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationCustomersByAttributes: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3506,10 +4514,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | + **body** | [**\TalonOne\Client\Model\CustomerProfileSearchQuery**](../Model/CustomerProfileSearchQuery.md)| body | + **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] + **withTotalResultSize** | **bool**| 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] ### Return type -[**\TalonOne\Client\Model\ApplicationApiHealth**](../Model/ApplicationApiHealth.md) +[**\TalonOne\Client\Model\InlineResponse20023**](../Model/InlineResponse20023.md) ### Authorization @@ -3517,7 +4529,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -3525,13 +4537,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationCustomer +## getApplicationEventTypes -> \TalonOne\Client\Model\ApplicationCustomer getApplicationCustomer($applicationId, $customerId) +> \TalonOne\Client\Model\InlineResponse20029 getApplicationEventTypes($applicationId, $pageSize, $skip, $sort) -Get application's customer +List Applications event types -Retrieve the customers of the specified application. +Get all of the distinct values of the Event `type` property for events recorded in the application. See also: [Track an event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) ### Example @@ -3558,13 +4570,15 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$customerId = 56; // int | 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. +$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. try { - $result = $apiInstance->getApplicationCustomer($applicationId, $customerId); + $result = $apiInstance->getApplicationEventTypes($applicationId, $pageSize, $skip, $sort); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationCustomer: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationEventTypes: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3575,11 +4589,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **customerId** | **int**| 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. | + **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] ### Return type -[**\TalonOne\Client\Model\ApplicationCustomer**](../Model/ApplicationCustomer.md) +[**\TalonOne\Client\Model\InlineResponse20029**](../Model/InlineResponse20029.md) ### Authorization @@ -3595,13 +4611,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationCustomerFriends +## getApplicationEventsWithoutTotalCount -> \TalonOne\Client\Model\InlineResponse20031 getApplicationCustomerFriends($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) +> \TalonOne\Client\Model\InlineResponse20028 getApplicationEventsWithoutTotalCount($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery) -List friends referred by customer profile +List Applications events -List the friends referred by the specified customer profile in this Application. +Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. ### Example @@ -3628,17 +4644,26 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$integrationId = 'integrationId_example'; // string | The Integration ID of the Advocate's Profile. -$pageSize = 1000; // int | The number of items in this response. +$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. -$withTotalResultSize = True; // bool | 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. +$type = 'type_example'; // string | Comma-separated list of types by which to filter events. Must be exact match(es). +$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created before this date. 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 | Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. +$session = 'session_example'; // string | Session integration ID filter for events. Must be exact match. +$profile = 'profile_example'; // string | Profile integration ID filter for events. Must be exact match. +$customerName = 'customerName_example'; // string | Customer name filter for events. Will match substrings case-insensitively. +$customerEmail = 'customerEmail_example'; // string | Customer e-mail address filter for events. Will match substrings case-insensitively. +$couponCode = 'couponCode_example'; // string | Coupon code +$referralCode = 'referralCode_example'; // string | Referral code +$ruleQuery = 'ruleQuery_example'; // string | Rule name filter for events +$campaignQuery = 'campaignQuery_example'; // string | Campaign name filter for events try { - $result = $apiInstance->getApplicationCustomerFriends($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + $result = $apiInstance->getApplicationEventsWithoutTotalCount($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationCustomerFriends: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationEventsWithoutTotalCount: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3649,15 +4674,24 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **integrationId** | **string**| The Integration ID of the Advocate's Profile. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] - **withTotalResultSize** | **bool**| 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] + **type** | **string**| Comma-separated list of types by which to filter events. Must be exact match(es). | [optional] + **createdBefore** | **\DateTime**| Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **createdAfter** | **\DateTime**| Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **session** | **string**| Session integration ID filter for events. Must be exact match. | [optional] + **profile** | **string**| Profile integration ID filter for events. Must be exact match. | [optional] + **customerName** | **string**| Customer name filter for events. Will match substrings case-insensitively. | [optional] + **customerEmail** | **string**| Customer e-mail address filter for events. Will match substrings case-insensitively. | [optional] + **couponCode** | **string**| Coupon code | [optional] + **referralCode** | **string**| Referral code | [optional] + **ruleQuery** | **string**| Rule name filter for events | [optional] + **campaignQuery** | **string**| Campaign name filter for events | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20031**](../Model/InlineResponse20031.md) +[**\TalonOne\Client\Model\InlineResponse20028**](../Model/InlineResponse20028.md) ### Authorization @@ -3673,13 +4707,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationCustomers +## getApplicationSession -> \TalonOne\Client\Model\InlineResponse20022 getApplicationCustomers($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) +> \TalonOne\Client\Model\ApplicationSession getApplicationSession($applicationId, $sessionId) -List application's customers +Get Application session -List all the customers of the specified application. +Get the details of the given session. You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. ### Example @@ -3706,16 +4740,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$integrationId = 'integrationId_example'; // string | Filter results performing an exact matching against the profile integration identifier. -$pageSize = 1000; // int | The number of items in this response. -$skip = 56; // int | The number of items to skip when paging through large result sets. -$withTotalResultSize = True; // bool | 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. +$sessionId = 56; // int | 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. try { - $result = $apiInstance->getApplicationCustomers($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + $result = $apiInstance->getApplicationSession($applicationId, $sessionId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationCustomers: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationSession: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3726,14 +4757,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **integrationId** | **string**| Filter results performing an exact matching against the profile integration identifier. | [optional] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] - **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] - **withTotalResultSize** | **bool**| 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] + **sessionId** | **int**| 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. | ### Return type -[**\TalonOne\Client\Model\InlineResponse20022**](../Model/InlineResponse20022.md) +[**\TalonOne\Client\Model\ApplicationSession**](../Model/ApplicationSession.md) ### Authorization @@ -3749,13 +4777,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationCustomersByAttributes +## getApplicationSessions -> \TalonOne\Client\Model\InlineResponse20023 getApplicationCustomersByAttributes($applicationId, $body, $pageSize, $skip, $withTotalResultSize) +> \TalonOne\Client\Model\InlineResponse20027 getApplicationSessions($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId) -List application customers matching the given attributes +List Application sessions -Get a list of the application customers matching the provided criteria. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. +List all the sessions of the specified Application. ### Example @@ -3782,16 +4810,23 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$body = new \TalonOne\Client\Model\CustomerProfileSearchQuery(); // \TalonOne\Client\Model\CustomerProfileSearchQuery | body -$pageSize = 1000; // int | The number of items in this response. +$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. -$withTotalResultSize = True; // bool | 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. +$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. +$profile = 'profile_example'; // string | Profile integration ID filter for sessions. Must be exact match. +$state = 'state_example'; // string | Filter by sessions with this state. Must be exact match. +$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created before this date. 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 | Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. +$coupon = 'coupon_example'; // string | Filter by sessions with this coupon. Must be exact match. +$referral = 'referral_example'; // string | Filter by sessions with this referral. Must be exact match. +$integrationId = 'integrationId_example'; // string | Filter by sessions with this integrationId. Must be exact match. +$storeIntegrationId = 'storeIntegrationId_example'; // string | The integration ID of the store. You choose this ID when you create a store. try { - $result = $apiInstance->getApplicationCustomersByAttributes($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + $result = $apiInstance->getApplicationSessions($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationCustomersByAttributes: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplicationSessions: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3802,14 +4837,21 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **body** | [**\TalonOne\Client\Model\CustomerProfileSearchQuery**](../Model/CustomerProfileSearchQuery.md)| body | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] - **withTotalResultSize** | **bool**| 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] + **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] + **profile** | **string**| Profile integration ID filter for sessions. Must be exact match. | [optional] + **state** | **string**| Filter by sessions with this state. Must be exact match. | [optional] + **createdBefore** | **\DateTime**| Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **createdAfter** | **\DateTime**| Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **coupon** | **string**| Filter by sessions with this coupon. Must be exact match. | [optional] + **referral** | **string**| Filter by sessions with this referral. Must be exact match. | [optional] + **integrationId** | **string**| Filter by sessions with this integrationId. Must be exact match. | [optional] + **storeIntegrationId** | **string**| The integration ID of the store. You choose this ID when you create a store. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20023**](../Model/InlineResponse20023.md) +[**\TalonOne\Client\Model\InlineResponse20027**](../Model/InlineResponse20027.md) ### Authorization @@ -3817,7 +4859,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -3825,13 +4867,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationEventTypes +## getApplications -> \TalonOne\Client\Model\InlineResponse20029 getApplicationEventTypes($applicationId, $pageSize, $skip, $sort) +> \TalonOne\Client\Model\InlineResponse2005 getApplications($pageSize, $skip, $sort) -List Applications event types +List Applications -Get all of the distinct values of the Event `type` property for events recorded in the application. See also: [Track an event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) +List all applications in the current account. ### Example @@ -3857,16 +4899,15 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$pageSize = 1000; // int | The number of items in this response. +$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. try { - $result = $apiInstance->getApplicationEventTypes($applicationId, $pageSize, $skip, $sort); + $result = $apiInstance->getApplications($pageSize, $skip, $sort); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationEventTypes: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getApplications: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3876,14 +4917,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] ### Return type -[**\TalonOne\Client\Model\InlineResponse20029**](../Model/InlineResponse20029.md) +[**\TalonOne\Client\Model\InlineResponse2005**](../Model/InlineResponse2005.md) ### Authorization @@ -3899,13 +4939,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationEventsWithoutTotalCount +## getAttribute -> \TalonOne\Client\Model\InlineResponse20028 getApplicationEventsWithoutTotalCount($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery) +> \TalonOne\Client\Model\Attribute getAttribute($attributeId) -List Applications events +Get custom attribute -Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results. +Retrieve the specified custom attribute. ### Example @@ -3931,27 +4971,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$pageSize = 1000; // int | The number of items in this 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. -$type = 'type_example'; // string | Comma-separated list of types by which to filter events. Must be exact match(es). -$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally. -$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. -$session = 'session_example'; // string | Session integration ID filter for events. Must be exact match. -$profile = 'profile_example'; // string | Profile integration ID filter for events. Must be exact match. -$customerName = 'customerName_example'; // string | Customer name filter for events. Will match substrings case-insensitively. -$customerEmail = 'customerEmail_example'; // string | Customer e-mail address filter for events. Will match substrings case-insensitively. -$couponCode = 'couponCode_example'; // string | Coupon code -$referralCode = 'referralCode_example'; // string | Referral code -$ruleQuery = 'ruleQuery_example'; // string | Rule name filter for events -$campaignQuery = 'campaignQuery_example'; // string | Campaign name filter for events +$attributeId = 56; // int | 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**. try { - $result = $apiInstance->getApplicationEventsWithoutTotalCount($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + $result = $apiInstance->getAttribute($attributeId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationEventsWithoutTotalCount: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAttribute: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -3961,25 +4987,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **pageSize** | **int**| The number of items in this 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] - **type** | **string**| Comma-separated list of types by which to filter events. Must be exact match(es). | [optional] - **createdBefore** | **\DateTime**| Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally. | [optional] - **createdAfter** | **\DateTime**| Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. | [optional] - **session** | **string**| Session integration ID filter for events. Must be exact match. | [optional] - **profile** | **string**| Profile integration ID filter for events. Must be exact match. | [optional] - **customerName** | **string**| Customer name filter for events. Will match substrings case-insensitively. | [optional] - **customerEmail** | **string**| Customer e-mail address filter for events. Will match substrings case-insensitively. | [optional] - **couponCode** | **string**| Coupon code | [optional] - **referralCode** | **string**| Referral code | [optional] - **ruleQuery** | **string**| Rule name filter for events | [optional] - **campaignQuery** | **string**| Campaign name filter for events | [optional] + **attributeId** | **int**| 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**. | ### Return type -[**\TalonOne\Client\Model\InlineResponse20028**](../Model/InlineResponse20028.md) +[**\TalonOne\Client\Model\Attribute**](../Model/Attribute.md) ### Authorization @@ -3995,13 +5007,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationSession +## getAttributes -> \TalonOne\Client\Model\ApplicationSession getApplicationSession($applicationId, $sessionId) +> \TalonOne\Client\Model\InlineResponse20034 getAttributes($pageSize, $skip, $sort, $entity) -Get Application session +List custom attributes -Get the details of the given session. You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint. +Return all the custom attributes for the account. ### Example @@ -4027,14 +5039,16 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$sessionId = 56; // int | 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. +$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. +$entity = 'entity_example'; // string | Returned attributes will be filtered by supplied entity. try { - $result = $apiInstance->getApplicationSession($applicationId, $sessionId); + $result = $apiInstance->getAttributes($pageSize, $skip, $sort, $entity); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationSession: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAttributes: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4044,12 +5058,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **sessionId** | **int**| 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. | + **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] + **entity** | **string**| Returned attributes will be filtered by supplied entity. | [optional] ### Return type -[**\TalonOne\Client\Model\ApplicationSession**](../Model/ApplicationSession.md) +[**\TalonOne\Client\Model\InlineResponse20034**](../Model/InlineResponse20034.md) ### Authorization @@ -4065,13 +5081,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplicationSessions +## getAudienceMemberships -> \TalonOne\Client\Model\InlineResponse20027 getApplicationSessions($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId) +> \TalonOne\Client\Model\InlineResponse20032 getAudienceMemberships($audienceId, $pageSize, $skip, $sort, $profileQuery) -List Application sessions +List audience members -List all the sessions of the specified Application. +Get a paginated list of the customer profiles in a given audience. A maximum of 1000 customer profiles per page is allowed. ### Example @@ -4097,23 +5113,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$pageSize = 1000; // int | The number of items in this response. +$audienceId = 56; // int | The ID of the audience. +$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. -$profile = 'profile_example'; // string | Profile integration ID filter for sessions. Must be exact match. -$state = 'state_example'; // string | Filter by sessions with this state. Must be exact match. -$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally. -$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. -$coupon = 'coupon_example'; // string | Filter by sessions with this coupon. Must be exact match. -$referral = 'referral_example'; // string | Filter by sessions with this referral. Must be exact match. -$integrationId = 'integrationId_example'; // string | Filter by sessions with this integrationId. Must be exact match. +$profileQuery = 'profileQuery_example'; // string | The filter to select a profile. try { - $result = $apiInstance->getApplicationSessions($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId); + $result = $apiInstance->getAudienceMemberships($audienceId, $pageSize, $skip, $sort, $profileQuery); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplicationSessions: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAudienceMemberships: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4123,21 +5133,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **audienceId** | **int**| The ID of the audience. | + **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] - **profile** | **string**| Profile integration ID filter for sessions. Must be exact match. | [optional] - **state** | **string**| Filter by sessions with this state. Must be exact match. | [optional] - **createdBefore** | **\DateTime**| Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally. | [optional] - **createdAfter** | **\DateTime**| Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. | [optional] - **coupon** | **string**| Filter by sessions with this coupon. Must be exact match. | [optional] - **referral** | **string**| Filter by sessions with this referral. Must be exact match. | [optional] - **integrationId** | **string**| Filter by sessions with this integrationId. Must be exact match. | [optional] + **profileQuery** | **string**| The filter to select a profile. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20027**](../Model/InlineResponse20027.md) +[**\TalonOne\Client\Model\InlineResponse20032**](../Model/InlineResponse20032.md) ### Authorization @@ -4153,13 +5157,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getApplications +## getAudiences -> \TalonOne\Client\Model\InlineResponse2005 getApplications($pageSize, $skip, $sort) +> \TalonOne\Client\Model\InlineResponse20030 getAudiences($pageSize, $skip, $sort, $withTotalResultSize) -List Applications +List audiences -List all applications in the current account. +Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2). ### Example @@ -4185,15 +5189,16 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. +$withTotalResultSize = True; // bool | 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. try { - $result = $apiInstance->getApplications($pageSize, $skip, $sort); + $result = $apiInstance->getAudiences($pageSize, $skip, $sort, $withTotalResultSize); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getApplications: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAudiences: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4203,13 +5208,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] + **withTotalResultSize** | **bool**| 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] ### Return type -[**\TalonOne\Client\Model\InlineResponse2005**](../Model/InlineResponse2005.md) +[**\TalonOne\Client\Model\InlineResponse20030**](../Model/InlineResponse20030.md) ### Authorization @@ -4225,13 +5231,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAttribute +## getAudiencesAnalytics -> \TalonOne\Client\Model\Attribute getAttribute($attributeId) +> \TalonOne\Client\Model\InlineResponse20031 getAudiencesAnalytics($audienceIds, $sort) -Get custom attribute +List audience analytics -Retrieve the specified custom attribute. +Get a list of audience IDs and their member count. ### Example @@ -4257,13 +5263,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$attributeId = 56; // int | 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**. +$audienceIds = 'audienceIds_example'; // string | The IDs of one or more audiences, separated by commas, by which to filter results. +$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. try { - $result = $apiInstance->getAttribute($attributeId); + $result = $apiInstance->getAudiencesAnalytics($audienceIds, $sort); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAttribute: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getAudiencesAnalytics: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4273,11 +5280,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **attributeId** | **int**| 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**. | + **audienceIds** | **string**| The IDs of one or more audiences, separated by commas, by which to filter results. | + **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] ### Return type -[**\TalonOne\Client\Model\Attribute**](../Model/Attribute.md) +[**\TalonOne\Client\Model\InlineResponse20031**](../Model/InlineResponse20031.md) ### Authorization @@ -4293,13 +5301,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAttributes +## getCampaign -> \TalonOne\Client\Model\InlineResponse20032 getAttributes($pageSize, $skip, $sort, $entity) +> \TalonOne\Client\Model\Campaign getCampaign($applicationId, $campaignId) -List custom attributes +Get campaign -Return all the custom attributes for the account. +Retrieve the given campaign. ### Example @@ -4325,16 +5333,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this 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. -$entity = 'entity_example'; // string | Returned attributes will be filtered by supplied entity. +$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->getAttributes($pageSize, $skip, $sort, $entity); + $result = $apiInstance->getCampaign($applicationId, $campaignId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAttributes: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getCampaign: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4344,14 +5350,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this 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] - **entity** | **string**| Returned attributes will be filtered by supplied entity. | [optional] + **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 -[**\TalonOne\Client\Model\InlineResponse20032**](../Model/InlineResponse20032.md) +[**\TalonOne\Client\Model\Campaign**](../Model/Campaign.md) ### Authorization @@ -4367,13 +5371,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAudiences +## getCampaignAnalytics -> \TalonOne\Client\Model\InlineResponse20030 getAudiences($pageSize, $skip, $sort, $withTotalResultSize) +> \TalonOne\Client\Model\InlineResponse20021 getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity) -List audiences +Get analytics of campaigns -Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2). +Retrieve statistical data about the performance of the given campaign. ### Example @@ -4399,16 +5403,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this 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. -$withTotalResultSize = True; // bool | 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. +$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. +$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$granularity = 'granularity_example'; // string | The time interval between the results in the returned time-series. try { - $result = $apiInstance->getAudiences($pageSize, $skip, $sort, $withTotalResultSize); + $result = $apiInstance->getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAudiences: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getCampaignAnalytics: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4418,14 +5423,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this 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] - **withTotalResultSize** | **bool**| 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] + **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. | + **rangeStart** | **\DateTime**| 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. | + **rangeEnd** | **\DateTime**| 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. | + **granularity** | **string**| The time interval between the results in the returned time-series. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20030**](../Model/InlineResponse20030.md) +[**\TalonOne\Client\Model\InlineResponse20021**](../Model/InlineResponse20021.md) ### Authorization @@ -4441,13 +5447,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getCampaign +## getCampaignByAttributes -> \TalonOne\Client\Model\Campaign getCampaign($applicationId, $campaignId) +> \TalonOne\Client\Model\InlineResponse2006 getCampaignByAttributes($applicationId, $body, $pageSize, $skip, $sort, $campaignState) -Get campaign +List campaigns that match the given attributes -Retrieve the given campaign. +Get a list of all the campaigns that match a set of attributes. ### Example @@ -4474,13 +5480,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $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\CampaignSearch(); // \TalonOne\Client\Model\CampaignSearch | body +$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. try { - $result = $apiInstance->getCampaign($applicationId, $campaignId); + $result = $apiInstance->getCampaignByAttributes($applicationId, $body, $pageSize, $skip, $sort, $campaignState); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getCampaign: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getCampaignByAttributes: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4491,11 +5501,15 @@ try { 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\CampaignSearch**](../Model/CampaignSearch.md)| body | + **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] ### Return type -[**\TalonOne\Client\Model\Campaign**](../Model/Campaign.md) +[**\TalonOne\Client\Model\InlineResponse2006**](../Model/InlineResponse2006.md) ### Authorization @@ -4503,7 +5517,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -4511,13 +5525,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getCampaignAnalytics +## getCampaignGroup -> \TalonOne\Client\Model\InlineResponse20021 getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity) +> \TalonOne\Client\Model\CampaignGroup getCampaignGroup($campaignGroupId) -Get analytics of campaigns +Get campaign access group -Retrieve statistical data about the performance of the given campaign. +Get a campaign access group specified by its ID. ### Example @@ -4543,17 +5557,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from after this timestamp. This must be an RFC3339 timestamp string. -$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from before this timestamp. This must be an RFC3339 timestamp string. -$granularity = 'granularity_example'; // string | The time interval between the results in the returned time-series. +$campaignGroupId = 56; // int | The ID of the campaign access group. try { - $result = $apiInstance->getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); + $result = $apiInstance->getCampaignGroup($campaignGroupId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getCampaignAnalytics: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getCampaignGroup: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4563,15 +5573,11 @@ try { 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. | - **rangeStart** | **\DateTime**| Only return results from after this timestamp. This must be an RFC3339 timestamp string. | - **rangeEnd** | **\DateTime**| Only return results from before this timestamp. This must be an RFC3339 timestamp string. | - **granularity** | **string**| The time interval between the results in the returned time-series. | [optional] + **campaignGroupId** | **int**| The ID of the campaign access group. | ### Return type -[**\TalonOne\Client\Model\InlineResponse20021**](../Model/InlineResponse20021.md) +[**\TalonOne\Client\Model\CampaignGroup**](../Model/CampaignGroup.md) ### Authorization @@ -4587,13 +5593,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getCampaignByAttributes +## getCampaignGroups -> \TalonOne\Client\Model\InlineResponse2006 getCampaignByAttributes($applicationId, $body, $pageSize, $skip, $sort, $campaignState) +> \TalonOne\Client\Model\InlineResponse20011 getCampaignGroups($pageSize, $skip, $sort) -List campaigns that match the given attributes +List campaign access groups -Get a list of all the campaigns that match a set of attributes. +List the campaign access groups in the current account. ### Example @@ -4619,18 +5625,15 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$body = new \TalonOne\Client\Model\CampaignSearch(); // \TalonOne\Client\Model\CampaignSearch | body -$pageSize = 1000; // int | The number of items in this response. +$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. try { - $result = $apiInstance->getCampaignByAttributes($applicationId, $body, $pageSize, $skip, $sort, $campaignState); + $result = $apiInstance->getCampaignGroups($pageSize, $skip, $sort); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getCampaignByAttributes: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getCampaignGroups: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -4640,16 +5643,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **body** | [**\TalonOne\Client\Model\CampaignSearch**](../Model/CampaignSearch.md)| body | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] ### Return type -[**\TalonOne\Client\Model\InlineResponse2006**](../Model/InlineResponse2006.md) +[**\TalonOne\Client\Model\InlineResponse20011**](../Model/InlineResponse20011.md) ### Authorization @@ -4657,7 +5657,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -4667,7 +5667,7 @@ Name | Type | Description | Notes ## getCampaignTemplates -> \TalonOne\Client\Model\InlineResponse20011 getCampaignTemplates($pageSize, $skip, $sort, $state, $name, $tags, $userId) +> \TalonOne\Client\Model\InlineResponse20012 getCampaignTemplates($pageSize, $skip, $sort, $state, $name, $tags, $userId) List campaign templates @@ -4697,7 +5697,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. $state = 'state_example'; // string | Filter results by the state of the campaign template. @@ -4719,7 +5719,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **state** | **string**| Filter results by the state of the campaign template. | [optional] @@ -4729,7 +5729,7 @@ Name | Type | Description | Notes ### Return type -[**\TalonOne\Client\Model\InlineResponse20011**](../Model/InlineResponse20011.md) +[**\TalonOne\Client\Model\InlineResponse20012**](../Model/InlineResponse20012.md) ### Authorization @@ -4778,14 +5778,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$pageSize = 1000; // int | The number of items in this response. +$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. $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 timezone. 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 campaign creation timestamp. You can use any timezone. 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, to the campaign 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 campaign creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. $campaignGroupId = 56; // int | Filter results to campaigns owned by the specified campaign access group ID. $templateId = 56; // int | The ID of the Campaign Template this Campaign was created from. $storeId = 56; // int | Filter results to campaigns linked to the specified store ID. @@ -4805,14 +5805,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **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 timezone. 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 campaign creation timestamp. You can use any timezone. Talon.One will convert to UTC internally. | [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] + **createdAfter** | **\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] **campaignGroupId** | **int**| Filter results to campaigns owned by the specified campaign access group ID. | [optional] **templateId** | **int**| The ID of the Campaign Template this Campaign was created from. | [optional] **storeId** | **int**| Filter results to campaigns linked to the specified store ID. | [optional] @@ -4837,7 +5837,7 @@ Name | Type | Description | Notes ## getChanges -> \TalonOne\Client\Model\InlineResponse20040 getChanges($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld) +> \TalonOne\Client\Model\InlineResponse20042 getChanges($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld) Get audit logs for an account @@ -4867,14 +5867,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. $applicationId = 3.4; // float | Filter results by Application ID. $entityPath = 'entityPath_example'; // string | Filter results on a case insensitive matching of the url path of the entity $userId = 56; // int | Filter results by user ID. -$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 change creation timestamp. You can use any timezone. 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 change creation timestamp. You can use any timezone. 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, to the change 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 change creation timestamp. You can use any time zone setting. Talon.One will convert to UTC internally. $withTotalResultSize = True; // bool | 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. $managementKeyId = 56; // int | Filter results that match the given management key ID. $includeOld = True; // bool | When this flag is set to false, the state without the change will not be returned. The default value is true. @@ -4893,21 +5893,21 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **applicationId** | **float**| Filter results by Application ID. | [optional] **entityPath** | **string**| Filter results on a case insensitive matching of the url path of the entity | [optional] **userId** | **int**| Filter results by user ID. | [optional] - **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any timezone. 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 change creation timestamp. You can use any timezone. Talon.One will convert to UTC internally. | [optional] + **createdBefore** | **\DateTime**| 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] + **createdAfter** | **\DateTime**| 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] **withTotalResultSize** | **bool**| 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] **managementKeyId** | **int**| Filter results that match the given management key ID. | [optional] **includeOld** | **bool**| When this flag is set to false, the state without the change will not be returned. The default value is true. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20040**](../Model/InlineResponse20040.md) +[**\TalonOne\Client\Model\InlineResponse20042**](../Model/InlineResponse20042.md) ### Authorization @@ -4997,7 +5997,7 @@ Name | Type | Description | Notes ## getCollectionItems -> \TalonOne\Client\Model\InlineResponse20017 getCollectionItems($collectionId, $pageSize, $skip) +> \TalonOne\Client\Model\InlineResponse20018 getCollectionItems($collectionId, $pageSize, $skip) Get collection items @@ -5028,7 +6028,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. -$pageSize = 1000; // int | The number of items in this response. +$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. try { @@ -5046,12 +6046,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] ### Return type -[**\TalonOne\Client\Model\InlineResponse20017**](../Model/InlineResponse20017.md) +[**\TalonOne\Client\Model\InlineResponse20018**](../Model/InlineResponse20018.md) ### Authorization @@ -5101,12 +6101,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. -$pageSize = 1000; // int | The number of items in this response. +$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. $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 timezone. 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 timezone. 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, 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. $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`. $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. @@ -5130,12 +6130,12 @@ 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. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **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 timezone. 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 timezone. Talon.One will convert to UTC internally. | [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] **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] **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] @@ -5193,11 +6193,11 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from after this timestamp. This must be an RFC3339 timestamp string. -$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from before this timestamp. This must be an RFC3339 timestamp string. +$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. $customerId = 56; // int | 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. -$pageSize = 1000; // int | The number of items in this response. +$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. try { @@ -5214,11 +6214,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **rangeStart** | **\DateTime**| Only return results from after this timestamp. This must be an RFC3339 timestamp string. | - **rangeEnd** | **\DateTime**| Only return results from before this timestamp. This must be an RFC3339 timestamp string. | + **rangeStart** | **\DateTime**| 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. | + **rangeEnd** | **\DateTime**| 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. | **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | **customerId** | **int**| 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. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] ### Return type @@ -5271,10 +6271,10 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from after this timestamp. This must be an RFC3339 timestamp string. -$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return results from before this timestamp. This must be an RFC3339 timestamp string. +$rangeStart = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$rangeEnd = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$pageSize = 1000; // int | The number of items in this response. +$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. $name = 'name_example'; // string | Only return reports matching the customer name @@ -5296,10 +6296,10 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **rangeStart** | **\DateTime**| Only return results from after this timestamp. This must be an RFC3339 timestamp string. | - **rangeEnd** | **\DateTime**| Only return results from before this timestamp. This must be an RFC3339 timestamp string. | + **rangeStart** | **\DateTime**| 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. | + **rangeEnd** | **\DateTime**| 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. | **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **name** | **string**| Only return reports matching the customer name | [optional] @@ -5359,7 +6359,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. $customerId = 56; // int | 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. -$pageSize = 1000; // int | The number of items in this response. +$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. @@ -5379,7 +6379,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | **customerId** | **int**| 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. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] @@ -5469,6 +6469,84 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## getCustomerProfileAchievementProgress + +> \TalonOne\Client\Model\InlineResponse20047 getCustomerProfileAchievementProgress($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title) + +List customer achievements + +For the given customer profile, list all the achievements that match your filter criteria. + +### 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. +$integrationId = 'integrationId_example'; // string | The identifier of the profile. +$pageSize = 50; // int | The number of items in the response. +$skip = 56; // int | The number of items to skip when paging through large result sets. +$achievementId = 56; // int | 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. +$title = 'title_example'; // string | Filter results by the `title` of an achievement. + +try { + $result = $apiInstance->getCustomerProfileAchievementProgress($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->getCustomerProfileAchievementProgress: ', $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. | + **integrationId** | **string**| The identifier of the profile. | + **pageSize** | **int**| The number of items in the response. | [optional] [default to 50] + **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] + **achievementId** | **int**| 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] + **title** | **string**| Filter results by the `title` of an achievement. | [optional] + +### Return type + +[**\TalonOne\Client\Model\InlineResponse20047**](../Model/InlineResponse20047.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) + + ## getCustomerProfiles > \TalonOne\Client\Model\InlineResponse20025 getCustomerProfiles($pageSize, $skip, $sandbox) @@ -5501,7 +6579,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. $sandbox = false; // bool | Indicates whether you are pointing to a sandbox or Live customer. @@ -5519,7 +6597,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **sandbox** | **bool**| Indicates whether you are pointing to a sandbox or Live customer. | [optional] [default to false] @@ -5574,7 +6652,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $body = new \TalonOne\Client\Model\CustomerProfileSearchQuery(); // \TalonOne\Client\Model\CustomerProfileSearchQuery | body -$pageSize = 1000; // int | The number of items in this response. +$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. $sandbox = false; // bool | Indicates whether you are pointing to a sandbox or Live customer. @@ -5593,7 +6671,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**\TalonOne\Client\Model\CustomerProfileSearchQuery**](../Model/CustomerProfileSearchQuery.md)| body | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **sandbox** | **bool**| Indicates whether you are pointing to a sandbox or Live customer. | [optional] [default to false] @@ -5617,7 +6695,7 @@ Name | Type | Description | Notes ## getEventTypes -> \TalonOne\Client\Model\InlineResponse20038 getEventTypes($name, $includeOldVersions, $pageSize, $skip, $sort) +> \TalonOne\Client\Model\InlineResponse20040 getEventTypes($name, $includeOldVersions, $pageSize, $skip, $sort) List event types @@ -5649,7 +6727,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $name = 'name_example'; // string | Filter results to event types with the given name. This parameter implies `includeOldVersions`. $includeOldVersions = false; // bool | Include all versions of every event type. -$pageSize = 1000; // int | The number of items in this response. +$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. @@ -5669,13 +6747,13 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name** | **string**| Filter results to event types with the given name. This parameter implies `includeOldVersions`. | [optional] **includeOldVersions** | **bool**| Include all versions of every event type. | [optional] [default to false] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] ### Return type -[**\TalonOne\Client\Model\InlineResponse20038**](../Model/InlineResponse20038.md) +[**\TalonOne\Client\Model\InlineResponse20040**](../Model/InlineResponse20040.md) ### Authorization @@ -5693,7 +6771,7 @@ Name | Type | Description | Notes ## getExports -> \TalonOne\Client\Model\InlineResponse20041 getExports($pageSize, $skip, $applicationId, $campaignId, $entity) +> \TalonOne\Client\Model\InlineResponse20043 getExports($pageSize, $skip, $applicationId, $campaignId, $entity) Get exports @@ -5723,7 +6801,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. $applicationId = 3.4; // float | Filter results by Application ID. $campaignId = 56; // int | Filter by the campaign ID on which the limit counters are used. @@ -5743,7 +6821,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **applicationId** | **float**| Filter results by Application ID. | [optional] **campaignId** | **int**| Filter by the campaign ID on which the limit counters are used. | [optional] @@ -5751,7 +6829,7 @@ Name | Type | Description | Notes ### Return type -[**\TalonOne\Client\Model\InlineResponse20041**](../Model/InlineResponse20041.md) +[**\TalonOne\Client\Model\InlineResponse20043**](../Model/InlineResponse20043.md) ### Authorization @@ -5839,7 +6917,7 @@ Name | Type | Description | Notes ## getLoyaltyCardTransactionLogs -> \TalonOne\Client\Model\InlineResponse20015 getLoyaltyCardTransactionLogs($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId) +> \TalonOne\Client\Model\InlineResponse20016 getLoyaltyCardTransactionLogs($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId) List card's transactions @@ -5871,9 +6949,9 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. $loyaltyCardId = 'loyaltyCardId_example'; // string | 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. -$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$pageSize = 1000; // int | The number of items in this response. +$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$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. $subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. @@ -5893,15 +6971,15 @@ 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. | **loyaltyCardId** | **string**| 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. | - **startDate** | **\DateTime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **endDate** | **\DateTime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **startDate** | **\DateTime**| 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] + **endDate** | **\DateTime**| 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] + **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] **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20015**](../Model/InlineResponse20015.md) +[**\TalonOne\Client\Model\InlineResponse20016**](../Model/InlineResponse20016.md) ### Authorization @@ -5919,7 +6997,7 @@ Name | Type | Description | Notes ## getLoyaltyCards -> \TalonOne\Client\Model\InlineResponse20014 getLoyaltyCards($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId) +> \TalonOne\Client\Model\InlineResponse20015 getLoyaltyCards($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId) List loyalty cards @@ -5950,7 +7028,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $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. -$pageSize = 1000; // int | The number of items in this response. +$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. @@ -5971,7 +7049,7 @@ try { 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. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] @@ -5979,7 +7057,7 @@ Name | Type | Description | Notes ### Return type -[**\TalonOne\Client\Model\InlineResponse20014**](../Model/InlineResponse20014.md) +[**\TalonOne\Client\Model\InlineResponse20015**](../Model/InlineResponse20015.md) ### Authorization @@ -6097,7 +7175,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. +$loyaltyProgramId = 56; // int | 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. try { $result = $apiInstance->getLoyaltyProgram($loyaltyProgramId); @@ -6113,7 +7191,7 @@ try { 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. | + **loyaltyProgramId** | **int**| 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. | ### Return type @@ -6135,11 +7213,11 @@ Name | Type | Description | Notes ## getLoyaltyProgramTransactions -> \TalonOne\Client\Model\InlineResponse20013 getLoyaltyProgramTransactions($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip) +> \TalonOne\Client\Model\InlineResponse20014 getLoyaltyProgramTransactions($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip) List loyalty program transactions -Retrieve all loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). +Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). ### Example @@ -6165,12 +7243,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. +$loyaltyProgramId = 56; // int | 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. $loyaltyTransactionType = 'loyaltyTransactionType_example'; // string | 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. $subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. -$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. -$pageSize = 50; // int | The number of items in this response. +$startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$pageSize = 50; // int | The number of items in the response. $skip = 56; // int | The number of items to skip when paging through large result sets. try { @@ -6187,17 +7265,17 @@ try { 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. | + **loyaltyProgramId** | **int**| 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. | **loyaltyTransactionType** | **string**| 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] **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] - **startDate** | **\DateTime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **endDate** | **\DateTime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string. | [optional] - **pageSize** | **int**| The number of items in this response. | [optional] [default to 50] + **startDate** | **\DateTime**| 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] + **endDate** | **\DateTime**| 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] + **pageSize** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20013**](../Model/InlineResponse20013.md) +[**\TalonOne\Client\Model\InlineResponse20014**](../Model/InlineResponse20014.md) ### Authorization @@ -6215,7 +7293,7 @@ Name | Type | Description | Notes ## getLoyaltyPrograms -> \TalonOne\Client\Model\InlineResponse20012 getLoyaltyPrograms() +> \TalonOne\Client\Model\InlineResponse20013 getLoyaltyPrograms() List loyalty programs @@ -6261,7 +7339,7 @@ This endpoint does not need any parameter. ### Return type -[**\TalonOne\Client\Model\InlineResponse20012**](../Model/InlineResponse20012.md) +[**\TalonOne\Client\Model\InlineResponse20013**](../Model/InlineResponse20013.md) ### Authorization @@ -6309,7 +7387,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. +$loyaltyProgramId = 56; // int | 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. try { $result = $apiInstance->getLoyaltyStatistics($loyaltyProgramId); @@ -6325,7 +7403,7 @@ try { 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. | + **loyaltyProgramId** | **int**| 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. | ### Return type @@ -6379,12 +7457,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. -$pageSize = 1000; // int | The number of items in this response. +$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. $code = 'code_example'; // string | 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. -$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 referral creation timestamp. You can use any timezone. 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 referral creation timestamp. You can use any timezone. 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, to the referral 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 referral 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 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. $usable = 'usable_example'; // string | Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. $advocate = 'advocate_example'; // string | Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field @@ -6405,12 +7483,12 @@ 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. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **code** | **string**| 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] - **createdBefore** | **\DateTime**| Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any timezone. 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 referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally. | [optional] + **createdBefore** | **\DateTime**| 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] + **createdAfter** | **\DateTime**| 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] **valid** | **string**| 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] **usable** | **string**| Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. | [optional] **advocate** | **string**| Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field | [optional] @@ -6465,7 +7543,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$roleId = 56; // int | The ID of role. +$roleId = 56; // int | ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint. try { $result = $apiInstance->getRole($roleId); @@ -6481,7 +7559,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **roleId** | **int**| The ID of role. | + **roleId** | **int**| ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint. | ### Return type @@ -6607,7 +7685,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. -$pageSize = 1000; // int | The number of items in this response. +$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. @@ -6627,7 +7705,7 @@ 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. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] @@ -6789,7 +7867,7 @@ Name | Type | Description | Notes ## getUsers -> \TalonOne\Client\Model\InlineResponse20039 getUsers($pageSize, $skip, $sort) +> \TalonOne\Client\Model\InlineResponse20041 getUsers($pageSize, $skip, $sort) List users in account @@ -6819,7 +7897,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. @@ -6837,13 +7915,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] ### Return type -[**\TalonOne\Client\Model\InlineResponse20039**](../Model/InlineResponse20039.md) +[**\TalonOne\Client\Model\InlineResponse20041**](../Model/InlineResponse20041.md) ### Authorization @@ -6929,7 +8007,7 @@ Name | Type | Description | Notes ## getWebhookActivationLogs -> \TalonOne\Client\Model\InlineResponse20036 getWebhookActivationLogs($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) +> \TalonOne\Client\Model\InlineResponse20038 getWebhookActivationLogs($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) List webhook activation log entries @@ -6959,15 +8037,15 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. $integrationRequestUuid = 'integrationRequestUuid_example'; // string | Filter results by integration request UUID. $webhookId = 3.4; // float | Filter results by Webhook. $applicationId = 3.4; // float | Filter results by Application ID. $campaignId = 3.4; // float | Filter results by campaign. -$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally. -$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. +$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only return events created before this date. 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 | Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. try { $result = $apiInstance->getWebhookActivationLogs($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); @@ -6983,19 +8061,19 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **integrationRequestUuid** | **string**| Filter results by integration request UUID. | [optional] **webhookId** | **float**| Filter results by Webhook. | [optional] **applicationId** | **float**| Filter results by Application ID. | [optional] **campaignId** | **float**| Filter results by campaign. | [optional] - **createdBefore** | **\DateTime**| Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally. | [optional] - **createdAfter** | **\DateTime**| Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. | [optional] + **createdBefore** | **\DateTime**| Only return events created before this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] + **createdAfter** | **\DateTime**| Only return events created after this date. You can use any time zone setting. Talon.One will convert to UTC internally. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20036**](../Model/InlineResponse20036.md) +[**\TalonOne\Client\Model\InlineResponse20038**](../Model/InlineResponse20038.md) ### Authorization @@ -7013,7 +8091,7 @@ Name | Type | Description | Notes ## getWebhookLogs -> \TalonOne\Client\Model\InlineResponse20037 getWebhookLogs($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) +> \TalonOne\Client\Model\InlineResponse20039 getWebhookLogs($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) List webhook log entries @@ -7043,7 +8121,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. $status = 'status_example'; // string | Filter results by HTTP status codes. @@ -7051,8 +8129,8 @@ $webhookId = 3.4; // float | Filter results by Webhook. $applicationId = 3.4; // float | Filter results by Application ID. $campaignId = 3.4; // float | Filter results by campaign. $requestUuid = 'requestUuid_example'; // string | Filter results by request UUID. -$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any timezone. Talon.One will convert to UTC internally. -$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any timezone. Talon.One will convert to UTC internally. +$createdBefore = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. +$createdAfter = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | 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. try { $result = $apiInstance->getWebhookLogs($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); @@ -7068,7 +8146,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **status** | **string**| Filter results by HTTP status codes. | [optional] @@ -7076,12 +8154,12 @@ Name | Type | Description | Notes **applicationId** | **float**| Filter results by Application ID. | [optional] **campaignId** | **float**| Filter results by campaign. | [optional] **requestUuid** | **string**| Filter results by request UUID. | [optional] - **createdBefore** | **\DateTime**| Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any timezone. Talon.One will convert to UTC internally. | [optional] - **createdAfter** | **\DateTime**| Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any timezone. Talon.One will convert to UTC internally. | [optional] + **createdBefore** | **\DateTime**| 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] + **createdAfter** | **\DateTime**| 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] ### Return type -[**\TalonOne\Client\Model\InlineResponse20037**](../Model/InlineResponse20037.md) +[**\TalonOne\Client\Model\InlineResponse20039**](../Model/InlineResponse20039.md) ### Authorization @@ -7099,7 +8177,7 @@ Name | Type | Description | Notes ## getWebhooks -> \TalonOne\Client\Model\InlineResponse20035 getWebhooks($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) +> \TalonOne\Client\Model\InlineResponse20037 getWebhooks($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) List webhooks @@ -7131,7 +8209,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $applicationIds = 'applicationIds_example'; // string | Filter by one or more Application IDs, separated by a comma. $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 this response. +$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. $creationType = 'creationType_example'; // string | Filter results by creation type. $visibility = 'visibility_example'; // string | Filter results by visibility. @@ -7154,7 +8232,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationIds** | **string**| Filter by one or more Application IDs, separated by a comma. | [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 this response. | [optional] [default to 1000] + **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] **creationType** | **string**| Filter results by creation type. | [optional] **visibility** | **string**| Filter results by visibility. | [optional] @@ -7163,7 +8241,7 @@ Name | Type | Description | Notes ### Return type -[**\TalonOne\Client\Model\InlineResponse20035**](../Model/InlineResponse20035.md) +[**\TalonOne\Client\Model\InlineResponse20037**](../Model/InlineResponse20037.md) ### Authorization @@ -7212,7 +8290,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. -$upFile = 'upFile_example'; // string | The file with the information about the data that should be imported. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. try { $result = $apiInstance->importAccountCollection($collectionId, $upFile); @@ -7229,7 +8307,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. | - **upFile** | **string**| The file with the information about the data that should be imported. | [optional] + **upFile** | **string**| The file containing the data that is being imported. | [optional] ### Return type @@ -7282,7 +8360,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $attributeId = 56; // int | 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**. -$upFile = 'upFile_example'; // string | The file with the information about the data that should be imported. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. try { $result = $apiInstance->importAllowedList($attributeId, $upFile); @@ -7299,7 +8377,77 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **attributeId** | **int**| 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**. | - **upFile** | **string**| The file with the information about the data that should be imported. | [optional] + **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) + + +## importAudiencesMemberships + +> \TalonOne\Client\Model\Import importAudiencesMemberships($audienceId, $upFile) + +Import audience members + +Upload a CSV file containing the integration IDs of the members you want to add to an audience. The file should be sent as multipart data and should contain only the following column (required): - `profileintegrationid`: The integration ID of the customer profile. The import **replaces** the previous list of audience members. **Note:** We recommend limiting your file size to 500MB. Example: ```text profileintegrationid charles alexa ``` + +### 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 +); +$audienceId = 56; // int | The ID of the audience. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. + +try { + $result = $apiInstance->importAudiencesMemberships($audienceId, $upFile); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->importAudiencesMemberships: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **audienceId** | **int**| The ID of the audience. | + **upFile** | **string**| The file containing the data that is being imported. | [optional] ### Return type @@ -7354,7 +8502,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $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. $collectionId = 56; // int | The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. -$upFile = 'upFile_example'; // string | The file with the information about the data that should be imported. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. try { $result = $apiInstance->importCollection($applicationId, $campaignId, $collectionId, $upFile); @@ -7373,7 +8521,7 @@ 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. | **collectionId** | **int**| The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. | - **upFile** | **string**| The file with the information about the data that should be imported. | [optional] + **upFile** | **string**| The file containing the data that is being imported. | [optional] ### Return type @@ -7395,7 +8543,7 @@ Name | Type | Description | Notes ## importCoupons -> \TalonOne\Client\Model\Import importCoupons($applicationId, $campaignId, $upFile) +> \TalonOne\Client\Model\Import importCoupons($applicationId, $campaignId, $skipDuplicates, $upFile) Import coupons @@ -7427,10 +8575,11 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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 with the information about the data that should be imported. +$skipDuplicates = True; // bool | An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. try { - $result = $apiInstance->importCoupons($applicationId, $campaignId, $upFile); + $result = $apiInstance->importCoupons($applicationId, $campaignId, $skipDuplicates, $upFile); print_r($result); } catch (Exception $e) { echo 'Exception when calling ManagementApi->importCoupons: ', $e->getMessage(), PHP_EOL; @@ -7445,7 +8594,8 @@ 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 with the information about the data that should be imported. | [optional] + **skipDuplicates** | **bool**| An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. | [optional] + **upFile** | **string**| The file containing the data that is being imported. | [optional] ### Return type @@ -7498,7 +8648,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $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. -$upFile = 'upFile_example'; // string | The file with the information about the data that should be imported. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. try { $result = $apiInstance->importLoyaltyCards($loyaltyProgramId, $upFile); @@ -7515,7 +8665,7 @@ try { 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. | - **upFile** | **string**| The file with the information about the data that should be imported. | [optional] + **upFile** | **string**| The file containing the data that is being imported. | [optional] ### Return type @@ -7541,7 +8691,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 a tier, the customer is assigned to match the new information provided in the CSV file. - If the customer is already in the tier that's specified in the CSV file, only the expiration date is updated. 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. 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 @@ -7567,8 +8717,8 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$upFile = 'upFile_example'; // string | The file with the information about the data that should be imported. +$loyaltyProgramId = 56; // int | 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. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. try { $result = $apiInstance->importLoyaltyCustomersTiers($loyaltyProgramId, $upFile); @@ -7584,8 +8734,8 @@ try { 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. | - **upFile** | **string**| The file with the information about the data that should be imported. | [optional] + **loyaltyProgramId** | **int**| 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. | + **upFile** | **string**| The file containing the data that is being imported. | [optional] ### Return type @@ -7611,7 +8761,7 @@ Name | Type | Description | Notes Import loyalty points -Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the loyalty program type, you can import the points into a given customer profile or into a given _active_ loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. **Note**: It must be an RFC3339 timestamp string or string `immediate`. Empty or missing values are considered `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until the date provided for `startdate` is reached. **Note:** We recommend limiting your file size to 500MB. **Example for profile-based programs:** ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` **Example for card-based programs:** ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` +Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the type of loyalty program, you can import points into a given customer profile or loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date. **Note**: It must be an RFC3339 timestamp string or string `immediate`. Empty or missing values are considered `immediate`. - `expirydate` (optional): The latest date when the points can be redeemed. The points are `expired` after this date. **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until the date provided for `startdate` is reached. **Note:** We recommend limiting your file size to 500MB. **Example for profile-based programs:** ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` **Example for card-based programs:** ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` ### Example @@ -7637,8 +8787,8 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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. -$upFile = 'upFile_example'; // string | The file with the information about the data that should be imported. +$loyaltyProgramId = 56; // int | 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. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. try { $result = $apiInstance->importLoyaltyPoints($loyaltyProgramId, $upFile); @@ -7654,8 +8804,78 @@ try { 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. | - **upFile** | **string**| The file with the information about the data that should be imported. | [optional] + **loyaltyProgramId** | **int**| 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. | + **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) + + +## importPoolGiveaways + +> \TalonOne\Client\Model\Import importPoolGiveaways($poolId, $upFile) + +Import giveaway codes into a giveaway pool + +Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): The code of your giveaway, for instance, a gift card redemption code. - `startdate`: The start date in RFC3339 of the code redemption period. - `enddate`: The last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone setting of your choice. The values are converted to UTC internally by Talon.One. **Note:** - We recommend limiting your file size to 500MB. - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. **Example:** ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` + +### 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 +); +$poolId = 56; // int | The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. +$upFile = 'upFile_example'; // string | The file containing the data that is being imported. + +try { + $result = $apiInstance->importPoolGiveaways($poolId, $upFile); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->importPoolGiveaways: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **poolId** | **int**| The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. | + **upFile** | **string**| The file containing the data that is being imported. | [optional] ### Return type @@ -7675,13 +8895,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## importPoolGiveaways +## importReferrals -> \TalonOne\Client\Model\Import importPoolGiveaways($poolId, $upFile) +> \TalonOne\Client\Model\Import importReferrals($applicationId, $campaignId, $upFile) -Import giveaway codes into a giveaway pool +Import referrals -Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): the code of your giveaway, for instance, a gift card redemption code. - `startdate`: the start date in RFC3339 of the code redemption period. - `enddate`: the last date in RFC3339 of the code redemption period. - `attributes`: A JSON object describing _custom_ giveaway attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated with the giveaway entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"provider\": \"myPartnerCompany\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone of your choice. The values are converted to UTC internally by Talon.One. **Note:** - We recommend limiting your file size to 500MB. - You can import the same code multiple times. Duplicate codes are treated and distributed to customers as unique codes. **Example:** ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ``` +Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Important:** When you import a CSV file with referrals, a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) is **not** automatically created for each `advocateprofileintegrationid` column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) endpoint to create the customer profiles. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` ### Example @@ -7707,14 +8927,15 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$poolId = 56; // int | The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. -$upFile = 'upFile_example'; // string | The file with the information about the data that should be imported. +$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->importPoolGiveaways($poolId, $upFile); + $result = $apiInstance->importReferrals($applicationId, $campaignId, $upFile); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->importPoolGiveaways: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->importReferrals: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -7724,8 +8945,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **poolId** | **int**| The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. | - **upFile** | **string**| The file with the information about the data that should be imported. | [optional] + **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 @@ -7745,13 +8967,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## importReferrals +## listAccountCollections -> \TalonOne\Client\Model\Import importReferrals($applicationId, $campaignId, $upFile) +> \TalonOne\Client\Model\InlineResponse20017 listAccountCollections($pageSize, $skip, $sort, $withTotalResultSize, $name) -Import referrals +List collections in account -Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A JSON object describing _custom_ referral attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated with the referral entity, the object in the CSV file, when opened in a text editor, must be: `\"{\"category\": \"10_off\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Important:** When you import a CSV file with referrals, a [customer profile](https://docs.talon.one/docs/dev/concepts/entities/customer-profiles) is **not** automatically created for each `advocateprofileintegrationid` column value. Use the [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint or the [Update multiple customer profiles](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfilesV2) endpoint to create the customer profiles. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ``` +List account-level collections in the account. ### Example @@ -7777,15 +8999,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( 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 with the information about the data that should be imported. +$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. +$withTotalResultSize = True; // bool | 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. +$name = 'name_example'; // string | Filter by collection name. try { - $result = $apiInstance->importReferrals($applicationId, $campaignId, $upFile); + $result = $apiInstance->listAccountCollections($pageSize, $skip, $sort, $withTotalResultSize, $name); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->importReferrals: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->listAccountCollections: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -7795,13 +9019,15 @@ try { 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 with the information about the data that should be imported. | [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] + **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] + **withTotalResultSize** | **bool**| 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] + **name** | **string**| Filter by collection name. | [optional] ### Return type -[**\TalonOne\Client\Model\Import**](../Model/Import.md) +[**\TalonOne\Client\Model\InlineResponse20017**](../Model/InlineResponse20017.md) ### Authorization @@ -7809,7 +9035,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: multipart/form-data +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -7817,13 +9043,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## listAccountCollections +## listAchievements -> \TalonOne\Client\Model\InlineResponse20016 listAccountCollections($pageSize, $skip, $sort, $withTotalResultSize, $name) +> \TalonOne\Client\Model\InlineResponse20046 listAchievements($applicationId, $campaignId, $pageSize, $skip, $title) -List collections in account +List achievements -List account-level collections in the account. +List all the achievements for a specific campaign. ### Example @@ -7849,17 +9075,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$pageSize = 1000; // int | The number of items in this response. +$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. +$pageSize = 50; // 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. -$withTotalResultSize = True; // bool | 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. -$name = 'name_example'; // string | Filter by collection name. +$title = 'title_example'; // string | 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. try { - $result = $apiInstance->listAccountCollections($pageSize, $skip, $sort, $withTotalResultSize, $name); + $result = $apiInstance->listAchievements($applicationId, $campaignId, $pageSize, $skip, $title); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->listAccountCollections: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->listAchievements: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -7869,15 +9095,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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. | + **pageSize** | **int**| The number of items in the response. | [optional] [default to 50] **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] - **withTotalResultSize** | **bool**| 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] - **name** | **string**| Filter by collection name. | [optional] + **title** | **string**| 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] ### Return type -[**\TalonOne\Client\Model\InlineResponse20016**](../Model/InlineResponse20016.md) +[**\TalonOne\Client\Model\InlineResponse20046**](../Model/InlineResponse20046.md) ### Authorization @@ -7895,7 +9121,7 @@ Name | Type | Description | Notes ## listCatalogItems -> \TalonOne\Client\Model\InlineResponse20033 listCatalogItems($catalogId, $pageSize, $skip, $withTotalResultSize, $sku) +> \TalonOne\Client\Model\InlineResponse20035 listCatalogItems($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames) List items in a catalog @@ -7926,13 +9152,14 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $catalogId = 56; // int | The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. -$pageSize = 1000; // int | The number of items in this response. +$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. $withTotalResultSize = True; // bool | 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. -$sku = 'sku_example'; // string | The SKU of the item. +$sku = array('sku_example'); // string[] | Filter results by one or more SKUs. Must be exact match. +$productNames = array('productNames_example'); // string[] | Filter results by one or more product names. Must be exact match. try { - $result = $apiInstance->listCatalogItems($catalogId, $pageSize, $skip, $withTotalResultSize, $sku); + $result = $apiInstance->listCatalogItems($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); print_r($result); } catch (Exception $e) { echo 'Exception when calling ManagementApi->listCatalogItems: ', $e->getMessage(), PHP_EOL; @@ -7946,14 +9173,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **catalogId** | **int**| The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **withTotalResultSize** | **bool**| 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] - **sku** | **string**| The SKU of the item. | [optional] + **sku** | [**string[]**](../Model/string.md)| Filter results by one or more SKUs. Must be exact match. | [optional] + **productNames** | [**string[]**](../Model/string.md)| Filter results by one or more product names. Must be exact match. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20033**](../Model/InlineResponse20033.md) +[**\TalonOne\Client\Model\InlineResponse20035**](../Model/InlineResponse20035.md) ### Authorization @@ -7971,7 +9199,7 @@ Name | Type | Description | Notes ## listCollections -> \TalonOne\Client\Model\InlineResponse20018 listCollections($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name) +> \TalonOne\Client\Model\InlineResponse20017 listCollections($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name) List collections in campaign @@ -8003,7 +9231,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $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. -$pageSize = 1000; // int | The number of items in this response. +$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. $withTotalResultSize = True; // bool | 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. @@ -8025,7 +9253,7 @@ 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. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **withTotalResultSize** | **bool**| 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] @@ -8033,7 +9261,7 @@ Name | Type | Description | Notes ### Return type -[**\TalonOne\Client\Model\InlineResponse20018**](../Model/InlineResponse20018.md) +[**\TalonOne\Client\Model\InlineResponse20017**](../Model/InlineResponse20017.md) ### Authorization @@ -8051,7 +9279,7 @@ Name | Type | Description | Notes ## listCollectionsInApplication -> \TalonOne\Client\Model\InlineResponse20018 listCollectionsInApplication($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name) +> \TalonOne\Client\Model\InlineResponse20017 listCollectionsInApplication($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name) List collections in Application @@ -8082,7 +9310,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$pageSize = 1000; // int | The number of items in this response. +$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. $withTotalResultSize = True; // bool | 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. @@ -8103,7 +9331,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **withTotalResultSize** | **bool**| 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] @@ -8111,7 +9339,7 @@ Name | Type | Description | Notes ### Return type -[**\TalonOne\Client\Model\InlineResponse20018**](../Model/InlineResponse20018.md) +[**\TalonOne\Client\Model\InlineResponse20017**](../Model/InlineResponse20017.md) ### Authorization @@ -8129,7 +9357,7 @@ Name | Type | Description | Notes ## listStores -> \TalonOne\Client\Model\InlineResponse20043 listStores($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId) +> \TalonOne\Client\Model\InlineResponse20045 listStores($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query) List stores @@ -8160,16 +9388,17 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $config ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. -$pageSize = 1000; // int | The number of items in this response. +$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. $withTotalResultSize = True; // bool | 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. $campaignId = 3.4; // float | Filter results by campaign. $name = 'name_example'; // string | The name of the store. $integrationId = 'integrationId_example'; // string | The integration ID of the store. +$query = 'query_example'; // string | Filter results by `name` or `integrationId`. try { - $result = $apiInstance->listStores($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId); + $result = $apiInstance->listStores($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); print_r($result); } catch (Exception $e) { echo 'Exception when calling ManagementApi->listStores: ', $e->getMessage(), PHP_EOL; @@ -8183,17 +9412,18 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **withTotalResultSize** | **bool**| 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] **campaignId** | **float**| Filter results by campaign. | [optional] **name** | **string**| The name of the store. | [optional] **integrationId** | **string**| The integration ID of the store. | [optional] + **query** | **string**| Filter results by `name` or `integrationId`. | [optional] ### Return type -[**\TalonOne\Client\Model\InlineResponse20043**](../Model/InlineResponse20043.md) +[**\TalonOne\Client\Model\InlineResponse20045**](../Model/InlineResponse20045.md) ### Authorization @@ -8284,7 +9514,7 @@ void (empty response body) Create notification about added or deducted loyalty points -Create a notification about added or deducted loyalty points in a given profile-based loyalty program. A notification for added or deducted loyalty points is different from regular webhooks in that it is loyalty program-scoped and has a predefined payload. For more information, see [Managing loyalty notifications](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-loyalty-notifications). +Create a notification about added or deducted loyalty points in a given profile-based loyalty program. A notification for added or deducted loyalty points is different from regular webhooks in that it is loyalty program-scoped and has a predefined payload. For more information, see [Managing loyalty notifications](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-notifications). ### Example @@ -8424,7 +9654,7 @@ Name | Type | Description | Notes Create notification about pending loyalty points -Create a notification about pending loyalty points for a given profile-based loyalty program. For more information, see [Managing loyalty notifications](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-loyalty-notifications). +Create a notification about pending loyalty points for a given profile-based loyalty program. For more information, see [Managing loyalty notifications](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-notifications). ### Example @@ -8661,12 +9891,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( ); $applicationId = 56; // int | The ID of the Application. It is displayed in your Talon.One deployment URL. $body = new \stdClass; // object | body -$pageSize = 1000; // int | The number of items in this response. +$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. $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 timezone. 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 timezone. 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, 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. $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`. $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. @@ -8691,12 +9921,12 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **applicationId** | **int**| The ID of the Application. It is displayed in your Talon.One deployment URL. | **body** | **object**| body | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **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 timezone. 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 timezone. Talon.One will convert to UTC internally. | [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] **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] **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] @@ -8758,12 +9988,12 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( $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 \stdClass; // object | body -$pageSize = 1000; // int | The number of items in this response. +$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. $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 timezone. 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 timezone. 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, 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. $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`. $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. @@ -8788,12 +10018,12 @@ 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** | **object**| body | - **pageSize** | **int**| The number of items in this response. | [optional] [default to 1000] + **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] **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 timezone. 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 timezone. Talon.One will convert to UTC internally. | [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] **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] **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] @@ -8960,6 +10190,80 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## updateAchievement + +> \TalonOne\Client\Model\Achievement updateAchievement($applicationId, $campaignId, $achievementId, $body) + +Update achievement + +Update the details of a specific achievement. + +### 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. +$achievementId = 56; // int | 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. +$body = new \TalonOne\Client\Model\UpdateAchievement(); // \TalonOne\Client\Model\UpdateAchievement | body + +try { + $result = $apiInstance->updateAchievement($applicationId, $campaignId, $achievementId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->updateAchievement: ', $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. | + **achievementId** | **int**| 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. | + **body** | [**\TalonOne\Client\Model\UpdateAchievement**](../Model/UpdateAchievement.md)| body | + +### Return type + +[**\TalonOne\Client\Model\Achievement**](../Model/Achievement.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) + + ## updateAdditionalCost > \TalonOne\Client\Model\AccountAdditionalCost updateAdditionalCost($additionalCostId, $body) @@ -9537,6 +10841,76 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## updateRoleV2 + +> \TalonOne\Client\Model\RoleV2 updateRoleV2($roleId, $body) + +Update role + +Update a specific role. + +### 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 +); +$roleId = 56; // int | The ID of role. +$body = new \TalonOne\Client\Model\RoleV2Base(); // \TalonOne\Client\Model\RoleV2Base | body + +try { + $result = $apiInstance->updateRoleV2($roleId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->updateRoleV2: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roleId** | **int**| The ID of role. | + **body** | **\TalonOne\Client\Model\RoleV2Base**| body | + +### Return type + +[**\TalonOne\Client\Model\RoleV2**](../Model/RoleV2.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) + + ## updateStore > \TalonOne\Client\Model\Store updateStore($applicationId, $storeId, $body) @@ -9608,3 +10982,73 @@ Name | Type | Description | Notes [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## updateUser + +> \TalonOne\Client\Model\User updateUser($userId, $body) + +Update user + +Update the details of a specific user. + +### 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\UpdateUser(); // \TalonOne\Client\Model\UpdateUser | body + +try { + $result = $apiInstance->updateUser($userId, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->updateUser: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **int**| The ID of the user. | + **body** | [**\TalonOne\Client\Model\UpdateUser**](../Model/UpdateUser.md)| body | + +### Return type + +[**\TalonOne\Client\Model\User**](../Model/User.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) + diff --git a/docs/Model/AccountDashboardStatistic.md b/docs/Model/AccountDashboardStatistic.md index 8f7b0d52..ffaafd30 100644 --- a/docs/Model/AccountDashboardStatistic.md +++ b/docs/Model/AccountDashboardStatistic.md @@ -8,7 +8,6 @@ Name | Type | Description | Notes **discounts** | [**\TalonOne\Client\Model\AccountDashboardStatisticDiscount[]**](AccountDashboardStatisticDiscount.md) | Aggregated statistic for account discount. | [optional] **loyaltyPoints** | [**\TalonOne\Client\Model\AccountDashboardStatisticLoyaltyPoints[]**](AccountDashboardStatisticLoyaltyPoints.md) | Aggregated statistic for account loyalty points. | [optional] **referrals** | [**\TalonOne\Client\Model\AccountDashboardStatisticReferrals[]**](AccountDashboardStatisticReferrals.md) | Aggregated statistic for account referrals. | [optional] -**apiCalls** | [**\TalonOne\Client\Model\AccountDashboardStatisticApiCalls[]**](AccountDashboardStatisticApiCalls.md) | Aggregated statistic for the number of account API calls. | [optional] **campaigns** | [**\TalonOne\Client\Model\AccountDashboardStatisticCampaigns**](AccountDashboardStatisticCampaigns.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/Achievement.md b/docs/Model/Achievement.md new file mode 100644 index 00000000..70380a65 --- /dev/null +++ b/docs/Model/Achievement.md @@ -0,0 +1,22 @@ +# # Achievement + +## 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 internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. | +**title** | **string** | The display name for the achievement in the Campaign Manager. | +**description** | **string** | A description of the achievement. | +**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | +**period** | **string** | The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** 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 also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. | +**periodEndOverride** | [**\TalonOne\Client\Model\TimePoint**](TimePoint.md) | | [optional] +**campaignId** | **int** | ID of the campaign, to which the achievement belongs to | +**userId** | **int** | ID of the user that created this achievement. | +**createdBy** | **string** | Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. | +**hasProgress** | **bool** | Indicates if a customer has made progress in the achievement. | [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/AchievementAdditionalProperties.md b/docs/Model/AchievementAdditionalProperties.md new file mode 100644 index 00000000..bb9965d5 --- /dev/null +++ b/docs/Model/AchievementAdditionalProperties.md @@ -0,0 +1,14 @@ +# # AchievementAdditionalProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaignId** | **int** | ID of the campaign, to which the achievement belongs to | +**userId** | **int** | ID of the user that created this achievement. | +**createdBy** | **string** | Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. | +**hasProgress** | **bool** | Indicates if a customer has made progress in the achievement. | [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/AchievementProgress.md b/docs/Model/AchievementProgress.md new file mode 100644 index 00000000..f50b3508 --- /dev/null +++ b/docs/Model/AchievementProgress.md @@ -0,0 +1,20 @@ +# # AchievementProgress + +## Properties + +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. | +**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] +**progress** | **float** | The current progress of the customer in the achievement. | +**startDate** | [**\DateTime**](\DateTime.md) | Timestamp at which the customer started the achievement. | +**completionDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the customer completed the achievement. | [optional] +**endDate** | [**\DateTime**](\DateTime.md) | Timestamp at which point the achievement ends and resets for the customer. | + +[[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/AddItemCatalogAction.md b/docs/Model/AddItemCatalogAction.md index 2f801e7a..35ad5461 100644 --- a/docs/Model/AddItemCatalogAction.md +++ b/docs/Model/AddItemCatalogAction.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes **sku** | **string** | The unique SKU of the item to add. | **price** | **float** | Price of the item. | [optional] **attributes** | [**object**](.md) | The attributes of the item to add. | [optional] -**replaceIfExists** | **bool** | Indicates whether to replace the attributes of the item if the same SKU exists. | [optional] [default to false] +**product** | [**\TalonOne\Client\Model\Product**](Product.md) | | [optional] +**replaceIfExists** | **bool** | Indicates whether to replace the attributes of the item if the same SKU exists. **Note**: When set to `true`: - If you do not provide a new `price` value, the existing `price` value is retained. - If you do not provide a new `product` value, the `product` value is set to `null`. | [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/AdditionalCampaignProperties.md b/docs/Model/AdditionalCampaignProperties.md index 3b6dcb47..92ca3e4c 100644 --- a/docs/Model/AdditionalCampaignProperties.md +++ b/docs/Model/AdditionalCampaignProperties.md @@ -25,6 +25,7 @@ Name | Type | Description | Notes **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/ApplicationAPIKey.md b/docs/Model/ApplicationAPIKey.md index ef7fa378..0341b678 100644 --- a/docs/Model/ApplicationAPIKey.md +++ b/docs/Model/ApplicationAPIKey.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **string** | Title for API Key. | -**expires** | [**\DateTime**](\DateTime.md) | The date the API key expired. | +**title** | **string** | Title of the API key. | +**expires** | [**\DateTime**](\DateTime.md) | The date the API key expires. | **platform** | **string** | The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. | [optional] +**type** | **string** | The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. | [optional] +**timeOffset** | **int** | A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. | [optional] **id** | **int** | ID of the API Key. | **createdBy** | **int** | ID of user who created. | **accountID** | **int** | ID of account the key is used for. | diff --git a/docs/Model/ApplicationAnalyticsDataPoint.md b/docs/Model/ApplicationAnalyticsDataPoint.md new file mode 100644 index 00000000..af25794e --- /dev/null +++ b/docs/Model/ApplicationAnalyticsDataPoint.md @@ -0,0 +1,18 @@ +# # ApplicationAnalyticsDataPoint + +## Properties + +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] +**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] + +[[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/ApplicationAnalyticsDataPointAvgItemsPerSession.md new file mode 100644 index 00000000..c50b6d80 --- /dev/null +++ b/docs/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.md @@ -0,0 +1,12 @@ +# # ApplicationAnalyticsDataPointAvgItemsPerSession + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | [optional] +**influenced** | **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/ApplicationAnalyticsDataPointAvgSessionValue.md b/docs/Model/ApplicationAnalyticsDataPointAvgSessionValue.md new file mode 100644 index 00000000..bf3dac8a --- /dev/null +++ b/docs/Model/ApplicationAnalyticsDataPointAvgSessionValue.md @@ -0,0 +1,12 @@ +# # ApplicationAnalyticsDataPointAvgSessionValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | [optional] +**influenced** | **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/ApplicationAnalyticsDataPointSessionsCount.md b/docs/Model/ApplicationAnalyticsDataPointSessionsCount.md new file mode 100644 index 00000000..a5adba19 --- /dev/null +++ b/docs/Model/ApplicationAnalyticsDataPointSessionsCount.md @@ -0,0 +1,12 @@ +# # ApplicationAnalyticsDataPointSessionsCount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | [optional] +**influenced** | **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/ApplicationAnalyticsDataPointTotalRevenue.md b/docs/Model/ApplicationAnalyticsDataPointTotalRevenue.md new file mode 100644 index 00000000..1cd78b5b --- /dev/null +++ b/docs/Model/ApplicationAnalyticsDataPointTotalRevenue.md @@ -0,0 +1,12 @@ +# # ApplicationAnalyticsDataPointTotalRevenue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | [optional] +**influenced** | **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/ApplicationCampaignAnalytics.md b/docs/Model/ApplicationCampaignAnalytics.md new file mode 100644 index 00000000..9ca07946 --- /dev/null +++ b/docs/Model/ApplicationCampaignAnalytics.md @@ -0,0 +1,25 @@ +# # ApplicationCampaignAnalytics + +## Properties + +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] + +[[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 new file mode 100644 index 00000000..f92588e3 --- /dev/null +++ b/docs/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.md @@ -0,0 +1,13 @@ +# # 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 new file mode 100644 index 00000000..43afda69 --- /dev/null +++ b/docs/Model/ApplicationCampaignAnalyticsAvgSessionValue.md @@ -0,0 +1,13 @@ +# # 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/ApplicationCampaignAnalyticsCouponsCount.md b/docs/Model/ApplicationCampaignAnalyticsCouponsCount.md new file mode 100644 index 00000000..e6adca87 --- /dev/null +++ b/docs/Model/ApplicationCampaignAnalyticsCouponsCount.md @@ -0,0 +1,12 @@ +# # ApplicationCampaignAnalyticsCouponsCount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **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 new file mode 100644 index 00000000..78c864a2 --- /dev/null +++ b/docs/Model/ApplicationCampaignAnalyticsSessionsCount.md @@ -0,0 +1,13 @@ +# # 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/ApplicationCampaignAnalyticsTotalDiscounts.md b/docs/Model/ApplicationCampaignAnalyticsTotalDiscounts.md new file mode 100644 index 00000000..4163b0e8 --- /dev/null +++ b/docs/Model/ApplicationCampaignAnalyticsTotalDiscounts.md @@ -0,0 +1,12 @@ +# # ApplicationCampaignAnalyticsTotalDiscounts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **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 new file mode 100644 index 00000000..7b03cb01 --- /dev/null +++ b/docs/Model/ApplicationCampaignAnalyticsTotalRevenue.md @@ -0,0 +1,13 @@ +# # 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/ApplicationCustomer.md b/docs/Model/ApplicationCustomer.md index b62fd66b..3af793ec 100644 --- a/docs/Model/ApplicationCustomer.md +++ b/docs/Model/ApplicationCustomer.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **loyaltyMemberships** | [**\TalonOne\Client\Model\LoyaltyMembership[]**](LoyaltyMembership.md) | **DEPRECATED** A list of loyalty programs joined by the customer. | [optional] **audienceMemberships** | [**\TalonOne\Client\Model\AudienceMembership[]**](AudienceMembership.md) | The audiences the customer belongs to. | [optional] **lastActivity** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#operation/createCouponReservation) for a customer doesn't impact this field. | -**sandbox** | **bool** | Shows whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). | [optional] +**sandbox** | **bool** | An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). | [optional] **advocateIntegrationId** | **string** | The Integration ID of the Customer Profile that referred this Customer in 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/AudienceAnalytics.md b/docs/Model/AudienceAnalytics.md index 1cc2d52f..6526fc26 100644 --- a/docs/Model/AudienceAnalytics.md +++ b/docs/Model/AudienceAnalytics.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **audienceId** | **int** | The ID of the audience. | [optional] -**membersCount** | **int** | The count of members under a single audience. | [optional] +**membersCount** | **int** | The member count of the audience. | [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/AudienceCustomer.md b/docs/Model/AudienceCustomer.md index 90e52d54..26f19bd0 100644 --- a/docs/Model/AudienceCustomer.md +++ b/docs/Model/AudienceCustomer.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **loyaltyMemberships** | [**\TalonOne\Client\Model\LoyaltyMembership[]**](LoyaltyMembership.md) | **DEPRECATED** A list of loyalty programs joined by the customer. | [optional] **audienceMemberships** | [**\TalonOne\Client\Model\AudienceMembership[]**](AudienceMembership.md) | The audiences the customer belongs to. | [optional] **lastActivity** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#operation/createCouponReservation) for a customer doesn't impact this field. | -**sandbox** | **bool** | Shows whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). | [optional] +**sandbox** | **bool** | An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). | [optional] **connectedApplicationsIds** | **int[]** | A list of the IDs of the Applications that are connected to this customer profile. | [optional] **connectedAudiences** | **int[]** | A list of the IDs of the audiences that are connected to this customer profile. | [optional] diff --git a/docs/Model/BaseCampaign.md b/docs/Model/BaseCampaign.md index ed364eb3..2bfb502d 100644 --- a/docs/Model/BaseCampaign.md +++ b/docs/Model/BaseCampaign.md @@ -17,7 +17,6 @@ Name | Type | Description | Notes **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 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] diff --git a/docs/Model/BaseLoyaltyProgram.md b/docs/Model/BaseLoyaltyProgram.md index 5b5e497b..6cccb5be 100644 --- a/docs/Model/BaseLoyaltyProgram.md +++ b/docs/Model/BaseLoyaltyProgram.md @@ -12,8 +12,10 @@ 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] -**tiersExpireIn** | **string** | The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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] +**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] [[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 16a9c86e..93cd5b3c 100644 --- a/docs/Model/Campaign.md +++ b/docs/Model/Campaign.md @@ -21,7 +21,6 @@ Name | Type | Description | Notes **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. | @@ -45,6 +44,7 @@ Name | Type | Description | Notes **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/CampaignCreatedNotification.md b/docs/Model/CampaignCreatedNotification.md index ba390449..270fa3d8 100644 --- a/docs/Model/CampaignCreatedNotification.md +++ b/docs/Model/CampaignCreatedNotification.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**campaign** | [**\TalonOne\Client\Model\CampaignStateNotification**](CampaignStateNotification.md) | | +**campaign** | [**\TalonOne\Client\Model\Campaign**](Campaign.md) | | **ruleset** | [**\TalonOne\Client\Model\Ruleset**](Ruleset.md) | | [optional] **evaluationPosition** | [**\TalonOne\Client\Model\CampaignEvaluationPosition**](CampaignEvaluationPosition.md) | | diff --git a/docs/Model/CampaignDeletedNotification.md b/docs/Model/CampaignDeletedNotification.md index 1207c06c..77586650 100644 --- a/docs/Model/CampaignDeletedNotification.md +++ b/docs/Model/CampaignDeletedNotification.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**campaign** | [**\TalonOne\Client\Model\CampaignStateNotification**](CampaignStateNotification.md) | | +**campaign** | [**\TalonOne\Client\Model\Campaign**](Campaign.md) | | **deletedAt** | [**\DateTime**](\DateTime.md) | Time when the campaign was deleted. | [[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/CampaignEditedNotification.md b/docs/Model/CampaignEditedNotification.md index 920d14f9..f84ecd9d 100644 --- a/docs/Model/CampaignEditedNotification.md +++ b/docs/Model/CampaignEditedNotification.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**campaign** | [**\TalonOne\Client\Model\CampaignStateNotification**](CampaignStateNotification.md) | | -**oldCampaign** | [**\TalonOne\Client\Model\CampaignStateNotification**](CampaignStateNotification.md) | | +**campaign** | [**\TalonOne\Client\Model\Campaign**](Campaign.md) | | +**oldCampaign** | [**\TalonOne\Client\Model\Campaign**](Campaign.md) | | **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/CampaignGroup.md b/docs/Model/CampaignGroup.md index d82c3c6b..f67d75c1 100644 --- a/docs/Model/CampaignGroup.md +++ b/docs/Model/CampaignGroup.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | **modified** | [**\DateTime**](\DateTime.md) | The time this entity was last modified. | **accountId** | **int** | The ID of the account that owns this entity. | -**name** | **string** | The name of this campaign access group. | +**name** | **string** | The name of the campaign access group. | **description** | **string** | A longer description of the campaign access group. | [optional] **subscribedApplicationsIds** | **int[]** | A list of IDs of the Applications that this campaign access group is enabled for. | [optional] **campaignIds** | **int[]** | A list of IDs of the campaigns that are part of the campaign access group. | [optional] diff --git a/docs/Model/CampaignRulesetChangedNotification.md b/docs/Model/CampaignRulesetChangedNotification.md index 135352e3..6bd5590d 100644 --- a/docs/Model/CampaignRulesetChangedNotification.md +++ b/docs/Model/CampaignRulesetChangedNotification.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**campaign** | [**\TalonOne\Client\Model\CampaignStateNotification**](CampaignStateNotification.md) | | +**campaign** | [**\TalonOne\Client\Model\Campaign**](Campaign.md) | | **oldRuleset** | [**\TalonOne\Client\Model\Ruleset**](Ruleset.md) | | [optional] **ruleset** | [**\TalonOne\Client\Model\Ruleset**](Ruleset.md) | | [optional] diff --git a/docs/Model/CampaignStateChangedNotification.md b/docs/Model/CampaignStateChangedNotification.md index a791f6a1..a513b60a 100644 --- a/docs/Model/CampaignStateChangedNotification.md +++ b/docs/Model/CampaignStateChangedNotification.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**campaign** | [**\TalonOne\Client\Model\CampaignForNotification**](CampaignForNotification.md) | | +**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'] | **ruleset** | [**\TalonOne\Client\Model\Ruleset**](Ruleset.md) | | [optional] diff --git a/docs/Model/CardExpiringPointsNotificationPolicy.md b/docs/Model/CardExpiringPointsNotificationPolicy.md new file mode 100644 index 00000000..1b48f339 --- /dev/null +++ b/docs/Model/CardExpiringPointsNotificationPolicy.md @@ -0,0 +1,13 @@ +# # CardExpiringPointsNotificationPolicy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Notification name. | +**triggers** | [**\TalonOne\Client\Model\CardExpiringPointsNotificationTrigger[]**](CardExpiringPointsNotificationTrigger.md) | | +**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/CardExpiringPointsNotificationTrigger.md b/docs/Model/CardExpiringPointsNotificationTrigger.md new file mode 100644 index 00000000..d84dd81d --- /dev/null +++ b/docs/Model/CardExpiringPointsNotificationTrigger.md @@ -0,0 +1,12 @@ +# # CardExpiringPointsNotificationTrigger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | The amount of period. | +**period** | **string** | Notification period indicated by a letter; \"w\" means week, \"d\" means day. | + +[[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 8f4047c8..67012ef5 100644 --- a/docs/Model/CartItem.md +++ b/docs/Model/CartItem.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **remainingQuantity** | **int** | Remaining quantity of the item, calculated internally based on returns of this item. | [optional] **price** | **float** | Price of the item in the currency defined by your Application. This field is required if this item is not part of a [catalog](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). If it is part of a catalog, setting a price here overrides the price from the catalog. | [optional] **category** | **string** | Type, group or model of the item. | [optional] +**product** | [**\TalonOne\Client\Model\Product**](Product.md) | | [optional] **weight** | **float** | Weight of item in grams. | [optional] **height** | **float** | Height of item in mm. | [optional] **width** | **float** | Width of item in mm. | [optional] diff --git a/docs/Model/CatalogItem.md b/docs/Model/CatalogItem.md index 7209942d..7bd9f61e 100644 --- a/docs/Model/CatalogItem.md +++ b/docs/Model/CatalogItem.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **catalogid** | **int** | The ID of the catalog the item belongs to. | **version** | **int** | The version of the catalog item. | **attributes** | [**\TalonOne\Client\Model\ItemAttribute[]**](ItemAttribute.md) | | [optional] +**product** | [**\TalonOne\Client\Model\Product**](Product.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/ChangeLoyaltyTierLevelEffectProps.md b/docs/Model/ChangeLoyaltyTierLevelEffectProps.md new file mode 100644 index 00000000..7b7147f5 --- /dev/null +++ b/docs/Model/ChangeLoyaltyTierLevelEffectProps.md @@ -0,0 +1,16 @@ +# # ChangeLoyaltyTierLevelEffectProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ruleTitle** | **string** | The title of the rule that triggered the tier upgrade. | +**programId** | **int** | The ID of the loyalty program where these points were added. | +**subLedgerId** | **string** | The ID of the subledger within the loyalty program where these points were added. | +**previousTierName** | **string** | The name of the tier from which the user was upgraded. | [optional] +**newTierName** | **string** | The name of the tier to which the user has been upgraded. | +**expiryDate** | [**\DateTime**](\DateTime.md) | The expiration date of the new 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/Coupon.md b/docs/Model/Coupon.md index 02b50234..c6f79da5 100644 --- a/docs/Model/Coupon.md +++ b/docs/Model/Coupon.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **importId** | **int** | The ID of the Import which created this coupon. | [optional] **reservation** | **bool** | Defines the type of reservation: - `true`: The reservation is a soft reservation. Any customer can use the coupon. This is done via the [Create coupon reservation](https://docs.talon.one/integration-api#operation/createCouponReservation) endpoint. - `false`: The reservation is a hard reservation. Only the associated customer (`recipientIntegrationId`) can use the coupon. This is done via the Campaign Manager when you create a coupon for a given `recipientIntegrationId`, the [Create coupons](https://docs.talon.one/management-api#operation/createCoupons) endpoint or [Create coupons for multiple recipients](https://docs.talon.one/management-api#operation/createCouponsForMultipleRecipients) endpoint. | [optional] [default to true] **batchId** | **string** | The id of the batch the coupon belongs to. | [optional] -**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to true] +**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to false] **implicitlyReserved** | **bool** | An indication of whether the coupon is implicitly reserved for all customers. | [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 98177fb2..746bb841 100644 --- a/docs/Model/CouponCreationJob.md +++ b/docs/Model/CouponCreationJob.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **couponSettings** | [**\TalonOne\Client\Model\CodeGeneratorSettings**](CodeGeneratorSettings.md) | | [optional] **attributes** | [**object**](.md) | Arbitrary properties associated with coupons. | **batchId** | **string** | The batch ID coupons created by this job will bear. | -**status** | **string** | The current status of this request. Possible values: - `pending` - `completed` - `failed` - `coupon pattern full` | +**status** | **string** | The current status of this request. Possible values: - `pending verification` - `pending` - `completed` - `failed` - `coupon pattern full` | **createdAmount** | **int** | The number of coupon codes that were already created for this request. | **failCount** | **int** | The number of times this job failed. | **errors** | **string[]** | An array of individual problems encountered during the request. | diff --git a/docs/Model/CouponsNotificationPolicy.md b/docs/Model/CouponsNotificationPolicy.md index 07130877..382937fa 100644 --- a/docs/Model/CouponsNotificationPolicy.md +++ b/docs/Model/CouponsNotificationPolicy.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Notification name. | **scopes** | **string[]** | | +**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/CreateAchievement.md b/docs/Model/CreateAchievement.md new file mode 100644 index 00000000..05ce5c2d --- /dev/null +++ b/docs/Model/CreateAchievement.md @@ -0,0 +1,16 @@ +# # CreateAchievement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. | +**title** | **string** | The display name for the achievement in the Campaign Manager. | +**description** | **string** | A description of the achievement. | +**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | +**period** | **string** | The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** 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 also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. | +**periodEndOverride** | [**\TalonOne\Client\Model\TimePoint**](TimePoint.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/CreateApplicationAPIKey.md b/docs/Model/CreateApplicationAPIKey.md index c50ee566..6d670bea 100644 --- a/docs/Model/CreateApplicationAPIKey.md +++ b/docs/Model/CreateApplicationAPIKey.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **string** | Title for API Key. | -**expires** | [**\DateTime**](\DateTime.md) | The date the API key expired. | +**title** | **string** | Title of the API key. | +**expires** | [**\DateTime**](\DateTime.md) | The date the API key expires. | **platform** | **string** | The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. | [optional] +**type** | **string** | The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. | [optional] +**timeOffset** | **int** | A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. | [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/CustomerInventory.md b/docs/Model/CustomerInventory.md index 8fb66a9f..63f85edc 100644 --- a/docs/Model/CustomerInventory.md +++ b/docs/Model/CustomerInventory.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **referrals** | [**\TalonOne\Client\Model\InventoryReferral[]**](InventoryReferral.md) | | [optional] **coupons** | [**\TalonOne\Client\Model\InventoryCoupon[]**](InventoryCoupon.md) | The coupons reserved by this profile. This array includes hard and soft reservations. See each coupon's `reservation` property. | [optional] **giveaways** | [**\TalonOne\Client\Model\Giveaway[]**](Giveaway.md) | | [optional] +**achievements** | [**\TalonOne\Client\Model\AchievementProgress[]**](AchievementProgress.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/CustomerProfile.md b/docs/Model/CustomerProfile.md index 9fb38081..0ed81fdb 100644 --- a/docs/Model/CustomerProfile.md +++ b/docs/Model/CustomerProfile.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **loyaltyMemberships** | [**\TalonOne\Client\Model\LoyaltyMembership[]**](LoyaltyMembership.md) | **DEPRECATED** A list of loyalty programs joined by the customer. | [optional] **audienceMemberships** | [**\TalonOne\Client\Model\AudienceMembership[]**](AudienceMembership.md) | The audiences the customer belongs to. | [optional] **lastActivity** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#operation/createCouponReservation) for a customer doesn't impact this field. | -**sandbox** | **bool** | Shows whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). | [optional] +**sandbox** | **bool** | An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). | [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/CustomerProfileAudienceRequestItem.md b/docs/Model/CustomerProfileAudienceRequestItem.md index 1b079f79..fb772660 100644 --- a/docs/Model/CustomerProfileAudienceRequestItem.md +++ b/docs/Model/CustomerProfileAudienceRequestItem.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | **string** | Defines the action to perform: - `add`: Adds the customer profile to the audience. - `delete`: Removes the customer profile from the audience. | +**action** | **string** | Defines the action to perform: - `add`: Adds the customer profile to the audience. If the customer profile does not exist, it will be created. - `delete`: Removes the customer profile from the audience. | **profileIntegrationId** | **string** | The ID of this customer profile in the third-party integration. | **audienceId** | **int** | The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). | diff --git a/docs/Model/CustomerSessionV2.md b/docs/Model/CustomerSessionV2.md index aa90e2b7..d8ce8088 100644 --- a/docs/Model/CustomerSessionV2.md +++ b/docs/Model/CustomerSessionV2.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **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] -**loyaltyCards** | **string[]** | Any loyalty cards used. | [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. | **additionalCosts** | [**map[string,\TalonOne\Client\Model\AdditionalCost]**](AdditionalCost.md) | Use this property to set a value for the additional costs of this session, 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] diff --git a/docs/Model/DeactivateUserRequest.md b/docs/Model/DeactivateUserRequest.md new file mode 100644 index 00000000..b83e4d4a --- /dev/null +++ b/docs/Model/DeactivateUserRequest.md @@ -0,0 +1,11 @@ +# # DeactivateUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | The email address associated with the user profile. | + +[[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/DeleteUserRequest.md b/docs/Model/DeleteUserRequest.md new file mode 100644 index 00000000..2cad5fbf --- /dev/null +++ b/docs/Model/DeleteUserRequest.md @@ -0,0 +1,11 @@ +# # DeleteUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | The email address associated with the user profile. | + +[[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/EmailEntity.md b/docs/Model/EmailEntity.md index 125c4f78..89da40e0 100644 --- a/docs/Model/EmailEntity.md +++ b/docs/Model/EmailEntity.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email address associated with your account. | +**email** | **string** | The email address associated with the user profile. | [[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 6fe01532..e068c37a 100644 --- a/docs/Model/Environment.md +++ b/docs/Model/Environment.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **variables** | **string** | A stringified version of the environment's Talang variables scope. | **giveawaysPools** | [**\TalonOne\Client\Model\GiveawaysPool[]**](GiveawaysPool.md) | The giveaways pools that the application is subscribed to. | [optional] **loyaltyPrograms** | [**\TalonOne\Client\Model\LoyaltyProgram[]**](LoyaltyProgram.md) | The loyalty programs that the application is subscribed to. | [optional] +**achievements** | [**\TalonOne\Client\Model\Achievement[]**](Achievement.md) | The achievements, linked to the campaigns, belonging to the application. | [optional] **attributes** | [**\TalonOne\Client\Model\Attribute[]**](Attribute.md) | The attributes that the application is subscribed to. | [optional] **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] diff --git a/docs/Model/ExpiringCouponsNotificationPolicy.md b/docs/Model/ExpiringCouponsNotificationPolicy.md new file mode 100644 index 00000000..c6ac9e2f --- /dev/null +++ b/docs/Model/ExpiringCouponsNotificationPolicy.md @@ -0,0 +1,13 @@ +# # ExpiringCouponsNotificationPolicy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Notification name. | +**triggers** | [**\TalonOne\Client\Model\ExpiringCouponsNotificationTrigger[]**](ExpiringCouponsNotificationTrigger.md) | | +**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/ExpiringCouponsNotificationTrigger.md b/docs/Model/ExpiringCouponsNotificationTrigger.md new file mode 100644 index 00000000..15b25c10 --- /dev/null +++ b/docs/Model/ExpiringCouponsNotificationTrigger.md @@ -0,0 +1,12 @@ +# # ExpiringCouponsNotificationTrigger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | The amount of period. | +**period** | **string** | Notification period indicated by a letter; \"w\" means week, \"d\" means day. | + +[[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/ExpiringPointsNotificationPolicy.md b/docs/Model/ExpiringPointsNotificationPolicy.md index 38b7d79f..b9ee51da 100644 --- a/docs/Model/ExpiringPointsNotificationPolicy.md +++ b/docs/Model/ExpiringPointsNotificationPolicy.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Notification name. | **triggers** | [**\TalonOne\Client\Model\ExpiringPointsNotificationTrigger[]**](ExpiringPointsNotificationTrigger.md) | | +**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/FuncArgDef.md b/docs/Model/FuncArgDef.md index 7c427262..36ca8390 100644 --- a/docs/Model/FuncArgDef.md +++ b/docs/Model/FuncArgDef.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **string** | The type of value this argument expects. | -**description** | **string** | A campaigner-friendly description of the argument, this will also be shown in the rule editor. | +**description** | **string** | A campaigner-friendly description of the argument, this will also be shown in the rule editor. | [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/GetIntegrationCouponRequest.md b/docs/Model/GetIntegrationCouponRequest.md new file mode 100644 index 00000000..4e2f5213 --- /dev/null +++ b/docs/Model/GetIntegrationCouponRequest.md @@ -0,0 +1,12 @@ +# # GetIntegrationCouponRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaignIds** | **int[]** | A list of IDs of the campaigns to get coupons from. | +**limit** | **int** | The maximum number of coupons included in the response. | + +[[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 new file mode 100644 index 00000000..9186655d --- /dev/null +++ b/docs/Model/IncreaseAchievementProgressEffectProps.md @@ -0,0 +1,17 @@ +# # IncreaseAchievementProgressEffectProps + +## 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. | [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. | +**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/InlineResponse20011.md b/docs/Model/InlineResponse20011.md index bdff1d38..096653b0 100644 --- a/docs/Model/InlineResponse20011.md +++ b/docs/Model/InlineResponse20011.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | | -**data** | [**\TalonOne\Client\Model\CampaignTemplate[]**](CampaignTemplate.md) | | +**totalResultSize** | **int** | | +**data** | [**\TalonOne\Client\Model\CampaignGroup[]**](CampaignGroup.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/InlineResponse20012.md b/docs/Model/InlineResponse20012.md index 7a8a8084..e1b2009e 100644 --- a/docs/Model/InlineResponse20012.md +++ b/docs/Model/InlineResponse20012.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\LoyaltyProgram[]**](LoyaltyProgram.md) | | +**hasMore** | **bool** | | +**data** | [**\TalonOne\Client\Model\CampaignTemplate[]**](CampaignTemplate.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/InlineResponse20013.md b/docs/Model/InlineResponse20013.md index d542b9d1..6145fc6b 100644 --- a/docs/Model/InlineResponse20013.md +++ b/docs/Model/InlineResponse20013.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | | -**data** | [**\TalonOne\Client\Model\LoyaltyProgramTransaction[]**](LoyaltyProgramTransaction.md) | | +**totalResultSize** | **int** | | +**data** | [**\TalonOne\Client\Model\LoyaltyProgram[]**](LoyaltyProgram.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/InlineResponse20014.md b/docs/Model/InlineResponse20014.md index 036160dc..325fdee0 100644 --- a/docs/Model/InlineResponse20014.md +++ b/docs/Model/InlineResponse20014.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hasMore** | **bool** | | -**data** | [**\TalonOne\Client\Model\LoyaltyCard[]**](LoyaltyCard.md) | | +**data** | [**\TalonOne\Client\Model\LoyaltyProgramTransaction[]**](LoyaltyProgramTransaction.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/InlineResponse20015.md b/docs/Model/InlineResponse20015.md index 0da1d3b9..b8730c53 100644 --- a/docs/Model/InlineResponse20015.md +++ b/docs/Model/InlineResponse20015.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | true means there is more data in the source collection to request.. | -**data** | [**\TalonOne\Client\Model\CardLedgerTransactionLogEntry[]**](CardLedgerTransactionLogEntry.md) | List of loyalty card transaction logs. | +**hasMore** | **bool** | | +**data** | [**\TalonOne\Client\Model\LoyaltyCard[]**](LoyaltyCard.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/InlineResponse20016.md b/docs/Model/InlineResponse20016.md index 70520c98..5375d6d1 100644 --- a/docs/Model/InlineResponse20016.md +++ b/docs/Model/InlineResponse20016.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | | [optional] -**totalResultSize** | **int** | | [optional] -**data** | [**\TalonOne\Client\Model\CollectionWithoutPayload[]**](CollectionWithoutPayload.md) | | +**hasMore** | **bool** | true means there is more data in the source collection to request.. | +**data** | [**\TalonOne\Client\Model\CardLedgerTransactionLogEntry[]**](CardLedgerTransactionLogEntry.md) | List of loyalty card transaction logs. | [[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/InlineResponse20017.md b/docs/Model/InlineResponse20017.md index 7dabbbf7..dc793272 100644 --- a/docs/Model/InlineResponse20017.md +++ b/docs/Model/InlineResponse20017.md @@ -4,8 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | | -**data** | [**\TalonOne\Client\Model\CollectionItem[]**](CollectionItem.md) | | +**hasMore** | **bool** | | [optional] +**totalResultSize** | **int** | | [optional] +**data** | [**\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/InlineResponse20018.md b/docs/Model/InlineResponse20018.md index 3401df7b..c2d80f12 100644 --- a/docs/Model/InlineResponse20018.md +++ b/docs/Model/InlineResponse20018.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | | [optional] -**totalResultSize** | **int** | | [optional] -**data** | [**\TalonOne\Client\Model\Collection[]**](Collection.md) | | +**hasMore** | **bool** | | +**data** | [**\TalonOne\Client\Model\CollectionItem[]**](CollectionItem.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/InlineResponse20031.md b/docs/Model/InlineResponse20031.md index 74d00846..32950cf1 100644 --- a/docs/Model/InlineResponse20031.md +++ b/docs/Model/InlineResponse20031.md @@ -5,8 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hasMore** | **bool** | | [optional] -**totalResultSize** | **int** | | [optional] -**data** | [**\TalonOne\Client\Model\ApplicationReferee[]**](ApplicationReferee.md) | | +**data** | [**\TalonOne\Client\Model\AudienceAnalytics[]**](AudienceAnalytics.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/InlineResponse20032.md b/docs/Model/InlineResponse20032.md index 54a19ebd..a0036945 100644 --- a/docs/Model/InlineResponse20032.md +++ b/docs/Model/InlineResponse20032.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\Attribute[]**](Attribute.md) | | +**hasMore** | **bool** | | [optional] +**data** | [**\TalonOne\Client\Model\CustomerProfile[]**](CustomerProfile.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/InlineResponse20033.md b/docs/Model/InlineResponse20033.md index cfd5afbf..45a9bc6f 100644 --- a/docs/Model/InlineResponse20033.md +++ b/docs/Model/InlineResponse20033.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hasMore** | **bool** | | [optional] **totalResultSize** | **int** | | [optional] -**data** | [**\TalonOne\Client\Model\CatalogItem[]**](CatalogItem.md) | | +**data** | [**\TalonOne\Client\Model\ApplicationReferee[]**](ApplicationReferee.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/InlineResponse20034.md b/docs/Model/InlineResponse20034.md index 8aed2290..10c1cdc7 100644 --- a/docs/Model/InlineResponse20034.md +++ b/docs/Model/InlineResponse20034.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\AccountAdditionalCost[]**](AccountAdditionalCost.md) | | +**data** | [**\TalonOne\Client\Model\Attribute[]**](Attribute.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/InlineResponse20035.md b/docs/Model/InlineResponse20035.md index 9996d46a..0eb1909e 100644 --- a/docs/Model/InlineResponse20035.md +++ b/docs/Model/InlineResponse20035.md @@ -4,8 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[]**](WebhookWithOutgoingIntegrationDetails.md) | | +**hasMore** | **bool** | | [optional] +**totalResultSize** | **int** | | [optional] +**data** | [**\TalonOne\Client\Model\CatalogItem[]**](CatalogItem.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/InlineResponse20036.md b/docs/Model/InlineResponse20036.md index 141d4a46..297abb9f 100644 --- a/docs/Model/InlineResponse20036.md +++ b/docs/Model/InlineResponse20036.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\WebhookActivationLogEntry[]**](WebhookActivationLogEntry.md) | | +**data** | [**\TalonOne\Client\Model\AccountAdditionalCost[]**](AccountAdditionalCost.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/InlineResponse20037.md b/docs/Model/InlineResponse20037.md index 3026f284..a088d595 100644 --- a/docs/Model/InlineResponse20037.md +++ b/docs/Model/InlineResponse20037.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\WebhookLogEntry[]**](WebhookLogEntry.md) | | +**data** | [**\TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[]**](WebhookWithOutgoingIntegrationDetails.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/InlineResponse20038.md b/docs/Model/InlineResponse20038.md index 52de6530..3f39e455 100644 --- a/docs/Model/InlineResponse20038.md +++ b/docs/Model/InlineResponse20038.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\EventType[]**](EventType.md) | | +**data** | [**\TalonOne\Client\Model\WebhookActivationLogEntry[]**](WebhookActivationLogEntry.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/InlineResponse20039.md b/docs/Model/InlineResponse20039.md index 8a093c31..f492d22f 100644 --- a/docs/Model/InlineResponse20039.md +++ b/docs/Model/InlineResponse20039.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\User[]**](User.md) | | +**data** | [**\TalonOne\Client\Model\WebhookLogEntry[]**](WebhookLogEntry.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/InlineResponse20040.md b/docs/Model/InlineResponse20040.md index 2083defe..bf4071ea 100644 --- a/docs/Model/InlineResponse20040.md +++ b/docs/Model/InlineResponse20040.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalResultSize** | **int** | | [optional] -**hasMore** | **bool** | | [optional] -**data** | [**\TalonOne\Client\Model\Change[]**](Change.md) | | +**totalResultSize** | **int** | | +**data** | [**\TalonOne\Client\Model\EventType[]**](EventType.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/InlineResponse20041.md b/docs/Model/InlineResponse20041.md index 27c06408..4350825a 100644 --- a/docs/Model/InlineResponse20041.md +++ b/docs/Model/InlineResponse20041.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\Export[]**](Export.md) | | +**data** | [**\TalonOne\Client\Model\User[]**](User.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/InlineResponse20042.md b/docs/Model/InlineResponse20042.md index 3b3fd294..ed6c2653 100644 --- a/docs/Model/InlineResponse20042.md +++ b/docs/Model/InlineResponse20042.md @@ -4,8 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\Role[]**](Role.md) | | +**totalResultSize** | **int** | | [optional] +**hasMore** | **bool** | | [optional] +**data** | [**\TalonOne\Client\Model\Change[]**](Change.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/InlineResponse20043.md b/docs/Model/InlineResponse20043.md index f68086e0..5b685bfd 100644 --- a/docs/Model/InlineResponse20043.md +++ b/docs/Model/InlineResponse20043.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | | [optional] -**totalResultSize** | **int** | | [optional] -**data** | [**\TalonOne\Client\Model\Store[]**](Store.md) | | +**totalResultSize** | **int** | | +**data** | [**\TalonOne\Client\Model\Export[]**](Export.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/InlineResponse20044.md b/docs/Model/InlineResponse20044.md new file mode 100644 index 00000000..3e70a804 --- /dev/null +++ b/docs/Model/InlineResponse20044.md @@ -0,0 +1,12 @@ +# # InlineResponse20044 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**totalResultSize** | **int** | | +**data** | [**\TalonOne\Client\Model\Role[]**](Role.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/InlineResponse20045.md b/docs/Model/InlineResponse20045.md new file mode 100644 index 00000000..ad21d3d4 --- /dev/null +++ b/docs/Model/InlineResponse20045.md @@ -0,0 +1,13 @@ +# # InlineResponse20045 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasMore** | **bool** | | [optional] +**totalResultSize** | **int** | | [optional] +**data** | [**\TalonOne\Client\Model\Store[]**](Store.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/InlineResponse20046.md b/docs/Model/InlineResponse20046.md new file mode 100644 index 00000000..4c8e0726 --- /dev/null +++ b/docs/Model/InlineResponse20046.md @@ -0,0 +1,12 @@ +# # InlineResponse20046 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasMore** | **bool** | | [optional] +**data** | [**\TalonOne\Client\Model\Achievement[]**](Achievement.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/InlineResponse20047.md b/docs/Model/InlineResponse20047.md new file mode 100644 index 00000000..206ccf2b --- /dev/null +++ b/docs/Model/InlineResponse20047.md @@ -0,0 +1,12 @@ +# # InlineResponse20047 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasMore** | **bool** | | +**data** | [**\TalonOne\Client\Model\AchievementProgress[]**](AchievementProgress.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/IntegrationCoupon.md b/docs/Model/IntegrationCoupon.md index cc638e17..14e413e1 100644 --- a/docs/Model/IntegrationCoupon.md +++ b/docs/Model/IntegrationCoupon.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **importId** | **int** | The ID of the Import which created this coupon. | [optional] **reservation** | **bool** | Defines the type of reservation: - `true`: The reservation is a soft reservation. Any customer can use the coupon. This is done via the [Create coupon reservation](https://docs.talon.one/integration-api#operation/createCouponReservation) endpoint. - `false`: The reservation is a hard reservation. Only the associated customer (`recipientIntegrationId`) can use the coupon. This is done via the Campaign Manager when you create a coupon for a given `recipientIntegrationId`, the [Create coupons](https://docs.talon.one/management-api#operation/createCoupons) endpoint or [Create coupons for multiple recipients](https://docs.talon.one/management-api#operation/createCouponsForMultipleRecipients) endpoint. | [optional] [default to true] **batchId** | **string** | The id of the batch the coupon belongs to. | [optional] -**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to true] +**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to false] **implicitlyReserved** | **bool** | An indication of whether the coupon is implicitly reserved for all customers. | [optional] **profileRedemptionCount** | **int** | The number of times the coupon was redeemed by the profile. | diff --git a/docs/Model/InventoryCoupon.md b/docs/Model/InventoryCoupon.md index 94adf216..47da5bbc 100644 --- a/docs/Model/InventoryCoupon.md +++ b/docs/Model/InventoryCoupon.md @@ -24,10 +24,10 @@ Name | Type | Description | Notes **importId** | **int** | The ID of the Import which created this coupon. | [optional] **reservation** | **bool** | Defines the type of reservation: - `true`: The reservation is a soft reservation. Any customer can use the coupon. This is done via the [Create coupon reservation](https://docs.talon.one/integration-api#operation/createCouponReservation) endpoint. - `false`: The reservation is a hard reservation. Only the associated customer (`recipientIntegrationId`) can use the coupon. This is done via the Campaign Manager when you create a coupon for a given `recipientIntegrationId`, the [Create coupons](https://docs.talon.one/management-api#operation/createCoupons) endpoint or [Create coupons for multiple recipients](https://docs.talon.one/management-api#operation/createCouponsForMultipleRecipients) endpoint. | [optional] [default to true] **batchId** | **string** | The id of the batch the coupon belongs to. | [optional] -**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to true] +**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to false] **implicitlyReserved** | **bool** | An indication of whether the coupon is implicitly reserved for all customers. | [optional] **profileRedemptionCount** | **int** | The number of times the coupon was redeemed by the profile. | -**state** | **string** | Can be: - `active`: The coupon can be used. It is a reserved coupon that is neither pending, used nor expired, and has a non-exhausted limit counter. - `used`: The coupon has been redeemed and cannot be used again. It is not pending and has reached its redemption limit or was redeemed by the profile before expiration. - `expired`: The coupon was never redeemed and it is now expired. It is non-pending, non-active and non-used by the profile. - `pending`: The coupon will be usable in the future. - `disabled`: The coupon is part of a non-active campaign. | +**state** | **string** | Can be: - `active`: The coupon can be used. It is a reserved coupon that is not pending, used, or expired, and it has a non-exhausted limit counter. **Note:** This coupon state is returned for [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule), but the coupon cannot be used until the campaign is **running**. - `used`: The coupon has been redeemed and cannot be used again. It is not pending and has reached its redemption limit or was redeemed by the profile before expiration. - `expired`: The coupon was never redeemed, and it is now expired. It is non-pending, non-active, and non-used by the profile. - `pending`: The coupon will be usable in the future. - `disabled`: The coupon is part of a non-active 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/LoginParams.md b/docs/Model/LoginParams.md index 69ccf1b5..046b8269 100644 --- a/docs/Model/LoginParams.md +++ b/docs/Model/LoginParams.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email address associated with your account. | +**email** | **string** | The email address associated with the user profile. | **password** | **string** | The password for your account. | [[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/LoyaltyLedgerTransactions.md b/docs/Model/LoyaltyLedgerTransactions.md index 77c152dc..ff1ec6d1 100644 --- a/docs/Model/LoyaltyLedgerTransactions.md +++ b/docs/Model/LoyaltyLedgerTransactions.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hasMore** | **bool** | true means there is more data in the source collection to request. | [optional] +**hasMore** | **bool** | If `true`, it means that there is more data to request in the source collection. | [optional] **data** | [**\TalonOne\Client\Model\LoyaltyLedgerEntry[]**](LoyaltyLedgerEntry.md) | List of transaction entries from a loyalty 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/LoyaltyProgram.md b/docs/Model/LoyaltyProgram.md index e5404a3e..ba32a732 100644 --- a/docs/Model/LoyaltyProgram.md +++ b/docs/Model/LoyaltyProgram.md @@ -14,14 +14,17 @@ 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. | -**tiersExpireIn** | **string** | The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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] +**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] **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] **canUpgradeToAdvancedTiers** | **bool** | `True` if the program can be upgraded to use the `tiersExpireIn` and `tiersDowngradePolicy` properties. | [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/LoyaltyProgramLedgers.md b/docs/Model/LoyaltyProgramLedgers.md index 5959a5da..45d67e0f 100644 --- a/docs/Model/LoyaltyProgramLedgers.md +++ b/docs/Model/LoyaltyProgramLedgers.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **id** | **int** | The internal ID of loyalty program. | **title** | **string** | Visible name of loyalty program. | **name** | **string** | Internal name of loyalty program. | +**joinDate** | [**\DateTime**](\DateTime.md) | The date on which the customer joined the loyalty program in RFC3339. **Note**: This is in the loyalty program's time zone. | [optional] **ledger** | [**\TalonOne\Client\Model\LedgerInfo**](LedgerInfo.md) | | **subLedgers** | [**map[string,\TalonOne\Client\Model\LedgerInfo]**](LedgerInfo.md) | A map containing information about each loyalty subledger. | [optional] diff --git a/docs/Model/LoyaltyProgramTransaction.md b/docs/Model/LoyaltyProgramTransaction.md index ef6cb1fb..4103293b 100644 --- a/docs/Model/LoyaltyProgramTransaction.md +++ b/docs/Model/LoyaltyProgramTransaction.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | ID of the loyalty ledger transaction. | **programId** | **int** | ID of the loyalty program. | +**campaignId** | **int** | ID of the campaign. | [optional] **created** | [**\DateTime**](\DateTime.md) | Date and time the loyalty transaction occurred. | **type** | **string** | Type of transaction. Possible values: - `addition`: Signifies added points. - `subtraction`: Signifies deducted points. | **amount** | **float** | Amount of loyalty points added or deducted in the transaction. | diff --git a/docs/Model/MessageLogEntries.md b/docs/Model/MessageLogEntries.md new file mode 100644 index 00000000..f7eb7d45 --- /dev/null +++ b/docs/Model/MessageLogEntries.md @@ -0,0 +1,12 @@ +# # MessageLogEntries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nextCursor** | **string** | The next value in the database. **Note:** If this value is not present, it means that there are no more values in the database for this combination of request parameters. | [optional] +**data** | [**\TalonOne\Client\Model\MessageLogEntry[]**](MessageLogEntry.md) | List of message logs. | + +[[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/MessageLogEntry.md b/docs/Model/MessageLogEntry.md new file mode 100644 index 00000000..bf3d2d94 --- /dev/null +++ b/docs/Model/MessageLogEntry.md @@ -0,0 +1,22 @@ +# # MessageLogEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Unique identifier of the message. | +**service** | **string** | Name of the service that generated the log entry. | +**changeType** | **string** | Type of change that triggered the notification. | [optional] +**notificationId** | **int** | ID of the notification. | [optional] +**notificationName** | **string** | The name of the notification. | [optional] +**request** | [**\TalonOne\Client\Model\MessageLogRequest**](MessageLogRequest.md) | | [optional] +**response** | [**\TalonOne\Client\Model\MessageLogResponse**](MessageLogResponse.md) | | [optional] +**createdAt** | [**\DateTime**](\DateTime.md) | Timestamp when the log entry was created. | +**entityType** | **string** | The entity type the log is related to. | [optional] +**url** | **string** | The target URL of the request. | [optional] +**applicationId** | **int** | Identifier of the Application. | [optional] +**loyaltyProgramId** | **int** | Identifier of the 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/MessageLogRequest.md b/docs/Model/MessageLogRequest.md new file mode 100644 index 00000000..70b909b2 --- /dev/null +++ b/docs/Model/MessageLogRequest.md @@ -0,0 +1,12 @@ +# # MessageLogRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdAt** | [**\DateTime**](\DateTime.md) | Timestamp when the request was made. | +**request** | **string** | Raw request data. | + +[[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 new file mode 100644 index 00000000..d4d1ebb9 --- /dev/null +++ b/docs/Model/MessageLogResponse.md @@ -0,0 +1,13 @@ +# # MessageLogResponse + +## Properties + +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. | + +[[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/NewAccountSignUp.md b/docs/Model/NewAccountSignUp.md index e79e6e82..c7c5c0ab 100644 --- a/docs/Model/NewAccountSignUp.md +++ b/docs/Model/NewAccountSignUp.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email address associated with your account. | +**email** | **string** | The email address associated with the user profile. | **password** | **string** | The password for your account. | **companyName** | **string** | | diff --git a/docs/Model/NewApplicationAPIKey.md b/docs/Model/NewApplicationAPIKey.md index 4f7759a4..b340a051 100644 --- a/docs/Model/NewApplicationAPIKey.md +++ b/docs/Model/NewApplicationAPIKey.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **string** | Title for API Key. | -**expires** | [**\DateTime**](\DateTime.md) | The date the API key expired. | +**title** | **string** | Title of the API key. | +**expires** | [**\DateTime**](\DateTime.md) | The date the API key expires. | **platform** | **string** | The third-party platform the API key is valid for. Use `none` for a generic API key to be used from your own integration layer. | [optional] +**type** | **string** | The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. | [optional] +**timeOffset** | **int** | A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. | [optional] **id** | **int** | ID of the API Key. | **createdBy** | **int** | ID of user who created. | **accountID** | **int** | ID of account the key is used for. | diff --git a/docs/Model/NewCampaign.md b/docs/Model/NewCampaign.md index 9f14cd4b..f899d2f5 100644 --- a/docs/Model/NewCampaign.md +++ b/docs/Model/NewCampaign.md @@ -17,9 +17,9 @@ Name | Type | Description | Notes **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 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] +**evaluationGroupId** | **int** | The ID of the campaign evaluation group the campaign belongs to. | [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/NewCampaignGroup.md b/docs/Model/NewCampaignGroup.md index 778a11a5..f863e15d 100644 --- a/docs/Model/NewCampaignGroup.md +++ b/docs/Model/NewCampaignGroup.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | The name of this campaign access group. | +**name** | **string** | The name of the campaign access group. | **description** | **string** | A longer description of the campaign access group. | [optional] **subscribedApplicationsIds** | **int[]** | A list of IDs of the Applications that this campaign access group is enabled for. | [optional] **campaignIds** | **int[]** | A list of IDs of the campaigns that are part of the campaign access group. | [optional] diff --git a/docs/Model/NewCoupons.md b/docs/Model/NewCoupons.md index 9d1501bb..f6d9c789 100644 --- a/docs/Model/NewCoupons.md +++ b/docs/Model/NewCoupons.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **recipientIntegrationId** | **string** | The integration ID for this coupon's beneficiary's profile. | [optional] **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] **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. | [optional] -**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to true] +**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to false] **implicitlyReserved** | **bool** | An indication of whether the coupon is implicitly reserved for all customers. | [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/NewCustomerSessionV2.md b/docs/Model/NewCustomerSessionV2.md index 0e17f63e..1b84efd7 100644 --- a/docs/Model/NewCustomerSessionV2.md +++ b/docs/Model/NewCustomerSessionV2.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **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] -**loyaltyCards** | **string[]** | Any loyalty cards used. | [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] **additionalCosts** | [**map[string,\TalonOne\Client\Model\AdditionalCost]**](AdditionalCost.md) | Use this property to set a value for the additional costs of this session, 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] diff --git a/docs/Model/NewInvitation.md b/docs/Model/NewInvitation.md index ed5666e9..e8e9c010 100644 --- a/docs/Model/NewInvitation.md +++ b/docs/Model/NewInvitation.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Name of the user being invited. | [optional] -**email** | **string** | | -**acl** | **string** | The `Access Control List` json defining the role of the user. This represents the access control on the user level. Use one of the following: - normal user: `{\"Role\": 0}` - admin: `{\"Role\": 127}` | [optional] -**isAdmin** | **bool** | An indication of whether the user has admin permissions. We recommend using this flag over using the `acl` with value `{\"Role\": 127}`. | [optional] -**roles** | **int[]** | An array of role IDs to assign to the new user. | [optional] +**name** | **string** | Name of the user. | [optional] +**email** | **string** | Email address of the user. | +**isAdmin** | **bool** | Indicates whether the user is an `admin`. | [optional] +**roles** | **int[]** | A list of the IDs of the roles assigned to the user. | [optional] +**acl** | **string** | Indicates the access level of the user. | [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/NewInviteEmail.md b/docs/Model/NewInviteEmail.md index 72c8930e..875af3c4 100644 --- a/docs/Model/NewInviteEmail.md +++ b/docs/Model/NewInviteEmail.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | | -**token** | **string** | | +**email** | **string** | Email address of the user. | +**token** | **string** | Invitation token 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/NewLoyaltyProgram.md b/docs/Model/NewLoyaltyProgram.md index 5594bcd6..65a46fd6 100644 --- a/docs/Model/NewLoyaltyProgram.md +++ b/docs/Model/NewLoyaltyProgram.md @@ -12,8 +12,10 @@ 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. | -**tiersExpireIn** | **string** | The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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] +**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] **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/NewNotificationTest.md b/docs/Model/NewNotificationTest.md new file mode 100644 index 00000000..8e71e6fb --- /dev/null +++ b/docs/Model/NewNotificationTest.md @@ -0,0 +1,16 @@ +# # NewNotificationTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The notification type. | +**queryParams** | **map[string,string]** | Array of query parameters. | [optional] +**headers** | **map[string,string]** | List of API HTTP headers for the given webhook-based notification. | [optional] +**verb** | **string** | API method for this notification. | +**url** | **string** | API URL for the given notification. | +**payload** | **string** | API payload of this 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/NewPicklist.md b/docs/Model/NewPicklist.md index 8a1bc95f..8facc1c6 100644 --- a/docs/Model/NewPicklist.md +++ b/docs/Model/NewPicklist.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **string** | The type of allowed values in the picklist. If type time is chosen, it must be an RFC3339 timestamp string. | +**type** | **string** | The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string. | **values** | **string[]** | The list of allowed values provided by this picklist. | [[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/NewRoleV2.md b/docs/Model/NewRoleV2.md index 22ba6355..67472dd0 100644 --- a/docs/Model/NewRoleV2.md +++ b/docs/Model/NewRoleV2.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | Name of the role. | **description** | **string** | Description of the role. | **permissions** | [**\TalonOne\Client\Model\RoleV2Permissions**](RoleV2Permissions.md) | | [optional] -**members** | **int[]** | A list of user identifiers the role is assigned to. | [optional] +**members** | **int[]** | A list of user IDs the role is assigned to. | [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/NewStore.md b/docs/Model/NewStore.md index 39db527d..49e16c74 100644 --- a/docs/Model/NewStore.md +++ b/docs/Model/NewStore.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | The name of the store. | **description** | **string** | The description of the store. | **attributes** | [**object**](.md) | The attributes of the store. | [optional] -**integrationId** | **string** | The integration ID of the store. You choose this ID when you create a store. | +**integrationId** | **string** | The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. | [[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/NewUser.md b/docs/Model/NewUser.md index c52fe50f..1bef3fbc 100644 --- a/docs/Model/NewUser.md +++ b/docs/Model/NewUser.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | The email address associated with your account. | +**email** | **string** | The email address associated with the user profile. | **password** | **string** | The password for your account. | **name** | **string** | Your name. | [optional] **inviteToken** | **string** | | diff --git a/docs/Model/NotificationListItem.md b/docs/Model/NotificationListItem.md new file mode 100644 index 00000000..a9f23e1e --- /dev/null +++ b/docs/Model/NotificationListItem.md @@ -0,0 +1,14 @@ +# # NotificationListItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**notificationId** | **int** | The ID of the notification. | +**notificationName** | **string** | The name of the notification. | +**entityId** | **int** | The ID of the entity to which this notification belongs. For example, in case of a loyalty notification, this value is the ID of the loyalty program. | +**enabled** | **bool** | Indicates whether the notification is activated. | + +[[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/NotificationTest.md b/docs/Model/NotificationTest.md new file mode 100644 index 00000000..0bee4aa3 --- /dev/null +++ b/docs/Model/NotificationTest.md @@ -0,0 +1,12 @@ +# # NotificationTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**httpResponse** | **string** | The returned http response. | +**httpStatus** | **int** | The returned http status code. | + +[[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/PatchItemCatalogAction.md b/docs/Model/PatchItemCatalogAction.md index a05bab0e..858b6278 100644 --- a/docs/Model/PatchItemCatalogAction.md +++ b/docs/Model/PatchItemCatalogAction.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **sku** | **string** | The unique SKU of the item to patch. | **price** | **float** | Price of the item. | [optional] **attributes** | [**object**](.md) | The attributes of the item to patch. | [optional] +**product** | [**\TalonOne\Client\Model\Product**](Product.md) | | [optional] **createIfNotExists** | **bool** | Indicates whether to create an item if the SKU does not exist. | [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/PendingPointsNotificationPolicy.md b/docs/Model/PendingPointsNotificationPolicy.md index beece647..ebb5f26c 100644 --- a/docs/Model/PendingPointsNotificationPolicy.md +++ b/docs/Model/PendingPointsNotificationPolicy.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/Picklist.md b/docs/Model/Picklist.md index 92b99228..3bef2e83 100644 --- a/docs/Model/Picklist.md +++ b/docs/Model/Picklist.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Internal ID of this entity. | **created** | [**\DateTime**](\DateTime.md) | The time this entity was created. | -**type** | **string** | The type of allowed values in the picklist. If type time is chosen, it must be an RFC3339 timestamp string. | +**type** | **string** | The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string. | **values** | **string[]** | The list of allowed values provided by this picklist. | **modifiedBy** | **int** | ID of the user who last updated this effect if available. | [optional] **createdBy** | **int** | ID of the user who created this effect. | diff --git a/docs/Model/Product.md b/docs/Model/Product.md new file mode 100644 index 00000000..31712da2 --- /dev/null +++ b/docs/Model/Product.md @@ -0,0 +1,11 @@ +# # Product + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the product. | + +[[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/RoleV2.md b/docs/Model/RoleV2.md index 8eb21884..240df406 100644 --- a/docs/Model/RoleV2.md +++ b/docs/Model/RoleV2.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **name** | **string** | Name of the role. | [optional] **description** | **string** | Description of the role. | [optional] **permissions** | [**\TalonOne\Client\Model\RoleV2Permissions**](RoleV2Permissions.md) | | [optional] -**members** | **int[]** | A list of user identifiers the role is assigned to. | [optional] +**members** | **int[]** | A list of user IDs the role is assigned to. | [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/RoleV2Base.md b/docs/Model/RoleV2Base.md index 2b542e8a..40c870b8 100644 --- a/docs/Model/RoleV2Base.md +++ b/docs/Model/RoleV2Base.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | Name of the role. | [optional] **description** | **string** | Description of the role. | [optional] **permissions** | [**\TalonOne\Client\Model\RoleV2Permissions**](RoleV2Permissions.md) | | [optional] -**members** | **int[]** | A list of user identifiers the role is assigned to. | [optional] +**members** | **int[]** | A list of user IDs the role is assigned to. | [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/RoleV2Permissions.md b/docs/Model/RoleV2Permissions.md index 97d31a53..9ba3da77 100644 --- a/docs/Model/RoleV2Permissions.md +++ b/docs/Model/RoleV2Permissions.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**permissionSets** | [**\TalonOne\Client\Model\RoleV2PermissionSet[]**](RoleV2PermissionSet.md) | List of grouped logical operations to use as a reference in the roles section. Each group of logical operations has a name. | [optional] +**permissionSets** | [**\TalonOne\Client\Model\RoleV2PermissionSet[]**](RoleV2PermissionSet.md) | List of grouped logical operations referenced by roles. | [optional] **roles** | [**\TalonOne\Client\Model\RoleV2RolesGroup**](RoleV2RolesGroup.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/SamlConnectionInternal.md b/docs/Model/SamlConnectionInternal.md new file mode 100644 index 00000000..09869a3b --- /dev/null +++ b/docs/Model/SamlConnectionInternal.md @@ -0,0 +1,12 @@ +# # SamlConnectionInternal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | ID of the SAML service. | +**metadataDocument** | **string** | Identity Provider metadata XML document. | + +[[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/SamlLoginEndpoint.md b/docs/Model/SamlLoginEndpoint.md index 3026769b..c5f874b4 100644 --- a/docs/Model/SamlLoginEndpoint.md +++ b/docs/Model/SamlLoginEndpoint.md @@ -4,8 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the SAML login endpoint. | **name** | **string** | ID of the SAML service. | -**loginURL** | **string** | Single Sign-On URL. | +**loginURL** | **string** | The single sign-on URL. | [[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/Store.md b/docs/Model/Store.md index 18e3229d..cd625bac 100644 --- a/docs/Model/Store.md +++ b/docs/Model/Store.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **name** | **string** | The name of the store. | **description** | **string** | The description of the store. | **attributes** | [**object**](.md) | The attributes of the store. | [optional] -**integrationId** | **string** | The integration ID of the store. You choose this ID when you create a store. | +**integrationId** | **string** | The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. | **applicationId** | **int** | The ID of the application that owns this entity. | **updated** | [**\DateTime**](\DateTime.md) | Timestamp of the most recent update on this entity. | **linkedCampaignIds** | **int[]** | A list of IDs of the campaigns that are linked with current store. | [optional] diff --git a/docs/Model/TemplateArgDef.md b/docs/Model/TemplateArgDef.md index 627994de..f1ce02da 100644 --- a/docs/Model/TemplateArgDef.md +++ b/docs/Model/TemplateArgDef.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **string** | The type of value this argument expects. | -**description** | **string** | A campaigner-friendly description of the argument, this will also be shown in the rule editor. | +**description** | **string** | A campaigner-friendly description of the argument, this will also be shown in the rule editor. | [optional] **title** | **string** | A campaigner friendly name for the argument, this will be shown in the rule editor. | **ui** | [**object**](.md) | Arbitrary metadata that may be used to render an input for this argument. | **picklistID** | **int** | ID of the picklist linked to a template. | [optional] diff --git a/docs/Model/TierDowngradeNotificationPolicy.md b/docs/Model/TierDowngradeNotificationPolicy.md index 42b85e19..b2958758 100644 --- a/docs/Model/TierDowngradeNotificationPolicy.md +++ b/docs/Model/TierDowngradeNotificationPolicy.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | The name of the notification. | +**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/TierUpgradeNotificationPolicy.md b/docs/Model/TierUpgradeNotificationPolicy.md index b1d80017..8da9fb8c 100644 --- a/docs/Model/TierUpgradeNotificationPolicy.md +++ b/docs/Model/TierUpgradeNotificationPolicy.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/TierWillDowngradeNotificationPolicy.md b/docs/Model/TierWillDowngradeNotificationPolicy.md index fa9639b7..37b8eb76 100644 --- a/docs/Model/TierWillDowngradeNotificationPolicy.md +++ b/docs/Model/TierWillDowngradeNotificationPolicy.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | The name of the notification. | +**batchingEnabled** | **bool** | Indicates whether batching is activated. | [optional] [default to true] **triggers** | [**\TalonOne\Client\Model\TierWillDowngradeNotificationTrigger[]**](TierWillDowngradeNotificationTrigger.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/TimePoint.md b/docs/Model/TimePoint.md new file mode 100644 index 00000000..fb53ea4f --- /dev/null +++ b/docs/Model/TimePoint.md @@ -0,0 +1,16 @@ +# # TimePoint + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**month** | **int** | The achievement ends and resets in this month. **Note**: Only applicable if the period is set to `Y`. | [optional] +**dayOfMonth** | **int** | The achievement ends and resets on this day of the month. **Note**: Only applicable if the period is set to `Y` or `M`. | [optional] +**dayOfWeek** | **int** | The achievement ends and resets on this day of the week. `1` represents `Monday` and `7` represents `Sunday`. **Note**: Only applicable if the period is set to `W`. | [optional] +**hour** | **int** | The achievement ends and resets at this hour. | +**minute** | **int** | The achievement ends and resets at this minute. | +**second** | **int** | The achievement ends and resets at this second. | + +[[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/UpdateAchievement.md b/docs/Model/UpdateAchievement.md new file mode 100644 index 00000000..3886ff81 --- /dev/null +++ b/docs/Model/UpdateAchievement.md @@ -0,0 +1,16 @@ +# # UpdateAchievement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The internal name of the achievement used in API requests. | [optional] +**title** | **string** | The display name for the achievement in the Campaign Manager. | [optional] +**description** | **string** | A description of the achievement. | [optional] +**target** | **float** | The required number of actions or the transactional milestone to complete the achievement. | [optional] +**period** | **string** | The relative duration after which the achievement ends and resets for a particular customer profile. | [optional] +**periodEndOverride** | [**\TalonOne\Client\Model\TimePoint**](TimePoint.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/UpdateApplicationAPIKey.md b/docs/Model/UpdateApplicationAPIKey.md new file mode 100644 index 00000000..ea5464ed --- /dev/null +++ b/docs/Model/UpdateApplicationAPIKey.md @@ -0,0 +1,11 @@ +# # UpdateApplicationAPIKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeOffset** | **int** | A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. | + +[[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/UpdateCampaignGroup.md b/docs/Model/UpdateCampaignGroup.md index 9b030161..e96f9607 100644 --- a/docs/Model/UpdateCampaignGroup.md +++ b/docs/Model/UpdateCampaignGroup.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | The name of this campaign access group. | +**name** | **string** | The name of the campaign access group. | **description** | **string** | A longer description of the campaign access group. | [optional] **subscribedApplicationsIds** | **int[]** | A list of IDs of the Applications that this campaign access group is enabled for. | [optional] **campaignIds** | **int[]** | A list of IDs of the campaigns that are part of the campaign access group. | [optional] diff --git a/docs/Model/UpdateCoupon.md b/docs/Model/UpdateCoupon.md index a542e1b2..c5bc98ed 100644 --- a/docs/Model/UpdateCoupon.md +++ b/docs/Model/UpdateCoupon.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **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] -**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to true] +**isReservationMandatory** | **bool** | Whether the reservation effect actually created a new reservation. | [optional] [default to false] **implicitlyReserved** | **bool** | An indication of whether the coupon is implicitly reserved for all customers. | [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 ad58f0ce..67ba7160 100644 --- a/docs/Model/UpdateLoyaltyProgram.md +++ b/docs/Model/UpdateLoyaltyProgram.md @@ -12,8 +12,10 @@ 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] -**tiersExpireIn** | **string** | The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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] +**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] **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/UpdatePicklist.md b/docs/Model/UpdatePicklist.md index 688660b0..0b17fa4e 100644 --- a/docs/Model/UpdatePicklist.md +++ b/docs/Model/UpdatePicklist.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **string** | The type of allowed values in the picklist. If type time is chosen, it must be an RFC3339 timestamp string. | +**type** | **string** | The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string. | **values** | **string[]** | The list of allowed values provided by this picklist. | [[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/UpdateUser.md b/docs/Model/UpdateUser.md index a9429797..ab9baac6 100644 --- a/docs/Model/UpdateUser.md +++ b/docs/Model/UpdateUser.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | The user name. | [optional] -**policy** | **string** | The `Access Control List` json defining the role of the user. This represents the access control on the user level. | [optional] -**state** | **string** | New state (\"deactivated\" or \"active\") for the user. Only usable by admins for the user. | [optional] -**roles** | **int[]** | List of roles to assign to the user. | [optional] -**applicationNotificationSubscriptions** | [**object**](.md) | | [optional] -**isAdmin** | **bool** | An indication of whether the user has admin permissions. | [optional] +**name** | **string** | Name of the user. | [optional] +**state** | **string** | The state of the user. - `deactivated`: The user has been deactivated. - `active`: The user is active. **Note**: Only `admin` users can update the state of another user. | [optional] +**isAdmin** | **bool** | Indicates whether the user is an `admin`. | [optional] +**policy** | **string** | Indicates the access level of the user. | [optional] +**roles** | **int[]** | A list of the IDs of the roles assigned to the user. **Note**: Use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint to find the ID of a role. | [optional] +**applicationNotificationSubscriptions** | [**object**](.md) | Application notifications that the user is subscribed to. | [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/User.md b/docs/Model/User.md index 981936a8..c6cae69d 100644 --- a/docs/Model/User.md +++ b/docs/Model/User.md @@ -7,19 +7,19 @@ 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. | -**email** | **string** | The email address associated with your account. | +**email** | **string** | The email address associated with the user profile. | **accountId** | **int** | The ID of the account that owns this entity. | -**inviteToken** | **string** | Invite token, empty if the user as already accepted their invite. | -**state** | **string** | Current user state. | -**name** | **string** | Full name | -**policy** | [**object**](.md) | User ACL Policy | -**latestFeedTimestamp** | [**\DateTime**](\DateTime.md) | Latest timestamp the user has been notified for feed. | [optional] -**roles** | **int[]** | Contains a list of all roles the user is a member of. | [optional] -**applicationNotificationSubscriptions** | [**object**](.md) | | [optional] -**authMethod** | **string** | The Authentication method for this user. | [optional] -**isAdmin** | **bool** | An indication of whether the user has admin permissions. | [optional] -**lastSignedIn** | [**\DateTime**](\DateTime.md) | Date and time when the user last signed in to Talon.One. | [optional] -**lastAccessed** | [**\DateTime**](\DateTime.md) | Date and time of the user's last activity after signing in to Talon.One. | [optional] +**name** | **string** | Name of the user. | +**state** | **string** | State of the user. | +**inviteToken** | **string** | Invitation token of the user. **Note**: If the user has already accepted their invitation, this is `null`. | +**isAdmin** | **bool** | Indicates whether the user is an `admin`. | [optional] +**policy** | [**object**](.md) | Access level of the user. | +**roles** | **int[]** | A list of the IDs of the roles assigned to the user. | [optional] +**authMethod** | **string** | Authentication method for this user. | [optional] +**applicationNotificationSubscriptions** | [**object**](.md) | Application notifications that the user is subscribed to. | [optional] +**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] [[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/lib/Api/IntegrationApi.php b/lib/Api/IntegrationApi.php index f5f95d76..a98abd15 100644 --- a/lib/Api/IntegrationApi.php +++ b/lib/Api/IntegrationApi.php @@ -1443,7 +1443,7 @@ protected function createReferralsForMultipleAdvocatesRequest($body, $silent = ' * * Delete audience memberships * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1459,7 +1459,7 @@ public function deleteAudienceMembershipsV2($audienceId) * * Delete audience memberships * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1527,7 +1527,7 @@ public function deleteAudienceMembershipsV2WithHttpInfo($audienceId) * * Delete audience memberships * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1547,7 +1547,7 @@ function ($response) { * * Delete audience memberships * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1583,7 +1583,7 @@ function ($exception) { /** * Create request for operation 'deleteAudienceMembershipsV2' * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -1689,7 +1689,7 @@ protected function deleteAudienceMembershipsV2Request($audienceId) * * Delete audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1705,7 +1705,7 @@ public function deleteAudienceV2($audienceId) * * Delete audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1781,7 +1781,7 @@ public function deleteAudienceV2WithHttpInfo($audienceId) * * Delete audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1801,7 +1801,7 @@ function ($response) { * * Delete audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -1837,7 +1837,7 @@ function ($exception) { /** * Create request for operation 'deleteAudienceV2' * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -2463,14 +2463,15 @@ protected function deleteCustomerDataRequest($integrationId) * @param bool $coupons Set to `true` to include coupon information in the response. (optional) * @param bool $loyalty Set to `true` to include loyalty information in the response. (optional) * @param bool $giveaways Set to `true` to include giveaways information in the response. (optional) + * @param bool $achievements Set to `true` to include achievement information in the response. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \TalonOne\Client\Model\CustomerInventory|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCustomerInventory($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null) + public function getCustomerInventory($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null, $achievements = null) { - list($response) = $this->getCustomerInventoryWithHttpInfo($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways); + list($response) = $this->getCustomerInventoryWithHttpInfo($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways, $achievements); return $response; } @@ -2485,14 +2486,15 @@ public function getCustomerInventory($integrationId, $profile = null, $referrals * @param bool $coupons Set to `true` to include coupon information in the response. (optional) * @param bool $loyalty Set to `true` to include loyalty information in the response. (optional) * @param bool $giveaways Set to `true` to include giveaways information in the response. (optional) + * @param bool $achievements Set to `true` to include achievement information in the response. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \TalonOne\Client\Model\CustomerInventory|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getCustomerInventoryWithHttpInfo($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null) + public function getCustomerInventoryWithHttpInfo($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null, $achievements = null) { - $request = $this->getCustomerInventoryRequest($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways); + $request = $this->getCustomerInventoryRequest($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways, $achievements); try { $options = $this->createHttpClientOption(); @@ -2618,13 +2620,14 @@ public function getCustomerInventoryWithHttpInfo($integrationId, $profile = null * @param bool $coupons Set to `true` to include coupon information in the response. (optional) * @param bool $loyalty Set to `true` to include loyalty information in the response. (optional) * @param bool $giveaways Set to `true` to include giveaways information in the response. (optional) + * @param bool $achievements Set to `true` to include achievement information in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerInventoryAsync($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null) + public function getCustomerInventoryAsync($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null, $achievements = null) { - return $this->getCustomerInventoryAsyncWithHttpInfo($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways) + return $this->getCustomerInventoryAsyncWithHttpInfo($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways, $achievements) ->then( function ($response) { return $response[0]; @@ -2643,14 +2646,15 @@ function ($response) { * @param bool $coupons Set to `true` to include coupon information in the response. (optional) * @param bool $loyalty Set to `true` to include loyalty information in the response. (optional) * @param bool $giveaways Set to `true` to include giveaways information in the response. (optional) + * @param bool $achievements Set to `true` to include achievement information in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerInventoryAsyncWithHttpInfo($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null) + public function getCustomerInventoryAsyncWithHttpInfo($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null, $achievements = null) { $returnType = '\TalonOne\Client\Model\CustomerInventory'; - $request = $this->getCustomerInventoryRequest($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways); + $request = $this->getCustomerInventoryRequest($integrationId, $profile, $referrals, $coupons, $loyalty, $giveaways, $achievements); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2695,11 +2699,12 @@ function ($exception) { * @param bool $coupons Set to `true` to include coupon information in the response. (optional) * @param bool $loyalty Set to `true` to include loyalty information in the response. (optional) * @param bool $giveaways Set to `true` to include giveaways information in the response. (optional) + * @param bool $achievements Set to `true` to include achievement information in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerInventoryRequest($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null) + protected function getCustomerInventoryRequest($integrationId, $profile = null, $referrals = null, $coupons = null, $loyalty = null, $giveaways = null, $achievements = null) { // verify the required parameter 'integrationId' is set if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { @@ -2750,6 +2755,13 @@ protected function getCustomerInventoryRequest($integrationId, $profile = null, if ($giveaways !== null) { $queryParams['giveaways'] = $giveaways; } + // query params + if (is_array($achievements)) { + $achievements = ObjectSerializer::serializeCollection($achievements, '', true); + } + if ($achievements !== null) { + $queryParams['achievements'] = $achievements; + } // path params @@ -3155,7 +3167,7 @@ protected function getCustomerSessionRequest($customerSessionId) * * @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 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. (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 @@ -3174,7 +3186,7 @@ public function getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate = * * @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 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. (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 @@ -3324,7 +3336,7 @@ public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId * * @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 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. (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 @@ -3346,7 +3358,7 @@ function ($response) { * * @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 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. (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 @@ -3395,7 +3407,7 @@ function ($exception) { * * @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 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. (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 @@ -3524,7 +3536,7 @@ protected function getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, * * @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 $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. (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 @@ -3543,7 +3555,7 @@ public function getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDa * * @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 $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. (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 @@ -3693,7 +3705,7 @@ public function getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCa * * @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 $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. (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 @@ -3715,7 +3727,7 @@ function ($response) { * * @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 $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. (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 @@ -3764,7 +3776,7 @@ function ($exception) { * * @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 $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. (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 @@ -3899,7 +3911,7 @@ protected function getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCard * @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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -3921,7 +3933,7 @@ public function getLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $status * @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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -4074,7 +4086,7 @@ public function getLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCard * @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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -4099,7 +4111,7 @@ function ($response) { * @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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -4151,7 +4163,7 @@ function ($exception) { * @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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -4315,9 +4327,9 @@ protected function getLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -4339,9 +4351,9 @@ public function getLoyaltyCardTransactions($loyaltyProgramId, $loyaltyCardId, $s * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -4494,9 +4506,9 @@ public function getLoyaltyCardTransactionsWithHttpInfo($loyaltyProgramId, $loyal * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \InvalidArgumentException @@ -4521,9 +4533,9 @@ function ($response) { * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \InvalidArgumentException @@ -4575,9 +4587,9 @@ function ($exception) { * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * * @throws \InvalidArgumentException @@ -4755,7 +4767,7 @@ protected function getLoyaltyCardTransactionsRequest($loyaltyProgramId, $loyalty * @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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -4777,7 +4789,7 @@ public function getLoyaltyProgramProfilePoints($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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -4930,7 +4942,7 @@ public function getLoyaltyProgramProfilePointsWithHttpInfo($loyaltyProgramId, $i * @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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -4955,7 +4967,7 @@ 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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -5007,7 +5019,7 @@ 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 string $status Filter points based on their status. (optional, default to 'active') * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -5167,9 +5179,9 @@ protected function getLoyaltyProgramProfilePointsRequest($loyaltyProgramId, $int * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -5191,9 +5203,9 @@ public function getLoyaltyProgramProfileTransactions($loyaltyProgramId, $integra * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -5346,9 +5358,9 @@ public function getLoyaltyProgramProfileTransactionsWithHttpInfo($loyaltyProgram * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -5373,9 +5385,9 @@ 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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -5427,9 +5439,9 @@ 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 string $subledgerId The ID of the subledger by which we filter the data. (optional) * @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 \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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) + * @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 @@ -7683,7 +7695,7 @@ protected function trackEventV2Request($body, $silent = 'yes', $dry = null) * * Update profile attributes for all customers in audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param object $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -7700,7 +7712,7 @@ public function updateAudienceCustomersAttributes($audienceId, $body) * * Update profile attributes for all customers in audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param object $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -7769,7 +7781,7 @@ public function updateAudienceCustomersAttributesWithHttpInfo($audienceId, $body * * Update profile attributes for all customers in audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param object $body body (required) * * @throws \InvalidArgumentException @@ -7790,7 +7802,7 @@ function ($response) { * * Update profile attributes for all customers in audience * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param object $body body (required) * * @throws \InvalidArgumentException @@ -7827,7 +7839,7 @@ function ($exception) { /** * Create request for operation 'updateAudienceCustomersAttributes' * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param object $body body (required) * * @throws \InvalidArgumentException @@ -7943,7 +7955,7 @@ protected function updateAudienceCustomersAttributesRequest($audienceId, $body) * * Update audience name * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param \TalonOne\Client\Model\UpdateAudience $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -7961,7 +7973,7 @@ public function updateAudienceV2($audienceId, $body) * * Update audience name * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param \TalonOne\Client\Model\UpdateAudience $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -8090,7 +8102,7 @@ public function updateAudienceV2WithHttpInfo($audienceId, $body) * * Update audience name * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param \TalonOne\Client\Model\UpdateAudience $body body (required) * * @throws \InvalidArgumentException @@ -8111,7 +8123,7 @@ function ($response) { * * Update audience name * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param \TalonOne\Client\Model\UpdateAudience $body body (required) * * @throws \InvalidArgumentException @@ -8159,7 +8171,7 @@ function ($exception) { /** * Create request for operation 'updateAudienceV2' * - * @param int $audienceId The ID of the audience. You get it via the `id` property when [creating an audience](#operation/createAudienceV2). (required) + * @param int $audienceId The ID of the audience. (required) * @param \TalonOne\Client\Model\UpdateAudience $body body (required) * * @throws \InvalidArgumentException @@ -9228,14 +9240,15 @@ 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 \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 * @throws \InvalidArgumentException * @return \TalonOne\Client\Model\IntegrationStateV2|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|object */ - public function updateCustomerSessionV2($customerSessionId, $body, $dry = null) + public function updateCustomerSessionV2($customerSessionId, $body, $dry = null, $now = null) { - list($response) = $this->updateCustomerSessionV2WithHttpInfo($customerSessionId, $body, $dry); + list($response) = $this->updateCustomerSessionV2WithHttpInfo($customerSessionId, $body, $dry, $now); return $response; } @@ -9247,14 +9260,15 @@ 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 \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 * @throws \InvalidArgumentException * @return array of \TalonOne\Client\Model\IntegrationStateV2|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|object, HTTP status code, HTTP response headers (array of strings) */ - public function updateCustomerSessionV2WithHttpInfo($customerSessionId, $body, $dry = null) + public function updateCustomerSessionV2WithHttpInfo($customerSessionId, $body, $dry = null, $now = null) { - $request = $this->updateCustomerSessionV2Request($customerSessionId, $body, $dry); + $request = $this->updateCustomerSessionV2Request($customerSessionId, $body, $dry, $now); try { $options = $this->createHttpClientOption(); @@ -9397,13 +9411,14 @@ 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 \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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCustomerSessionV2Async($customerSessionId, $body, $dry = null) + public function updateCustomerSessionV2Async($customerSessionId, $body, $dry = null, $now = null) { - return $this->updateCustomerSessionV2AsyncWithHttpInfo($customerSessionId, $body, $dry) + return $this->updateCustomerSessionV2AsyncWithHttpInfo($customerSessionId, $body, $dry, $now) ->then( function ($response) { return $response[0]; @@ -9419,14 +9434,15 @@ 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 \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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCustomerSessionV2AsyncWithHttpInfo($customerSessionId, $body, $dry = null) + public function updateCustomerSessionV2AsyncWithHttpInfo($customerSessionId, $body, $dry = null, $now = null) { $returnType = '\TalonOne\Client\Model\IntegrationStateV2'; - $request = $this->updateCustomerSessionV2Request($customerSessionId, $body, $dry); + $request = $this->updateCustomerSessionV2Request($customerSessionId, $body, $dry, $now); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9468,11 +9484,12 @@ 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 \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 * @return \GuzzleHttp\Psr7\Request */ - protected function updateCustomerSessionV2Request($customerSessionId, $body, $dry = null) + protected function updateCustomerSessionV2Request($customerSessionId, $body, $dry = null, $now = null) { // verify the required parameter 'customerSessionId' is set if ($customerSessionId === null || (is_array($customerSessionId) && count($customerSessionId) === 0)) { @@ -9501,6 +9518,13 @@ protected function updateCustomerSessionV2Request($customerSessionId, $body, $dr if ($dry !== null) { $queryParams['dry'] = $dry; } + // query params + if (is_array($now)) { + $now = ObjectSerializer::serializeCollection($now, '', true); + } + if ($now !== null) { + $queryParams['now'] = $now; + } // path params diff --git a/lib/Api/ManagementApi.php b/lib/Api/ManagementApi.php index ebdba1be..3383f5e0 100644 --- a/lib/Api/ManagementApi.php +++ b/lib/Api/ManagementApi.php @@ -1358,36 +1358,40 @@ protected function createAccountCollectionRequest($body) } /** - * Operation createAdditionalCost + * Operation createAchievement * - * Create additional cost + * Create achievement * - * @param \TalonOne\Client\Model\NewAdditionalCost $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\CreateAchievement $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\AccountAdditionalCost + * @return \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function createAdditionalCost($body) + public function createAchievement($applicationId, $campaignId, $body) { - list($response) = $this->createAdditionalCostWithHttpInfo($body); + list($response) = $this->createAchievementWithHttpInfo($applicationId, $campaignId, $body); return $response; } /** - * Operation createAdditionalCostWithHttpInfo + * Operation createAchievementWithHttpInfo * - * Create additional cost + * Create achievement * - * @param \TalonOne\Client\Model\NewAdditionalCost $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\CreateAchievement $body body (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\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function createAdditionalCostWithHttpInfo($body) + public function createAchievementWithHttpInfo($applicationId, $campaignId, $body) { - $request = $this->createAdditionalCostRequest($body); + $request = $this->createAchievementRequest($applicationId, $campaignId, $body); try { $options = $this->createHttpClientOption(); @@ -1420,20 +1424,44 @@ public function createAdditionalCostWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { case 201: - if ('\TalonOne\Client\Model\AccountAdditionalCost' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Achievement' === '\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\Achievement', []), + $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\AccountAdditionalCost'; + $returnType = '\TalonOne\Client\Model\Achievement'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1452,7 +1480,23 @@ public function createAdditionalCostWithHttpInfo($body) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\AccountAdditionalCost', + '\TalonOne\Client\Model\Achievement', + $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); @@ -1463,18 +1507,20 @@ public function createAdditionalCostWithHttpInfo($body) } /** - * Operation createAdditionalCostAsync + * Operation createAchievementAsync * - * Create additional cost + * Create achievement * - * @param \TalonOne\Client\Model\NewAdditionalCost $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\CreateAchievement $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAdditionalCostAsync($body) + public function createAchievementAsync($applicationId, $campaignId, $body) { - return $this->createAdditionalCostAsyncWithHttpInfo($body) + return $this->createAchievementAsyncWithHttpInfo($applicationId, $campaignId, $body) ->then( function ($response) { return $response[0]; @@ -1483,19 +1529,21 @@ function ($response) { } /** - * Operation createAdditionalCostAsyncWithHttpInfo + * Operation createAchievementAsyncWithHttpInfo * - * Create additional cost + * Create achievement * - * @param \TalonOne\Client\Model\NewAdditionalCost $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\CreateAchievement $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAdditionalCostAsyncWithHttpInfo($body) + public function createAchievementAsyncWithHttpInfo($applicationId, $campaignId, $body) { - $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; - $request = $this->createAdditionalCostRequest($body); + $returnType = '\TalonOne\Client\Model\Achievement'; + $request = $this->createAchievementRequest($applicationId, $campaignId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1532,23 +1580,37 @@ function ($exception) { } /** - * Create request for operation 'createAdditionalCost' + * Create request for operation 'createAchievement' * - * @param \TalonOne\Client\Model\NewAdditionalCost $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\CreateAchievement $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createAdditionalCostRequest($body) + protected function createAchievementRequest($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 createAchievement' + ); + } + // 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 createAchievement' + ); + } // 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 createAdditionalCost' + 'Missing the required parameter $body when calling createAchievement' ); } - $resourcePath = '/v1/additional_costs'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1557,6 +1619,22 @@ protected function createAdditionalCostRequest($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; @@ -1636,36 +1714,36 @@ protected function createAdditionalCostRequest($body) } /** - * Operation createAttribute + * Operation createAdditionalCost * - * Create custom attribute + * Create additional cost * - * @param \TalonOne\Client\Model\NewAttribute $body body (required) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Attribute + * @return \TalonOne\Client\Model\AccountAdditionalCost */ - public function createAttribute($body) + public function createAdditionalCost($body) { - list($response) = $this->createAttributeWithHttpInfo($body); + list($response) = $this->createAdditionalCostWithHttpInfo($body); return $response; } /** - * Operation createAttributeWithHttpInfo + * Operation createAdditionalCostWithHttpInfo * - * Create custom attribute + * Create additional cost * - * @param \TalonOne\Client\Model\NewAttribute $body body (required) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @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\AccountAdditionalCost, HTTP status code, HTTP response headers (array of strings) */ - public function createAttributeWithHttpInfo($body) + public function createAdditionalCostWithHttpInfo($body) { - $request = $this->createAttributeRequest($body); + $request = $this->createAdditionalCostRequest($body); try { $options = $this->createHttpClientOption(); @@ -1698,20 +1776,20 @@ public function createAttributeWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { case 201: - if ('\TalonOne\Client\Model\Attribute' === '\SplFileObject') { + if ('\TalonOne\Client\Model\AccountAdditionalCost' === '\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\AccountAdditionalCost', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Attribute'; + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1730,7 +1808,7 @@ public function createAttributeWithHttpInfo($body) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Attribute', + '\TalonOne\Client\Model\AccountAdditionalCost', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1741,18 +1819,18 @@ public function createAttributeWithHttpInfo($body) } /** - * Operation createAttributeAsync + * Operation createAdditionalCostAsync * - * Create custom attribute + * Create additional cost * - * @param \TalonOne\Client\Model\NewAttribute $body body (required) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAttributeAsync($body) + public function createAdditionalCostAsync($body) { - return $this->createAttributeAsyncWithHttpInfo($body) + return $this->createAdditionalCostAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -1761,19 +1839,19 @@ function ($response) { } /** - * Operation createAttributeAsyncWithHttpInfo + * Operation createAdditionalCostAsyncWithHttpInfo * - * Create custom attribute + * Create additional cost * - * @param \TalonOne\Client\Model\NewAttribute $body body (required) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAttributeAsyncWithHttpInfo($body) + public function createAdditionalCostAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\Attribute'; - $request = $this->createAttributeRequest($body); + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $request = $this->createAdditionalCostRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1810,23 +1888,23 @@ function ($exception) { } /** - * Create request for operation 'createAttribute' + * Create request for operation 'createAdditionalCost' * - * @param \TalonOne\Client\Model\NewAttribute $body body (required) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createAttributeRequest($body) + protected function createAdditionalCostRequest($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 createAttribute' + 'Missing the required parameter $body when calling createAdditionalCost' ); } - $resourcePath = '/v1/attributes'; + $resourcePath = '/v1/additional_costs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1914,38 +1992,36 @@ protected function createAttributeRequest($body) } /** - * Operation createCampaignFromTemplate + * Operation createAttribute * - * Create campaign from campaign template + * Create custom attribute * - * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\CreateTemplateCampaignResponse + * @return \TalonOne\Client\Model\Attribute */ - public function createCampaignFromTemplate($applicationId, $body) + public function createAttribute($body) { - list($response) = $this->createCampaignFromTemplateWithHttpInfo($applicationId, $body); + list($response) = $this->createAttributeWithHttpInfo($body); return $response; } /** - * Operation createCampaignFromTemplateWithHttpInfo + * Operation createAttributeWithHttpInfo * - * Create campaign from campaign template + * Create custom attribute * - * @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 \TalonOne\Client\Model\NewAttribute $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\Attribute, HTTP status code, HTTP response headers (array of strings) */ - public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) + public function createAttributeWithHttpInfo($body) { - $request = $this->createCampaignFromTemplateRequest($applicationId, $body); + $request = $this->createAttributeRequest($body); try { $options = $this->createHttpClientOption(); @@ -1978,20 +2054,20 @@ public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) $responseBody = $response->getBody(); switch($statusCode) { case 201: - if ('\TalonOne\Client\Model\CreateTemplateCampaignResponse' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Attribute' === '\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\Attribute', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CreateTemplateCampaignResponse'; + $returnType = '\TalonOne\Client\Model\Attribute'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2010,7 +2086,7 @@ public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CreateTemplateCampaignResponse', + '\TalonOne\Client\Model\Attribute', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2021,19 +2097,18 @@ public function createCampaignFromTemplateWithHttpInfo($applicationId, $body) } /** - * Operation createCampaignFromTemplateAsync + * Operation createAttributeAsync * - * Create campaign from campaign template + * Create custom attribute * - * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignFromTemplateAsync($applicationId, $body) + public function createAttributeAsync($body) { - return $this->createCampaignFromTemplateAsyncWithHttpInfo($applicationId, $body) + return $this->createAttributeAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -2042,20 +2117,19 @@ function ($response) { } /** - * Operation createCampaignFromTemplateAsyncWithHttpInfo + * Operation createAttributeAsyncWithHttpInfo * - * Create campaign from campaign template + * Create custom attribute * - * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCampaignFromTemplateAsyncWithHttpInfo($applicationId, $body) + public function createAttributeAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\CreateTemplateCampaignResponse'; - $request = $this->createCampaignFromTemplateRequest($applicationId, $body); + $returnType = '\TalonOne\Client\Model\Attribute'; + $request = $this->createAttributeRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2092,30 +2166,23 @@ function ($exception) { } /** - * Create request for operation 'createCampaignFromTemplate' + * Create request for operation 'createAttribute' * - * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createCampaignFromTemplateRequest($applicationId, $body) + protected function createAttributeRequest($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 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 createCampaignFromTemplate' + 'Missing the required parameter $body when calling createAttribute' ); } - $resourcePath = '/v1/applications/{applicationId}/create_campaign_from_template'; + $resourcePath = '/v1/attributes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2124,14 +2191,6 @@ protected function createCampaignFromTemplateRequest($applicationId, $body) - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -2211,40 +2270,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(); @@ -2277,20 +2334,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 @@ -2309,7 +2366,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); @@ -2320,20 +2377,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]; @@ -2342,21 +2398,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()) @@ -2393,37 +2448,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 = []; @@ -2440,14 +2488,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; @@ -2527,42 +2567,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(); @@ -2594,21 +2632,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 @@ -2624,10 +2662,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); @@ -2638,21 +2676,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]; @@ -2661,22 +2698,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()) @@ -2713,51 +2749,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 @@ -2855,40 +2883,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(); @@ -2921,20 +2951,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 @@ -2953,7 +2983,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); @@ -2964,20 +2994,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]; @@ -2986,21 +3017,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()) @@ -3037,43 +3069,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 @@ -3171,42 +3211,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->createCouponsAsynchronouslyRequest($applicationId, $campaignId, $body); try { $options = $this->createHttpClientOption(); @@ -3239,20 +3277,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 @@ -3271,7 +3309,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); @@ -3282,21 +3320,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]; @@ -3305,22 +3342,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->createCouponsAsynchronouslyRequest($applicationId, $campaignId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3357,51 +3393,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 @@ -3499,36 +3527,42 @@ protected function createCouponsForMultipleRecipientsRequest($applicationId, $ca } /** - * Operation createPasswordRecoveryEmail + * Operation createCouponsForMultipleRecipients * - * Request a password reset + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewPasswordEmail $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\NewPasswordEmail + * @return \TalonOne\Client\Model\InlineResponse2008 */ - public function createPasswordRecoveryEmail($body) + public function createCouponsForMultipleRecipients($applicationId, $campaignId, $body, $silent = 'yes') { - list($response) = $this->createPasswordRecoveryEmailWithHttpInfo($body); + list($response) = $this->createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $campaignId, $body, $silent); return $response; } /** - * Operation createPasswordRecoveryEmailWithHttpInfo + * Operation createCouponsForMultipleRecipientsWithHttpInfo * - * Request a password reset + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewPasswordEmail $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\NewPasswordEmail, 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 createPasswordRecoveryEmailWithHttpInfo($body) + public function createCouponsForMultipleRecipientsWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') { - $request = $this->createPasswordRecoveryEmailRequest($body); + $request = $this->createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent); try { $options = $this->createHttpClientOption(); @@ -3560,21 +3594,21 @@ public function createPasswordRecoveryEmailWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { - case 204: - if ('\TalonOne\Client\Model\NewPasswordEmail' === '\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\NewPasswordEmail', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2008', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; + $returnType = '\TalonOne\Client\Model\InlineResponse2008'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3590,10 +3624,10 @@ public function createPasswordRecoveryEmailWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { - case 204: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\NewPasswordEmail', + '\TalonOne\Client\Model\InlineResponse2008', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3604,18 +3638,21 @@ public function createPasswordRecoveryEmailWithHttpInfo($body) } /** - * Operation createPasswordRecoveryEmailAsync + * Operation createCouponsForMultipleRecipientsAsync * - * Request a password reset + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewPasswordEmail $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 createPasswordRecoveryEmailAsync($body) + public function createCouponsForMultipleRecipientsAsync($applicationId, $campaignId, $body, $silent = 'yes') { - return $this->createPasswordRecoveryEmailAsyncWithHttpInfo($body) + return $this->createCouponsForMultipleRecipientsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent) ->then( function ($response) { return $response[0]; @@ -3624,19 +3661,22 @@ function ($response) { } /** - * Operation createPasswordRecoveryEmailAsyncWithHttpInfo + * Operation createCouponsForMultipleRecipientsAsyncWithHttpInfo * - * Request a password reset + * Create coupons for multiple recipients * - * @param \TalonOne\Client\Model\NewPasswordEmail $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 createPasswordRecoveryEmailAsyncWithHttpInfo($body) + public function createCouponsForMultipleRecipientsAsyncWithHttpInfo($applicationId, $campaignId, $body, $silent = 'yes') { - $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; - $request = $this->createPasswordRecoveryEmailRequest($body); + $returnType = '\TalonOne\Client\Model\InlineResponse2008'; + $request = $this->createCouponsForMultipleRecipientsRequest($applicationId, $campaignId, $body, $silent); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3673,31 +3713,69 @@ function ($exception) { } /** - * Create request for operation 'createPasswordRecoveryEmail' + * Create request for operation 'createCouponsForMultipleRecipients' * - * @param \TalonOne\Client\Model\NewPasswordEmail $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 createPasswordRecoveryEmailRequest($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 createPasswordRecoveryEmail' + 'Missing the required parameter $body when calling createCouponsForMultipleRecipients' ); } - $resourcePath = '/v1/password_recovery_emails'; + $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; @@ -3777,36 +3855,36 @@ protected function createPasswordRecoveryEmailRequest($body) } /** - * Operation createSession + * Operation createInviteEmail * - * Create session + * Resend invitation email * - * @param \TalonOne\Client\Model\LoginParams $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\Session + * @return \TalonOne\Client\Model\NewInviteEmail */ - public function createSession($body) + public function createInviteEmail($body) { - list($response) = $this->createSessionWithHttpInfo($body); + list($response) = $this->createInviteEmailWithHttpInfo($body); return $response; } /** - * Operation createSessionWithHttpInfo + * Operation createInviteEmailWithHttpInfo * - * Create session + * Resend invitation email * - * @param \TalonOne\Client\Model\LoginParams $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\Session, 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 createSessionWithHttpInfo($body) + public function createInviteEmailWithHttpInfo($body) { - $request = $this->createSessionRequest($body); + $request = $this->createInviteEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -3839,20 +3917,20 @@ public function createSessionWithHttpInfo($body) $responseBody = $response->getBody(); switch($statusCode) { case 201: - if ('\TalonOne\Client\Model\Session' === '\SplFileObject') { + if ('\TalonOne\Client\Model\NewInviteEmail' === '\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\NewInviteEmail', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Session'; + $returnType = '\TalonOne\Client\Model\NewInviteEmail'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3871,7 +3949,7 @@ public function createSessionWithHttpInfo($body) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Session', + '\TalonOne\Client\Model\NewInviteEmail', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3882,18 +3960,18 @@ public function createSessionWithHttpInfo($body) } /** - * Operation createSessionAsync + * Operation createInviteEmailAsync * - * Create session + * Resend invitation email * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSessionAsync($body) + public function createInviteEmailAsync($body) { - return $this->createSessionAsyncWithHttpInfo($body) + return $this->createInviteEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -3902,19 +3980,19 @@ function ($response) { } /** - * Operation createSessionAsyncWithHttpInfo + * Operation createInviteEmailAsyncWithHttpInfo * - * Create session + * Resend invitation email * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSessionAsyncWithHttpInfo($body) + public function createInviteEmailAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\Session'; - $request = $this->createSessionRequest($body); + $returnType = '\TalonOne\Client\Model\NewInviteEmail'; + $request = $this->createInviteEmailRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3951,23 +4029,23 @@ function ($exception) { } /** - * Create request for operation 'createSession' + * Create request for operation 'createInviteEmail' * - * @param \TalonOne\Client\Model\LoginParams $body body (required) + * @param \TalonOne\Client\Model\NewInviteEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createSessionRequest($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 createSession' + 'Missing the required parameter $body when calling createInviteEmail' ); } - $resourcePath = '/v1/sessions'; + $resourcePath = '/v1/invite_emails'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4055,38 +4133,36 @@ protected function createSessionRequest($body) } /** - * Operation createStore + * Operation createInviteV2 * - * Create store + * Invite user * - * @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\NewInvitation $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\User */ - public function createStore($applicationId, $body) + public function createInviteV2($body) { - list($response) = $this->createStoreWithHttpInfo($applicationId, $body); + list($response) = $this->createInviteV2WithHttpInfo($body); return $response; } /** - * Operation createStoreWithHttpInfo + * Operation createInviteV2WithHttpInfo * - * Create store + * Invite user * - * @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\NewInvitation $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\User, HTTP status code, HTTP response headers (array of strings) */ - public function createStoreWithHttpInfo($applicationId, $body) + public function createInviteV2WithHttpInfo($body) { - $request = $this->createStoreRequest($applicationId, $body); + $request = $this->createInviteV2Request($body); try { $options = $this->createHttpClientOption(); @@ -4119,44 +4195,20 @@ 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') { + if ('\TalonOne\Client\Model\User' === '\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\User', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Store'; + $returnType = '\TalonOne\Client\Model\User'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4175,23 +4227,7 @@ public function createStoreWithHttpInfo($applicationId, $body) 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: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4202,19 +4238,18 @@ public function createStoreWithHttpInfo($applicationId, $body) } /** - * Operation createStoreAsync + * Operation createInviteV2Async * - * Create store + * Invite user * - * @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\NewInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStoreAsync($applicationId, $body) + public function createInviteV2Async($body) { - return $this->createStoreAsyncWithHttpInfo($applicationId, $body) + return $this->createInviteV2AsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -4223,20 +4258,19 @@ function ($response) { } /** - * Operation createStoreAsyncWithHttpInfo + * Operation createInviteV2AsyncWithHttpInfo * - * Create store + * Invite user * - * @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\NewInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStoreAsyncWithHttpInfo($applicationId, $body) + public function createInviteV2AsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\Store'; - $request = $this->createStoreRequest($applicationId, $body); + $returnType = '\TalonOne\Client\Model\User'; + $request = $this->createInviteV2Request($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4273,30 +4307,23 @@ function ($exception) { } /** - * Create request for operation 'createStore' + * Create request for operation 'createInviteV2' * - * @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\NewInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createStoreRequest($applicationId, $body) + protected function createInviteV2Request($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 createInviteV2' ); } - $resourcePath = '/v1/applications/{applicationId}/stores'; + $resourcePath = '/v2/invites'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4305,14 +4332,6 @@ protected function createStoreRequest($applicationId, $body) - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -4392,39 +4411,36 @@ protected function createStoreRequest($applicationId, $body) } /** - * Operation deductLoyaltyCardPoints + * Operation createPasswordRecoveryEmail * - * Deduct points from card + * Request a password reset * - * @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 \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\NewPasswordEmail */ - public function deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body) + public function createPasswordRecoveryEmail($body) { - $this->deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); + list($response) = $this->createPasswordRecoveryEmailWithHttpInfo($body); + return $response; } /** - * Operation deductLoyaltyCardPointsWithHttpInfo + * Operation createPasswordRecoveryEmailWithHttpInfo * - * Deduct points from card + * Request a password reset * - * @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 \TalonOne\Client\Model\NewPasswordEmail $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\NewPasswordEmail, HTTP status code, HTTP response headers (array of strings) */ - public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function createPasswordRecoveryEmailWithHttpInfo($body) { - $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); + $request = $this->createPasswordRecoveryEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -4454,30 +4470,42 @@ public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyC ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + 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\NewPasswordEmail', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; + $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 204: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\NewPasswordEmail', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4488,20 +4516,18 @@ public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyC } /** - * Operation deductLoyaltyCardPointsAsync + * Operation createPasswordRecoveryEmailAsync * - * Deduct points from card + * Request a password reset * - * @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 \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deductLoyaltyCardPointsAsync($loyaltyProgramId, $loyaltyCardId, $body) + public function createPasswordRecoveryEmailAsync($body) { - return $this->deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + return $this->createPasswordRecoveryEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -4510,27 +4536,36 @@ function ($response) { } /** - * Operation deductLoyaltyCardPointsAsyncWithHttpInfo + * Operation createPasswordRecoveryEmailAsyncWithHttpInfo * - * Deduct points from card + * Request a password reset * - * @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 \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function createPasswordRecoveryEmailAsyncWithHttpInfo($body) { - $returnType = ''; - $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); + $returnType = '\TalonOne\Client\Model\NewPasswordEmail'; + $request = $this->createPasswordRecoveryEmailRequest($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(); @@ -4550,41 +4585,23 @@ function ($exception) { } /** - * Create request for operation 'deductLoyaltyCardPoints' + * Create request for operation 'createPasswordRecoveryEmail' * - * @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 \TalonOne\Client\Model\NewPasswordEmail $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body) + protected function createPasswordRecoveryEmailRequest($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)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling deductLoyaltyCardPoints' - ); - } - 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 createPasswordRecoveryEmail' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points'; + $resourcePath = '/v1/password_recovery_emails'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4593,22 +4610,6 @@ protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCar - // 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; @@ -4680,7 +4681,7 @@ protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCar $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4688,35 +4689,36 @@ protected function deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCar } /** - * Operation deleteAccountCollection + * Operation createSession * - * Delete account-level collection + * Create session * - * @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\LoginParams $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\Session */ - public function deleteAccountCollection($collectionId) + public function createSession($body) { - $this->deleteAccountCollectionWithHttpInfo($collectionId); + list($response) = $this->createSessionWithHttpInfo($body); + return $response; } /** - * Operation deleteAccountCollectionWithHttpInfo + * Operation createSessionWithHttpInfo * - * Delete account-level collection + * Create session * - * @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\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 deleteAccountCollectionWithHttpInfo($collectionId) + public function createSessionWithHttpInfo($body) { - $request = $this->deleteAccountCollectionRequest($collectionId); + $request = $this->createSessionRequest($body); try { $options = $this->createHttpClientOption(); @@ -4746,14 +4748,42 @@ public function deleteAccountCollectionWithHttpInfo($collectionId) ); } - 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 404: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\Session', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4764,18 +4794,18 @@ public function deleteAccountCollectionWithHttpInfo($collectionId) } /** - * Operation deleteAccountCollectionAsync + * Operation createSessionAsync * - * Delete account-level collection + * Create session * - * @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\LoginParams $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccountCollectionAsync($collectionId) + public function createSessionAsync($body) { - return $this->deleteAccountCollectionAsyncWithHttpInfo($collectionId) + return $this->createSessionAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -4784,25 +4814,36 @@ function ($response) { } /** - * Operation deleteAccountCollectionAsyncWithHttpInfo + * Operation createSessionAsyncWithHttpInfo * - * Delete account-level collection + * Create session * - * @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\LoginParams $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAccountCollectionAsyncWithHttpInfo($collectionId) + public function createSessionAsyncWithHttpInfo($body) { - $returnType = ''; - $request = $this->deleteAccountCollectionRequest($collectionId); + $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(); @@ -4822,23 +4863,23 @@ function ($exception) { } /** - * Create request for operation 'deleteAccountCollection' + * Create request for operation 'createSession' * - * @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\LoginParams $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAccountCollectionRequest($collectionId) + protected function createSessionRequest($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 createSession' ); } - $resourcePath = '/v1/collections/{collectionId}'; + $resourcePath = '/v1/sessions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4847,17 +4888,12 @@ 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( @@ -4866,7 +4902,7 @@ protected function deleteAccountCollectionRequest($collectionId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -4923,7 +4959,7 @@ protected function deleteAccountCollectionRequest($collectionId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4931,37 +4967,38 @@ protected function deleteAccountCollectionRequest($collectionId) } /** - * Operation deleteCampaign + * Operation createStore * - * Delete campaign + * Create store * * @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\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 deleteCampaign($applicationId, $campaignId) + public function createStore($applicationId, $body) { - $this->deleteCampaignWithHttpInfo($applicationId, $campaignId); + list($response) = $this->createStoreWithHttpInfo($applicationId, $body); + return $response; } /** - * Operation deleteCampaignWithHttpInfo + * Operation createStoreWithHttpInfo * - * Delete campaign + * Create store * * @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\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 deleteCampaignWithHttpInfo($applicationId, $campaignId) + public function createStoreWithHttpInfo($applicationId, $body) { - $request = $this->deleteCampaignRequest($applicationId, $campaignId); + $request = $this->createStoreRequest($applicationId, $body); try { $options = $this->createHttpClientOption(); @@ -4991,29 +5028,105 @@ public function deleteCampaignWithHttpInfo($applicationId, $campaignId) ); } - 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 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: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteCampaignAsync + * Operation createStoreAsync * - * Delete campaign + * Create store * * @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\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignAsync($applicationId, $campaignId) + public function createStoreAsync($applicationId, $body) { - return $this->deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) + return $this->createStoreAsyncWithHttpInfo($applicationId, $body) ->then( function ($response) { return $response[0]; @@ -5022,26 +5135,37 @@ function ($response) { } /** - * Operation deleteCampaignAsyncWithHttpInfo + * Operation createStoreAsyncWithHttpInfo * - * Delete campaign + * Create store * * @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\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) + public function createStoreAsyncWithHttpInfo($applicationId, $body) { - $returnType = ''; - $request = $this->deleteCampaignRequest($applicationId, $campaignId); + $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(); @@ -5061,30 +5185,30 @@ function ($exception) { } /** - * Create request for operation 'deleteCampaign' + * Create request for operation 'createStore' * * @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\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteCampaignRequest($applicationId, $campaignId) + protected function createStoreRequest($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 deleteCampaign' + 'Missing the required parameter $applicationId when calling createStore' ); } - // 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 deleteCampaign' + 'Missing the required parameter $body when calling createStore' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; + $resourcePath = '/v1/applications/{applicationId}/stores'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5101,26 +5225,21 @@ protected function deleteCampaignRequest($applicationId, $campaignId) $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( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], - [] + ['application/json'], + ['application/json'] ); } @@ -5177,7 +5296,7 @@ protected function deleteCampaignRequest($applicationId, $campaignId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5185,39 +5304,35 @@ protected function deleteCampaignRequest($applicationId, $campaignId) } /** - * Operation deleteCollection + * Operation deactivateUserByEmail * - * Delete campaign-level collection + * Deactivate user by email address * - * @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 \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteCollection($applicationId, $campaignId, $collectionId) + public function deactivateUserByEmail($body) { - $this->deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); + $this->deactivateUserByEmailWithHttpInfo($body); } /** - * Operation deleteCollectionWithHttpInfo + * Operation deactivateUserByEmailWithHttpInfo * - * Delete campaign-level collection + * Deactivate user by email address * - * @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 \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 deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) + public function deactivateUserByEmailWithHttpInfo($body) { - $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); + $request = $this->deactivateUserByEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -5251,34 +5366,24 @@ public function deleteCollectionWithHttpInfo($applicationId, $campaignId, $colle } 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 deleteCollectionAsync + * Operation deactivateUserByEmailAsync * - * Delete campaign-level collection + * Deactivate user by email address * - * @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 \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCollectionAsync($applicationId, $campaignId, $collectionId) + public function deactivateUserByEmailAsync($body) { - return $this->deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + return $this->deactivateUserByEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -5287,21 +5392,19 @@ function ($response) { } /** - * Operation deleteCollectionAsyncWithHttpInfo + * Operation deactivateUserByEmailAsyncWithHttpInfo * - * Delete campaign-level collection + * Deactivate user by email address * - * @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 \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + public function deactivateUserByEmailAsyncWithHttpInfo($body) { $returnType = ''; - $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); + $request = $this->deactivateUserByEmailRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5327,37 +5430,23 @@ function ($exception) { } /** - * Create request for operation 'deleteCollection' + * Create request for operation 'deactivateUserByEmail' * - * @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 \TalonOne\Client\Model\DeactivateUserRequest $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteCollectionRequest($applicationId, $campaignId, $collectionId) + protected function deactivateUserByEmailRequest($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 deleteCollection' - ); - } - // 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 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' + 'Missing the required parameter $body when calling deactivateUserByEmail' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; + $resourcePath = '/v1/users/deactivate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5366,42 +5455,21 @@ protected function deleteCollectionRequest($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 - ); - } // 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'] ); } @@ -5458,7 +5526,7 @@ protected function deleteCollectionRequest($applicationId, $campaignId, $collect $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5466,39 +5534,39 @@ protected function deleteCollectionRequest($applicationId, $campaignId, $collect } /** - * Operation deleteCoupon + * Operation deductLoyaltyCardPoints * - * Delete coupon + * 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 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) + * @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 deleteCoupon($applicationId, $campaignId, $couponId) + public function deductLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body) { - $this->deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId); + $this->deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); } /** - * Operation deleteCouponWithHttpInfo + * Operation deductLoyaltyCardPointsWithHttpInfo * - * Delete coupon + * 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 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) + * @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 deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId) + public function deductLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { - $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); + $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); try { $options = $this->createHttpClientOption(); @@ -5532,26 +5600,50 @@ public function deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId) } 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: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteCouponAsync + * Operation deductLoyaltyCardPointsAsync * - * Delete coupon + * 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 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) + * @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 deleteCouponAsync($applicationId, $campaignId, $couponId) + public function deductLoyaltyCardPointsAsync($loyaltyProgramId, $loyaltyCardId, $body) { - return $this->deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) + return $this->deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) ->then( function ($response) { return $response[0]; @@ -5560,21 +5652,21 @@ function ($response) { } /** - * Operation deleteCouponAsyncWithHttpInfo + * Operation deductLoyaltyCardPointsAsyncWithHttpInfo * - * Delete coupon + * 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 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) + * @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 deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) + public function deductLoyaltyCardPointsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { $returnType = ''; - $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); + $request = $this->deductLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5600,37 +5692,41 @@ function ($exception) { } /** - * Create request for operation 'deleteCoupon' + * 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 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) + * @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 deleteCouponRequest($applicationId, $campaignId, $couponId) + 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 deleteCoupon' + '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 deleteCoupon' + 'Missing the required parameter $loyaltyCardId when calling deductLoyaltyCardPoints' ); } - // verify the required parameter 'couponId' is set - if ($couponId === null || (is_array($couponId) && count($couponId) === 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 $couponId when calling deleteCoupon' + 'Missing the required parameter $body when calling deductLoyaltyCardPoints' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/deduct_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5640,41 +5736,36 @@ protected function deleteCouponRequest($applicationId, $campaignId, $couponId) // 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 ($couponId !== null) { + if ($loyaltyCardId !== null) { $resourcePath = str_replace( - '{' . 'couponId' . '}', - ObjectSerializer::toPathValue($couponId), + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), $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'] ); } @@ -5731,7 +5822,7 @@ protected function deleteCouponRequest($applicationId, $campaignId, $couponId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5739,63 +5830,35 @@ protected function deleteCouponRequest($applicationId, $campaignId, $couponId) } /** - * Operation deleteCoupons + * Operation deleteAccountCollection * - * Delete coupons + * 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 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 account](#operation/listAccountCollections) 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 deleteAccountCollection($collectionId) { - $this->deleteCouponsWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); + $this->deleteAccountCollectionWithHttpInfo($collectionId); } /** - * Operation deleteCouponsWithHttpInfo + * Operation deleteAccountCollectionWithHttpInfo * - * Delete coupons + * 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 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 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 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 deleteAccountCollectionWithHttpInfo($collectionId) { - $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); + $request = $this->deleteAccountCollectionRequest($collectionId); try { $options = $this->createHttpClientOption(); @@ -5829,38 +5892,32 @@ public function deleteCouponsWithHttpInfo($applicationId, $campaignId, $value = } 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 deleteCouponsAsync + * Operation deleteAccountCollectionAsync * - * Delete coupons + * 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 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 account](#operation/listAccountCollections) 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 deleteAccountCollectionAsync($collectionId) { - return $this->deleteCouponsAsyncWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch) + return $this->deleteAccountCollectionAsyncWithHttpInfo($collectionId) ->then( function ($response) { return $response[0]; @@ -5869,33 +5926,19 @@ function ($response) { } /** - * Operation deleteCouponsAsyncWithHttpInfo + * Operation deleteAccountCollectionAsyncWithHttpInfo * - * Delete coupons + * 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 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 account](#operation/listAccountCollections) 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 deleteAccountCollectionAsyncWithHttpInfo($collectionId) { $returnType = ''; - $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); + $request = $this->deleteAccountCollectionRequest($collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5921,155 +5964,36 @@ function ($exception) { } /** - * Create request for operation 'deleteCoupons' + * 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 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 timezone. 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 account](#operation/listAccountCollections) 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 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 deleteCoupons' - ); - } - // 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 deleteCoupons' + 'Missing the required parameter $collectionId when calling deleteAccountCollection' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'; + $resourcePath = '/v1/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 - 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 ); } @@ -6079,11 +6003,11 @@ protected function deleteCouponsRequest($applicationId, $campaignId, $value = nu if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], [] ); } @@ -6149,37 +6073,39 @@ protected function deleteCouponsRequest($applicationId, $campaignId, $value = nu } /** - * Operation deleteLoyaltyCard + * Operation deleteAchievement * - * Delete loyalty card + * Delete achievement * - * @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 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 deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId) + public function deleteAchievement($applicationId, $campaignId, $achievementId) { - $this->deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); + $this->deleteAchievementWithHttpInfo($applicationId, $campaignId, $achievementId); } /** - * Operation deleteLoyaltyCardWithHttpInfo + * Operation deleteAchievementWithHttpInfo * - * Delete loyalty card + * Delete achievement * - * @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 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 deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function deleteAchievementWithHttpInfo($applicationId, $campaignId, $achievementId) { - $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $request = $this->deleteAchievementRequest($applicationId, $campaignId, $achievementId); try { $options = $this->createHttpClientOption(); @@ -6235,19 +6161,20 @@ public function deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) } /** - * Operation deleteLoyaltyCardAsync + * Operation deleteAchievementAsync * - * Delete loyalty card + * Delete achievement * - * @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 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 deleteLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) + public function deleteAchievementAsync($applicationId, $campaignId, $achievementId) { - return $this->deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + return $this->deleteAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) ->then( function ($response) { return $response[0]; @@ -6256,20 +6183,21 @@ function ($response) { } /** - * Operation deleteLoyaltyCardAsyncWithHttpInfo + * Operation deleteAchievementAsyncWithHttpInfo * - * Delete loyalty card + * Delete achievement * - * @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 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 deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function deleteAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) { $returnType = ''; - $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $request = $this->deleteAchievementRequest($applicationId, $campaignId, $achievementId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6295,34 +6223,37 @@ function ($exception) { } /** - * Create request for operation 'deleteLoyaltyCard' + * Create request for operation 'deleteAchievement' * - * @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 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 deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) + protected function deleteAchievementRequest($applicationId, $campaignId, $achievementId) { - // 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 deleteAchievement' ); } - // 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 deleteAchievement' ); } - 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 'achievementId' is set + if ($achievementId === null || (is_array($achievementId) && count($achievementId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $achievementId when calling deleteAchievement' + ); } - - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6332,18 +6263,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 ($achievementId !== null) { + $resourcePath = str_replace( + '{' . 'achievementId' . '}', + ObjectSerializer::toPathValue($achievementId), $resourcePath ); } @@ -6423,39 +6362,37 @@ protected function deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) } /** - * Operation deleteReferral + * Operation deleteCampaign * - * Delete referral + * 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 $referralId The ID of the referral code. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteReferral($applicationId, $campaignId, $referralId) + public function deleteCampaign($applicationId, $campaignId) { - $this->deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId); + $this->deleteCampaignWithHttpInfo($applicationId, $campaignId); } /** - * Operation deleteReferralWithHttpInfo + * Operation deleteCampaignWithHttpInfo * - * Delete referral + * 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 $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 deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId) + public function deleteCampaignWithHttpInfo($applicationId, $campaignId) { - $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); + $request = $this->deleteCampaignRequest($applicationId, $campaignId); try { $options = $this->createHttpClientOption(); @@ -6495,20 +6432,19 @@ public function deleteReferralWithHttpInfo($applicationId, $campaignId, $referra } /** - * Operation deleteReferralAsync + * Operation deleteCampaignAsync * - * Delete referral + * 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 $referralId The ID of the referral code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteReferralAsync($applicationId, $campaignId, $referralId) + public function deleteCampaignAsync($applicationId, $campaignId) { - return $this->deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) + return $this->deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) ->then( function ($response) { return $response[0]; @@ -6517,21 +6453,20 @@ function ($response) { } /** - * Operation deleteReferralAsyncWithHttpInfo + * Operation deleteCampaignAsyncWithHttpInfo * - * Delete referral + * 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 $referralId The ID of the referral code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) + public function deleteCampaignAsyncWithHttpInfo($applicationId, $campaignId) { $returnType = ''; - $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); + $request = $this->deleteCampaignRequest($applicationId, $campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6557,37 +6492,30 @@ function ($exception) { } /** - * Create request for operation 'deleteReferral' + * 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 $referralId The ID of the referral code. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteReferralRequest($applicationId, $campaignId, $referralId) + 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 deleteReferral' + '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 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 deleteCampaign' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6612,14 +6540,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; @@ -6696,37 +6616,39 @@ protected function deleteReferralRequest($applicationId, $campaignId, $referralI } /** - * Operation deleteStore + * Operation deleteCollection * - * Delete store + * Delete campaign-level collection * * @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 $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 deleteStore($applicationId, $storeId) + public function deleteCollection($applicationId, $campaignId, $collectionId) { - $this->deleteStoreWithHttpInfo($applicationId, $storeId); + $this->deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); } /** - * Operation deleteStoreWithHttpInfo + * Operation deleteCollectionWithHttpInfo * - * Delete store + * Delete campaign-level collection * * @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 $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 deleteStoreWithHttpInfo($applicationId, $storeId) + public function deleteCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) { - $request = $this->deleteStoreRequest($applicationId, $storeId); + $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); try { $options = $this->createHttpClientOption(); @@ -6760,7 +6682,7 @@ public function deleteStoreWithHttpInfo($applicationId, $storeId) } catch (ApiException $e) { switch ($e->getCode()) { - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -6774,19 +6696,20 @@ public function deleteStoreWithHttpInfo($applicationId, $storeId) } /** - * Operation deleteStoreAsync + * Operation deleteCollectionAsync * - * Delete store + * Delete campaign-level collection * * @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 $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 deleteStoreAsync($applicationId, $storeId) + public function deleteCollectionAsync($applicationId, $campaignId, $collectionId) { - return $this->deleteStoreAsyncWithHttpInfo($applicationId, $storeId) + return $this->deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) ->then( function ($response) { return $response[0]; @@ -6795,20 +6718,21 @@ function ($response) { } /** - * Operation deleteStoreAsyncWithHttpInfo + * Operation deleteCollectionAsyncWithHttpInfo * - * Delete store + * Delete campaign-level collection * * @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 $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 deleteStoreAsyncWithHttpInfo($applicationId, $storeId) + public function deleteCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) { $returnType = ''; - $request = $this->deleteStoreRequest($applicationId, $storeId); + $request = $this->deleteCollectionRequest($applicationId, $campaignId, $collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6834,30 +6758,37 @@ function ($exception) { } /** - * Create request for operation 'deleteStore' + * Create request for operation 'deleteCollection' * * @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 $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 deleteStoreRequest($applicationId, $storeId) + 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 deleteStore' + 'Missing the required parameter $applicationId when calling deleteCollection' ); } - // 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 deleteStore' + '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}/stores/{storeId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6875,10 +6806,18 @@ protected function deleteStoreRequest($applicationId, $storeId) ); } // path params - if ($storeId !== null) { + if ($campaignId !== null) { $resourcePath = str_replace( - '{' . 'storeId' . '}', - ObjectSerializer::toPathValue($storeId), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -6958,33 +6897,39 @@ protected function deleteStoreRequest($applicationId, $storeId) } /** - * Operation destroySession + * Operation deleteCoupon * - * Destroy session + * Delete coupon * + * @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 destroySession() + public function deleteCoupon($applicationId, $campaignId, $couponId) { - $this->destroySessionWithHttpInfo(); + $this->deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId); } /** - * Operation destroySessionWithHttpInfo + * Operation deleteCouponWithHttpInfo * - * Destroy session + * Delete coupon * + * @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 destroySessionWithHttpInfo() + public function deleteCouponWithHttpInfo($applicationId, $campaignId, $couponId) { - $request = $this->destroySessionRequest(); + $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); try { $options = $this->createHttpClientOption(); @@ -7024,17 +6969,20 @@ public function destroySessionWithHttpInfo() } /** - * Operation destroySessionAsync + * Operation deleteCouponAsync * - * Destroy session + * Delete coupon * + * @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 destroySessionAsync() + public function deleteCouponAsync($applicationId, $campaignId, $couponId) { - return $this->destroySessionAsyncWithHttpInfo() + return $this->deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) ->then( function ($response) { return $response[0]; @@ -7043,18 +6991,21 @@ function ($response) { } /** - * Operation destroySessionAsyncWithHttpInfo + * Operation deleteCouponAsyncWithHttpInfo * - * Destroy session + * Delete coupon * + * @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 destroySessionAsyncWithHttpInfo() + public function deleteCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId) { $returnType = ''; - $request = $this->destroySessionRequest(); + $request = $this->deleteCouponRequest($applicationId, $campaignId, $couponId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7080,16 +7031,37 @@ function ($exception) { } /** - * Create request for operation 'destroySession' + * Create request for operation 'deleteCoupon' * + * @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 destroySessionRequest() + protected function deleteCouponRequest($applicationId, $campaignId, $couponId) { + // 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' + ); + } + // 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' + ); + } - $resourcePath = '/v1/sessions'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7098,6 +7070,30 @@ protected function destroySessionRequest() + // 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 ($couponId !== null) { + $resourcePath = str_replace( + '{' . 'couponId' . '}', + ObjectSerializer::toPathValue($couponId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -7174,36 +7170,63 @@ protected function destroySessionRequest() } /** - * Operation exportAccountCollectionItems + * Operation deleteCoupons * - * Export account-level collection's items + * Delete coupons * - * @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 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) * * @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 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) { - list($response) = $this->exportAccountCollectionItemsWithHttpInfo($collectionId); - return $response; + $this->deleteCouponsWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); } /** - * Operation exportAccountCollectionItemsWithHttpInfo + * Operation deleteCouponsWithHttpInfo * - * Export account-level collection's items + * Delete coupons * - * @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 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) * * @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 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->exportAccountCollectionItemsRequest($collectionId); + $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch); try { $options = $this->createHttpClientOption(); @@ -7233,104 +7256,42 @@ 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 deleteCouponsAsync * - * Export account-level collection's items + * Delete coupons * - * @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 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAccountCollectionItemsAsync($collectionId) + 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->exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) + return $this->deleteCouponsAsyncWithHttpInfo($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch) ->then( function ($response) { return $response[0]; @@ -7339,36 +7300,39 @@ function ($response) { } /** - * Operation exportAccountCollectionItemsAsyncWithHttpInfo + * Operation deleteCouponsAsyncWithHttpInfo * - * Export account-level collection's items + * Delete coupons * - * @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 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) + 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 = 'string'; - $request = $this->exportAccountCollectionItemsRequest($collectionId); + $returnType = ''; + $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()) ->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(); @@ -7388,36 +7352,155 @@ function ($exception) { } /** - * Create request for operation 'exportAccountCollectionItems' + * Create request for operation 'deleteCoupons' * - * @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 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportAccountCollectionItemsRequest($collectionId) + 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 '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 exportAccountCollectionItems' + '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 deleteCoupons' ); } - $resourcePath = '/v1/collections/{collectionId}/export'; + $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 - if ($collectionId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -7427,11 +7510,11 @@ protected function exportAccountCollectionItemsRequest($collectionId) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + [], [] ); } @@ -7489,7 +7572,7 @@ protected function exportAccountCollectionItemsRequest($collectionId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7497,40 +7580,6456 @@ protected function exportAccountCollectionItemsRequest($collectionId) } /** - * Operation exportCollectionItems + * Operation deleteLoyaltyCard + * + * Delete 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 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 deleteLoyaltyCard($loyaltyProgramId, $loyaltyCardId) + { + $this->deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); + } + + /** + * Operation deleteLoyaltyCardWithHttpInfo + * + * Delete 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 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 deleteLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + { + $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + + 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 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 + * + * Delete 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 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 deleteLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) + { + return $this->deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLoyaltyCardAsyncWithHttpInfo + * + * Delete 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 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 deleteLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + { + $returnType = ''; + $request = $this->deleteLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + + 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 'deleteLoyaltyCard' + * + * @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 deleteLoyaltyCardRequest($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 deleteLoyaltyCard' + ); + } + // 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 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/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // 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 ($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( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteReferral + * + * Delete referral + * + * @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 deleteReferral($applicationId, $campaignId, $referralId) + { + $this->deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId); + } + + /** + * Operation deleteReferralWithHttpInfo + * + * Delete referral + * + * @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 deleteReferralWithHttpInfo($applicationId, $campaignId, $referralId) + { + $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); + + 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()) { + } + throw $e; + } + } + + /** + * Operation deleteReferralAsync + * + * Delete referral + * + * @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 deleteReferralAsync($applicationId, $campaignId, $referralId) + { + return $this->deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteReferralAsyncWithHttpInfo + * + * Delete referral + * + * @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 deleteReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId) + { + $returnType = ''; + $request = $this->deleteReferralRequest($applicationId, $campaignId, $referralId); + + 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 'deleteReferral' + * + * @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 deleteReferralRequest($applicationId, $campaignId, $referralId) + { + // 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' + ); + } + // 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/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}'; + $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 ($referralId !== null) { + $resourcePath = str_replace( + '{' . 'referralId' . '}', + ObjectSerializer::toPathValue($referralId), + $resourcePath + ); + } + + // 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); + + } 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( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteStore + * + * Delete store + * + * @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 deleteStore($applicationId, $storeId) + { + $this->deleteStoreWithHttpInfo($applicationId, $storeId); + } + + /** + * Operation deleteStoreWithHttpInfo + * + * Delete store + * + * @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 deleteStoreWithHttpInfo($applicationId, $storeId) + { + $request = $this->deleteStoreRequest($applicationId, $storeId); + + 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 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteStoreAsync + * + * Delete store + * + * @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 deleteStoreAsync($applicationId, $storeId) + { + return $this->deleteStoreAsyncWithHttpInfo($applicationId, $storeId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteStoreAsyncWithHttpInfo + * + * Delete store + * + * @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 deleteStoreAsyncWithHttpInfo($applicationId, $storeId) + { + $returnType = ''; + $request = $this->deleteStoreRequest($applicationId, $storeId); + + 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 'deleteStore' + * + * @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 deleteStoreRequest($applicationId, $storeId) + { + // 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 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/applications/{applicationId}/stores/{storeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // 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 ($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( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteUser + * + * 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 deleteUser($userId) + { + $this->deleteUserWithHttpInfo($userId); + } + + /** + * Operation deleteUserWithHttpInfo + * + * 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 deleteUserWithHttpInfo($userId) + { + $request = $this->deleteUserRequest($userId); + + 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()) { + } + throw $e; + } + } + + /** + * Operation deleteUserAsync + * + * Delete user + * + * @param int $userId The ID of the user. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteUserAsync($userId) + { + return $this->deleteUserAsyncWithHttpInfo($userId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteUserAsyncWithHttpInfo + * + * Delete user + * + * @param int $userId The ID of the user. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteUserAsyncWithHttpInfo($userId) + { + $returnType = ''; + $request = $this->deleteUserRequest($userId); + + 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 'deleteUser' + * + * @param int $userId The ID of the user. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + 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/users/{userId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($userId !== null) { + $resourcePath = str_replace( + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), + $resourcePath + ); + } + + // 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); + + } 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( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteUserByEmail + * + * Delete user by email address + * + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteUserByEmail($body) + { + $this->deleteUserByEmailWithHttpInfo($body); + } + + /** + * Operation deleteUserByEmailWithHttpInfo + * + * Delete user by email address + * + * @param \TalonOne\Client\Model\DeleteUserRequest $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 deleteUserByEmailWithHttpInfo($body) + { + $request = $this->deleteUserByEmailRequest($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() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteUserByEmailAsync + * + * Delete user by email address + * + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteUserByEmailAsync($body) + { + return $this->deleteUserByEmailAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteUserByEmailAsyncWithHttpInfo + * + * Delete user by email address + * + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteUserByEmailAsyncWithHttpInfo($body) + { + $returnType = ''; + $request = $this->deleteUserByEmailRequest($body); + + 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 'deleteUserByEmail' + * + * @param \TalonOne\Client\Model\DeleteUserRequest $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteUserByEmailRequest($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 deleteUserByEmail' + ); + } + + $resourcePath = '/v1/users/delete'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } 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( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation destroySession + * + * Destroy session + * + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function destroySession() + { + $this->destroySessionWithHttpInfo(); + } + + /** + * Operation destroySessionWithHttpInfo + * + * Destroy session + * + * + * @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() + { + $request = $this->destroySessionRequest(); + + 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()) { + } + throw $e; + } + } + + /** + * Operation destroySessionAsync + * + * Destroy session + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function destroySessionAsync() + { + return $this->destroySessionAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation destroySessionAsyncWithHttpInfo + * + * Destroy session + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function destroySessionAsyncWithHttpInfo() + { + $returnType = ''; + $request = $this->destroySessionRequest(); + + 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); + + } 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( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation exportAccountCollectionItems + * + * Export account-level collection's items + * + * @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\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function exportAccountCollectionItems($collectionId) + { + list($response) = $this->exportAccountCollectionItemsWithHttpInfo($collectionId); + return $response; + } + + /** + * Operation exportAccountCollectionItemsWithHttpInfo + * + * Export account-level collection's items + * + * @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\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function exportAccountCollectionItemsWithHttpInfo($collectionId) + { + $request = $this->exportAccountCollectionItemsRequest($collectionId); + + 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 ('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() + ]; + + } 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 + * + * Export account-level collection's items + * + * @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 exportAccountCollectionItemsAsync($collectionId) + { + return $this->exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportAccountCollectionItemsAsyncWithHttpInfo + * + * Export account-level collection's items + * + * @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 exportAccountCollectionItemsAsyncWithHttpInfo($collectionId) + { + $returnType = 'string'; + $request = $this->exportAccountCollectionItemsRequest($collectionId); + + 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 'exportAccountCollectionItems' + * + * @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 exportAccountCollectionItemsRequest($collectionId) + { + // 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 exportAccountCollectionItems' + ); + } + + $resourcePath = '/v1/collections/{collectionId}/export'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportAchievements + * + * 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 $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 + */ + public function exportAchievements($applicationId, $campaignId, $achievementId) + { + list($response) = $this->exportAchievementsWithHttpInfo($applicationId, $campaignId, $achievementId); + return $response; + } + + /** + * Operation exportAchievementsWithHttpInfo + * + * 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 $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) + */ + public function exportAchievementsWithHttpInfo($applicationId, $campaignId, $achievementId) + { + $request = $this->exportAchievementsRequest($applicationId, $campaignId, $achievementId); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + 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; + } + + 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 = '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()) { + 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', + $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 exportAchievementsAsync + * + * 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 $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) + { + return $this->exportAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportAchievementsAsyncWithHttpInfo + * + * 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 $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) + { + $returnType = 'string'; + $request = $this->exportAchievementsRequest($applicationId, $campaignId, $achievementId); + + 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 '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 $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) + { + // 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' + ); + } + // 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' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}/export'; + $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 ($achievementId !== null) { + $resourcePath = str_replace( + '{' . 'achievementId' . '}', + ObjectSerializer::toPathValue($achievementId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportAudiencesMemberships + * + * Export audience members + * + * @param int $audienceId The ID of the audience. (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 + */ + public function exportAudiencesMemberships($audienceId) + { + list($response) = $this->exportAudiencesMembershipsWithHttpInfo($audienceId); + return $response; + } + + /** + * Operation exportAudiencesMembershipsWithHttpInfo + * + * Export audience members + * + * @param int $audienceId The ID of the audience. (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) + */ + public function exportAudiencesMembershipsWithHttpInfo($audienceId) + { + $request = $this->exportAudiencesMembershipsRequest($audienceId); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $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'; + $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(), + 'string', + $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 exportAudiencesMembershipsAsync + * + * Export audience members + * + * @param int $audienceId The ID of the audience. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exportAudiencesMembershipsAsync($audienceId) + { + return $this->exportAudiencesMembershipsAsyncWithHttpInfo($audienceId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportAudiencesMembershipsAsyncWithHttpInfo + * + * Export audience members + * + * @param int $audienceId The ID of the audience. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exportAudiencesMembershipsAsyncWithHttpInfo($audienceId) + { + $returnType = 'string'; + $request = $this->exportAudiencesMembershipsRequest($audienceId); + + 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 'exportAudiencesMemberships' + * + * @param int $audienceId The ID of the audience. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function exportAudiencesMembershipsRequest($audienceId) + { + // 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 exportAudiencesMemberships' + ); + } + + $resourcePath = '/v1/audiences/{audienceId}/memberships/export'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($audienceId !== null) { + $resourcePath = str_replace( + '{' . 'audienceId' . '}', + ObjectSerializer::toPathValue($audienceId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportCollectionItems + * + * Export campaign-level collection's items + * + * @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|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function exportCollectionItems($applicationId, $campaignId, $collectionId) + { + list($response) = $this->exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId); + return $response; + } + + /** + * Operation exportCollectionItemsWithHttpInfo + * + * Export campaign-level collection's items + * + * @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|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId) + { + $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); + + 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 ('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() + ]; + + } 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 exportCollectionItemsAsync + * + * Export campaign-level collection's items + * + * @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 exportCollectionItemsAsync($applicationId, $campaignId, $collectionId) + { + return $this->exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportCollectionItemsAsyncWithHttpInfo + * + * Export campaign-level collection's items + * + * @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 exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + { + $returnType = 'string'; + $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); + + 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 'exportCollectionItems' + * + * @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 exportCollectionItemsRequest($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 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/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export'; + $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 + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportCoupons + * + * 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. - `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) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + 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->exportCouponsWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + return $response; + } + + /** + * Operation exportCouponsWithHttpInfo + * + * 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. - `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) + * + * @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 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->exportCouponsRequest($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $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()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation exportCouponsAsync + * + * 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. - `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) + * + * @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) + { + return $this->exportCouponsAsyncWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportCouponsAsyncWithHttpInfo + * + * 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. - `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) + * + * @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) + { + $returnType = 'string'; + $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()) + ->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 '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. - `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) + * + * @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) + { + // 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 exportCoupons' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/export_coupons'; + $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) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportCustomerSessions + * + * Export customer sessions + * + * @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 + */ + public function exportCustomerSessions($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + { + list($response) = $this->exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + return $response; + } + + /** + * Operation exportCustomerSessionsWithHttpInfo + * + * Export customer sessions + * + * @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, HTTP status code, HTTP response headers (array of strings) + */ + public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + { + $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $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()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation exportCustomerSessionsAsync + * + * Export customer sessions + * + * @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 exportCustomerSessionsAsync($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + { + return $this->exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportCustomerSessionsAsyncWithHttpInfo + * + * Export customer sessions + * + * @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 exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + { + $returnType = 'string'; + $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + + 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 'exportCustomerSessions' + * + * @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 exportCustomerSessionsRequest($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = 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 exportCustomerSessions' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/export_customer_sessions'; + $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 + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportCustomersTiers + * + * Export customers' tier data + * + * @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) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + public function exportCustomersTiers($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + { + list($response) = $this->exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames); + return $response; + } + + /** + * Operation exportCustomersTiersWithHttpInfo + * + * Export customers' tier data + * + * @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) + * + * @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 exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + { + $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $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()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation exportCustomersTiersAsync + * + * Export customers' tier data + * + * @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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exportCustomersTiersAsync($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + { + return $this->exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportCustomersTiersAsyncWithHttpInfo + * + * Export customers' tier data + * + * @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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + { + $returnType = 'string'; + $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); + + 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 'exportCustomersTiers' + * + * @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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + 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 exportCustomersTiers' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customers_tiers'; + $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) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportEffects + * + * Export triggered effects + * + * @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 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 $dateFormat Determines the format of dates in the export document. (optional) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + public function exportEffects($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + { + list($response) = $this->exportEffectsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + return $response; + } + + /** + * Operation exportEffectsWithHttpInfo + * + * Export triggered effects + * + * @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 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 $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) + */ + public function exportEffectsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + { + $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $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()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation exportEffectsAsync + * + * Export triggered effects + * + * @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 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 $dateFormat Determines the format of dates in the export document. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exportEffectsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + { + return $this->exportEffectsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportEffectsAsyncWithHttpInfo + * + * Export triggered effects + * + * @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 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 $dateFormat Determines the format of dates in the export document. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exportEffectsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + { + $returnType = 'string'; + $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + + 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 'exportEffects' + * + * @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 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 $dateFormat Determines the format of dates in the export document. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function exportEffectsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = 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 exportEffects' + ); + } + + $resourcePath = '/v1/applications/{applicationId}/export_effects'; + $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($dateFormat)) { + $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + } + if ($dateFormat !== null) { + $queryParams['dateFormat'] = $dateFormat; + } + + + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportLoyaltyBalance + * + * Export customer loyalty balance to CSV + * + * @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 exportLoyaltyBalance($loyaltyProgramId, $endDate = null) + { + list($response) = $this->exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate); + return $response; + } + + /** + * Operation exportLoyaltyBalanceWithHttpInfo + * + * Export customer loyalty balance to CSV + * + * @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 exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = null) + { + $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + 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; + } + + 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(); + 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(), + '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); + break; + } + throw $e; + } + } + + /** + * Operation exportLoyaltyBalanceAsync + * + * Export customer loyalty balance to CSV + * + * @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 exportLoyaltyBalanceAsync($loyaltyProgramId, $endDate = null) + { + return $this->exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportLoyaltyBalanceAsyncWithHttpInfo + * + * Export customer loyalty balance to CSV + * + * @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 exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + { + $returnType = 'string'; + $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); + + 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 'exportLoyaltyBalance' + * + * @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 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 exportLoyaltyBalance' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + + + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportLoyaltyBalances + * + * Export customer loyalty balances + * + * @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 exportLoyaltyBalances($loyaltyProgramId, $endDate = null) + { + list($response) = $this->exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate); + return $response; + } + + /** + * Operation exportLoyaltyBalancesWithHttpInfo + * + * Export customer loyalty balances + * + * @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 exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) + { + $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + 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; + } + + 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(); + 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(), + '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); + break; + } + throw $e; + } + } + + /** + * Operation exportLoyaltyBalancesAsync + * + * Export customer loyalty balances + * + * @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 exportLoyaltyBalancesAsync($loyaltyProgramId, $endDate = null) + { + return $this->exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportLoyaltyBalancesAsyncWithHttpInfo + * + * Export customer loyalty balances + * + * @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 exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + { + $returnType = 'string'; + $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); + + 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 'exportLoyaltyBalances' + * + * @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 exportLoyaltyBalancesRequest($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 exportLoyaltyBalances' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + + + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportLoyaltyCardBalances + * + * Export all card transaction logs + * + * @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|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function exportLoyaltyCardBalances($loyaltyProgramId, $endDate = null) + { + list($response) = $this->exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate); + return $response; + } + + /** + * Operation exportLoyaltyCardBalancesWithHttpInfo + * + * Export all card transaction logs + * + * @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|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) + { + $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + 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; + } + + 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(); + 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(), + '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); + break; + } + throw $e; + } + } + + /** + * Operation exportLoyaltyCardBalancesAsync + * + * Export all card transaction logs + * + * @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 exportLoyaltyCardBalancesAsync($loyaltyProgramId, $endDate = null) + { + return $this->exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportLoyaltyCardBalancesAsyncWithHttpInfo + * + * Export all card transaction logs + * + * @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 exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + { + $returnType = 'string'; + $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); + + 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 'exportLoyaltyCardBalances' + * + * @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 exportLoyaltyCardBalancesRequest($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 exportLoyaltyCardBalances' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_card_balances'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + + + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportLoyaltyCardLedger + * + * Export card's ledger log + * + * @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|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + { + list($response) = $this->exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + return $response; + } + + /** + * Operation exportLoyaltyCardLedgerWithHttpInfo + * + * Export card's ledger log + * + * @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|\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) + { + $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + + 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 ('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() + ]; + + } 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 exportLoyaltyCardLedgerAsync + * + * Export card's ledger log + * + * @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 exportLoyaltyCardLedgerAsync($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + { + return $this->exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportLoyaltyCardLedgerAsyncWithHttpInfo + * + * Export card's ledger log + * + * @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 exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + { + $returnType = 'string'; + $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + + 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 'exportLoyaltyCardLedger' + * + * @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 exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = 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' + ); + } + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/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 ($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 ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportLoyaltyLedger + * + * Export customer's transaction logs + * + * @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 string + */ + public function exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + { + list($response) = $this->exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + return $response; + } + + /** + * Operation exportLoyaltyLedgerWithHttpInfo + * + * Export customer's transaction logs + * + * @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 string, HTTP status code, HTTP response headers (array of strings) + */ + public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + { + $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + + 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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $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()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation exportLoyaltyLedgerAsync + * + * Export customer's transaction logs + * + * @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 exportLoyaltyLedgerAsync($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + { + return $this->exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportLoyaltyLedgerAsyncWithHttpInfo + * + * Export customer's transaction logs + * + * @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 exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + { + $returnType = 'string'; + $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + + 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 'exportLoyaltyLedger' + * + * @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 exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = 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' + ); + } + + $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 ($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 ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportPoolGiveaways + * + * Export giveaway codes of 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 \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 string|\TalonOne\Client\Model\ErrorResponseWithStatus + */ + public function exportPoolGiveaways($poolId, $createdBefore = null, $createdAfter = null) + { + list($response) = $this->exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore, $createdAfter); + return $response; + } + + /** + * Operation exportPoolGiveawaysWithHttpInfo + * + * Export giveaway codes of 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 \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 string|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) + { + $request = $this->exportPoolGiveawaysRequest($poolId, $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 ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + 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; + } + + 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()) { + 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', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation exportPoolGiveawaysAsync + * + * Export giveaway codes of 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 \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 exportPoolGiveawaysAsync($poolId, $createdBefore = null, $createdAfter = null) + { + return $this->exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore, $createdAfter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exportPoolGiveawaysAsyncWithHttpInfo + * + * Export giveaway codes of 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 \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 exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) + { + $returnType = 'string'; + $request = $this->exportPoolGiveawaysRequest($poolId, $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 'exportPoolGiveaways' + * + * @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 exportPoolGiveawaysRequest($poolId, $createdBefore = null, $createdAfter = 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 exportPoolGiveaways' + ); + } + + $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 ($poolId !== null) { + $resourcePath = str_replace( + '{' . 'poolId' . '}', + ObjectSerializer::toPathValue($poolId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/csv'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/csv'], + [] + ); + } + + // 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 exportReferrals * - * Export campaign-level collection's items + * Export 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (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 string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return string */ - public function exportCollectionItems($applicationId, $campaignId, $collectionId) + public function exportReferrals($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - list($response) = $this->exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId); + list($response) = $this->exportReferralsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); return $response; } /** - * Operation exportCollectionItemsWithHttpInfo + * Operation exportReferralsWithHttpInfo * - * Export campaign-level collection's items + * Export 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (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 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 exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $collectionId) + public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); + $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); try { $options = $this->createHttpClientOption(); @@ -7574,30 +14073,6 @@ public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $ $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'; @@ -7624,42 +14099,31 @@ public function exportCollectionItemsWithHttpInfo($applicationId, $campaignId, $ ); $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 exportCollectionItemsAsync + * Operation exportReferralsAsync * - * Export campaign-level collection's items + * Export 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (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 exportCollectionItemsAsync($applicationId, $campaignId, $collectionId) + public function exportReferralsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { - return $this->exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + return $this->exportReferralsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat) ->then( function ($response) { return $response[0]; @@ -7668,21 +14132,26 @@ function ($response) { } /** - * Operation exportCollectionItemsAsyncWithHttpInfo + * Operation exportReferralsAsyncWithHttpInfo * - * Export campaign-level collection's items + * Export 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (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 exportCollectionItemsAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + public function exportReferralsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) { $returnType = 'string'; - $request = $this->exportCollectionItemsRequest($applicationId, $campaignId, $collectionId); + $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7719,43 +14188,85 @@ function ($exception) { } /** - * Create request for operation 'exportCollectionItems' + * Create request for operation 'exportReferrals' * * @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 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 exportCollectionItemsRequest($applicationId, $campaignId, $collectionId) + protected function exportReferralsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = 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 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' + 'Missing the required parameter $applicationId when calling exportReferrals' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export'; + $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 @@ -7766,22 +14277,6 @@ protected function exportCollectionItemsRequest($applicationId, $campaignId, $co $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 - ); - } // body params $_tempBody = null; @@ -7858,64 +14353,52 @@ protected function exportCollectionItemsRequest($applicationId, $campaignId, $co } /** - * Operation exportCoupons + * Operation getAccessLogsWithoutTotalCount * - * Export coupons + * Get access logs for Application * * @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 $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 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 timezone. 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 timezone. 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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return \TalonOne\Client\Model\InlineResponse20019 */ - 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 getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->exportCouponsWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + list($response) = $this->getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $response; } /** - * Operation exportCouponsWithHttpInfo + * Operation getAccessLogsWithoutTotalCountWithHttpInfo * - * Export coupons + * Get access logs for Application * * @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 $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 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 timezone. 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 timezone. 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) * * @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 \TalonOne\Client\Model\InlineResponse20019, 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 getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->exportCouponsRequest($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -7948,20 +14431,20 @@ public function exportCouponsWithHttpInfo($applicationId, $campaignId = null, $s $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20019' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20019', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\InlineResponse20019'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -7980,7 +14463,7 @@ public function exportCouponsWithHttpInfo($applicationId, $campaignId = null, $s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\TalonOne\Client\Model\InlineResponse20019', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7991,32 +14474,26 @@ public function exportCouponsWithHttpInfo($applicationId, $campaignId = null, $s } /** - * Operation exportCouponsAsync + * Operation getAccessLogsWithoutTotalCountAsync * - * Export coupons + * Get access logs for Application * * @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 $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 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 timezone. 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 timezone. 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) * * @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 getAccessLogsWithoutTotalCountAsync($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - return $this->exportCouponsAsyncWithHttpInfo($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly) + return $this->getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -8025,33 +14502,27 @@ function ($response) { } /** - * Operation exportCouponsAsyncWithHttpInfo + * Operation getAccessLogsWithoutTotalCountAsyncWithHttpInfo * - * Export coupons + * Get access logs for Application * * @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 $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 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 timezone. 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 timezone. 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) * * @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 getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = 'string'; - $request = $this->exportCouponsRequest($applicationId, $campaignId, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $dateFormat, $campaignState, $valuesOnly); + $returnType = '\TalonOne\Client\Model\InlineResponse20019'; + $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8088,37 +14559,50 @@ function ($exception) { } /** - * Create request for operation 'exportCoupons' + * Create request for operation 'getAccessLogsWithoutTotalCount' * * @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 $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 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 timezone. 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 timezone. 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) * * @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 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 exportCoupons' + '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)) { + throw new \InvalidArgumentException( + '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}/export_coupons'; + + $resourcePath = '/v1/applications/{applicationId}/access_logs/no_total'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8126,102 +14610,60 @@ protected function exportCouponsRequest($applicationId, $campaignId = null, $sor $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 (is_array($path)) { + $path = ObjectSerializer::serializeCollection($path, '', true); } - if ($usable !== null) { - $queryParams['usable'] = $usable; + if ($path !== null) { + $queryParams['path'] = $path; } // query params - if (is_array($referralId)) { - $referralId = ObjectSerializer::serializeCollection($referralId, '', true); + if (is_array($method)) { + $method = ObjectSerializer::serializeCollection($method, '', true); } - if ($referralId !== null) { - $queryParams['referralId'] = $referralId; + if ($method !== null) { + $queryParams['method'] = $method; } // query params - if (is_array($recipientIntegrationId)) { - $recipientIntegrationId = ObjectSerializer::serializeCollection($recipientIntegrationId, '', true); + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); } - if ($recipientIntegrationId !== null) { - $queryParams['recipientIntegrationId'] = $recipientIntegrationId; + if ($status !== null) { + $queryParams['status'] = $status; } // query params - if (is_array($batchId)) { - $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - if ($batchId !== null) { - $queryParams['batchId'] = $batchId; + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; } // query params - if (is_array($exactMatch)) { - $exactMatch = ObjectSerializer::serializeCollection($exactMatch, '', true); + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); } - if ($exactMatch !== null) { - $queryParams['exactMatch'] = $exactMatch; + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; } // query params - if (is_array($dateFormat)) { - $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - if ($dateFormat !== null) { - $queryParams['dateFormat'] = $dateFormat; + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; } // query params - if (is_array($campaignState)) { - $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); } - if ($campaignState !== null) { - $queryParams['campaignState'] = $campaignState; + if ($skip !== null) { + $queryParams['skip'] = $skip; } // query params - if (is_array($valuesOnly)) { - $valuesOnly = ObjectSerializer::serializeCollection($valuesOnly, '', true); + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($valuesOnly !== null) { - $queryParams['valuesOnly'] = $valuesOnly; + if ($sort !== null) { + $queryParams['sort'] = $sort; } @@ -8239,11 +14681,11 @@ protected function exportCouponsRequest($applicationId, $campaignId = null, $sor if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -8309,46 +14751,36 @@ protected function exportCouponsRequest($applicationId, $campaignId = null, $sor } /** - * Operation exportCustomerSessions + * Operation getAccount * - * Export customer sessions + * Get account details * - * @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 $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 string + * @return \TalonOne\Client\Model\Account */ - public function exportCustomerSessions($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function getAccount($accountId) { - list($response) = $this->exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + list($response) = $this->getAccountWithHttpInfo($accountId); return $response; } /** - * Operation exportCustomerSessionsWithHttpInfo + * Operation getAccountWithHttpInfo * - * Export customer sessions + * Get account details * - * @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 $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 string, 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 exportCustomerSessionsWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function getAccountWithHttpInfo($accountId) { - $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + $request = $this->getAccountRequest($accountId); try { $options = $this->createHttpClientOption(); @@ -8381,20 +14813,20 @@ public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefor $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Account' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Account', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\Account'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -8413,7 +14845,7 @@ public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefor case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\TalonOne\Client\Model\Account', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8424,23 +14856,18 @@ public function exportCustomerSessionsWithHttpInfo($applicationId, $createdBefor } /** - * Operation exportCustomerSessionsAsync + * Operation getAccountAsync * - * Export customer sessions + * Get account details * - * @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 $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 exportCustomerSessionsAsync($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function getAccountAsync($accountId) { - return $this->exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState) + return $this->getAccountAsyncWithHttpInfo($accountId) ->then( function ($response) { return $response[0]; @@ -8449,24 +14876,19 @@ function ($response) { } /** - * Operation exportCustomerSessionsAsyncWithHttpInfo + * Operation getAccountAsyncWithHttpInfo * - * Export customer sessions + * Get account details * - * @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 $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 exportCustomerSessionsAsyncWithHttpInfo($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + public function getAccountAsyncWithHttpInfo($accountId) { - $returnType = 'string'; - $request = $this->exportCustomerSessionsRequest($applicationId, $createdBefore, $createdAfter, $profileIntegrationId, $dateFormat, $customerSessionState); + $returnType = '\TalonOne\Client\Model\Account'; + $request = $this->getAccountRequest($accountId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8503,76 +14925,36 @@ function ($exception) { } /** - * Create request for operation 'exportCustomerSessions' + * Create request for operation 'getAccount' * - * @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 $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 exportCustomerSessionsRequest($applicationId, $createdBefore = null, $createdAfter = null, $profileIntegrationId = null, $dateFormat = null, $customerSessionState = null) + protected function getAccountRequest($accountId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'accountId' is set + if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling exportCustomerSessions' + 'Missing the required parameter $accountId when calling getAccount' ); } - $resourcePath = '/v1/applications/{applicationId}/export_customer_sessions'; + $resourcePath = '/v1/accounts/{accountId}'; $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 - if ($applicationId !== null) { + if ($accountId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'accountId' . '}', + ObjectSerializer::toPathValue($accountId), $resourcePath ); } @@ -8582,11 +14964,11 @@ protected function exportCustomerSessionsRequest($applicationId, $createdBefore if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -8652,40 +15034,36 @@ protected function exportCustomerSessionsRequest($applicationId, $createdBefore } /** - * Operation exportCustomersTiers + * Operation getAccountAnalytics * - * Export customers' tier data + * Get account analytics * - * @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 $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 string + * @return \TalonOne\Client\Model\AccountAnalytics */ - public function exportCustomersTiers($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function getAccountAnalytics($accountId) { - list($response) = $this->exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames); + list($response) = $this->getAccountAnalyticsWithHttpInfo($accountId); return $response; } /** - * Operation exportCustomersTiersWithHttpInfo + * Operation getAccountAnalyticsWithHttpInfo * - * Export customers' tier data + * Get account analytics * - * @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 $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 string, 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 exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function getAccountAnalyticsWithHttpInfo($accountId) { - $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); + $request = $this->getAccountAnalyticsRequest($accountId); try { $options = $this->createHttpClientOption(); @@ -8718,20 +15096,20 @@ public function exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerId $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\TalonOne\Client\Model\AccountAnalytics' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AccountAnalytics', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\AccountAnalytics'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -8750,7 +15128,7 @@ public function exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\TalonOne\Client\Model\AccountAnalytics', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8761,20 +15139,18 @@ public function exportCustomersTiersWithHttpInfo($loyaltyProgramId, $subledgerId } /** - * Operation exportCustomersTiersAsync + * Operation getAccountAnalyticsAsync * - * Export customers' tier data + * Get account analytics * - * @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 $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 exportCustomersTiersAsync($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function getAccountAnalyticsAsync($accountId) { - return $this->exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds, $tierNames) + return $this->getAccountAnalyticsAsyncWithHttpInfo($accountId) ->then( function ($response) { return $response[0]; @@ -8783,21 +15159,19 @@ function ($response) { } /** - * Operation exportCustomersTiersAsyncWithHttpInfo + * Operation getAccountAnalyticsAsyncWithHttpInfo * - * Export customers' tier data + * Get account analytics * - * @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 $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 exportCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + public function getAccountAnalyticsAsyncWithHttpInfo($accountId) { - $returnType = 'string'; - $request = $this->exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds, $tierNames); + $returnType = '\TalonOne\Client\Model\AccountAnalytics'; + $request = $this->getAccountAnalyticsRequest($accountId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8834,52 +15208,36 @@ function ($exception) { } /** - * Create request for operation 'exportCustomersTiers' + * Create request for operation 'getAccountAnalytics' * - * @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 $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 exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds = null, $tierNames = null) + protected function getAccountAnalyticsRequest($accountId) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'accountId' is set + if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportCustomersTiers' + 'Missing the required parameter $accountId when calling getAccountAnalytics' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customers_tiers'; + $resourcePath = '/v1/accounts/{accountId}/analytics'; $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 ($accountId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'accountId' . '}', + ObjectSerializer::toPathValue($accountId), $resourcePath ); } @@ -8889,11 +15247,11 @@ protected function exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -8959,44 +15317,36 @@ protected function exportCustomersTiersRequest($loyaltyProgramId, $subledgerIds } /** - * Operation exportEffects + * Operation getAccountCollection * - * Export triggered effects + * Get account-level collection * - * @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 coupon creation timestamp. You can use any timezone. 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (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 string + * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportEffects($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function getAccountCollection($collectionId) { - list($response) = $this->exportEffectsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + list($response) = $this->getAccountCollectionWithHttpInfo($collectionId); return $response; } /** - * Operation exportEffectsWithHttpInfo + * Operation getAccountCollectionWithHttpInfo * - * Export triggered effects + * Get account-level collection * - * @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 coupon creation timestamp. You can use any timezone. 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (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 string, 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 exportEffectsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function getAccountCollectionWithHttpInfo($collectionId) { - $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + $request = $this->getAccountCollectionRequest($collectionId); try { $options = $this->createHttpClientOption(); @@ -9029,20 +15379,32 @@ public function exportEffectsWithHttpInfo($applicationId, $campaignId = null, $c $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Collection' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'string', []), + 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 = 'string'; + $returnType = '\TalonOne\Client\Model\Collection'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9061,7 +15423,15 @@ public function exportEffectsWithHttpInfo($applicationId, $campaignId = null, $c case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\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); @@ -9072,22 +15442,18 @@ public function exportEffectsWithHttpInfo($applicationId, $campaignId = null, $c } /** - * Operation exportEffectsAsync + * Operation getAccountCollectionAsync * - * Export triggered effects + * Get account-level collection * - * @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 coupon creation timestamp. You can use any timezone. 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (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 exportEffectsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function getAccountCollectionAsync($collectionId) { - return $this->exportEffectsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat) + return $this->getAccountCollectionAsyncWithHttpInfo($collectionId) ->then( function ($response) { return $response[0]; @@ -9096,23 +15462,19 @@ function ($response) { } /** - * Operation exportEffectsAsyncWithHttpInfo + * Operation getAccountCollectionAsyncWithHttpInfo * - * Export triggered effects + * Get account-level collection * - * @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 coupon creation timestamp. You can use any timezone. 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (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 exportEffectsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + public function getAccountCollectionAsyncWithHttpInfo($collectionId) { - $returnType = 'string'; - $request = $this->exportEffectsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $dateFormat); + $returnType = '\TalonOne\Client\Model\Collection'; + $request = $this->getAccountCollectionRequest($collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9149,68 +15511,36 @@ function ($exception) { } /** - * Create request for operation 'exportEffects' + * Create request for operation 'getAccountCollection' * - * @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 coupon creation timestamp. You can use any timezone. 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param string $dateFormat Determines the format of dates in the export document. (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 exportEffectsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $dateFormat = null) + protected function getAccountCollectionRequest($collectionId) { - // 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 exportEffects' + 'Missing the required parameter $collectionId when calling getAccountCollection' ); } - $resourcePath = '/v1/applications/{applicationId}/export_effects'; + $resourcePath = '/v1/collections/{collectionId}'; $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($dateFormat)) { - $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); - } - if ($dateFormat !== null) { - $queryParams['dateFormat'] = $dateFormat; - } // path params - if ($applicationId !== null) { + if ($collectionId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -9220,11 +15550,11 @@ protected function exportEffectsRequest($applicationId, $campaignId = null, $cre if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -9290,38 +15620,40 @@ protected function exportEffectsRequest($applicationId, $campaignId = null, $cre } /** - * Operation exportLoyaltyBalance + * Operation getAchievement * - * Export customer loyalty balance to CSV + * Get achievement * - * @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. (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 $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 \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function exportLoyaltyBalance($loyaltyProgramId, $endDate = null) + public function getAchievement($applicationId, $campaignId, $achievementId) { - list($response) = $this->exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate); + list($response) = $this->getAchievementWithHttpInfo($applicationId, $campaignId, $achievementId); return $response; } /** - * Operation exportLoyaltyBalanceWithHttpInfo + * Operation getAchievementWithHttpInfo * - * Export customer loyalty balance to CSV + * Get achievement * - * @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. (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 $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 \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = null) + public function getAchievementWithHttpInfo($applicationId, $campaignId, $achievementId) { - $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); + $request = $this->getAchievementRequest($applicationId, $campaignId, $achievementId); try { $options = $this->createHttpClientOption(); @@ -9354,18 +15686,18 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Achievement' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Achievement', []), $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -9377,7 +15709,7 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 404: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -9391,7 +15723,7 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\Achievement'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9410,12 +15742,12 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\TalonOne\Client\Model\Achievement', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -9423,7 +15755,7 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -9437,19 +15769,20 @@ public function exportLoyaltyBalanceWithHttpInfo($loyaltyProgramId, $endDate = n } /** - * Operation exportLoyaltyBalanceAsync + * Operation getAchievementAsync * - * Export customer loyalty balance to CSV + * Get achievement * - * @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. (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 $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 exportLoyaltyBalanceAsync($loyaltyProgramId, $endDate = null) + public function getAchievementAsync($applicationId, $campaignId, $achievementId) { - return $this->exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate) + return $this->getAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) ->then( function ($response) { return $response[0]; @@ -9458,20 +15791,21 @@ function ($response) { } /** - * Operation exportLoyaltyBalanceAsyncWithHttpInfo + * Operation getAchievementAsyncWithHttpInfo * - * Export customer loyalty balance to CSV + * Get achievement * - * @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. (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 $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 exportLoyaltyBalanceAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + public function getAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId) { - $returnType = 'string'; - $request = $this->exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate); + $returnType = '\TalonOne\Client\Model\Achievement'; + $request = $this->getAchievementRequest($applicationId, $campaignId, $achievementId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9508,44 +15842,66 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyBalance' + * Create request for operation 'getAchievement' * - * @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. (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 $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 exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate = null) + protected function getAchievementRequest($applicationId, $campaignId, $achievementId) { - // 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 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/loyalty_programs/{loyaltyProgramId}/export_customer_balance'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } - if ($endDate !== null) { - $queryParams['endDate'] = $endDate; - } // 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 ($achievementId !== null) { + $resourcePath = str_replace( + '{' . 'achievementId' . '}', + ObjectSerializer::toPathValue($achievementId), $resourcePath ); } @@ -9555,11 +15911,11 @@ protected function exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate = nul if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -9625,38 +15981,36 @@ protected function exportLoyaltyBalanceRequest($loyaltyProgramId, $endDate = nul } /** - * Operation exportLoyaltyBalances + * Operation getAdditionalCost * - * Export customer loyalty balances + * Get additional cost * - * @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. (optional) + * @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 string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\AccountAdditionalCost */ - public function exportLoyaltyBalances($loyaltyProgramId, $endDate = null) + public function getAdditionalCost($additionalCostId) { - list($response) = $this->exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate); + list($response) = $this->getAdditionalCostWithHttpInfo($additionalCostId); return $response; } /** - * Operation exportLoyaltyBalancesWithHttpInfo + * Operation getAdditionalCostWithHttpInfo * - * Export customer loyalty balances + * Get additional cost * - * @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. (optional) + * @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 string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) + public function getAdditionalCostWithHttpInfo($additionalCostId) { - $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); + $request = $this->getAdditionalCostRequest($additionalCostId); try { $options = $this->createHttpClientOption(); @@ -9689,44 +16043,20 @@ public function exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = $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 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\AccountAdditionalCost' === '\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\AccountAdditionalCost', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9745,23 +16075,7 @@ public function exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = 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', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\AccountAdditionalCost', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9772,19 +16086,18 @@ public function exportLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $endDate = } /** - * Operation exportLoyaltyBalancesAsync + * Operation getAdditionalCostAsync * - * Export customer loyalty balances + * Get additional cost * - * @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. (optional) + * @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 exportLoyaltyBalancesAsync($loyaltyProgramId, $endDate = null) + public function getAdditionalCostAsync($additionalCostId) { - return $this->exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) + return $this->getAdditionalCostAsyncWithHttpInfo($additionalCostId) ->then( function ($response) { return $response[0]; @@ -9793,20 +16106,19 @@ function ($response) { } /** - * Operation exportLoyaltyBalancesAsyncWithHttpInfo + * Operation getAdditionalCostAsyncWithHttpInfo * - * Export customer loyalty balances + * Get additional cost * - * @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. (optional) + * @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 exportLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + public function getAdditionalCostAsyncWithHttpInfo($additionalCostId) { - $returnType = 'string'; - $request = $this->exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate); + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $request = $this->getAdditionalCostRequest($additionalCostId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9843,44 +16155,36 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyBalances' + * Create request for operation 'getAdditionalCost' * - * @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. (optional) + * @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 exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate = null) + protected function getAdditionalCostRequest($additionalCostId) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'additionalCostId' is set + if ($additionalCostId === null || (is_array($additionalCostId) && count($additionalCostId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling exportLoyaltyBalances' + 'Missing the required parameter $additionalCostId when calling getAdditionalCost' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances'; + $resourcePath = '/v1/additional_costs/{additionalCostId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } - if ($endDate !== null) { - $queryParams['endDate'] = $endDate; - } // path params - if ($loyaltyProgramId !== null) { + if ($additionalCostId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'additionalCostId' . '}', + ObjectSerializer::toPathValue($additionalCostId), $resourcePath ); } @@ -9890,11 +16194,11 @@ protected function exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate = nu if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -9960,38 +16264,40 @@ protected function exportLoyaltyBalancesRequest($loyaltyProgramId, $endDate = nu } /** - * Operation exportLoyaltyCardBalances + * Operation getAdditionalCosts * - * Export all card transaction logs + * List additional costs * - * @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. (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 string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20036 */ - public function exportLoyaltyCardBalances($loyaltyProgramId, $endDate = null) + public function getAdditionalCosts($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate); + list($response) = $this->getAdditionalCostsWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation exportLoyaltyCardBalancesWithHttpInfo + * Operation getAdditionalCostsWithHttpInfo * - * Export all card transaction logs + * List additional costs * - * @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. (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 string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDate = null) + public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); + $request = $this->getAdditionalCostsRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -10024,44 +16330,20 @@ public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDat $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 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\InlineResponse20036' === '\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\InlineResponse20036', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\InlineResponse20036'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10080,23 +16362,7 @@ public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDat 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', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20036', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10107,19 +16373,20 @@ public function exportLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $endDat } /** - * Operation exportLoyaltyCardBalancesAsync + * Operation getAdditionalCostsAsync * - * Export all card transaction logs + * List additional costs * - * @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. (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 exportLoyaltyCardBalancesAsync($loyaltyProgramId, $endDate = null) + public function getAdditionalCostsAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate) + return $this->getAdditionalCostsAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -10128,20 +16395,21 @@ function ($response) { } /** - * Operation exportLoyaltyCardBalancesAsyncWithHttpInfo + * Operation getAdditionalCostsAsyncWithHttpInfo * - * Export all card transaction logs + * List additional costs * - * @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. (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 exportLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $endDate = null) + public function getAdditionalCostsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = 'string'; - $request = $this->exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate); + $returnType = '\TalonOne\Client\Model\InlineResponse20036'; + $request = $this->getAdditionalCostsRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10178,24 +16446,26 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyCardBalances' + * Create request for operation 'getAdditionalCosts' * - * @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. (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 exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate = null) + protected function getAdditionalCostsRequest($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 exportLoyaltyCardBalances' - ); + 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.'); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/export_card_balances'; + + $resourcePath = '/v1/additional_costs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10203,33 +16473,39 @@ protected function exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate $multipart = false; // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + if (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + 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 ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -10295,44 +16571,50 @@ protected function exportLoyaltyCardBalancesRequest($loyaltyProgramId, $endDate } /** - * Operation exportLoyaltyCardLedger + * Operation getAllAccessLogs * - * Export card's ledger log + * List access logs * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20020 */ - public function exportLoyaltyCardLedger($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function getAllAccessLogs($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + list($response) = $this->getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $response; } /** - * Operation exportLoyaltyCardLedgerWithHttpInfo + * Operation getAllAccessLogsWithHttpInfo * - * Export card's ledger log + * List access logs * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @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) * * @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 \TalonOne\Client\Model\InlineResponse20020, HTTP status code, HTTP response headers (array of strings) */ - public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function getAllAccessLogsWithHttpInfo($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -10365,44 +16647,20 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC $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') { + if ('\TalonOne\Client\Model\InlineResponse20020' === '\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\InlineResponse20020', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\InlineResponse20020'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10421,23 +16679,7 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC 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', + '\TalonOne\Client\Model\InlineResponse20020', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10448,22 +16690,25 @@ public function exportLoyaltyCardLedgerWithHttpInfo($loyaltyProgramId, $loyaltyC } /** - * Operation exportLoyaltyCardLedgerAsync + * Operation getAllAccessLogsAsync * - * Export card's ledger log + * List access logs * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyCardLedgerAsync($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function getAllAccessLogsAsync($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - return $this->exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat) + return $this->getAllAccessLogsAsyncWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -10472,23 +16717,26 @@ function ($response) { } /** - * Operation exportLoyaltyCardLedgerAsyncWithHttpInfo + * Operation getAllAccessLogsAsyncWithHttpInfo * - * Export card's ledger log + * List access logs * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportLoyaltyCardLedgerAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + public function getAllAccessLogsAsyncWithHttpInfo($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = 'string'; - $request = $this->exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat); + $returnType = '\TalonOne\Client\Model\InlineResponse20020'; + $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10525,49 +16773,31 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyCardLedger' + * Create request for operation 'getAllAccessLogs' * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $dateFormat Determines the format of dates in the export document. (optional) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCardId, $rangeStart, $rangeEnd, $dateFormat = null) + protected function getAllAccessLogsRequest($rangeStart = null, $rangeEnd = null, $path = null, $method = null, $status = null, $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 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 ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAllAccessLogs, must be smaller than or equal to 1000.'); } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.exportLoyaltyCardLedger, must be smaller than or equal to 108.'); + 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 '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'; + $resourcePath = '/v1/access_logs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10589,41 +16819,60 @@ protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCar $queryParams['rangeEnd'] = $rangeEnd; } // query params - if (is_array($dateFormat)) { - $dateFormat = ObjectSerializer::serializeCollection($dateFormat, '', true); + if (is_array($path)) { + $path = ObjectSerializer::serializeCollection($path, '', true); } - if ($dateFormat !== null) { - $queryParams['dateFormat'] = $dateFormat; + if ($path !== null) { + $queryParams['path'] = $path; } - - - // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); + // query params + if (is_array($method)) { + $method = ObjectSerializer::serializeCollection($method, '', true); } - // path params - if ($loyaltyCardId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), - $resourcePath - ); + 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; } + + // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -10689,44 +16938,34 @@ protected function exportLoyaltyCardLedgerRequest($loyaltyProgramId, $loyaltyCar } /** - * Operation exportLoyaltyLedger + * Operation getAllRoles * - * Export customer's transaction logs + * List roles * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 string + * @return \TalonOne\Client\Model\InlineResponse20044 */ - public function exportLoyaltyLedger($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function getAllRoles() { - list($response) = $this->exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + list($response) = $this->getAllRolesWithHttpInfo(); return $response; } /** - * Operation exportLoyaltyLedgerWithHttpInfo + * Operation getAllRolesWithHttpInfo * - * Export customer's transaction logs + * List roles * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 string, 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 exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function getAllRolesWithHttpInfo() { - $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + $request = $this->getAllRolesRequest(); try { $options = $this->createHttpClientOption(); @@ -10759,20 +16998,20 @@ public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyalty $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20044' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20044', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\InlineResponse20044'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10791,7 +17030,7 @@ public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyalty case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\TalonOne\Client\Model\InlineResponse20044', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10802,22 +17041,17 @@ public function exportLoyaltyLedgerWithHttpInfo($rangeStart, $rangeEnd, $loyalty } /** - * Operation exportLoyaltyLedgerAsync + * Operation getAllRolesAsync * - * Export customer's transaction logs + * List roles * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 exportLoyaltyLedgerAsync($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function getAllRolesAsync() { - return $this->exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat) + return $this->getAllRolesAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -10826,23 +17060,18 @@ function ($response) { } /** - * Operation exportLoyaltyLedgerAsyncWithHttpInfo + * Operation getAllRolesAsyncWithHttpInfo * - * Export customer's transaction logs + * List roles * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 exportLoyaltyLedgerAsyncWithHttpInfo($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + public function getAllRolesAsyncWithHttpInfo() { - $returnType = 'string'; - $request = $this->exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat); + $returnType = '\TalonOne\Client\Model\InlineResponse20044'; + $request = $this->getAllRolesRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10879,101 +17108,35 @@ function ($exception) { } /** - * Create request for operation 'exportLoyaltyLedger' + * Create request for operation 'getAllRoles' * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyProgramId, $integrationId, $dateFormat = null) + protected function getAllRolesRequest() { - // 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' - ); - } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log'; + $resourcePath = '/v1/roles'; $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 ($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 ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -11039,40 +17202,36 @@ protected function exportLoyaltyLedgerRequest($rangeStart, $rangeEnd, $loyaltyPr } /** - * Operation exportPoolGiveaways + * Operation getApplication * - * Export giveaway codes of a giveaway pool + * Get Application * - * @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 $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Application */ - public function exportPoolGiveaways($poolId, $createdBefore = null, $createdAfter = null) + public function getApplication($applicationId) { - list($response) = $this->exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore, $createdAfter); + list($response) = $this->getApplicationWithHttpInfo($applicationId); return $response; } /** - * Operation exportPoolGiveawaysWithHttpInfo + * Operation getApplicationWithHttpInfo * - * Export giveaway codes of a giveaway pool + * Get Application * - * @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 $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * * @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 \TalonOne\Client\Model\Application, HTTP status code, HTTP response headers (array of strings) */ - public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) + public function getApplicationWithHttpInfo($applicationId) { - $request = $this->exportPoolGiveawaysRequest($poolId, $createdBefore, $createdAfter); + $request = $this->getApplicationRequest($applicationId); try { $options = $this->createHttpClientOption(); @@ -11105,32 +17264,20 @@ public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, $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 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Application' === '\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\Application', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\Application'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -11149,15 +17296,7 @@ public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, 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\Application', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11168,20 +17307,18 @@ public function exportPoolGiveawaysWithHttpInfo($poolId, $createdBefore = null, } /** - * Operation exportPoolGiveawaysAsync + * Operation getApplicationAsync * - * Export giveaway codes of a giveaway pool + * Get Application * - * @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 $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportPoolGiveawaysAsync($poolId, $createdBefore = null, $createdAfter = null) + public function getApplicationAsync($applicationId) { - return $this->exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore, $createdAfter) + return $this->getApplicationAsyncWithHttpInfo($applicationId) ->then( function ($response) { return $response[0]; @@ -11190,21 +17327,19 @@ function ($response) { } /** - * Operation exportPoolGiveawaysAsyncWithHttpInfo + * Operation getApplicationAsyncWithHttpInfo * - * Export giveaway codes of a giveaway pool + * Get Application * - * @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 $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportPoolGiveawaysAsyncWithHttpInfo($poolId, $createdBefore = null, $createdAfter = null) + public function getApplicationAsyncWithHttpInfo($applicationId) { - $returnType = 'string'; - $request = $this->exportPoolGiveawaysRequest($poolId, $createdBefore, $createdAfter); + $returnType = '\TalonOne\Client\Model\Application'; + $request = $this->getApplicationRequest($applicationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11241,52 +17376,36 @@ function ($exception) { } /** - * Create request for operation 'exportPoolGiveaways' + * Create request for operation 'getApplication' * - * @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 $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportPoolGiveawaysRequest($poolId, $createdBefore = null, $createdAfter = null) + protected function getApplicationRequest($applicationId) { - // verify the required parameter 'poolId' is set - if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $poolId when calling exportPoolGiveaways' + 'Missing the required parameter $applicationId when calling getApplication' ); } - $resourcePath = '/v1/giveaways/pools/{poolId}/export'; + $resourcePath = '/v1/applications/{applicationId}'; $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 ($poolId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'poolId' . '}', - ObjectSerializer::toPathValue($poolId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -11296,11 +17415,11 @@ protected function exportPoolGiveawaysRequest($poolId, $createdBefore = null, $c if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -11366,50 +17485,36 @@ protected function exportPoolGiveawaysRequest($poolId, $createdBefore = null, $c } /** - * Operation exportReferrals + * Operation getApplicationApiHealth * - * Export referrals + * Get Application health * * @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 timezone. 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 timezone. 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 string + * @return \TalonOne\Client\Model\ApplicationApiHealth */ - public function exportReferrals($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function getApplicationApiHealth($applicationId) { - list($response) = $this->exportReferralsWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); + list($response) = $this->getApplicationApiHealthWithHttpInfo($applicationId); return $response; } /** - * Operation exportReferralsWithHttpInfo + * Operation getApplicationApiHealthWithHttpInfo * - * Export referrals + * Get Application health * * @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 timezone. 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 timezone. 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 string, 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 exportReferralsWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function getApplicationApiHealthWithHttpInfo($applicationId) { - $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); + $request = $this->getApplicationApiHealthRequest($applicationId); try { $options = $this->createHttpClientOption(); @@ -11442,20 +17547,20 @@ public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationApiHealth' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationApiHealth', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = 'string'; + $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -11474,7 +17579,7 @@ public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\TalonOne\Client\Model\ApplicationApiHealth', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11485,25 +17590,18 @@ public function exportReferralsWithHttpInfo($applicationId, $campaignId = null, } /** - * Operation exportReferralsAsync + * Operation getApplicationApiHealthAsync * - * Export referrals + * Get Application health * * @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 timezone. 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 timezone. 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 exportReferralsAsync($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function getApplicationApiHealthAsync($applicationId) { - return $this->exportReferralsAsyncWithHttpInfo($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat) + return $this->getApplicationApiHealthAsyncWithHttpInfo($applicationId) ->then( function ($response) { return $response[0]; @@ -11512,26 +17610,19 @@ function ($response) { } /** - * Operation exportReferralsAsyncWithHttpInfo + * Operation getApplicationApiHealthAsyncWithHttpInfo * - * Export referrals + * Get Application health * * @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 timezone. 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 timezone. 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 exportReferralsAsyncWithHttpInfo($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = null) + public function getApplicationApiHealthAsyncWithHttpInfo($applicationId) { - $returnType = 'string'; - $request = $this->exportReferralsRequest($applicationId, $campaignId, $createdBefore, $createdAfter, $valid, $usable, $batchId, $dateFormat); + $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; + $request = $this->getApplicationApiHealthRequest($applicationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11568,85 +17659,29 @@ function ($exception) { } /** - * Create request for operation 'exportReferrals' + * Create request for operation 'getApplicationApiHealth' * * @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 timezone. 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 timezone. 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 exportReferralsRequest($applicationId, $campaignId = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $batchId = null, $dateFormat = 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 exportReferrals' + 'Missing the required parameter $applicationId when calling getApplicationApiHealth' ); } - $resourcePath = '/v1/applications/{applicationId}/export_referrals'; + $resourcePath = '/v1/applications/{applicationId}/health_report'; $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 @@ -11663,11 +17698,11 @@ protected function exportReferralsRequest($applicationId, $campaignId = null, $c if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/csv'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/csv'], + ['application/json'], [] ); } @@ -11733,52 +17768,38 @@ protected function exportReferralsRequest($applicationId, $campaignId = null, $c } /** - * Operation getAccessLogsWithoutTotalCount + * Operation getApplicationCustomer * - * Get access logs for Application + * Get application's customer * * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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\InlineResponse20019 + * @return \TalonOne\Client\Model\ApplicationCustomer */ - public function getAccessLogsWithoutTotalCount($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomer($applicationId, $customerId) { - list($response) = $this->getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + list($response) = $this->getApplicationCustomerWithHttpInfo($applicationId, $customerId); return $response; } /** - * Operation getAccessLogsWithoutTotalCountWithHttpInfo + * Operation getApplicationCustomerWithHttpInfo * - * Get access logs for Application + * Get application's customer * * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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\InlineResponse20019, 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 getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) { - $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $request = $this->getApplicationCustomerRequest($applicationId, $customerId); try { $options = $this->createHttpClientOption(); @@ -11811,20 +17832,20 @@ public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rang $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20019' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationCustomer' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20019', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationCustomer', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20019'; + $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -11843,7 +17864,7 @@ public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rang case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20019', + '\TalonOne\Client\Model\ApplicationCustomer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11854,26 +17875,19 @@ public function getAccessLogsWithoutTotalCountWithHttpInfo($applicationId, $rang } /** - * Operation getAccessLogsWithoutTotalCountAsync + * Operation getApplicationCustomerAsync * - * Get access logs for Application + * Get application's customer * * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 getAccessLogsWithoutTotalCountAsync($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomerAsync($applicationId, $customerId) { - return $this->getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) + return $this->getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) ->then( function ($response) { return $response[0]; @@ -11882,27 +17896,20 @@ function ($response) { } /** - * Operation getAccessLogsWithoutTotalCountAsyncWithHttpInfo + * Operation getApplicationCustomerAsyncWithHttpInfo * - * Get access logs for Application + * Get application's customer * * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 getAccessLogsWithoutTotalCountAsyncWithHttpInfo($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20019'; - $request = $this->getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; + $request = $this->getApplicationCustomerRequest($applicationId, $customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11939,112 +17946,36 @@ function ($exception) { } /** - * Create request for operation 'getAccessLogsWithoutTotalCount' + * Create request for operation 'getApplicationCustomer' * * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 getAccessLogsWithoutTotalCountRequest($applicationId, $rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $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 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' + 'Missing the required parameter $applicationId when calling getApplicationCustomer' ); } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling getAccessLogsWithoutTotalCount' + 'Missing the required parameter $customerId when calling getApplicationCustomer' ); } - 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/applications/{applicationId}/customers/{customerId}'; $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 @@ -12055,6 +17986,14 @@ protected function getAccessLogsWithoutTotalCountRequest($applicationId, $rangeS $resourcePath ); } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -12131,36 +18070,46 @@ protected function getAccessLogsWithoutTotalCountRequest($applicationId, $rangeS } /** - * Operation getAccount + * Operation getApplicationCustomerFriends * - * Get account details + * List friends referred by customer profile * - * @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 $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 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\Account + * @return \TalonOne\Client\Model\InlineResponse20033 */ - public function getAccount($accountId) + public function getApplicationCustomerFriends($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - list($response) = $this->getAccountWithHttpInfo($accountId); + list($response) = $this->getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); return $response; } /** - * Operation getAccountWithHttpInfo + * Operation getApplicationCustomerFriendsWithHttpInfo * - * Get account details + * List friends referred by customer profile * - * @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 $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 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\Account, 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 getAccountWithHttpInfo($accountId) + public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $request = $this->getAccountRequest($accountId); + $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -12193,20 +18142,20 @@ public function getAccountWithHttpInfo($accountId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Account' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20033' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Account', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20033', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Account'; + $returnType = '\TalonOne\Client\Model\InlineResponse20033'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -12225,7 +18174,7 @@ public function getAccountWithHttpInfo($accountId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Account', + '\TalonOne\Client\Model\InlineResponse20033', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12236,18 +18185,23 @@ public function getAccountWithHttpInfo($accountId) } /** - * Operation getAccountAsync + * Operation getApplicationCustomerFriendsAsync * - * Get account details + * List friends referred by customer profile * - * @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 $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 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 getAccountAsync($accountId) + public function getApplicationCustomerFriendsAsync($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - return $this->getAccountAsyncWithHttpInfo($accountId) + return $this->getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -12256,19 +18210,24 @@ function ($response) { } /** - * Operation getAccountAsyncWithHttpInfo + * Operation getApplicationCustomerFriendsAsyncWithHttpInfo * - * Get account details + * List friends referred by customer profile * - * @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 $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 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 getAccountAsyncWithHttpInfo($accountId) + public function getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\Account'; - $request = $this->getAccountRequest($accountId); + $returnType = '\TalonOne\Client\Model\InlineResponse20033'; + $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12305,36 +18264,90 @@ function ($exception) { } /** - * Create request for operation 'getAccount' + * Create request for operation 'getApplicationCustomerFriends' * - * @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 $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 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 getAccountRequest($accountId) + protected function getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - // verify the required parameter 'accountId' is set - if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $accountId when calling getAccount' + '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.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomerFriends, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/accounts/{accountId}'; + + $resourcePath = '/v1/applications/{applicationId}/profile/{integrationId}/friends'; $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; + } // path params - if ($accountId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'accountId' . '}', - ObjectSerializer::toPathValue($accountId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), $resourcePath ); } @@ -12414,36 +18427,44 @@ protected function getAccountRequest($accountId) } /** - * Operation getAccountAnalytics + * Operation getApplicationCustomers * - * Get account analytics + * List application's customers * - * @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 $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\AccountAnalytics + * @return \TalonOne\Client\Model\InlineResponse20022 */ - public function getAccountAnalytics($accountId) + public function getApplicationCustomers($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - list($response) = $this->getAccountAnalyticsWithHttpInfo($accountId); + list($response) = $this->getApplicationCustomersWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); return $response; } /** - * Operation getAccountAnalyticsWithHttpInfo + * Operation getApplicationCustomersWithHttpInfo * - * Get account analytics + * List application's customers * - * @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 $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\AccountAnalytics, 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 getAccountAnalyticsWithHttpInfo($accountId) + public function getApplicationCustomersWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $request = $this->getAccountAnalyticsRequest($accountId); + $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -12476,20 +18497,20 @@ public function getAccountAnalyticsWithHttpInfo($accountId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\AccountAnalytics' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20022' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AccountAnalytics', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20022', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\AccountAnalytics'; + $returnType = '\TalonOne\Client\Model\InlineResponse20022'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -12508,7 +18529,7 @@ public function getAccountAnalyticsWithHttpInfo($accountId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\AccountAnalytics', + '\TalonOne\Client\Model\InlineResponse20022', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12519,18 +18540,22 @@ public function getAccountAnalyticsWithHttpInfo($accountId) } /** - * Operation getAccountAnalyticsAsync + * Operation getApplicationCustomersAsync * - * Get account analytics + * List application's customers * - * @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 $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 getAccountAnalyticsAsync($accountId) + public function getApplicationCustomersAsync($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - return $this->getAccountAnalyticsAsyncWithHttpInfo($accountId) + return $this->getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -12539,19 +18564,23 @@ function ($response) { } /** - * Operation getAccountAnalyticsAsyncWithHttpInfo + * Operation getApplicationCustomersAsyncWithHttpInfo * - * Get account analytics + * List application's customers * - * @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 $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 getAccountAnalyticsAsyncWithHttpInfo($accountId) + public function getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\AccountAnalytics'; - $request = $this->getAccountAnalyticsRequest($accountId); + $returnType = '\TalonOne\Client\Model\InlineResponse20022'; + $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12588,36 +18617,75 @@ function ($exception) { } /** - * Create request for operation 'getAccountAnalytics' + * Create request for operation 'getApplicationCustomers' * - * @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 $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 getAccountAnalyticsRequest($accountId) + protected function getApplicationCustomersRequest($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - // verify the required parameter 'accountId' is set - if ($accountId === null || (is_array($accountId) && count($accountId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $accountId when calling getAccountAnalytics' + 'Missing the required parameter $applicationId when calling getApplicationCustomers' ); } + 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/accounts/{accountId}/analytics'; + + $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 - if ($accountId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'accountId' . '}', - ObjectSerializer::toPathValue($accountId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -12697,36 +18765,44 @@ protected function getAccountAnalyticsRequest($accountId) } /** - * Operation getAccountCollection + * Operation getApplicationCustomersByAttributes * - * Get account-level collection + * List application customers matching the given attributes * - * @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 \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\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20023 */ - public function getAccountCollection($collectionId) + public function getApplicationCustomersByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - list($response) = $this->getAccountCollectionWithHttpInfo($collectionId); + list($response) = $this->getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize); return $response; } /** - * Operation getAccountCollectionWithHttpInfo + * Operation getApplicationCustomersByAttributesWithHttpInfo * - * Get account-level collection + * List application customers matching the given attributes * - * @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 \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\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 getAccountCollectionWithHttpInfo($collectionId) + public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $request = $this->getAccountCollectionRequest($collectionId); + $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -12759,32 +18835,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 ('\TalonOne\Client\Model\InlineResponse20023' === '\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\InlineResponse20023', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Collection'; + $returnType = '\TalonOne\Client\Model\InlineResponse20023'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -12803,15 +18867,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', + '\TalonOne\Client\Model\InlineResponse20023', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12822,18 +18878,22 @@ public function getAccountCollectionWithHttpInfo($collectionId) } /** - * Operation getAccountCollectionAsync + * Operation getApplicationCustomersByAttributesAsync * - * Get account-level collection + * List application customers matching the given attributes * - * @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 \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 getAccountCollectionAsync($collectionId) + public function getApplicationCustomersByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - return $this->getAccountCollectionAsyncWithHttpInfo($collectionId) + return $this->getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -12842,19 +18902,23 @@ function ($response) { } /** - * Operation getAccountCollectionAsyncWithHttpInfo + * Operation getApplicationCustomersByAttributesAsyncWithHttpInfo * - * Get account-level collection + * List application customers matching the given attributes * - * @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 \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 getAccountCollectionAsyncWithHttpInfo($collectionId) + public function getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\Collection'; - $request = $this->getAccountCollectionRequest($collectionId); + $returnType = '\TalonOne\Client\Model\InlineResponse20023'; + $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12891,42 +18955,83 @@ function ($exception) { } /** - * Create request for operation 'getAccountCollection' + * Create request for operation 'getApplicationCustomersByAttributes' * - * @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 \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 getAccountCollectionRequest($collectionId) + protected function getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = 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 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.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/collections/{collectionId}'; + + $resourcePath = '/v1/applications/{applicationId}/customer_search'; $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 - if ($collectionId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -12935,7 +19040,7 @@ protected function getAccountCollectionRequest($collectionId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -12992,7 +19097,7 @@ protected function getAccountCollectionRequest($collectionId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -13000,36 +19105,42 @@ protected function getAccountCollectionRequest($collectionId) } /** - * Operation getAdditionalCost + * Operation getApplicationEventTypes * - * Get additional cost + * List Applications event types * - * @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 $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\AccountAdditionalCost + * @return \TalonOne\Client\Model\InlineResponse20029 */ - public function getAdditionalCost($additionalCostId) + public function getApplicationEventTypes($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getAdditionalCostWithHttpInfo($additionalCostId); + list($response) = $this->getApplicationEventTypesWithHttpInfo($applicationId, $pageSize, $skip, $sort); return $response; } /** - * Operation getAdditionalCostWithHttpInfo + * Operation getApplicationEventTypesWithHttpInfo * - * Get additional cost + * List Applications event types * - * @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 $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\AccountAdditionalCost, 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 getAdditionalCostWithHttpInfo($additionalCostId) + public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getAdditionalCostRequest($additionalCostId); + $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -13062,20 +19173,20 @@ public function getAdditionalCostWithHttpInfo($additionalCostId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\AccountAdditionalCost' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20029' === '\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\InlineResponse20029', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $returnType = '\TalonOne\Client\Model\InlineResponse20029'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -13094,7 +19205,7 @@ public function getAdditionalCostWithHttpInfo($additionalCostId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\AccountAdditionalCost', + '\TalonOne\Client\Model\InlineResponse20029', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13105,18 +19216,21 @@ public function getAdditionalCostWithHttpInfo($additionalCostId) } /** - * Operation getAdditionalCostAsync + * Operation getApplicationEventTypesAsync * - * Get additional cost + * List Applications event types * - * @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 $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 \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAdditionalCostAsync($additionalCostId) + public function getApplicationEventTypesAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getAdditionalCostAsyncWithHttpInfo($additionalCostId) + return $this->getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -13125,19 +19239,22 @@ function ($response) { } /** - * Operation getAdditionalCostAsyncWithHttpInfo + * Operation getApplicationEventTypesAsyncWithHttpInfo * - * Get additional cost + * List Applications event types * - * @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 $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 \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAdditionalCostAsyncWithHttpInfo($additionalCostId) + public function getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; - $request = $this->getAdditionalCostRequest($additionalCostId); + $returnType = '\TalonOne\Client\Model\InlineResponse20029'; + $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13174,36 +19291,67 @@ function ($exception) { } /** - * Create request for operation 'getAdditionalCost' + * Create request for operation 'getApplicationEventTypes' * - * @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 $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 \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAdditionalCostRequest($additionalCostId) + protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'additionalCostId' is set - if ($additionalCostId === null || (is_array($additionalCostId) && count($additionalCostId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $additionalCostId when calling getAdditionalCost' + 'Missing the required parameter $applicationId when calling getApplicationEventTypes' ); } + 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.'); + } - $resourcePath = '/v1/additional_costs/{additionalCostId}'; + + $resourcePath = '/v1/applications/{applicationId}/event_types'; $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 ($additionalCostId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'additionalCostId' . '}', - ObjectSerializer::toPathValue($additionalCostId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -13283,40 +19431,64 @@ protected function getAdditionalCostRequest($additionalCostId) } /** - * Operation getAdditionalCosts + * Operation getApplicationEventsWithoutTotalCount * - * List additional costs + * List Applications events * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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\InlineResponse20034 + * @return \TalonOne\Client\Model\InlineResponse20028 */ - public function getAdditionalCosts($pageSize = 1000, $skip = null, $sort = null) + 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->getAdditionalCostsWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); return $response; } /** - * Operation getAdditionalCostsWithHttpInfo + * Operation getApplicationEventsWithoutTotalCountWithHttpInfo * - * List additional costs + * List Applications events * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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\InlineResponse20034, 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 getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + 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->getAdditionalCostsRequest($pageSize, $skip, $sort); + $request = $this->getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); try { $options = $this->createHttpClientOption(); @@ -13349,20 +19521,20 @@ public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20034' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20028' === '\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\InlineResponse20028', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20034'; + $returnType = '\TalonOne\Client\Model\InlineResponse20028'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -13381,7 +19553,7 @@ public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20034', + '\TalonOne\Client\Model\InlineResponse20028', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13392,20 +19564,32 @@ public function getAdditionalCostsWithHttpInfo($pageSize = 1000, $skip = null, $ } /** - * Operation getAdditionalCostsAsync + * Operation getApplicationEventsWithoutTotalCountAsync * - * List additional costs + * List Applications events * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 getAdditionalCostsAsync($pageSize = 1000, $skip = null, $sort = null) + 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->getAdditionalCostsAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->getApplicationEventsWithoutTotalCountAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery) ->then( function ($response) { return $response[0]; @@ -13414,21 +19598,33 @@ function ($response) { } /** - * Operation getAdditionalCostsAsyncWithHttpInfo + * Operation getApplicationEventsWithoutTotalCountAsyncWithHttpInfo * - * List additional costs + * List Applications events * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 getAdditionalCostsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + 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\InlineResponse20034'; - $request = $this->getAdditionalCostsRequest($pageSize, $skip, $sort); + $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()) @@ -13465,26 +19661,52 @@ function ($exception) { } /** - * Create request for operation 'getAdditionalCosts' + * Create request for operation 'getApplicationEventsWithoutTotalCount' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 getAdditionalCostsRequest($pageSize = 1000, $skip = null, $sort = null) + 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 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getApplicationEventsWithoutTotalCount' + ); + } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAdditionalCosts, must be smaller than or equal to 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.getAdditionalCosts, must be bigger than or equal to 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.'); + } - $resourcePath = '/v1/additional_costs'; + 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 = []; @@ -13512,8 +19734,93 @@ protected function getAdditionalCostsRequest($pageSize = 1000, $skip = null, $so 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 ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -13590,50 +19897,38 @@ protected function getAdditionalCostsRequest($pageSize = 1000, $skip = null, $so } /** - * Operation getAllAccessLogs + * Operation getApplicationSession * - * List access logs + * Get Application session * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 $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\InlineResponse20020 + * @return \TalonOne\Client\Model\ApplicationSession */ - public function getAllAccessLogs($rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationSession($applicationId, $sessionId) { - list($response) = $this->getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + list($response) = $this->getApplicationSessionWithHttpInfo($applicationId, $sessionId); return $response; } /** - * Operation getAllAccessLogsWithHttpInfo + * Operation getApplicationSessionWithHttpInfo * - * List access logs + * Get Application session * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 $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\InlineResponse20020, 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 getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) { - $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $request = $this->getApplicationSessionRequest($applicationId, $sessionId); try { $options = $this->createHttpClientOption(); @@ -13666,20 +19961,20 @@ public function getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20020' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationSession' === '\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\ApplicationSession', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20020'; + $returnType = '\TalonOne\Client\Model\ApplicationSession'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -13698,7 +19993,7 @@ public function getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20020', + '\TalonOne\Client\Model\ApplicationSession', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13709,25 +20004,19 @@ public function getAllAccessLogsWithHttpInfo($rangeStart, $rangeEnd, $path = nul } /** - * Operation getAllAccessLogsAsync + * Operation getApplicationSessionAsync * - * List access logs + * Get Application session * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 $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 getAllAccessLogsAsync($rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationSessionAsync($applicationId, $sessionId) { - return $this->getAllAccessLogsAsyncWithHttpInfo($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort) + return $this->getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) ->then( function ($response) { return $response[0]; @@ -13736,26 +20025,20 @@ function ($response) { } /** - * Operation getAllAccessLogsAsyncWithHttpInfo + * Operation getApplicationSessionAsyncWithHttpInfo * - * List access logs + * Get Application session * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 $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 getAllAccessLogsAsyncWithHttpInfo($rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + public function getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20020'; - $request = $this->getAllAccessLogsRequest($rangeStart, $rangeEnd, $path, $method, $status, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\ApplicationSession'; + $request = $this->getApplicationSessionRequest($applicationId, $sessionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13792,107 +20075,54 @@ function ($exception) { } /** - * Create request for operation 'getAllAccessLogs' + * Create request for operation 'getApplicationSession' * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this 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 $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 getAllAccessLogsRequest($rangeStart, $rangeEnd, $path = null, $method = null, $status = null, $pageSize = 1000, $skip = null, $sort = null) + protected function getApplicationSessionRequest($applicationId, $sessionId) { - // 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 getAllAccessLogs' + 'Missing the required parameter $applicationId when calling getApplicationSession' ); } - // verify the required parameter 'rangeEnd' is set - if ($rangeEnd === null || (is_array($rangeEnd) && count($rangeEnd) === 0)) { + // verify the required parameter 'sessionId' is set + if ($sessionId === null || (is_array($sessionId) && count($sessionId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $rangeEnd when calling getAllAccessLogs' + 'Missing the required parameter $sessionId when calling getApplicationSession' ); } - 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.'); - } - - $resourcePath = '/v1/access_logs'; + $resourcePath = '/v1/applications/{applicationId}/sessions/{sessionId}'; $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 ($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; @@ -13969,34 +20199,58 @@ protected function getAllAccessLogsRequest($rangeStart, $rangeEnd, $path = null, } /** - * Operation getAllRoles + * Operation getApplicationSessions * - * List roles + * List Application sessions * + * @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 $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\InlineResponse20042 + * @return \TalonOne\Client\Model\InlineResponse20027 */ - public function getAllRoles() + 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->getAllRolesWithHttpInfo(); + list($response) = $this->getApplicationSessionsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); return $response; } /** - * Operation getAllRolesWithHttpInfo + * Operation getApplicationSessionsWithHttpInfo * - * List roles + * List Application sessions * + * @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 $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\InlineResponse20042, 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 getAllRolesWithHttpInfo() + 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->getAllRolesRequest(); + $request = $this->getApplicationSessionsRequest($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId); try { $options = $this->createHttpClientOption(); @@ -14029,20 +20283,20 @@ public function getAllRolesWithHttpInfo() $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20042' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20027' === '\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\InlineResponse20027', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20042'; + $returnType = '\TalonOne\Client\Model\InlineResponse20027'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -14061,7 +20315,7 @@ public function getAllRolesWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20042', + '\TalonOne\Client\Model\InlineResponse20027', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14072,17 +20326,29 @@ public function getAllRolesWithHttpInfo() } /** - * Operation getAllRolesAsync + * Operation getApplicationSessionsAsync * - * List roles + * List Application sessions * + * @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 $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 getAllRolesAsync() + 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->getAllRolesAsyncWithHttpInfo() + return $this->getApplicationSessionsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId, $storeIntegrationId) ->then( function ($response) { return $response[0]; @@ -14091,18 +20357,30 @@ function ($response) { } /** - * Operation getAllRolesAsyncWithHttpInfo + * Operation getApplicationSessionsAsyncWithHttpInfo * - * List roles + * List Application sessions * + * @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 $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 getAllRolesAsyncWithHttpInfo() + 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\InlineResponse20042'; - $request = $this->getAllRolesRequest(); + $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()) @@ -14139,24 +20417,134 @@ function ($exception) { } /** - * Create request for operation 'getAllRoles' + * Create request for operation 'getApplicationSessions' * + * @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 $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 getAllRolesRequest() + 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 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getApplicationSessions' + ); + } + if ($pageSize !== null && $pageSize > 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.getApplicationSessions, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/roles'; + + $resourcePath = '/v1/applications/{applicationId}/sessions'; $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($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 ($storeIntegrationId !== null) { + $queryParams['storeIntegrationId'] = $storeIntegrationId; + } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -14233,36 +20621,40 @@ protected function getAllRolesRequest() } /** - * Operation getApplication + * Operation getApplications * - * Get Application + * List Applications * - * @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\Application + * @return \TalonOne\Client\Model\InlineResponse2005 */ - public function getApplication($applicationId) + public function getApplications($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getApplicationWithHttpInfo($applicationId); + list($response) = $this->getApplicationsWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getApplicationWithHttpInfo + * Operation getApplicationsWithHttpInfo * - * Get Application + * List Applications * - * @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\Application, 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 getApplicationWithHttpInfo($applicationId) + public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getApplicationRequest($applicationId); + $request = $this->getApplicationsRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -14295,20 +20687,20 @@ public function getApplicationWithHttpInfo($applicationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Application' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2005' === '\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\InlineResponse2005', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Application'; + $returnType = '\TalonOne\Client\Model\InlineResponse2005'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -14327,7 +20719,7 @@ public function getApplicationWithHttpInfo($applicationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Application', + '\TalonOne\Client\Model\InlineResponse2005', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14338,18 +20730,20 @@ public function getApplicationWithHttpInfo($applicationId) } /** - * Operation getApplicationAsync + * Operation getApplicationsAsync * - * Get Application + * List Applications * - * @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 \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationAsync($applicationId) + public function getApplicationsAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getApplicationAsyncWithHttpInfo($applicationId) + return $this->getApplicationsAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -14358,19 +20752,21 @@ function ($response) { } /** - * Operation getApplicationAsyncWithHttpInfo + * Operation getApplicationsAsyncWithHttpInfo * - * Get Application + * List Applications * - * @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 \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationAsyncWithHttpInfo($applicationId) + public function getApplicationsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\Application'; - $request = $this->getApplicationRequest($applicationId); + $returnType = '\TalonOne\Client\Model\InlineResponse2005'; + $request = $this->getApplicationsRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14407,39 +20803,55 @@ function ($exception) { } /** - * Create request for operation 'getApplication' + * Create request for operation 'getApplications' * - * @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 \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationRequest($applicationId) + protected function getApplicationsRequest($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 getApplication' - ); + if ($pageSize !== null && $pageSize > 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.getApplications, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}'; + + $resourcePath = '/v1/applications'; $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 - ); - } // body params $_tempBody = null; @@ -14516,36 +20928,36 @@ protected function getApplicationRequest($applicationId) } /** - * Operation getApplicationApiHealth + * Operation getAttribute * - * Get Application health + * Get custom attribute * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @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\ApplicationApiHealth + * @return \TalonOne\Client\Model\Attribute */ - public function getApplicationApiHealth($applicationId) + public function getAttribute($attributeId) { - list($response) = $this->getApplicationApiHealthWithHttpInfo($applicationId); + list($response) = $this->getAttributeWithHttpInfo($attributeId); return $response; } /** - * Operation getApplicationApiHealthWithHttpInfo + * Operation getAttributeWithHttpInfo * - * Get Application health + * Get custom attribute * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @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\ApplicationApiHealth, 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 getApplicationApiHealthWithHttpInfo($applicationId) + public function getAttributeWithHttpInfo($attributeId) { - $request = $this->getApplicationApiHealthRequest($applicationId); + $request = $this->getAttributeRequest($attributeId); try { $options = $this->createHttpClientOption(); @@ -14578,20 +20990,20 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationApiHealth' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Attribute' === '\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\Attribute', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; + $returnType = '\TalonOne\Client\Model\Attribute'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -14610,7 +21022,7 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationApiHealth', + '\TalonOne\Client\Model\Attribute', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14621,18 +21033,18 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) } /** - * Operation getApplicationApiHealthAsync + * Operation getAttributeAsync * - * Get Application health + * Get custom attribute * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @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 getApplicationApiHealthAsync($applicationId) + public function getAttributeAsync($attributeId) { - return $this->getApplicationApiHealthAsyncWithHttpInfo($applicationId) + return $this->getAttributeAsyncWithHttpInfo($attributeId) ->then( function ($response) { return $response[0]; @@ -14641,19 +21053,19 @@ function ($response) { } /** - * Operation getApplicationApiHealthAsyncWithHttpInfo + * Operation getAttributeAsyncWithHttpInfo * - * Get Application health + * Get custom attribute * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @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 getApplicationApiHealthAsyncWithHttpInfo($applicationId) + public function getAttributeAsyncWithHttpInfo($attributeId) { - $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; - $request = $this->getApplicationApiHealthRequest($applicationId); + $returnType = '\TalonOne\Client\Model\Attribute'; + $request = $this->getAttributeRequest($attributeId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14690,23 +21102,23 @@ function ($exception) { } /** - * Create request for operation 'getApplicationApiHealth' + * Create request for operation 'getAttribute' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @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 getApplicationApiHealthRequest($applicationId) + protected function getAttributeRequest($attributeId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'attributeId' is set + if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationApiHealth' + 'Missing the required parameter $attributeId when calling getAttribute' ); } - $resourcePath = '/v1/applications/{applicationId}/health_report'; + $resourcePath = '/v1/attributes/{attributeId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14716,10 +21128,10 @@ protected function getApplicationApiHealthRequest($applicationId) // path params - if ($applicationId !== null) { + if ($attributeId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'attributeId' . '}', + ObjectSerializer::toPathValue($attributeId), $resourcePath ); } @@ -14799,38 +21211,42 @@ protected function getApplicationApiHealthRequest($applicationId) } /** - * Operation getApplicationCustomer + * Operation getAttributes * - * Get application's customer + * List custom attributes * - * @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 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\ApplicationCustomer + * @return \TalonOne\Client\Model\InlineResponse20034 */ - public function getApplicationCustomer($applicationId, $customerId) + public function getAttributes($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - list($response) = $this->getApplicationCustomerWithHttpInfo($applicationId, $customerId); + list($response) = $this->getAttributesWithHttpInfo($pageSize, $skip, $sort, $entity); return $response; } /** - * Operation getApplicationCustomerWithHttpInfo + * Operation getAttributesWithHttpInfo * - * Get application's customer + * List custom attributes * - * @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 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\ApplicationCustomer, 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 getApplicationCustomerWithHttpInfo($applicationId, $customerId) + public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - $request = $this->getApplicationCustomerRequest($applicationId, $customerId); + $request = $this->getAttributesRequest($pageSize, $skip, $sort, $entity); try { $options = $this->createHttpClientOption(); @@ -14863,20 +21279,20 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationCustomer' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20034' === '\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\InlineResponse20034', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; + $returnType = '\TalonOne\Client\Model\InlineResponse20034'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -14895,7 +21311,7 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationCustomer', + '\TalonOne\Client\Model\InlineResponse20034', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14906,19 +21322,21 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) } /** - * Operation getApplicationCustomerAsync + * Operation getAttributesAsync * - * Get application's customer + * List custom attributes * - * @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 string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerAsync($applicationId, $customerId) + public function getAttributesAsync($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - return $this->getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) + return $this->getAttributesAsyncWithHttpInfo($pageSize, $skip, $sort, $entity) ->then( function ($response) { return $response[0]; @@ -14927,20 +21345,22 @@ function ($response) { } /** - * Operation getApplicationCustomerAsyncWithHttpInfo + * Operation getAttributesAsyncWithHttpInfo * - * Get application's customer + * List custom attributes * - * @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 string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) + public function getAttributesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) { - $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; - $request = $this->getApplicationCustomerRequest($applicationId, $customerId); + $returnType = '\TalonOne\Client\Model\InlineResponse20034'; + $request = $this->getAttributesRequest($pageSize, $skip, $sort, $entity); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14977,54 +21397,63 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomer' + * 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 $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 string $entity Returned attributes will be filtered by supplied entity. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomerRequest($applicationId, $customerId) + 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 getApplicationCustomer' - ); + 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 '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.getAttributes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}'; + + $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 ($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; + } + // query params + if (is_array($entity)) { + $entity = ObjectSerializer::serializeCollection($entity, '', true); + } + if ($entity !== null) { + $queryParams['entity'] = $entity; + } + + // body params $_tempBody = null; @@ -15101,46 +21530,44 @@ protected function getApplicationCustomerRequest($applicationId, $customerId) } /** - * Operation getApplicationCustomerFriends + * Operation getAudienceMemberships * - * List friends referred by customer profile + * List audience members * - * @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 this response. (optional, default to 1000) + * @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 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 $profileQuery The filter to select a profile. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20031 + * @return \TalonOne\Client\Model\InlineResponse20032|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getApplicationCustomerFriends($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAudienceMemberships($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - list($response) = $this->getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + list($response) = $this->getAudienceMembershipsWithHttpInfo($audienceId, $pageSize, $skip, $sort, $profileQuery); return $response; } /** - * Operation getApplicationCustomerFriendsWithHttpInfo + * Operation getAudienceMembershipsWithHttpInfo * - * List friends referred by customer profile + * List audience members * - * @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 this response. (optional, default to 1000) + * @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 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 $profileQuery The filter to select a profile. (optional) * * @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\InlineResponse20032|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAudienceMembershipsWithHttpInfo($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + $request = $this->getAudienceMembershipsRequest($audienceId, $pageSize, $skip, $sort, $profileQuery); try { $options = $this->createHttpClientOption(); @@ -15173,20 +21600,32 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20031' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20032' === '\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\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\InlineResponse20031'; + $returnType = '\TalonOne\Client\Model\InlineResponse20032'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -15205,7 +21644,15 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20031', + '\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); @@ -15216,23 +21663,22 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ } /** - * Operation getApplicationCustomerFriendsAsync + * Operation getAudienceMembershipsAsync * - * List friends referred by customer profile + * List audience members * - * @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 this response. (optional, default to 1000) + * @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 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 $profileQuery The filter to select a profile. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerFriendsAsync($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAudienceMembershipsAsync($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - return $this->getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) + return $this->getAudienceMembershipsAsyncWithHttpInfo($audienceId, $pageSize, $skip, $sort, $profileQuery) ->then( function ($response) { return $response[0]; @@ -15241,24 +21687,23 @@ function ($response) { } /** - * Operation getApplicationCustomerFriendsAsyncWithHttpInfo + * Operation getAudienceMembershipsAsyncWithHttpInfo * - * List friends referred by customer profile + * List audience members * - * @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 this response. (optional, default to 1000) + * @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 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 $profileQuery The filter to select a profile. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getAudienceMembershipsAsyncWithHttpInfo($audienceId, $pageSize = 1000, $skip = null, $sort = null, $profileQuery = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20031'; - $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse20032'; + $request = $this->getAudienceMembershipsRequest($audienceId, $pageSize, $skip, $sort, $profileQuery); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15295,41 +21740,34 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomerFriends' + * Create request for operation 'getAudienceMemberships' * - * @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 this response. (optional, default to 1000) + * @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 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 $profileQuery The filter to select a profile. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = 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)) { + // 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 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' + 'Missing the required parameter $audienceId when calling getAudienceMemberships' ); } 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.getAudienceMemberships, 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.getAudienceMemberships, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/profile/{integrationId}/friends'; + $resourcePath = '/v1/audiences/{audienceId}/memberships'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15358,27 +21796,19 @@ protected function getApplicationCustomerFriendsRequest($applicationId, $integra $queryParams['sort'] = $sort; } // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + if (is_array($profileQuery)) { + $profileQuery = ObjectSerializer::serializeCollection($profileQuery, '', true); } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; + if ($profileQuery !== null) { + $queryParams['profileQuery'] = $profileQuery; } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($integrationId !== null) { + if ($audienceId !== null) { $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), + '{' . 'audienceId' . '}', + ObjectSerializer::toPathValue($audienceId), $resourcePath ); } @@ -15458,44 +21888,42 @@ protected function getApplicationCustomerFriendsRequest($applicationId, $integra } /** - * Operation getApplicationCustomers + * Operation getAudiences * - * List application's customers + * List audiences * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse20022 + * @return \TalonOne\Client\Model\InlineResponse20030 */ - public function getApplicationCustomers($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiences($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - list($response) = $this->getApplicationCustomersWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + list($response) = $this->getAudiencesWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize); return $response; } /** - * Operation getApplicationCustomersWithHttpInfo + * Operation getAudiencesWithHttpInfo * - * List application's customers + * List audiences * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse20022, 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 getApplicationCustomersWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -15528,20 +21956,20 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20022' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20030' === '\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\InlineResponse20030', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20022'; + $returnType = '\TalonOne\Client\Model\InlineResponse20030'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -15560,7 +21988,7 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20022', + '\TalonOne\Client\Model\InlineResponse20030', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15571,22 +21999,21 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration } /** - * Operation getApplicationCustomersAsync + * Operation getAudiencesAsync * - * List application's customers + * List audiences * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getApplicationCustomersAsync($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiencesAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - return $this->getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) + return $this->getAudiencesAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -15595,23 +22022,22 @@ function ($response) { } /** - * Operation getApplicationCustomersAsyncWithHttpInfo + * Operation getAudiencesAsyncWithHttpInfo * - * List application's customers + * List audiences * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiencesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20022'; - $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse20030'; + $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15648,47 +22074,33 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomers' + * Create request for operation 'getAudiences' * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getApplicationCustomersRequest($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = 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 getApplicationCustomers' - ); - } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomers, 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.getApplicationCustomers, 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}/customers'; + $resourcePath = '/v1/audiences'; $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); @@ -15704,6 +22116,13 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId $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); } @@ -15712,14 +22131,6 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId } - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -15796,44 +22207,38 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId } /** - * Operation getApplicationCustomersByAttributes + * Operation getAudiencesAnalytics * - * List application customers matching the given attributes + * List audience analytics * - * @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 this 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 $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\InlineResponse20023 + * @return \TalonOne\Client\Model\InlineResponse20031 */ - public function getApplicationCustomersByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiencesAnalytics($audienceIds, $sort = null) { - list($response) = $this->getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + list($response) = $this->getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort); return $response; } /** - * Operation getApplicationCustomersByAttributesWithHttpInfo + * Operation getAudiencesAnalyticsWithHttpInfo * - * List application customers matching the given attributes + * List audience analytics * - * @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 this 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 $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\InlineResponse20023, 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 getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiencesAnalyticsWithHttpInfo($audienceIds, $sort = null) { - $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + $request = $this->getAudiencesAnalyticsRequest($audienceIds, $sort); try { $options = $this->createHttpClientOption(); @@ -15866,20 +22271,20 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20023' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20031' === '\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\InlineResponse20031', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20023'; + $returnType = '\TalonOne\Client\Model\InlineResponse20031'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -15898,7 +22303,7 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20023', + '\TalonOne\Client\Model\InlineResponse20031', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15909,22 +22314,19 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, } /** - * Operation getApplicationCustomersByAttributesAsync + * Operation getAudiencesAnalyticsAsync * - * List application customers matching the given attributes + * List audience analytics * - * @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 this 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 $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 getApplicationCustomersByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiencesAnalyticsAsync($audienceIds, $sort = null) { - return $this->getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize) + return $this->getAudiencesAnalyticsAsyncWithHttpInfo($audienceIds, $sort) ->then( function ($response) { return $response[0]; @@ -15933,23 +22335,20 @@ function ($response) { } /** - * Operation getApplicationCustomersByAttributesAsyncWithHttpInfo + * Operation getAudiencesAnalyticsAsyncWithHttpInfo * - * List application customers matching the given attributes + * List audience analytics * - * @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 this 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 $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 getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getAudiencesAnalyticsAsyncWithHttpInfo($audienceIds, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20023'; - $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse20031'; + $request = $this->getAudiencesAnalyticsRequest($audienceIds, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15986,40 +22385,24 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomersByAttributes' + * Create request for operation 'getAudiencesAnalytics' * - * @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 this 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 $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 getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + protected function getAudiencesAnalyticsRequest($audienceIds, $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 getApplicationCustomersByAttributes' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'audienceIds' is set + if ($audienceIds === null || (is_array($audienceIds) && count($audienceIds) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling getApplicationCustomersByAttributes' + 'Missing the required parameter $audienceIds when calling getAudiencesAnalytics' ); } - 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/audiences/analytics'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16027,42 +22410,24 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b $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 (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($skip !== null) { - $queryParams['skip'] = $skip; + if ($sort !== null) { + $queryParams['sort'] = $sort; } // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + if (is_array($audienceIds)) { + $audienceIds = ObjectSerializer::serializeCollection($audienceIds, '', true); } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; + if ($audienceIds !== null) { + $queryParams['audienceIds'] = $audienceIds; } - // 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( @@ -16071,7 +22436,7 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -16128,7 +22493,7 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -16136,42 +22501,38 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b } /** - * Operation getApplicationEventTypes + * Operation getCampaign * - * List Applications event types + * Get campaign * * @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 this 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 $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\InlineResponse20029 + * @return \TalonOne\Client\Model\Campaign */ - public function getApplicationEventTypes($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getCampaign($applicationId, $campaignId) { - list($response) = $this->getApplicationEventTypesWithHttpInfo($applicationId, $pageSize, $skip, $sort); + list($response) = $this->getCampaignWithHttpInfo($applicationId, $campaignId); return $response; } /** - * Operation getApplicationEventTypesWithHttpInfo + * Operation getCampaignWithHttpInfo * - * List Applications event types + * Get campaign * * @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 this 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 $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\InlineResponse20029, 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 getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getCampaignWithHttpInfo($applicationId, $campaignId) { - $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); + $request = $this->getCampaignRequest($applicationId, $campaignId); try { $options = $this->createHttpClientOption(); @@ -16204,20 +22565,20 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20029' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Campaign' === '\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\Campaign', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20029'; + $returnType = '\TalonOne\Client\Model\Campaign'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -16236,7 +22597,7 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20029', + '\TalonOne\Client\Model\Campaign', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16247,21 +22608,19 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = } /** - * Operation getApplicationEventTypesAsync + * Operation getCampaignAsync * - * List Applications event types + * Get campaign * * @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 this 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 $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationEventTypesAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getCampaignAsync($applicationId, $campaignId) { - return $this->getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort) + return $this->getCampaignAsyncWithHttpInfo($applicationId, $campaignId) ->then( function ($response) { return $response[0]; @@ -16270,22 +22629,20 @@ function ($response) { } /** - * Operation getApplicationEventTypesAsyncWithHttpInfo + * Operation getCampaignAsyncWithHttpInfo * - * List Applications event types + * Get campaign * * @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 this 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 $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) + public function getCampaignAsyncWithHttpInfo($applicationId, $campaignId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20029'; - $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\Campaign'; + $request = $this->getCampaignRequest($applicationId, $campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16322,60 +22679,36 @@ function ($exception) { } /** - * Create request for operation 'getApplicationEventTypes' + * Create request for operation 'getCampaign' * * @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 this 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 $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null) + protected function getCampaignRequest($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 getApplicationEventTypes' + 'Missing the required parameter $applicationId when calling getCampaign' ); } - 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 '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/applications/{applicationId}/event_types'; + $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 @@ -16386,6 +22719,14 @@ protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1 $resourcePath ); } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -16462,64 +22803,44 @@ protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1 } /** - * Operation getApplicationEventsWithoutTotalCount + * Operation getCampaignAnalytics * - * List Applications events + * Get analytics of campaigns * * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 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\InlineResponse20028 + * @return \TalonOne\Client\Model\InlineResponse20021 */ - 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 getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - list($response) = $this->getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + list($response) = $this->getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); return $response; } /** - * Operation getApplicationEventsWithoutTotalCountWithHttpInfo + * Operation getCampaignAnalyticsWithHttpInfo * - * List Applications events + * Get analytics of campaigns * * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 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\InlineResponse20028, 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 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 getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - $request = $this->getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); try { $options = $this->createHttpClientOption(); @@ -16552,20 +22873,20 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20028' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20021' === '\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\InlineResponse20021', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20028'; + $returnType = '\TalonOne\Client\Model\InlineResponse20021'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -16584,7 +22905,7 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20028', + '\TalonOne\Client\Model\InlineResponse20021', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16595,32 +22916,22 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId } /** - * Operation getApplicationEventsWithoutTotalCountAsync + * Operation getCampaignAnalyticsAsync * - * List Applications events + * Get analytics of campaigns * * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 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 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 getCampaignAnalyticsAsync($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) { - return $this->getApplicationEventsWithoutTotalCountAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery) + return $this->getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity) ->then( function ($response) { return $response[0]; @@ -16629,33 +22940,23 @@ function ($response) { } /** - * Operation getApplicationEventsWithoutTotalCountAsyncWithHttpInfo + * Operation getCampaignAnalyticsAsyncWithHttpInfo * - * List Applications events + * Get analytics of campaigns * * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 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 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 getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = 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\InlineResponse20021'; + $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16692,52 +22993,45 @@ function ($exception) { } /** - * Create request for operation 'getApplicationEventsWithoutTotalCount' + * Create request for operation 'getCampaignAnalytics' * * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 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 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 getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = 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 getCampaignAnalytics' ); } - 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.'); + // 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' + ); } - - 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.'); + // 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 ($customerEmail !== null && strlen($customerEmail) < 2) { - throw new \InvalidArgumentException('invalid length for "$customerEmail" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 2.'); + // 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/applications/{applicationId}/events/no_total'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/analytics'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16745,102 +23039,25 @@ protected function getApplicationEventsWithoutTotalCountRequest($applicationId, $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 (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - if ($referralCode !== null) { - $queryParams['referralCode'] = $referralCode; + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; } // query params - if (is_array($ruleQuery)) { - $ruleQuery = ObjectSerializer::serializeCollection($ruleQuery, '', true); + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); } - if ($ruleQuery !== null) { - $queryParams['ruleQuery'] = $ruleQuery; + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; } // query params - if (is_array($campaignQuery)) { - $campaignQuery = ObjectSerializer::serializeCollection($campaignQuery, '', true); + if (is_array($granularity)) { + $granularity = ObjectSerializer::serializeCollection($granularity, '', true); } - if ($campaignQuery !== null) { - $queryParams['campaignQuery'] = $campaignQuery; + if ($granularity !== null) { + $queryParams['granularity'] = $granularity; } @@ -16852,6 +23069,14 @@ protected function getApplicationEventsWithoutTotalCountRequest($applicationId, $resourcePath ); } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -16928,38 +23153,46 @@ protected function getApplicationEventsWithoutTotalCountRequest($applicationId, } /** - * Operation getApplicationSession + * Operation getCampaignByAttributes * - * Get Application session + * 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 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 \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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\ApplicationSession + * @return \TalonOne\Client\Model\InlineResponse2006 */ - public function getApplicationSession($applicationId, $sessionId) + public function getCampaignByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { - list($response) = $this->getApplicationSessionWithHttpInfo($applicationId, $sessionId); + list($response) = $this->getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState); return $response; } /** - * Operation getApplicationSessionWithHttpInfo + * Operation getCampaignByAttributesWithHttpInfo * - * Get Application session + * 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 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 \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) * * @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\InlineResponse2006, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) + public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { - $request = $this->getApplicationSessionRequest($applicationId, $sessionId); + $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); try { $options = $this->createHttpClientOption(); @@ -16992,20 +23225,20 @@ public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationSession' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2006' === '\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\InlineResponse2006', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationSession'; + $returnType = '\TalonOne\Client\Model\InlineResponse2006'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17024,7 +23257,7 @@ public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationSession', + '\TalonOne\Client\Model\InlineResponse2006', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17035,19 +23268,23 @@ public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) } /** - * Operation getApplicationSessionAsync + * Operation getCampaignByAttributesAsync * - * Get Application session + * 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 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 \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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationSessionAsync($applicationId, $sessionId) + public function getCampaignByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { - return $this->getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) + return $this->getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState) ->then( function ($response) { return $response[0]; @@ -17056,20 +23293,24 @@ function ($response) { } /** - * Operation getApplicationSessionAsyncWithHttpInfo + * Operation getCampaignByAttributesAsyncWithHttpInfo * - * Get Application session + * 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 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 \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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) + public function getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) { - $returnType = '\TalonOne\Client\Model\ApplicationSession'; - $request = $this->getApplicationSessionRequest($applicationId, $sessionId); + $returnType = '\TalonOne\Client\Model\InlineResponse2006'; + $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17106,36 +23347,75 @@ function ($exception) { } /** - * Create request for operation 'getApplicationSession' + * Create request for operation 'getCampaignByAttributes' * * @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 \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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationSessionRequest($applicationId, $sessionId) + 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 getApplicationSession' + 'Missing the required parameter $applicationId when calling getCampaignByAttributes' ); } - // verify the required parameter 'sessionId' is set - if ($sessionId === null || (is_array($sessionId) && count($sessionId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $sessionId when calling getApplicationSession' + '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.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCampaignByAttributes, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/applications/{applicationId}/sessions/{sessionId}'; + + $resourcePath = '/v1/applications/{applicationId}/campaigns_search'; $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($campaignState)) { + $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); + } + if ($campaignState !== null) { + $queryParams['campaignState'] = $campaignState; + } // path params @@ -17146,17 +23426,12 @@ protected function getApplicationSessionRequest($applicationId, $sessionId) $resourcePath ); } - // path params - if ($sessionId !== null) { - $resourcePath = str_replace( - '{' . 'sessionId' . '}', - ObjectSerializer::toPathValue($sessionId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -17165,7 +23440,7 @@ protected function getApplicationSessionRequest($applicationId, $sessionId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -17222,7 +23497,7 @@ protected function getApplicationSessionRequest($applicationId, $sessionId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17230,56 +23505,36 @@ protected function getApplicationSessionRequest($applicationId, $sessionId) } /** - * Operation getApplicationSessions + * Operation getCampaignGroup * - * List Application sessions + * Get campaign access group * - * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 int $campaignGroupId The ID of the campaign access group. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20027 + * @return \TalonOne\Client\Model\CampaignGroup */ - public function getApplicationSessions($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null) + public function getCampaignGroup($campaignGroupId) { - list($response) = $this->getApplicationSessionsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId); + list($response) = $this->getCampaignGroupWithHttpInfo($campaignGroupId); return $response; } /** - * Operation getApplicationSessionsWithHttpInfo + * Operation getCampaignGroupWithHttpInfo * - * List Application sessions + * Get campaign access group * - * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 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\InlineResponse20027, 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 getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $profile = null, $state = null, $createdBefore = null, $createdAfter = null, $coupon = null, $referral = null, $integrationId = null) + public function getCampaignGroupWithHttpInfo($campaignGroupId) { - $request = $this->getApplicationSessionsRequest($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId); + $request = $this->getCampaignGroupRequest($campaignGroupId); try { $options = $this->createHttpClientOption(); @@ -17312,20 +23567,20 @@ public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1 $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20027' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CampaignGroup' === '\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\CampaignGroup', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20027'; + $returnType = '\TalonOne\Client\Model\CampaignGroup'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17344,7 +23599,7 @@ public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1 case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20027', + '\TalonOne\Client\Model\CampaignGroup', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17355,28 +23610,18 @@ public function getApplicationSessionsWithHttpInfo($applicationId, $pageSize = 1 } /** - * Operation getApplicationSessionsAsync + * Operation getCampaignGroupAsync * - * List Application sessions + * Get campaign access group * - * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 int $campaignGroupId The ID of the campaign access group. (required) * * @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) + public function getCampaignGroupAsync($campaignGroupId) { - return $this->getApplicationSessionsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId) + return $this->getCampaignGroupAsyncWithHttpInfo($campaignGroupId) ->then( function ($response) { return $response[0]; @@ -17385,29 +23630,19 @@ function ($response) { } /** - * Operation getApplicationSessionsAsyncWithHttpInfo + * Operation getCampaignGroupAsyncWithHttpInfo * - * List Application sessions + * Get campaign access group * - * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 int $campaignGroupId The ID of the campaign access group. (required) * * @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) + public function getCampaignGroupAsyncWithHttpInfo($campaignGroupId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20027'; - $request = $this->getApplicationSessionsRequest($applicationId, $pageSize, $skip, $sort, $profile, $state, $createdBefore, $createdAfter, $coupon, $referral, $integrationId); + $returnType = '\TalonOne\Client\Model\CampaignGroup'; + $request = $this->getCampaignGroupRequest($campaignGroupId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17444,123 +23679,36 @@ function ($exception) { } /** - * Create request for operation 'getApplicationSessions' + * Create request for operation 'getCampaignGroup' * - * @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 this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. 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 int $campaignGroupId The ID of the campaign access group. (required) * * @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) + protected function getCampaignGroupRequest($campaignGroupId) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'campaignGroupId' is set + if ($campaignGroupId === null || (is_array($campaignGroupId) && count($campaignGroupId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationSessions' + 'Missing the required parameter $campaignGroupId when calling getCampaignGroup' ); } - if ($pageSize !== null && $pageSize > 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.getApplicationSessions, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/sessions'; + $resourcePath = '/v1/campaign_groups/{campaignGroupId}'; $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($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; - } // path params - if ($applicationId !== null) { + if ($campaignGroupId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'campaignGroupId' . '}', + ObjectSerializer::toPathValue($campaignGroupId), $resourcePath ); } @@ -17640,40 +23788,40 @@ protected function getApplicationSessionsRequest($applicationId, $pageSize = 100 } /** - * Operation getApplications + * Operation getCampaignGroups * - * List Applications + * List campaign access groups * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse20011 */ - public function getApplications($pageSize = 1000, $skip = null, $sort = null) + public function getCampaignGroups($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getApplicationsWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->getCampaignGroupsWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getApplicationsWithHttpInfo + * Operation getCampaignGroupsWithHttpInfo * - * List Applications + * List campaign access groups * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse20011, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getCampaignGroupsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getApplicationsRequest($pageSize, $skip, $sort); + $request = $this->getCampaignGroupsRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -17706,20 +23854,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\InlineResponse20011' === '\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\InlineResponse20011', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2005'; + $returnType = '\TalonOne\Client\Model\InlineResponse20011'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17738,7 +23886,7 @@ public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sor case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2005', + '\TalonOne\Client\Model\InlineResponse20011', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17749,20 +23897,20 @@ public function getApplicationsWithHttpInfo($pageSize = 1000, $skip = null, $sor } /** - * Operation getApplicationsAsync + * Operation getCampaignGroupsAsync * - * List Applications + * List campaign access groups * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getApplicationsAsync($pageSize = 1000, $skip = null, $sort = null) + public function getCampaignGroupsAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getApplicationsAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->getCampaignGroupsAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -17771,21 +23919,21 @@ function ($response) { } /** - * Operation getApplicationsAsyncWithHttpInfo + * Operation getCampaignGroupsAsyncWithHttpInfo * - * List Applications + * List campaign access groups * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getApplicationsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getCampaignGroupsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse2005'; - $request = $this->getApplicationsRequest($pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\InlineResponse20011'; + $request = $this->getCampaignGroupsRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17822,26 +23970,26 @@ function ($exception) { } /** - * Create request for operation 'getApplications' + * Create request for operation 'getCampaignGroups' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getApplicationsRequest($pageSize = 1000, $skip = null, $sort = null) + protected function getCampaignGroupsRequest($pageSize = 1000, $skip = null, $sort = null) { 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.getCampaignGroups, 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.getCampaignGroups, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications'; + $resourcePath = '/v1/campaign_groups'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17947,36 +24095,48 @@ protected function getApplicationsRequest($pageSize = 1000, $skip = null, $sort } /** - * Operation getAttribute + * Operation getCampaignTemplates * - * Get custom attribute + * List campaign templates * - * @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 $pageSize The number of items in 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\Attribute + * @return \TalonOne\Client\Model\InlineResponse20012 */ - public function getAttribute($attributeId) + public function getCampaignTemplates($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - list($response) = $this->getAttributeWithHttpInfo($attributeId); + list($response) = $this->getCampaignTemplatesWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId); return $response; } /** - * Operation getAttributeWithHttpInfo + * Operation getCampaignTemplatesWithHttpInfo * - * Get custom attribute + * List campaign templates * - * @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 $pageSize The number of items in 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\Attribute, 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 getAttributeWithHttpInfo($attributeId) + public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - $request = $this->getAttributeRequest($attributeId); + $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); try { $options = $this->createHttpClientOption(); @@ -18009,20 +24169,20 @@ public function getAttributeWithHttpInfo($attributeId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Attribute' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20012' === '\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\InlineResponse20012', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Attribute'; + $returnType = '\TalonOne\Client\Model\InlineResponse20012'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18041,7 +24201,7 @@ public function getAttributeWithHttpInfo($attributeId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Attribute', + '\TalonOne\Client\Model\InlineResponse20012', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18052,18 +24212,24 @@ public function getAttributeWithHttpInfo($attributeId) } /** - * Operation getAttributeAsync + * Operation getCampaignTemplatesAsync * - * Get custom attribute + * List campaign templates * - * @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 $pageSize The number of items in 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 getAttributeAsync($attributeId) + public function getCampaignTemplatesAsync($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - return $this->getAttributeAsyncWithHttpInfo($attributeId) + return $this->getCampaignTemplatesAsyncWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId) ->then( function ($response) { return $response[0]; @@ -18072,19 +24238,25 @@ function ($response) { } /** - * Operation getAttributeAsyncWithHttpInfo + * Operation getCampaignTemplatesAsyncWithHttpInfo * - * Get custom attribute + * List campaign templates * - * @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 $pageSize The number of items in 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 getAttributeAsyncWithHttpInfo($attributeId) + public function getCampaignTemplatesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) { - $returnType = '\TalonOne\Client\Model\Attribute'; - $request = $this->getAttributeRequest($attributeId); + $returnType = '\TalonOne\Client\Model\InlineResponse20012'; + $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18121,39 +24293,87 @@ function ($exception) { } /** - * Create request for operation 'getAttribute' + * Create request for operation 'getCampaignTemplates' * - * @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 $pageSize The number of items in 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 getAttributeRequest($attributeId) + protected function getCampaignTemplatesRequest($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = 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 getAttribute' - ); + if ($pageSize !== null && $pageSize > 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.getCampaignTemplates, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/attributes/{attributeId}'; + + $resourcePath = '/v1/campaign_templates'; $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($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 ($attributeId !== null) { - $resourcePath = str_replace( - '{' . 'attributeId' . '}', - ObjectSerializer::toPathValue($attributeId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -18230,42 +24450,58 @@ protected function getAttributeRequest($attributeId) } /** - * Operation getAttributes + * Operation getCampaigns * - * List custom attributes + * List campaigns * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 $entity Returned attributes will be filtered by supplied entity. (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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20032 + * @return \TalonOne\Client\Model\InlineResponse2006|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getAttributes($pageSize = 1000, $skip = null, $sort = null, $entity = null) + 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->getAttributesWithHttpInfo($pageSize, $skip, $sort, $entity); + list($response) = $this->getCampaignsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); return $response; } /** - * Operation getAttributesWithHttpInfo + * Operation getCampaignsWithHttpInfo * - * List custom attributes + * List campaigns * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 $entity Returned attributes will be filtered by supplied entity. (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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20032, 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 getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) + 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->getAttributesRequest($pageSize, $skip, $sort, $entity); + $request = $this->getCampaignsRequest($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); try { $options = $this->createHttpClientOption(); @@ -18298,20 +24534,32 @@ public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20032' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2006' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20032', []), + 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\InlineResponse20032'; + $returnType = '\TalonOne\Client\Model\InlineResponse2006'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18330,7 +24578,15 @@ public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20032', + '\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); @@ -18341,21 +24597,29 @@ public function getAttributesWithHttpInfo($pageSize = 1000, $skip = null, $sort } /** - * Operation getAttributesAsync + * Operation getCampaignsAsync * - * List custom attributes + * List campaigns * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 $entity Returned attributes will be filtered by supplied entity. (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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAttributesAsync($pageSize = 1000, $skip = null, $sort = null, $entity = null) + 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->getAttributesAsyncWithHttpInfo($pageSize, $skip, $sort, $entity) + return $this->getCampaignsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId) ->then( function ($response) { return $response[0]; @@ -18364,22 +24628,30 @@ function ($response) { } /** - * Operation getAttributesAsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * List custom attributes + * List campaigns * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 $entity Returned attributes will be filtered by supplied entity. (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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAttributesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $entity = null) + 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\InlineResponse20032'; - $request = $this->getAttributesRequest($pageSize, $skip, $sort, $entity); + $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()) @@ -18416,27 +24688,41 @@ function ($exception) { } /** - * Create request for operation 'getAttributes' + * Create request for operation 'getCampaigns' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 $entity Returned attributes will be filtered by supplied entity. (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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAttributesRequest($pageSize = 1000, $skip = null, $sort = null, $entity = null) + 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 getCampaigns' + ); + } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getAttributes, 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.getAttributes, 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/attributes'; + $resourcePath = '/v1/applications/{applicationId}/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18465,14 +24751,71 @@ protected function getAttributesRequest($pageSize = 1000, $skip = null, $sort = $queryParams['sort'] = $sort; } // query params - if (is_array($entity)) { - $entity = ObjectSerializer::serializeCollection($entity, '', true); + if (is_array($campaignState)) { + $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); } - if ($entity !== null) { - $queryParams['entity'] = $entity; + 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 + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -18549,42 +24892,56 @@ protected function getAttributesRequest($pageSize = 1000, $skip = null, $sort = } /** - * Operation getAudiences + * Operation getChanges * - * List audiences + * Get audit logs for an account * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse20030 + * @return \TalonOne\Client\Model\InlineResponse20042 */ - public function getAudiences($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = 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->getAudiencesWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize); + list($response) = $this->getChangesWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); return $response; } /** - * Operation getAudiencesWithHttpInfo + * Operation getChangesWithHttpInfo * - * List audiences + * Get audit logs for an account * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse20030, 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 getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = 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->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); + $request = $this->getChangesRequest($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); try { $options = $this->createHttpClientOption(); @@ -18617,20 +24974,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\InlineResponse20042' === '\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\InlineResponse20042', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20030'; + $returnType = '\TalonOne\Client\Model\InlineResponse20042'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18649,7 +25006,7 @@ public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20030', + '\TalonOne\Client\Model\InlineResponse20042', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18660,21 +25017,28 @@ public function getAudiencesWithHttpInfo($pageSize = 1000, $skip = null, $sort = } /** - * Operation getAudiencesAsync + * Operation getChangesAsync * - * List audiences + * Get audit logs for an account * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getAudiencesAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = 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->getAudiencesAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize) + return $this->getChangesAsyncWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld) ->then( function ($response) { return $response[0]; @@ -18683,22 +25047,29 @@ function ($response) { } /** - * Operation getAudiencesAsyncWithHttpInfo + * Operation getChangesAsyncWithHttpInfo * - * List audiences + * Get audit logs for an account * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getAudiencesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = 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\InlineResponse20030'; - $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize); + $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()) @@ -18735,27 +25106,34 @@ function ($exception) { } /** - * Create request for operation 'getAudiences' + * Create request for operation 'getChanges' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getAudiencesRequest($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = 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) { 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.getChanges, 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.getChanges, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/audiences'; + $resourcePath = '/v1/changes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18784,12 +25162,61 @@ protected function getAudiencesRequest($pageSize = 1000, $skip = null, $sort = n $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; + } @@ -18868,38 +25295,40 @@ protected function getAudiencesRequest($pageSize = 1000, $skip = null, $sort = n } /** - * Operation getCampaign + * Operation getCollection * - * Get campaign + * Get 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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Campaign + * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCampaign($applicationId, $campaignId) + public function getCollection($applicationId, $campaignId, $collectionId) { - list($response) = $this->getCampaignWithHttpInfo($applicationId, $campaignId); + list($response) = $this->getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); return $response; } /** - * Operation getCampaignWithHttpInfo + * Operation getCollectionWithHttpInfo * - * Get campaign + * Get 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) * * @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\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignWithHttpInfo($applicationId, $campaignId) + public function getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) { - $request = $this->getCampaignRequest($applicationId, $campaignId); + $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); try { $options = $this->createHttpClientOption(); @@ -18932,20 +25361,32 @@ public function getCampaignWithHttpInfo($applicationId, $campaignId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Campaign' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Collection' === '\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\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\Campaign'; + $returnType = '\TalonOne\Client\Model\Collection'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18964,7 +25405,15 @@ public function getCampaignWithHttpInfo($applicationId, $campaignId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Campaign', + '\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); @@ -18975,19 +25424,20 @@ public function getCampaignWithHttpInfo($applicationId, $campaignId) } /** - * Operation getCampaignAsync + * Operation getCollectionAsync * - * Get campaign + * Get 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAsync($applicationId, $campaignId) + public function getCollectionAsync($applicationId, $campaignId, $collectionId) { - return $this->getCampaignAsyncWithHttpInfo($applicationId, $campaignId) + return $this->getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) ->then( function ($response) { return $response[0]; @@ -18996,20 +25446,21 @@ function ($response) { } /** - * Operation getCampaignAsyncWithHttpInfo + * Operation getCollectionAsyncWithHttpInfo * - * Get campaign + * Get 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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAsyncWithHttpInfo($applicationId, $campaignId) + public function getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) { - $returnType = '\TalonOne\Client\Model\Campaign'; - $request = $this->getCampaignRequest($applicationId, $campaignId); + $returnType = '\TalonOne\Client\Model\Collection'; + $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19046,30 +25497,37 @@ function ($exception) { } /** - * Create request for operation 'getCampaign' + * Create request for operation 'getCollection' * * @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 getCampaignRequest($applicationId, $campaignId) + protected function getCollectionRequest($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 getCampaign' + '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 getCampaign' + 'Missing the required parameter $campaignId when calling getCollection' + ); + } + // 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' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19094,6 +25552,14 @@ protected function getCampaignRequest($applicationId, $campaignId) $resourcePath ); } + // path params + if ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -19170,44 +25636,40 @@ protected function getCampaignRequest($applicationId, $campaignId) } /** - * Operation getCampaignAnalytics + * Operation getCollectionItems * - * Get analytics of campaigns + * Get collection items * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20021 + * @return \TalonOne\Client\Model\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCampaignAnalytics($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getCollectionItems($collectionId, $pageSize = 1000, $skip = null) { - list($response) = $this->getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); + list($response) = $this->getCollectionItemsWithHttpInfo($collectionId, $pageSize, $skip); return $response; } /** - * Operation getCampaignAnalyticsWithHttpInfo + * Operation getCollectionItemsWithHttpInfo * - * Get analytics of campaigns + * Get collection items * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @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) * * @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\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) { - $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); + $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); try { $options = $this->createHttpClientOption(); @@ -19240,20 +25702,32 @@ public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $r $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20021' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20018' === '\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\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\InlineResponse20021'; + $returnType = '\TalonOne\Client\Model\InlineResponse20018'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19272,7 +25746,15 @@ public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $r case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20021', + '\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); @@ -19283,22 +25765,20 @@ public function getCampaignAnalyticsWithHttpInfo($applicationId, $campaignId, $r } /** - * Operation getCampaignAnalyticsAsync + * Operation getCollectionItemsAsync * - * Get analytics of campaigns + * Get collection items * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAnalyticsAsync($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getCollectionItemsAsync($collectionId, $pageSize = 1000, $skip = null) { - return $this->getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity) + return $this->getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize, $skip) ->then( function ($response) { return $response[0]; @@ -19307,23 +25787,21 @@ function ($response) { } /** - * Operation getCampaignAnalyticsAsyncWithHttpInfo + * Operation getCollectionItemsAsyncWithHttpInfo * - * Get analytics of campaigns + * Get collection items * - * @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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignAnalyticsAsyncWithHttpInfo($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = null) + public function getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20021'; - $request = $this->getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity); + $returnType = '\TalonOne\Client\Model\InlineResponse20018'; + $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19360,45 +25838,32 @@ function ($exception) { } /** - * Create request for operation 'getCampaignAnalytics' + * 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 $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. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (required) - * @param string $granularity The time interval between the results in the returned time-series. (optional) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignAnalyticsRequest($applicationId, $campaignId, $rangeStart, $rangeEnd, $granularity = 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 getCampaignAnalytics' - ); - } - // 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 getCampaignAnalytics' + 'Missing the required parameter $collectionId when calling getCollectionItems' ); } - // 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.getCollectionItems, 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.getCollectionItems, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/analytics'; + + $resourcePath = '/v1/collections/{collectionId}/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19406,41 +25871,26 @@ protected function getCampaignAnalyticsRequest($applicationId, $campaignId, $ran $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 (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; } // query params - if (is_array($granularity)) { - $granularity = ObjectSerializer::serializeCollection($granularity, '', true); + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); } - if ($granularity !== null) { - $queryParams['granularity'] = $granularity; + if ($skip !== null) { + $queryParams['skip'] = $skip; } // 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 ); } @@ -19520,46 +25970,62 @@ protected function getCampaignAnalyticsRequest($applicationId, $campaignId, $ran } /** - * Operation getCampaignByAttributes + * Operation getCouponsWithoutTotalCount * - * List campaigns that match the given attributes + * List coupons * * @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 this response. (optional, default to 1000) + * @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 $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 $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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2006 + * @return \TalonOne\Client\Model\InlineResponse2009 */ - public function getCampaignByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + 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) { - list($response) = $this->getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState); + list($response) = $this->getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); return $response; } /** - * Operation getCampaignByAttributesWithHttpInfo + * Operation getCouponsWithoutTotalCountWithHttpInfo * - * List campaigns that match the given attributes + * List coupons * * @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 this response. (optional, default to 1000) + * @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 $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 $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) * * @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\InlineResponse2009, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + 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) { - $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); + $request = $this->getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); try { $options = $this->createHttpClientOption(); @@ -19592,20 +26058,20 @@ public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $page $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2006' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2009' === '\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\InlineResponse2009', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2006'; + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19624,7 +26090,7 @@ public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $page case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2006', + '\TalonOne\Client\Model\InlineResponse2009', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19635,23 +26101,31 @@ public function getCampaignByAttributesWithHttpInfo($applicationId, $body, $page } /** - * Operation getCampaignByAttributesAsync + * Operation getCouponsWithoutTotalCountAsync * - * List campaigns that match the given attributes + * List coupons * * @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 this response. (optional, default to 1000) + * @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 $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 $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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + 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) { - return $this->getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $campaignState) + return $this->getCouponsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch) ->then( function ($response) { return $response[0]; @@ -19660,24 +26134,32 @@ function ($response) { } /** - * Operation getCampaignByAttributesAsyncWithHttpInfo + * Operation getCouponsWithoutTotalCountAsyncWithHttpInfo * - * List campaigns that match the given attributes + * List coupons * * @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 this response. (optional, default to 1000) + * @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 $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 $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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + 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) { - $returnType = '\TalonOne\Client\Model\InlineResponse2006'; - $request = $this->getCampaignByAttributesRequest($applicationId, $body, $pageSize, $skip, $sort, $campaignState); + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; + $request = $this->getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19714,41 +26196,49 @@ function ($exception) { } /** - * Create request for operation 'getCampaignByAttributes' + * Create request for operation 'getCouponsWithoutTotalCount' * * @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 this response. (optional, default to 1000) + * @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 $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 $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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCampaignByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $campaignState = null) + 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) { // 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' + 'Missing the required parameter $applicationId when calling getCouponsWithoutTotalCount' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling getCampaignByAttributes' + 'Missing the required parameter $campaignId when calling getCouponsWithoutTotalCount' ); } 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.getCouponsWithoutTotalCount, 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.getCouponsWithoutTotalCount, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns_search'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19777,11 +26267,67 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi $queryParams['sort'] = $sort; } // query params - if (is_array($campaignState)) { - $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); + if (is_array($value)) { + $value = ObjectSerializer::serializeCollection($value, '', true); } - if ($campaignState !== null) { - $queryParams['campaignState'] = $campaignState; + 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; } @@ -19793,12 +26339,17 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi $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( @@ -19807,7 +26358,7 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -19864,7 +26415,7 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19872,48 +26423,46 @@ protected function getCampaignByAttributesRequest($applicationId, $body, $pageSi } /** - * Operation getCampaignTemplates + * Operation getCustomerActivityReport * - * List campaign templates + * Get customer's activity report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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\InlineResponse20011 + * @return \TalonOne\Client\Model\CustomerActivityReport */ - public function getCampaignTemplates($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCustomerActivityReport($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - list($response) = $this->getCampaignTemplatesWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId); + list($response) = $this->getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); return $response; } /** - * Operation getCampaignTemplatesWithHttpInfo + * Operation getCustomerActivityReportWithHttpInfo * - * List campaign templates + * Get customer's activity report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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\InlineResponse20011, 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 getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); + $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); try { $options = $this->createHttpClientOption(); @@ -19946,20 +26495,20 @@ public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20011' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CustomerActivityReport' === '\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\CustomerActivityReport', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20011'; + $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19978,7 +26527,7 @@ public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20011', + '\TalonOne\Client\Model\CustomerActivityReport', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19989,24 +26538,23 @@ public function getCampaignTemplatesWithHttpInfo($pageSize = 1000, $skip = null, } /** - * Operation getCampaignTemplatesAsync + * Operation getCustomerActivityReportAsync * - * List campaign templates + * Get customer's activity report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 getCampaignTemplatesAsync($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCustomerActivityReportAsync($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - return $this->getCampaignTemplatesAsyncWithHttpInfo($pageSize, $skip, $sort, $state, $name, $tags, $userId) + return $this->getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip) ->then( function ($response) { return $response[0]; @@ -20015,25 +26563,24 @@ function ($response) { } /** - * Operation getCampaignTemplatesAsyncWithHttpInfo + * Operation getCustomerActivityReportAsyncWithHttpInfo * - * List campaign templates + * Get customer's activity report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 getCampaignTemplatesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = null) + public function getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20011'; - $request = $this->getCampaignTemplatesRequest($pageSize, $skip, $sort, $state, $name, $tags, $userId); + $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; + $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20070,30 +26617,53 @@ function ($exception) { } /** - * Create request for operation 'getCampaignTemplates' + * Create request for operation 'getCustomerActivityReport' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 getCampaignTemplatesRequest($pageSize = 1000, $skip = null, $sort = null, $state = null, $name = null, $tags = null, $userId = 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 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.getCampaignTemplates, must be smaller than or equal to 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.getCampaignTemplates, 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/campaign_templates'; + $resourcePath = '/v1/applications/{applicationId}/customer_activity_reports/{customerId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20115,42 +26685,37 @@ protected function getCampaignTemplatesRequest($pageSize = 1000, $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 (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - if ($tags !== null) { - $queryParams['tags'] = $tags; + if ($rangeStart !== null) { + $queryParams['rangeStart'] = $rangeStart; } // query params - if (is_array($userId)) { - $userId = ObjectSerializer::serializeCollection($userId, '', true); + if (is_array($rangeEnd)) { + $rangeEnd = ObjectSerializer::serializeCollection($rangeEnd, '', true); } - if ($userId !== null) { - $queryParams['userId'] = $userId; + if ($rangeEnd !== null) { + $queryParams['rangeEnd'] = $rangeEnd; } + // 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; @@ -20227,58 +26792,54 @@ protected function getCampaignTemplatesRequest($pageSize = 1000, $skip = null, $ } /** - * Operation getCampaigns + * Operation getCustomerActivityReportsWithoutTotalCount * - * List campaigns + * 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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 $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\InlineResponse2006|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20026 */ - 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 getCustomerActivityReportsWithoutTotalCount($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - list($response) = $this->getCampaignsWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); + list($response) = $this->getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); return $response; } /** - * Operation getCampaignsWithHttpInfo + * Operation getCustomerActivityReportsWithoutTotalCountWithHttpInfo * - * List campaigns + * 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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 $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\InlineResponse2006|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 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 getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - $request = $this->getCampaignsRequest($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); + $request = $this->getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); try { $options = $this->createHttpClientOption(); @@ -20311,32 +26872,20 @@ public function getCampaignsWithHttpInfo($applicationId, $pageSize = 1000, $skip $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2006' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2006', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20026' === '\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\InlineResponse20026', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2006'; + $returnType = '\TalonOne\Client\Model\InlineResponse20026'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20355,15 +26904,7 @@ public function getCampaignsWithHttpInfo($applicationId, $pageSize = 1000, $skip case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2006', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\InlineResponse20026', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20374,29 +26915,27 @@ public function getCampaignsWithHttpInfo($applicationId, $pageSize = 1000, $skip } /** - * Operation getCampaignsAsync + * Operation getCustomerActivityReportsWithoutTotalCountAsync * - * List campaigns + * 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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 $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 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 getCustomerActivityReportsWithoutTotalCountAsync($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - return $this->getCampaignsAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId) + return $this->getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName) ->then( function ($response) { return $response[0]; @@ -20405,30 +26944,28 @@ function ($response) { } /** - * Operation getCampaignsAsyncWithHttpInfo + * Operation getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo * - * List campaigns + * 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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 $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 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 getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse2006'; - $request = $this->getCampaignsRequest($applicationId, $pageSize, $skip, $sort, $campaignState, $name, $tags, $createdBefore, $createdAfter, $campaignGroupId, $templateId, $storeId); + $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()) @@ -20465,41 +27002,51 @@ function ($exception) { } /** - * Create request for operation 'getCampaigns' + * 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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 $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 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 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 getCampaigns' + 'Missing the required parameter $applicationId when calling getCustomerActivityReportsWithoutTotalCount' ); } 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.getCustomerActivityReportsWithoutTotalCount, 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.getCustomerActivityReportsWithoutTotalCount, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns'; + $resourcePath = '/v1/applications/{applicationId}/customer_activity_reports/no_total'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20528,11 +27075,18 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = $queryParams['sort'] = $sort; } // query params - if (is_array($campaignState)) { - $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); + if (is_array($rangeStart)) { + $rangeStart = ObjectSerializer::serializeCollection($rangeStart, '', true); } - if ($campaignState !== null) { - $queryParams['campaignState'] = $campaignState; + 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)) { @@ -20542,46 +27096,25 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = $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 (is_array($integrationId)) { + $integrationId = ObjectSerializer::serializeCollection($integrationId, '', true); } - if ($campaignGroupId !== null) { - $queryParams['campaignGroupId'] = $campaignGroupId; + if ($integrationId !== null) { + $queryParams['integrationId'] = $integrationId; } // query params - if (is_array($templateId)) { - $templateId = ObjectSerializer::serializeCollection($templateId, '', true); + if (is_array($campaignName)) { + $campaignName = ObjectSerializer::serializeCollection($campaignName, '', true); } - if ($templateId !== null) { - $queryParams['templateId'] = $templateId; + if ($campaignName !== null) { + $queryParams['campaignName'] = $campaignName; } // query params - if (is_array($storeId)) { - $storeId = ObjectSerializer::serializeCollection($storeId, '', true); + if (is_array($advocateName)) { + $advocateName = ObjectSerializer::serializeCollection($advocateName, '', true); } - if ($storeId !== null) { - $queryParams['storeId'] = $storeId; + if ($advocateName !== null) { + $queryParams['advocateName'] = $advocateName; } @@ -20669,56 +27202,44 @@ protected function getCampaignsRequest($applicationId, $pageSize = 1000, $skip = } /** - * Operation getChanges + * Operation getCustomerAnalytics * - * Get audit logs for an account + * Get customer's analytics report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 timezone. 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 timezone. 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\InlineResponse20040 + * @return \TalonOne\Client\Model\CustomerAnalytics */ - 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 getCustomerAnalytics($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getChangesWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); + list($response) = $this->getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort); return $response; } /** - * Operation getChangesWithHttpInfo + * Operation getCustomerAnalyticsWithHttpInfo * - * Get audit logs for an account + * Get customer's analytics report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 timezone. 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 timezone. 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\InlineResponse20040, 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 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 getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getChangesRequest($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); + $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -20751,20 +27272,20 @@ public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = n $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20040' === '\SplFileObject') { + if ('\TalonOne\Client\Model\CustomerAnalytics' === '\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\CustomerAnalytics', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20040'; + $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20783,7 +27304,7 @@ public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20040', + '\TalonOne\Client\Model\CustomerAnalytics', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20794,28 +27315,22 @@ public function getChangesWithHttpInfo($pageSize = 1000, $skip = null, $sort = n } /** - * Operation getChangesAsync + * Operation getCustomerAnalyticsAsync * - * Get audit logs for an account + * Get customer's analytics report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 timezone. 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 timezone. 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 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 getCustomerAnalyticsAsync($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getChangesAsyncWithHttpInfo($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld) + return $this->getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -20824,29 +27339,23 @@ function ($response) { } /** - * Operation getChangesAsyncWithHttpInfo + * Operation getCustomerAnalyticsAsyncWithHttpInfo * - * Get audit logs for an account + * Get customer's analytics report * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 timezone. 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 timezone. 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 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 getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20040'; - $request = $this->getChangesRequest($pageSize, $skip, $sort, $applicationId, $entityPath, $userId, $createdBefore, $createdAfter, $withTotalResultSize, $managementKeyId, $includeOld); + $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; + $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20883,34 +27392,40 @@ function ($exception) { } /** - * Create request for operation 'getChanges' + * Create request for operation 'getCustomerAnalytics' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 timezone. 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 timezone. 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 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 getCustomerAnalyticsRequest($applicationId, $customerId, $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 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.getChanges, 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.getChanges, 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/changes'; + $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}/analytics'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20938,65 +27453,25 @@ protected function getChangesRequest($pageSize = 1000, $skip = null, $sort = nul if ($sort !== null) { $queryParams['sort'] = $sort; } - // query params - if (is_array($applicationId)) { - $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); - } + + + // path params 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); + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); } - if ($includeOld !== null) { - $queryParams['includeOld'] = $includeOld; + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); } - - // body params $_tempBody = null; @@ -21072,40 +27547,36 @@ protected function getChangesRequest($pageSize = 1000, $skip = null, $sort = nul } /** - * Operation getCollection + * Operation getCustomerProfile * - * Get campaign-level collection + * Get customer profile * - * @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 $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\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\CustomerProfile */ - public function getCollection($applicationId, $campaignId, $collectionId) + public function getCustomerProfile($customerId) { - list($response) = $this->getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId); + list($response) = $this->getCustomerProfileWithHttpInfo($customerId); return $response; } /** - * Operation getCollectionWithHttpInfo + * Operation getCustomerProfileWithHttpInfo * - * Get campaign-level collection + * Get customer profile * - * @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 $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\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 getCollectionWithHttpInfo($applicationId, $campaignId, $collectionId) + public function getCustomerProfileWithHttpInfo($customerId) { - $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); + $request = $this->getCustomerProfileRequest($customerId); try { $options = $this->createHttpClientOption(); @@ -21138,32 +27609,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\CustomerProfile' === '\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\CustomerProfile', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Collection'; + $returnType = '\TalonOne\Client\Model\CustomerProfile'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21182,15 +27641,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\CustomerProfile', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21201,20 +27652,18 @@ public function getCollectionWithHttpInfo($applicationId, $campaignId, $collecti } /** - * Operation getCollectionAsync + * Operation getCustomerProfileAsync * - * Get campaign-level collection + * Get customer profile * - * @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 $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 getCollectionAsync($applicationId, $campaignId, $collectionId) + public function getCustomerProfileAsync($customerId) { - return $this->getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + return $this->getCustomerProfileAsyncWithHttpInfo($customerId) ->then( function ($response) { return $response[0]; @@ -21223,21 +27672,19 @@ function ($response) { } /** - * Operation getCollectionAsyncWithHttpInfo + * Operation getCustomerProfileAsyncWithHttpInfo * - * Get campaign-level collection + * Get customer profile * - * @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 $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 getCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId) + public function getCustomerProfileAsyncWithHttpInfo($customerId) { - $returnType = '\TalonOne\Client\Model\Collection'; - $request = $this->getCollectionRequest($applicationId, $campaignId, $collectionId); + $returnType = '\TalonOne\Client\Model\CustomerProfile'; + $request = $this->getCustomerProfileRequest($customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21274,37 +27721,23 @@ function ($exception) { } /** - * Create request for operation 'getCollection' + * Create request for operation 'getCustomerProfile' * - * @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 $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 getCollectionRequest($applicationId, $campaignId, $collectionId) + protected function getCustomerProfileRequest($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 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' - ); - } - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling getCollection' + 'Missing the required parameter $customerId when calling getCustomerProfile' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; + $resourcePath = '/v1/customers/{customerId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21314,26 +27747,10 @@ protected function getCollectionRequest($applicationId, $campaignId, $collection // 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) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -21413,40 +27830,46 @@ protected function getCollectionRequest($applicationId, $campaignId, $collection } /** - * Operation getCollectionItems + * Operation getCustomerProfileAchievementProgress * - * Get collection items + * List customer achievements * - * @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 this 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 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\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20047|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCollectionItems($collectionId, $pageSize = 1000, $skip = null) + public function getCustomerProfileAchievementProgress($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - list($response) = $this->getCollectionItemsWithHttpInfo($collectionId, $pageSize, $skip); + list($response) = $this->getCustomerProfileAchievementProgressWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); return $response; } /** - * Operation getCollectionItemsWithHttpInfo + * Operation getCustomerProfileAchievementProgressWithHttpInfo * - * Get collection items + * List customer achievements * - * @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 this 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 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\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) + public function getCustomerProfileAchievementProgressWithHttpInfo($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); + $request = $this->getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); try { $options = $this->createHttpClientOption(); @@ -21479,18 +27902,30 @@ public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20017' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20047' === '\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\InlineResponse20047', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: + 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 { @@ -21504,7 +27939,7 @@ public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $returnType = '\TalonOne\Client\Model\InlineResponse20047'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21523,12 +27958,20 @@ public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20017', + '\TalonOne\Client\Model\InlineResponse20047', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + 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', @@ -21542,20 +27985,23 @@ public function getCollectionItemsWithHttpInfo($collectionId, $pageSize = 1000, } /** - * Operation getCollectionItemsAsync + * Operation getCustomerProfileAchievementProgressAsync * - * Get collection items + * List customer achievements * - * @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 this 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 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 getCollectionItemsAsync($collectionId, $pageSize = 1000, $skip = null) + public function getCustomerProfileAchievementProgressAsync($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - return $this->getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize, $skip) + return $this->getCustomerProfileAchievementProgressAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title) ->then( function ($response) { return $response[0]; @@ -21564,21 +28010,24 @@ function ($response) { } /** - * Operation getCollectionItemsAsyncWithHttpInfo + * Operation getCustomerProfileAchievementProgressAsyncWithHttpInfo * - * Get collection items + * List customer achievements * - * @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 this 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 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 getCollectionItemsAsyncWithHttpInfo($collectionId, $pageSize = 1000, $skip = null) + public function getCustomerProfileAchievementProgressAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20017'; - $request = $this->getCollectionItemsRequest($collectionId, $pageSize, $skip); + $returnType = '\TalonOne\Client\Model\InlineResponse20047'; + $request = $this->getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize, $skip, $achievementId, $title); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21615,32 +28064,41 @@ function ($exception) { } /** - * Create request for operation 'getCollectionItems' + * Create request for operation 'getCustomerProfileAchievementProgress' * - * @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 this 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 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 getCollectionItemsRequest($collectionId, $pageSize = 1000, $skip = null) + protected function getCustomerProfileAchievementProgressRequest($applicationId, $integrationId, $pageSize = 50, $skip = null, $achievementId = null, $title = 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 getCollectionItems' + 'Missing the required parameter $applicationId when calling getCustomerProfileAchievementProgress' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCollectionItems, 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 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.getCollectionItems, 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/collections/{collectionId}/items'; + $resourcePath = '/v1/applications/{applicationId}/achievement_progress/{integrationId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21661,13 +28119,35 @@ protected function getCollectionItemsRequest($collectionId, $pageSize = 1000, $s if ($skip !== null) { $queryParams['skip'] = $skip; } + // query params + if (is_array($achievementId)) { + $achievementId = ObjectSerializer::serializeCollection($achievementId, '', true); + } + if ($achievementId !== null) { + $queryParams['achievementId'] = $achievementId; + } + // query params + if (is_array($title)) { + $title = ObjectSerializer::serializeCollection($title, '', true); + } + if ($title !== null) { + $queryParams['title'] = $title; + } // path params - if ($collectionId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), $resourcePath ); } @@ -21747,62 +28227,40 @@ protected function getCollectionItemsRequest($collectionId, $pageSize = 1000, $s } /** - * Operation getCouponsWithoutTotalCount + * Operation getCustomerProfiles * - * List coupons + * List customer profiles * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 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\InlineResponse2009 + * @return \TalonOne\Client\Model\InlineResponse20025 */ - 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 getCustomerProfiles($pageSize = 1000, $skip = null, $sandbox = false) { - list($response) = $this->getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); + list($response) = $this->getCustomerProfilesWithHttpInfo($pageSize, $skip, $sandbox); return $response; } /** - * Operation getCouponsWithoutTotalCountWithHttpInfo + * Operation getCustomerProfilesWithHttpInfo * - * List coupons + * List customer profiles * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 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\InlineResponse2009, 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 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 getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) { - $request = $this->getCouponsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch); + $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); try { $options = $this->createHttpClientOption(); @@ -21835,20 +28293,20 @@ public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaig $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2009' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20025' === '\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\InlineResponse20025', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2009'; + $returnType = '\TalonOne\Client\Model\InlineResponse20025'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21867,7 +28325,7 @@ public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaig case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2009', + '\TalonOne\Client\Model\InlineResponse20025', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21878,31 +28336,20 @@ public function getCouponsWithoutTotalCountWithHttpInfo($applicationId, $campaig } /** - * Operation getCouponsWithoutTotalCountAsync + * Operation getCustomerProfilesAsync * - * List coupons + * List customer profiles * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 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 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 getCustomerProfilesAsync($pageSize = 1000, $skip = null, $sandbox = false) { - return $this->getCouponsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch) + return $this->getCustomerProfilesAsyncWithHttpInfo($pageSize, $skip, $sandbox) ->then( function ($response) { return $response[0]; @@ -21911,32 +28358,21 @@ function ($response) { } /** - * Operation getCouponsWithoutTotalCountAsyncWithHttpInfo + * Operation getCustomerProfilesAsyncWithHttpInfo * - * List coupons + * List customer profiles * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 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 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 getCustomerProfilesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) { - $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\InlineResponse20025'; + $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21973,49 +28409,26 @@ function ($exception) { } /** - * Create request for operation 'getCouponsWithoutTotalCount' + * Create request for operation 'getCustomerProfiles' * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 timezone. 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 timezone. 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 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 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 getCustomerProfilesRequest($pageSize = 1000, $skip = null, $sandbox = 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 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.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getCustomerProfiles, 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.getCustomerProfiles, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total'; + $resourcePath = '/v1/customers/no_total'; $formParams = []; $queryParams = []; $headerParams = []; @@ -22037,93 +28450,14 @@ protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignI $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($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 (is_array($sandbox)) { + $sandbox = ObjectSerializer::serializeCollection($sandbox, '', true); } - if ($exactMatch !== null) { - $queryParams['exactMatch'] = $exactMatch; + if ($sandbox !== null) { + $queryParams['sandbox'] = $sandbox; } - // 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; @@ -22200,46 +28534,42 @@ protected function getCouponsWithoutTotalCountRequest($applicationId, $campaignI } /** - * Operation getCustomerActivityReport + * Operation getCustomersByAttributes * - * Get customer's activity report + * List customer profiles matching the given attributes * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $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\CustomerActivityReport + * @return \TalonOne\Client\Model\InlineResponse20024 */ - public function getCustomerActivityReport($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getCustomersByAttributes($body, $pageSize = 1000, $skip = null, $sandbox = false) { - list($response) = $this->getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); + list($response) = $this->getCustomersByAttributesWithHttpInfo($body, $pageSize, $skip, $sandbox); return $response; } /** - * Operation getCustomerActivityReportWithHttpInfo + * Operation getCustomersByAttributesWithHttpInfo * - * Get customer's activity report + * List customer profiles matching the given attributes * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $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\CustomerActivityReport, 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 getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) { - $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); + $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); try { $options = $this->createHttpClientOption(); @@ -22272,20 +28602,20 @@ public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $a $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\CustomerActivityReport' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20024' === '\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\InlineResponse20024', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; + $returnType = '\TalonOne\Client\Model\InlineResponse20024'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22304,7 +28634,7 @@ public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $a case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CustomerActivityReport', + '\TalonOne\Client\Model\InlineResponse20024', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22315,23 +28645,21 @@ public function getCustomerActivityReportWithHttpInfo($rangeStart, $rangeEnd, $a } /** - * Operation getCustomerActivityReportAsync + * Operation getCustomersByAttributesAsync * - * Get customer's activity report + * List customer profiles matching the given attributes * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerActivityReportAsync($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getCustomersByAttributesAsync($body, $pageSize = 1000, $skip = null, $sandbox = false) { - return $this->getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip) + return $this->getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize, $skip, $sandbox) ->then( function ($response) { return $response[0]; @@ -22340,24 +28668,22 @@ function ($response) { } /** - * Operation getCustomerActivityReportAsyncWithHttpInfo + * Operation getCustomersByAttributesAsyncWithHttpInfo * - * Get customer's activity report + * List customer profiles matching the given attributes * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerActivityReportAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + public function getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) { - $returnType = '\TalonOne\Client\Model\CustomerActivityReport'; - $request = $this->getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize, $skip); + $returnType = '\TalonOne\Client\Model\InlineResponse20024'; + $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22394,53 +28720,33 @@ function ($exception) { } /** - * Create request for operation 'getCustomerActivityReport' + * Create request for operation 'getCustomersByAttributes' * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $sandbox Indicates whether you are pointing to a sandbox or Live customer. (optional, default to false) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $applicationId, $customerId, $pageSize = 1000, $skip = null) + protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $skip = null, $sandbox = false) { - // 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)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling getCustomerActivityReport' + 'Missing the required parameter $body when calling getCustomersByAttributes' ); } 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.getCustomersByAttributes, 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.getCustomersByAttributes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customer_activity_reports/{customerId}'; + $resourcePath = '/v1/customer_search/no_total'; $formParams = []; $queryParams = []; $headerParams = []; @@ -22462,40 +28768,20 @@ protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $app $queryParams['skip'] = $skip; } // 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 (is_array($sandbox)) { + $sandbox = ObjectSerializer::serializeCollection($sandbox, '', true); } - if ($rangeEnd !== null) { - $queryParams['rangeEnd'] = $rangeEnd; + if ($sandbox !== null) { + $queryParams['sandbox'] = $sandbox; } - // 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( @@ -22504,7 +28790,7 @@ protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $app } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -22561,7 +28847,7 @@ protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $app $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -22569,54 +28855,44 @@ protected function getCustomerActivityReportRequest($rangeStart, $rangeEnd, $app } /** - * Operation getCustomerActivityReportsWithoutTotalCount + * Operation getEventTypes * - * Get Activity Reports for Application Customers + * List event types * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $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\InlineResponse20026 + * @return \TalonOne\Client\Model\InlineResponse20040 */ - public function getCustomerActivityReportsWithoutTotalCount($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getEventTypes($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); + list($response) = $this->getEventTypesWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort); return $response; } /** - * Operation getCustomerActivityReportsWithoutTotalCountWithHttpInfo + * Operation getEventTypesWithHttpInfo * - * Get Activity Reports for Application Customers + * List event types * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $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\InlineResponse20026, 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 getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); + $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -22649,20 +28925,20 @@ public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeSt $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20026' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20040' === '\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\InlineResponse20040', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20026'; + $returnType = '\TalonOne\Client\Model\InlineResponse20040'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22681,7 +28957,7 @@ public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeSt case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20026', + '\TalonOne\Client\Model\InlineResponse20040', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22692,27 +28968,22 @@ public function getCustomerActivityReportsWithoutTotalCountWithHttpInfo($rangeSt } /** - * Operation getCustomerActivityReportsWithoutTotalCountAsync + * Operation getEventTypesAsync * - * Get Activity Reports for Application Customers + * List event types * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $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 getCustomerActivityReportsWithoutTotalCountAsync($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getEventTypesAsync($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName) + return $this->getEventTypesAsyncWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -22721,28 +28992,23 @@ function ($response) { } /** - * Operation getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo + * Operation getEventTypesAsyncWithHttpInfo * - * Get Activity Reports for Application Customers + * List event types * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $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 getCustomerActivityReportsWithoutTotalCountAsyncWithHttpInfo($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + public function getEventTypesAsyncWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20026'; - $request = $this->getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize, $skip, $sort, $name, $integrationId, $campaignName, $advocateName); + $returnType = '\TalonOne\Client\Model\InlineResponse20040'; + $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22779,57 +29045,48 @@ function ($exception) { } /** - * Create request for operation 'getCustomerActivityReportsWithoutTotalCount' + * Create request for operation 'getEventTypes' * - * @param \DateTime $rangeStart Only return results from after this timestamp. This must be an RFC3339 timestamp string. (required) - * @param \DateTime $rangeEnd Only return results from before this timestamp. This must be an RFC3339 timestamp string. (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 this response. (optional, default to 1000) + * @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 $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 getCustomerActivityReportsWithoutTotalCountRequest($rangeStart, $rangeEnd, $applicationId, $pageSize = 1000, $skip = null, $sort = null, $name = null, $integrationId = null, $campaignName = null, $advocateName = null) + protected function getEventTypesRequest($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = 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.getCustomerActivityReportsWithoutTotalCount, 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.getCustomerActivityReportsWithoutTotalCount, 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/applications/{applicationId}/customer_activity_reports/no_total'; + $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); @@ -22851,58 +29108,8 @@ protected function getCustomerActivityReportsWithoutTotalCountRequest($rangeStar 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 ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -22979,44 +29186,44 @@ protected function getCustomerActivityReportsWithoutTotalCountRequest($rangeStar } /** - * Operation getCustomerAnalytics + * Operation getExports * - * Get customer's analytics report + * Get exports * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 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\CustomerAnalytics + * @return \TalonOne\Client\Model\InlineResponse20043 */ - public function getCustomerAnalytics($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getExports($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - list($response) = $this->getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort); + list($response) = $this->getExportsWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity); return $response; } /** - * Operation getCustomerAnalyticsWithHttpInfo + * Operation getExportsWithHttpInfo * - * Get customer's analytics report + * Get exports * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 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\CustomerAnalytics, 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 getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); + $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); try { $options = $this->createHttpClientOption(); @@ -23049,20 +29256,20 @@ public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $p $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\CustomerAnalytics' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20043' === '\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\InlineResponse20043', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; + $returnType = '\TalonOne\Client\Model\InlineResponse20043'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23081,7 +29288,7 @@ public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $p case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CustomerAnalytics', + '\TalonOne\Client\Model\InlineResponse20043', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23092,22 +29299,22 @@ public function getCustomerAnalyticsWithHttpInfo($applicationId, $customerId, $p } /** - * Operation getCustomerAnalyticsAsync + * Operation getExportsAsync * - * Get customer's analytics report + * Get exports * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 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 getCustomerAnalyticsAsync($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getExportsAsync($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - return $this->getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize, $skip, $sort) + return $this->getExportsAsyncWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity) ->then( function ($response) { return $response[0]; @@ -23116,23 +29323,23 @@ function ($response) { } /** - * Operation getCustomerAnalyticsAsyncWithHttpInfo + * Operation getExportsAsyncWithHttpInfo * - * Get customer's analytics report + * Get exports * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 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 getCustomerAnalyticsAsyncWithHttpInfo($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + public function getExportsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) { - $returnType = '\TalonOne\Client\Model\CustomerAnalytics'; - $request = $this->getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\InlineResponse20043'; + $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23169,40 +29376,28 @@ function ($exception) { } /** - * Create request for operation 'getCustomerAnalytics' + * Create request for operation 'getExports' * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 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 getCustomerAnalyticsRequest($applicationId, $customerId, $pageSize = 1000, $skip = null, $sort = null) + protected function getExportsRequest($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = 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 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.getCustomerAnalytics, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getExports, 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.getExports, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}/analytics'; + $resourcePath = '/v1/exports'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23224,31 +29419,29 @@ protected function getCustomerAnalyticsRequest($applicationId, $customerId, $pag $queryParams['skip'] = $skip; } // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; + 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($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; @@ -23324,36 +29517,38 @@ protected function getCustomerAnalyticsRequest($applicationId, $customerId, $pag } /** - * Operation getCustomerProfile + * Operation getLoyaltyCard * - * Get customer profile + * Get loyalty card * - * @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 $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\CustomerProfile + * @return \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCustomerProfile($customerId) + public function getLoyaltyCard($loyaltyProgramId, $loyaltyCardId) { - list($response) = $this->getCustomerProfileWithHttpInfo($customerId); + list($response) = $this->getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); return $response; } /** - * Operation getCustomerProfileWithHttpInfo + * Operation getLoyaltyCardWithHttpInfo * - * Get customer profile + * Get loyalty card * - * @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 $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\CustomerProfile, 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 getCustomerProfileWithHttpInfo($customerId) + public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) { - $request = $this->getCustomerProfileRequest($customerId); + $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); try { $options = $this->createHttpClientOption(); @@ -23386,20 +29581,56 @@ public function getCustomerProfileWithHttpInfo($customerId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\CustomerProfile' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyCard' === '\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\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\CustomerProfile'; + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23418,7 +29649,31 @@ public function getCustomerProfileWithHttpInfo($customerId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\CustomerProfile', + '\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); @@ -23429,18 +29684,19 @@ public function getCustomerProfileWithHttpInfo($customerId) } /** - * Operation getCustomerProfileAsync + * Operation getLoyaltyCardAsync * - * Get customer profile + * Get loyalty card * - * @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 $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 getCustomerProfileAsync($customerId) + public function getLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) { - return $this->getCustomerProfileAsyncWithHttpInfo($customerId) + return $this->getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) ->then( function ($response) { return $response[0]; @@ -23449,19 +29705,20 @@ function ($response) { } /** - * Operation getCustomerProfileAsyncWithHttpInfo + * Operation getLoyaltyCardAsyncWithHttpInfo * - * Get customer profile + * Get loyalty card * - * @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 $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 getCustomerProfileAsyncWithHttpInfo($customerId) + public function getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) { - $returnType = '\TalonOne\Client\Model\CustomerProfile'; - $request = $this->getCustomerProfileRequest($customerId); + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23498,23 +29755,34 @@ function ($exception) { } /** - * Create request for operation 'getCustomerProfile' + * Create request for operation 'getLoyaltyCard' * - * @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 $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 getCustomerProfileRequest($customerId) + protected function getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling getCustomerProfile' + '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/customers/{customerId}'; + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23524,10 +29792,18 @@ protected function getCustomerProfileRequest($customerId) // path params - if ($customerId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } + // path params + if ($loyaltyCardId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), $resourcePath ); } @@ -23607,40 +29883,48 @@ protected function getCustomerProfileRequest($customerId) } /** - * Operation getCustomerProfiles + * Operation getLoyaltyCardTransactionLogs * - * List customer profiles + * List card's transactions * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $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\InlineResponse20025 + * @return \TalonOne\Client\Model\InlineResponse20016|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCustomerProfiles($pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCardTransactionLogs($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - list($response) = $this->getCustomerProfilesWithHttpInfo($pageSize, $skip, $sandbox); + list($response) = $this->getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); return $response; } /** - * Operation getCustomerProfilesWithHttpInfo + * Operation getLoyaltyCardTransactionLogsWithHttpInfo * - * List customer profiles + * List card's transactions * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $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\InlineResponse20025, 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 getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); + $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); try { $options = $this->createHttpClientOption(); @@ -23673,20 +29957,44 @@ public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20025' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20016' === '\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\InlineResponse20016', []), + $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\InlineResponse20025'; + $returnType = '\TalonOne\Client\Model\InlineResponse20016'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23705,7 +30013,23 @@ public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20025', + '\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', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23716,20 +30040,24 @@ public function getCustomerProfilesWithHttpInfo($pageSize = 1000, $skip = null, } /** - * Operation getCustomerProfilesAsync + * Operation getLoyaltyCardTransactionLogsAsync * - * List customer profiles + * List card's transactions * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfilesAsync($pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCardTransactionLogsAsync($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - return $this->getCustomerProfilesAsyncWithHttpInfo($pageSize, $skip, $sandbox) + return $this->getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId) ->then( function ($response) { return $response[0]; @@ -23738,21 +30066,25 @@ function ($response) { } /** - * Operation getCustomerProfilesAsyncWithHttpInfo + * Operation getLoyaltyCardTransactionLogsAsyncWithHttpInfo * - * List customer profiles + * List card's transactions * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCustomerProfilesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20025'; - $request = $this->getCustomerProfilesRequest($pageSize, $skip, $sandbox); + $returnType = '\TalonOne\Client\Model\InlineResponse20016'; + $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23789,32 +30121,66 @@ function ($exception) { } /** - * Create request for operation 'getCustomerProfiles' + * Create request for operation 'getLoyaltyCardTransactionLogs' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCustomerProfilesRequest($pageSize = 1000, $skip = null, $sandbox = false) + 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 getLoyaltyCardTransactionLogs' + ); + } + // 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.getCustomerProfiles, must be smaller than or equal to 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.getCustomerProfiles, 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/customers/no_total'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs'; $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); @@ -23830,14 +30196,30 @@ 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($subledgerId)) { + $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); } - if ($sandbox !== null) { - $queryParams['sandbox'] = $sandbox; + if ($subledgerId !== null) { + $queryParams['subledgerId'] = $subledgerId; } + // 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; @@ -23914,42 +30296,46 @@ protected function getCustomerProfilesRequest($pageSize = 1000, $skip = null, $s } /** - * Operation getCustomersByAttributes + * Operation getLoyaltyCards * - * List customer profiles matching the given attributes + * List loyalty cards * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $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\InlineResponse20024 + * @return \TalonOne\Client\Model\InlineResponse20015|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getCustomersByAttributes($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCards($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) { - list($response) = $this->getCustomersByAttributesWithHttpInfo($body, $pageSize, $skip, $sandbox); + list($response) = $this->getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); return $response; } /** - * Operation getCustomersByAttributesWithHttpInfo + * Operation getLoyaltyCardsWithHttpInfo * - * List customer profiles matching the given attributes + * List loyalty cards * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $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\InlineResponse20024, 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 getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) { - $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); + $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); try { $options = $this->createHttpClientOption(); @@ -23982,20 +30368,44 @@ public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $s $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20024' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20015' === '\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\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\InlineResponse20024'; + $returnType = '\TalonOne\Client\Model\InlineResponse20015'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24014,7 +30424,23 @@ public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20024', + '\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); @@ -24025,21 +30451,23 @@ public function getCustomersByAttributesWithHttpInfo($body, $pageSize = 1000, $s } /** - * Operation getCustomersByAttributesAsync + * Operation getLoyaltyCardsAsync * - * List customer profiles matching the given attributes + * List loyalty cards * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $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 getCustomersByAttributesAsync($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCardsAsync($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) { - return $this->getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize, $skip, $sandbox) + return $this->getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId) ->then( function ($response) { return $response[0]; @@ -24048,22 +30476,24 @@ function ($response) { } /** - * Operation getCustomersByAttributesAsyncWithHttpInfo + * Operation getLoyaltyCardsAsyncWithHttpInfo * - * List customer profiles matching the given attributes + * List loyalty cards * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $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 getCustomersByAttributesAsyncWithHttpInfo($body, $pageSize = 1000, $skip = null, $sandbox = false) + public function getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20024'; - $request = $this->getCustomersByAttributesRequest($body, $pageSize, $skip, $sandbox); + $returnType = '\TalonOne\Client\Model\InlineResponse20015'; + $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24100,33 +30530,43 @@ function ($exception) { } /** - * Create request for operation 'getCustomersByAttributes' + * Create request for operation 'getLoyaltyCards' * - * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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 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 $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 getCustomersByAttributesRequest($body, $pageSize = 1000, $skip = null, $sandbox = false) + protected function getLoyaltyCardsRequest($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling getCustomersByAttributes' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyCards' ); } 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.getLoyaltyCards, 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.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.'); + } - $resourcePath = '/v1/customer_search/no_total'; + + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24148,20 +30588,39 @@ 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; + } + // 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; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -24170,7 +30629,7 @@ protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $ski } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -24227,7 +30686,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 @@ -24235,44 +30694,38 @@ protected function getCustomersByAttributesRequest($body, $pageSize = 1000, $ski } /** - * Operation getEventTypes + * Operation getLoyaltyPoints * - * List event types + * Get customer's full loyalty ledger * - * @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 this 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 $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\InlineResponse20038 + * @return \TalonOne\Client\Model\LoyaltyLedger */ - public function getEventTypes($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyPoints($loyaltyProgramId, $integrationId) { - list($response) = $this->getEventTypesWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort); + list($response) = $this->getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId); return $response; } /** - * Operation getEventTypesWithHttpInfo + * Operation getLoyaltyPointsWithHttpInfo * - * List event types + * Get customer's full loyalty ledger * - * @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 this 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 $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\InlineResponse20038, 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 getEventTypesWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) { - $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); + $request = $this->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); try { $options = $this->createHttpClientOption(); @@ -24305,20 +30758,20 @@ public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = fa $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20038' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyLedger' === '\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\LoyaltyLedger', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20038'; + $returnType = '\TalonOne\Client\Model\LoyaltyLedger'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24337,7 +30790,7 @@ public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = fa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20038', + '\TalonOne\Client\Model\LoyaltyLedger', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24348,22 +30801,19 @@ public function getEventTypesWithHttpInfo($name = null, $includeOldVersions = fa } /** - * Operation getEventTypesAsync + * Operation getLoyaltyPointsAsync * - * List event types + * Get customer's full loyalty ledger * - * @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 this 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 $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 getEventTypesAsync($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyPointsAsync($loyaltyProgramId, $integrationId) { - return $this->getEventTypesAsyncWithHttpInfo($name, $includeOldVersions, $pageSize, $skip, $sort) + return $this->getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) ->then( function ($response) { return $response[0]; @@ -24372,23 +30822,20 @@ function ($response) { } /** - * Operation getEventTypesAsyncWithHttpInfo + * Operation getLoyaltyPointsAsyncWithHttpInfo * - * List event types + * Get customer's full loyalty ledger * - * @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 this 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 $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 getEventTypesAsyncWithHttpInfo($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + public function getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20038'; - $request = $this->getEventTypesRequest($name, $includeOldVersions, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\LoyaltyLedger'; + $request = $this->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24425,71 +30872,54 @@ function ($exception) { } /** - * Create request for operation 'getEventTypes' + * Create request for operation 'getLoyaltyPoints' * - * @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 this 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 $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 getEventTypesRequest($name = null, $includeOldVersions = false, $pageSize = 1000, $skip = null, $sort = null) + protected function getLoyaltyPointsRequest($loyaltyProgramId, $integrationId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getEventTypes, must be smaller than or equal to 1000.'); + // 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 < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getEventTypes, must be bigger than or equal to 1.'); + // 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/event_types'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}'; $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 ($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; @@ -24566,44 +30996,36 @@ protected function getEventTypesRequest($name = null, $includeOldVersions = fals } /** - * Operation getExports + * Operation getLoyaltyProgram * - * Get exports + * Get loyalty program * - * @param int $pageSize The number of items in this 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) + * @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\InlineResponse20041 + * @return \TalonOne\Client\Model\LoyaltyProgram */ - public function getExports($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getLoyaltyProgram($loyaltyProgramId) { - list($response) = $this->getExportsWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity); + list($response) = $this->getLoyaltyProgramWithHttpInfo($loyaltyProgramId); return $response; } /** - * Operation getExportsWithHttpInfo + * Operation getLoyaltyProgramWithHttpInfo * - * Get exports + * Get loyalty program * - * @param int $pageSize The number of items in this 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) + * @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\InlineResponse20041, 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 getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) { - $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); + $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); try { $options = $this->createHttpClientOption(); @@ -24636,20 +31058,20 @@ public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicat $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20041' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyProgram' === '\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\LoyaltyProgram', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20041'; + $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24668,7 +31090,7 @@ public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicat case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20041', + '\TalonOne\Client\Model\LoyaltyProgram', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24679,22 +31101,18 @@ public function getExportsWithHttpInfo($pageSize = 1000, $skip = null, $applicat } /** - * Operation getExportsAsync + * Operation getLoyaltyProgramAsync * - * Get exports + * Get loyalty program * - * @param int $pageSize The number of items in this 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) + * @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 getExportsAsync($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getLoyaltyProgramAsync($loyaltyProgramId) { - return $this->getExportsAsyncWithHttpInfo($pageSize, $skip, $applicationId, $campaignId, $entity) + return $this->getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) ->then( function ($response) { return $response[0]; @@ -24703,23 +31121,19 @@ function ($response) { } /** - * Operation getExportsAsyncWithHttpInfo + * Operation getLoyaltyProgramAsyncWithHttpInfo * - * Get exports + * Get loyalty program * - * @param int $pageSize The number of items in this 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) + * @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 getExportsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + public function getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20041'; - $request = $this->getExportsRequest($pageSize, $skip, $applicationId, $campaignId, $entity); + $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; + $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24756,71 +31170,39 @@ function ($exception) { } /** - * Create request for operation 'getExports' + * Create request for operation 'getLoyaltyProgram' * - * @param int $pageSize The number of items in this 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) + * @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 getExportsRequest($pageSize = 1000, $skip = null, $applicationId = null, $campaignId = null, $entity = null) + protected function getLoyaltyProgramRequest($loyaltyProgramId) { - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getExports, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getExports, must be bigger than or equal to 1.'); + // 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' + ); } - - $resourcePath = '/v1/exports'; + $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($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; - } + // path params + if ($loyaltyProgramId !== null) { + $resourcePath = str_replace( + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -24897,38 +31279,48 @@ protected function getExportsRequest($pageSize = 1000, $skip = null, $applicatio } /** - * Operation getLoyaltyCard + * Operation getLoyaltyProgramTransactions * - * Get loyalty card + * List loyalty program transactions * - * @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 $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\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyCard($loyaltyProgramId, $loyaltyCardId) + public function getLoyaltyProgramTransactions($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - list($response) = $this->getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId); + list($response) = $this->getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); return $response; } /** - * Operation getLoyaltyCardWithHttpInfo + * Operation getLoyaltyProgramTransactionsWithHttpInfo * - * Get loyalty card + * List loyalty program transactions * - * @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 $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\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\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); try { $options = $this->createHttpClientOption(); @@ -24961,14 +31353,14 @@ public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyCard' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20014' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyCard', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20014', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -25010,7 +31402,7 @@ public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $returnType = '\TalonOne\Client\Model\InlineResponse20014'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25029,7 +31421,7 @@ public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyCard', + '\TalonOne\Client\Model\InlineResponse20014', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25064,19 +31456,24 @@ public function getLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId) } /** - * Operation getLoyaltyCardAsync + * Operation getLoyaltyProgramTransactionsAsync * - * Get loyalty card + * List loyalty program transactions * - * @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 $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 getLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId) + public function getLoyaltyProgramTransactionsAsync($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - return $this->getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + return $this->getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip) ->then( function ($response) { return $response[0]; @@ -25085,20 +31482,25 @@ function ($response) { } /** - * Operation getLoyaltyCardAsyncWithHttpInfo + * Operation getLoyaltyProgramTransactionsAsyncWithHttpInfo * - * Get loyalty card + * List loyalty program transactions * - * @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 $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 getLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId) + public function getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) { - $returnType = '\TalonOne\Client\Model\LoyaltyCard'; - $request = $this->getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId); + $returnType = '\TalonOne\Client\Model\InlineResponse20014'; + $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25135,40 +31537,84 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyCard' + * Create request for operation 'getLoyaltyProgramTransactions' * - * @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 $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 getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) + protected function getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = 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 getLoyaltyCard' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgramTransactions' ); } - // 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 > 50) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyProgramTransactions, must be smaller than or equal to 50.'); } - 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.getLoyaltyProgramTransactions, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; + $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 @@ -25179,14 +31625,6 @@ protected function getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) $resourcePath ); } - // path params - if ($loyaltyCardId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -25263,48 +31701,34 @@ protected function getLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId) } /** - * Operation getLoyaltyCardTransactionLogs + * Operation getLoyaltyPrograms * - * List card's transactions + * List loyalty programs * - * @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. (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. (optional) - * @param int $pageSize The number of items in this 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\InlineResponse20015|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20013 */ - public function getLoyaltyCardTransactionLogs($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getLoyaltyPrograms() { - list($response) = $this->getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); + list($response) = $this->getLoyaltyProgramsWithHttpInfo(); return $response; } /** - * Operation getLoyaltyCardTransactionLogsWithHttpInfo + * Operation getLoyaltyProgramsWithHttpInfo * - * List card's transactions + * List loyalty programs * - * @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. (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. (optional) - * @param int $pageSize The number of items in this 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\InlineResponse20015|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getLoyaltyProgramsWithHttpInfo() { - $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); + $request = $this->getLoyaltyProgramsRequest(); try { $options = $this->createHttpClientOption(); @@ -25327,54 +31751,30 @@ public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $lo '[%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\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 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\InlineResponse20013' === '\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\InlineResponse20013', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20015'; + $returnType = '\TalonOne\Client\Model\InlineResponse20013'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25393,23 +31793,7 @@ public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $lo case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20015', - $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\InlineResponse20013', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25420,24 +31804,17 @@ public function getLoyaltyCardTransactionLogsWithHttpInfo($loyaltyProgramId, $lo } /** - * Operation getLoyaltyCardTransactionLogsAsync + * Operation getLoyaltyProgramsAsync * - * List card's transactions + * List loyalty programs * - * @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. (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. (optional) - * @param int $pageSize The number of items in this 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 getLoyaltyCardTransactionLogsAsync($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getLoyaltyProgramsAsync() { - return $this->getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId) + return $this->getLoyaltyProgramsAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -25446,25 +31823,18 @@ function ($response) { } /** - * Operation getLoyaltyCardTransactionLogsAsyncWithHttpInfo + * Operation getLoyaltyProgramsAsyncWithHttpInfo * - * List card's transactions + * List loyalty programs * - * @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. (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. (optional) - * @param int $pageSize The number of items in this 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 getLoyaltyCardTransactionLogsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + public function getLoyaltyProgramsAsyncWithHttpInfo() { - $returnType = '\TalonOne\Client\Model\InlineResponse20015'; - $request = $this->getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate, $endDate, $pageSize, $skip, $subledgerId); + $returnType = '\TalonOne\Client\Model\InlineResponse20013'; + $request = $this->getLoyaltyProgramsRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25501,105 +31871,24 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyCardTransactionLogs' + * Create request for operation 'getLoyaltyPrograms' * - * @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. (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. (optional) - * @param int $pageSize The number of items in this 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 getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loyaltyCardId, $startDate = null, $endDate = null, $pageSize = 1000, $skip = null, $subledgerId = null) + protected function getLoyaltyProgramsRequest() { - // 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)) { - 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.getLoyaltyCardTransactionLogs, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs'; + $resourcePath = '/v1/loyalty_programs'; $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); - } - 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($subledgerId)) { - $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); - } - if ($subledgerId !== null) { - $queryParams['subledgerId'] = $subledgerId; - } - // 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; @@ -25676,46 +31965,36 @@ protected function getLoyaltyCardTransactionLogsRequest($loyaltyProgramId, $loya } /** - * Operation getLoyaltyCards + * Operation getLoyaltyStatistics * - * List loyalty cards + * Get loyalty program statistics * - * @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 this 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) + * @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\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\LoyaltyDashboardData */ - public function getLoyaltyCards($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getLoyaltyStatistics($loyaltyProgramId) { - list($response) = $this->getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); + list($response) = $this->getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId); return $response; } /** - * Operation getLoyaltyCardsWithHttpInfo + * Operation getLoyaltyStatisticsWithHttpInfo * - * List loyalty cards + * Get loyalty program statistics * - * @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 this 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) + * @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\InlineResponse20014|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) { - $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); + $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); try { $options = $this->createHttpClientOption(); @@ -25748,44 +32027,20 @@ public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $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') { - $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\LoyaltyDashboardData' === '\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\LoyaltyDashboardData', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20014'; + $returnType = '\TalonOne\Client\Model\LoyaltyDashboardData'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25804,23 +32059,7 @@ public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, 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', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\LoyaltyDashboardData', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25831,23 +32070,18 @@ public function getLoyaltyCardsWithHttpInfo($loyaltyProgramId, $pageSize = 1000, } /** - * Operation getLoyaltyCardsAsync + * Operation getLoyaltyStatisticsAsync * - * List loyalty cards + * Get loyalty program statistics * - * @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 this 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) + * @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 getLoyaltyCardsAsync($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getLoyaltyStatisticsAsync($loyaltyProgramId) { - return $this->getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId) + return $this->getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) ->then( function ($response) { return $response[0]; @@ -25856,24 +32090,19 @@ function ($response) { } /** - * Operation getLoyaltyCardsAsyncWithHttpInfo + * Operation getLoyaltyStatisticsAsyncWithHttpInfo * - * List loyalty cards + * Get loyalty program statistics * - * @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 this 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) + * @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 getLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + public function getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20014'; - $request = $this->getLoyaltyCardsRequest($loyaltyProgramId, $pageSize, $skip, $sort, $identifier, $profileId); + $returnType = '\TalonOne\Client\Model\LoyaltyDashboardData'; + $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25910,84 +32139,29 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyCards' + * Create request for operation 'getLoyaltyStatistics' * - * @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 this 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) + * @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 getLoyaltyCardsRequest($loyaltyProgramId, $pageSize = 1000, $skip = null, $sort = null, $identifier = null, $profileId = null) + protected function getLoyaltyStatisticsRequest($loyaltyProgramId) { // 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' + 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyStatistics' ); } - 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.'); - } - - 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'; + $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; - } - // 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 @@ -26074,38 +32248,56 @@ protected function getLoyaltyCardsRequest($loyaltyProgramId, $pageSize = 1000, $ } /** - * Operation getLoyaltyPoints + * Operation getReferralsWithoutTotalCount * - * Get customer's full loyalty ledger + * List referrals * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (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 $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\LoyaltyLedger + * @return \TalonOne\Client\Model\InlineResponse20010 */ - public function getLoyaltyPoints($loyaltyProgramId, $integrationId) + 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->getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId); + list($response) = $this->getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); return $response; } /** - * Operation getLoyaltyPointsWithHttpInfo + * Operation getReferralsWithoutTotalCountWithHttpInfo * - * Get customer's full loyalty ledger + * List referrals * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (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 $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\LoyaltyLedger, 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 getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) + 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->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); + $request = $this->getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); try { $options = $this->createHttpClientOption(); @@ -26138,20 +32330,20 @@ public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyLedger' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20010' === '\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\InlineResponse20010', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyLedger'; + $returnType = '\TalonOne\Client\Model\InlineResponse20010'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26170,7 +32362,7 @@ public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyLedger', + '\TalonOne\Client\Model\InlineResponse20010', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26181,19 +32373,28 @@ public function getLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId) } /** - * Operation getLoyaltyPointsAsync + * Operation getReferralsWithoutTotalCountAsync * - * Get customer's full loyalty ledger + * List referrals * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (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 $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 getLoyaltyPointsAsync($loyaltyProgramId, $integrationId) + 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->getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) + return $this->getReferralsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate) ->then( function ($response) { return $response[0]; @@ -26202,20 +32403,29 @@ function ($response) { } /** - * Operation getLoyaltyPointsAsyncWithHttpInfo + * Operation getReferralsWithoutTotalCountAsyncWithHttpInfo * - * Get customer's full loyalty ledger + * List referrals * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (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 $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 getLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId) + 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\LoyaltyLedger'; - $request = $this->getLoyaltyPointsRequest($loyaltyProgramId, $integrationId); + $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()) @@ -26252,51 +32462,130 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyPoints' + * Create request for operation 'getReferralsWithoutTotalCount' * - * @param string $loyaltyProgramId The identifier for the loyalty program. (required) - * @param string $integrationId The identifier of the profile. (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 $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 getLoyaltyPointsRequest($loyaltyProgramId, $integrationId) + 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 '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 getLoyaltyPoints' + 'Missing the required parameter $applicationId when calling getReferralsWithoutTotalCount' ); } - // verify the required parameter 'integrationId' is set - if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $integrationId when calling getLoyaltyPoints' + '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/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}'; + + $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 - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } // path params - if ($integrationId !== null) { + if ($campaignId !== null) { $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -26376,36 +32665,36 @@ protected function getLoyaltyPointsRequest($loyaltyProgramId, $integrationId) } /** - * Operation getLoyaltyProgram + * Operation getRole * - * Get loyalty program + * Get role * - * @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 $roleId ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\LoyaltyProgram + * @return \TalonOne\Client\Model\Role */ - public function getLoyaltyProgram($loyaltyProgramId) + public function getRole($roleId) { - list($response) = $this->getLoyaltyProgramWithHttpInfo($loyaltyProgramId); + list($response) = $this->getRoleWithHttpInfo($roleId); return $response; } /** - * Operation getLoyaltyProgramWithHttpInfo + * Operation getRoleWithHttpInfo * - * Get loyalty program + * Get role * - * @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 $roleId ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) 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\Role, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) + public function getRoleWithHttpInfo($roleId) { - $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); + $request = $this->getRoleRequest($roleId); try { $options = $this->createHttpClientOption(); @@ -26438,20 +32727,20 @@ public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyProgram' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Role' === '\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\Role', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; + $returnType = '\TalonOne\Client\Model\Role'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26470,7 +32759,7 @@ public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyProgram', + '\TalonOne\Client\Model\Role', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26481,18 +32770,18 @@ public function getLoyaltyProgramWithHttpInfo($loyaltyProgramId) } /** - * Operation getLoyaltyProgramAsync + * Operation getRoleAsync * - * Get loyalty program + * Get role * - * @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 $roleId ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramAsync($loyaltyProgramId) + public function getRoleAsync($roleId) { - return $this->getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) + return $this->getRoleAsyncWithHttpInfo($roleId) ->then( function ($response) { return $response[0]; @@ -26501,19 +32790,19 @@ function ($response) { } /** - * Operation getLoyaltyProgramAsyncWithHttpInfo + * Operation getRoleAsyncWithHttpInfo * - * Get loyalty program + * Get role * - * @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 $roleId ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyProgramAsyncWithHttpInfo($loyaltyProgramId) + public function getRoleAsyncWithHttpInfo($roleId) { - $returnType = '\TalonOne\Client\Model\LoyaltyProgram'; - $request = $this->getLoyaltyProgramRequest($loyaltyProgramId); + $returnType = '\TalonOne\Client\Model\Role'; + $request = $this->getRoleRequest($roleId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26550,23 +32839,23 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyProgram' + * Create request for operation 'getRole' * - * @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 $roleId ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyProgramRequest($loyaltyProgramId) + protected function getRoleRequest($roleId) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'roleId' is set + if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling getLoyaltyProgram' + 'Missing the required parameter $roleId when calling getRole' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}'; + $resourcePath = '/v1/roles/{roleId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -26576,10 +32865,10 @@ protected function getLoyaltyProgramRequest($loyaltyProgramId) // path params - if ($loyaltyProgramId !== null) { + if ($roleId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'roleId' . '}', + ObjectSerializer::toPathValue($roleId), $resourcePath ); } @@ -26659,48 +32948,40 @@ protected function getLoyaltyProgramRequest($loyaltyProgramId) } /** - * Operation getLoyaltyProgramTransactions + * Operation getRuleset * - * List loyalty program transactions + * Get ruleset * - * @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 $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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (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\InlineResponse20013|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Ruleset */ - public function getLoyaltyProgramTransactions($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + public function getRuleset($applicationId, $campaignId, $rulesetId) { - list($response) = $this->getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); + list($response) = $this->getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId); return $response; } /** - * Operation getLoyaltyProgramTransactionsWithHttpInfo + * Operation getRulesetWithHttpInfo * - * List loyalty program transactions + * Get ruleset * - * @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 $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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (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\InlineResponse20013|\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\Ruleset, 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 getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) { - $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); + $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); try { $options = $this->createHttpClientOption(); @@ -26733,56 +33014,20 @@ public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $lo $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20013' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20013', []), - $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\Ruleset' === '\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\Ruleset', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20013'; + $returnType = '\TalonOne\Client\Model\Ruleset'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26801,31 +33046,7 @@ public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $lo case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20013', - $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\Ruleset', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26836,24 +33057,20 @@ public function getLoyaltyProgramTransactionsWithHttpInfo($loyaltyProgramId, $lo } /** - * Operation getLoyaltyProgramTransactionsAsync + * Operation getRulesetAsync * - * List loyalty program transactions + * Get ruleset * - * @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 $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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (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 getLoyaltyProgramTransactionsAsync($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + public function getRulesetAsync($applicationId, $campaignId, $rulesetId) { - return $this->getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip) + return $this->getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) ->then( function ($response) { return $response[0]; @@ -26862,25 +33079,21 @@ function ($response) { } /** - * Operation getLoyaltyProgramTransactionsAsyncWithHttpInfo + * Operation getRulesetAsyncWithHttpInfo * - * List loyalty program transactions + * Get ruleset * - * @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 $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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (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 getLoyaltyProgramTransactionsAsyncWithHttpInfo($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + public function getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20013'; - $request = $this->getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType, $subledgerId, $startDate, $endDate, $pageSize, $skip); + $returnType = '\TalonOne\Client\Model\Ruleset'; + $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26917,91 +33130,66 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyProgramTransactions' + * Create request for operation 'getRuleset' * - * @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 $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. (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. (optional) - * @param int $pageSize The number of items in this response. (optional, default to 50) - * @param int $skip The number of items to skip when paging through large result sets. (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 getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loyaltyTransactionType = null, $subledgerId = null, $startDate = null, $endDate = null, $pageSize = 50, $skip = null) + protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) { - // 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 getLoyaltyProgramTransactions' + 'Missing the required parameter $applicationId when calling getRuleset' ); } - 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 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getRuleset' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getLoyaltyProgramTransactions, must be bigger than or equal to 1.'); + // 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/loyalty_programs/{loyaltyProgramId}/transactions'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'; $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 ($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 ($rulesetId !== null) { + $resourcePath = str_replace( + '{' . 'rulesetId' . '}', + ObjectSerializer::toPathValue($rulesetId), $resourcePath ); } @@ -27081,34 +33269,44 @@ protected function getLoyaltyProgramTransactionsRequest($loyaltyProgramId, $loya } /** - * Operation getLoyaltyPrograms + * Operation getRulesets * - * List loyalty programs + * List campaign rulesets * + * @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\InlineResponse20012 + * @return \TalonOne\Client\Model\InlineResponse2007 */ - public function getLoyaltyPrograms() + public function getRulesets($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getLoyaltyProgramsWithHttpInfo(); + list($response) = $this->getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort); return $response; } /** - * Operation getLoyaltyProgramsWithHttpInfo + * Operation getRulesetsWithHttpInfo * - * List loyalty programs + * List campaign rulesets * + * @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\InlineResponse20012, 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 getLoyaltyProgramsWithHttpInfo() + public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getLoyaltyProgramsRequest(); + $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -27141,20 +33339,20 @@ public function getLoyaltyProgramsWithHttpInfo() $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20012' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2007' === '\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\InlineResponse2007', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20012'; + $returnType = '\TalonOne\Client\Model\InlineResponse2007'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -27173,7 +33371,7 @@ public function getLoyaltyProgramsWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20012', + '\TalonOne\Client\Model\InlineResponse2007', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27184,17 +33382,22 @@ public function getLoyaltyProgramsWithHttpInfo() } /** - * Operation getLoyaltyProgramsAsync + * Operation getRulesetsAsync * - * List loyalty programs + * List campaign rulesets * + * @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 getLoyaltyProgramsAsync() + public function getRulesetsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getLoyaltyProgramsAsyncWithHttpInfo() + return $this->getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -27203,18 +33406,23 @@ function ($response) { } /** - * Operation getLoyaltyProgramsAsyncWithHttpInfo + * Operation getRulesetsAsyncWithHttpInfo * - * List loyalty programs + * List campaign rulesets * + * @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 getLoyaltyProgramsAsyncWithHttpInfo() + public function getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20012'; - $request = $this->getLoyaltyProgramsRequest(); + $returnType = '\TalonOne\Client\Model\InlineResponse2007'; + $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27251,24 +33459,85 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyPrograms' + * Create request for operation 'getRulesets' * + * @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 getLoyaltyProgramsRequest() + protected function getRulesetsRequest($applicationId, $campaignId, $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 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/loyalty_programs'; + + $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 ($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; @@ -27345,36 +33614,38 @@ protected function getLoyaltyProgramsRequest() } /** - * Operation getLoyaltyStatistics + * Operation getStore * - * Get loyalty program statistics + * Get 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 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\LoyaltyDashboardData + * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyStatistics($loyaltyProgramId) + public function getStore($applicationId, $storeId) { - list($response) = $this->getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId); + list($response) = $this->getStoreWithHttpInfo($applicationId, $storeId); return $response; } /** - * Operation getLoyaltyStatisticsWithHttpInfo + * Operation getStoreWithHttpInfo * - * Get loyalty program statistics + * Get 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 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\LoyaltyDashboardData, 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 getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) + public function getStoreWithHttpInfo($applicationId, $storeId) { - $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); + $request = $this->getStoreRequest($applicationId, $storeId); try { $options = $this->createHttpClientOption(); @@ -27407,20 +33678,32 @@ public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyDashboardData' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Store' === '\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\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\LoyaltyDashboardData'; + $returnType = '\TalonOne\Client\Model\Store'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -27439,7 +33722,15 @@ public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyDashboardData', + '\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); @@ -27450,18 +33741,19 @@ public function getLoyaltyStatisticsWithHttpInfo($loyaltyProgramId) } /** - * Operation getLoyaltyStatisticsAsync + * Operation getStoreAsync * - * Get loyalty program statistics + * Get 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 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 getLoyaltyStatisticsAsync($loyaltyProgramId) + public function getStoreAsync($applicationId, $storeId) { - return $this->getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) + return $this->getStoreAsyncWithHttpInfo($applicationId, $storeId) ->then( function ($response) { return $response[0]; @@ -27470,19 +33762,20 @@ function ($response) { } /** - * Operation getLoyaltyStatisticsAsyncWithHttpInfo + * Operation getStoreAsyncWithHttpInfo * - * Get loyalty program statistics + * Get 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 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 getLoyaltyStatisticsAsyncWithHttpInfo($loyaltyProgramId) + public function getStoreAsyncWithHttpInfo($applicationId, $storeId) { - $returnType = '\TalonOne\Client\Model\LoyaltyDashboardData'; - $request = $this->getLoyaltyStatisticsRequest($loyaltyProgramId); + $returnType = '\TalonOne\Client\Model\Store'; + $request = $this->getStoreRequest($applicationId, $storeId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27519,23 +33812,30 @@ function ($exception) { } /** - * Create request for operation 'getLoyaltyStatistics' + * Create request for operation 'getStore' * - * @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 $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 getLoyaltyStatisticsRequest($loyaltyProgramId) + protected function getStoreRequest($applicationId, $storeId) { - // 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 getLoyaltyStatistics' + 'Missing the required parameter $applicationId when calling getStore' + ); + } + // 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/loyalty_programs/{loyaltyProgramId}/statistics'; + $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27545,10 +33845,18 @@ protected function getLoyaltyStatisticsRequest($loyaltyProgramId) // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($storeId !== null) { + $resourcePath = str_replace( + '{' . 'storeId' . '}', + ObjectSerializer::toPathValue($storeId), $resourcePath ); } @@ -27628,56 +33936,36 @@ protected function getLoyaltyStatisticsRequest($loyaltyProgramId) } /** - * Operation getReferralsWithoutTotalCount + * Operation getUser * - * List referrals + * Get 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 this 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 timezone. 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 timezone. 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 $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20010 + * @return \TalonOne\Client\Model\User */ - 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 getUser($userId) { - list($response) = $this->getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); + list($response) = $this->getUserWithHttpInfo($userId); return $response; } /** - * Operation getReferralsWithoutTotalCountWithHttpInfo + * Operation getUserWithHttpInfo * - * List referrals + * Get 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 this 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 timezone. 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 timezone. 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 $userId The ID of the user. (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\User, 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 getUserWithHttpInfo($userId) { - $request = $this->getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); + $request = $this->getUserRequest($userId); try { $options = $this->createHttpClientOption(); @@ -27710,20 +33998,20 @@ public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campa $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20010' === '\SplFileObject') { + if ('\TalonOne\Client\Model\User' === '\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\User', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20010'; + $returnType = '\TalonOne\Client\Model\User'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -27742,7 +34030,7 @@ public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20010', + '\TalonOne\Client\Model\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -27753,28 +34041,18 @@ public function getReferralsWithoutTotalCountWithHttpInfo($applicationId, $campa } /** - * Operation getReferralsWithoutTotalCountAsync + * Operation getUserAsync * - * List referrals + * Get 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 this 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 timezone. 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 timezone. 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 $userId The ID of the user. (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 getUserAsync($userId) { - return $this->getReferralsWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate) + return $this->getUserAsyncWithHttpInfo($userId) ->then( function ($response) { return $response[0]; @@ -27783,29 +34061,19 @@ function ($response) { } /** - * Operation getReferralsWithoutTotalCountAsyncWithHttpInfo + * Operation getUserAsyncWithHttpInfo * - * List referrals + * Get 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 this 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 timezone. 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 timezone. 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 $userId The ID of the user. (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 getUserAsyncWithHttpInfo($userId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20010'; - $request = $this->getReferralsWithoutTotalCountRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $code, $createdBefore, $createdAfter, $valid, $usable, $advocate); + $returnType = '\TalonOne\Client\Model\User'; + $request = $this->getUserRequest($userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27842,130 +34110,36 @@ function ($exception) { } /** - * Create request for operation 'getReferralsWithoutTotalCount' + * Create request for operation 'getUser' * - * @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 this 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 timezone. 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 timezone. 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 $userId The ID of the user. (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 getUserRequest($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 getReferralsWithoutTotalCount' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getReferralsWithoutTotalCount' + 'Missing the required parameter $userId when calling getUser' ); } - 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/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($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 ($userId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), $resourcePath ); } @@ -28045,36 +34219,40 @@ protected function getReferralsWithoutTotalCountRequest($applicationId, $campaig } /** - * Operation getRole + * Operation getUsers * - * Get role + * List users in account * - * @param int $roleId The ID of role. (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\Role + * @return \TalonOne\Client\Model\InlineResponse20041 */ - public function getRole($roleId) + public function getUsers($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getRoleWithHttpInfo($roleId); + list($response) = $this->getUsersWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getRoleWithHttpInfo + * Operation getUsersWithHttpInfo * - * Get role + * List users in account * - * @param int $roleId The ID of role. (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\Role, 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 getRoleWithHttpInfo($roleId) + public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getRoleRequest($roleId); + $request = $this->getUsersRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -28107,20 +34285,20 @@ public function getRoleWithHttpInfo($roleId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Role' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20041' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Role', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20041', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Role'; + $returnType = '\TalonOne\Client\Model\InlineResponse20041'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -28139,7 +34317,7 @@ public function getRoleWithHttpInfo($roleId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Role', + '\TalonOne\Client\Model\InlineResponse20041', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28150,18 +34328,20 @@ public function getRoleWithHttpInfo($roleId) } /** - * Operation getRoleAsync + * Operation getUsersAsync * - * Get role + * List users in account * - * @param int $roleId The ID of role. (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 getRoleAsync($roleId) + public function getUsersAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getRoleAsyncWithHttpInfo($roleId) + return $this->getUsersAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -28170,19 +34350,21 @@ function ($response) { } /** - * Operation getRoleAsyncWithHttpInfo + * Operation getUsersAsyncWithHttpInfo * - * Get role + * List users in account * - * @param int $roleId The ID of role. (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 getRoleAsyncWithHttpInfo($roleId) + public function getUsersAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\Role'; - $request = $this->getRoleRequest($roleId); + $returnType = '\TalonOne\Client\Model\InlineResponse20041'; + $request = $this->getUsersRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28219,39 +34401,55 @@ function ($exception) { } /** - * Create request for operation 'getRole' + * Create request for operation 'getUsers' * - * @param int $roleId The ID of role. (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 getRoleRequest($roleId) + protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) { - // verify the required parameter 'roleId' is set - if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $roleId when calling getRole' - ); + if ($pageSize !== null && $pageSize > 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.getUsers, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/roles/{roleId}'; + + $resourcePath = '/v1/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; + } - // path params - if ($roleId !== null) { - $resourcePath = str_replace( - '{' . 'roleId' . '}', - ObjectSerializer::toPathValue($roleId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -28328,40 +34526,36 @@ protected function getRoleRequest($roleId) } /** - * Operation getRuleset + * Operation getWebhook * - * Get ruleset + * Get webhook * - * @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) + * @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\Ruleset + * @return \TalonOne\Client\Model\Webhook */ - public function getRuleset($applicationId, $campaignId, $rulesetId) + public function getWebhook($webhookId) { - list($response) = $this->getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId); + list($response) = $this->getWebhookWithHttpInfo($webhookId); return $response; } /** - * Operation getRulesetWithHttpInfo + * Operation getWebhookWithHttpInfo * - * Get ruleset + * Get webhook * - * @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) + * @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\Ruleset, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Webhook, HTTP status code, HTTP response headers (array of strings) */ - public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) + public function getWebhookWithHttpInfo($webhookId) { - $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); + $request = $this->getWebhookRequest($webhookId); try { $options = $this->createHttpClientOption(); @@ -28394,20 +34588,20 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Ruleset' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Webhook' === '\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\Webhook', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Ruleset'; + $returnType = '\TalonOne\Client\Model\Webhook'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -28426,7 +34620,7 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Ruleset', + '\TalonOne\Client\Model\Webhook', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28437,20 +34631,18 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) } /** - * Operation getRulesetAsync + * Operation getWebhookAsync * - * Get ruleset + * Get webhook * - * @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) + * @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 getRulesetAsync($applicationId, $campaignId, $rulesetId) + public function getWebhookAsync($webhookId) { - return $this->getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) + return $this->getWebhookAsyncWithHttpInfo($webhookId) ->then( function ($response) { return $response[0]; @@ -28459,21 +34651,19 @@ function ($response) { } /** - * Operation getRulesetAsyncWithHttpInfo + * Operation getWebhookAsyncWithHttpInfo * - * Get ruleset + * Get webhook * - * @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) + * @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 getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) + public function getWebhookAsyncWithHttpInfo($webhookId) { - $returnType = '\TalonOne\Client\Model\Ruleset'; - $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); + $returnType = '\TalonOne\Client\Model\Webhook'; + $request = $this->getWebhookRequest($webhookId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28510,37 +34700,23 @@ function ($exception) { } /** - * Create request for operation 'getRuleset' + * Create request for operation 'getWebhook' * - * @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) + * @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 getRulesetRequest($applicationId, $campaignId, $rulesetId) + protected function getWebhookRequest($webhookId) { - // 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)) { + // verify the required parameter 'webhookId' is set + if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $rulesetId when calling getRuleset' + 'Missing the required parameter $webhookId when calling getWebhook' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'; + $resourcePath = '/v1/webhooks/{webhookId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28550,26 +34726,10 @@ 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) { + if ($webhookId !== null) { $resourcePath = str_replace( - '{' . 'rulesetId' . '}', - ObjectSerializer::toPathValue($rulesetId), + '{' . 'webhookId' . '}', + ObjectSerializer::toPathValue($webhookId), $resourcePath ); } @@ -28649,44 +34809,52 @@ protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) } /** - * Operation getRulesets + * Operation getWebhookActivationLogs * - * List campaign rulesets + * List webhook activation log entries * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse2007 + * @return \TalonOne\Client\Model\InlineResponse20038 */ - public function getRulesets($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = 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->getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort); + list($response) = $this->getWebhookActivationLogsWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); return $response; } /** - * Operation getRulesetsWithHttpInfo + * Operation getWebhookActivationLogsWithHttpInfo * - * List campaign rulesets + * List webhook activation log entries * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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\InlineResponse2007, 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 getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) { - $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); + $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); try { $options = $this->createHttpClientOption(); @@ -28719,20 +34887,20 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2007' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20038' === '\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\InlineResponse20038', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse2007'; + $returnType = '\TalonOne\Client\Model\InlineResponse20038'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -28751,7 +34919,7 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2007', + '\TalonOne\Client\Model\InlineResponse20038', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -28762,22 +34930,26 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = } /** - * Operation getRulesetsAsync + * Operation getWebhookActivationLogsAsync * - * List campaign rulesets + * List webhook activation log entries * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getRulesetsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getWebhookActivationLogsAsync($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) { - return $this->getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort) + return $this->getWebhookActivationLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) ->then( function ($response) { return $response[0]; @@ -28786,23 +34958,27 @@ function ($response) { } /** - * Operation getRulesetsAsyncWithHttpInfo + * Operation getWebhookActivationLogsAsyncWithHttpInfo * - * List campaign rulesets + * List webhook activation log entries * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + 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\InlineResponse2007'; - $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\InlineResponse20038'; + $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28839,40 +35015,32 @@ function ($exception) { } /** - * Create request for operation 'getRulesets' + * Create request for operation 'getWebhookActivationLogs' * - * @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 this response. (optional, default to 1000) + * @param int $pageSize The number of items in 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 getRulesetsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = 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 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.'); + 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.getRulesets, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets'; + $resourcePath = '/v1/webhook_activation_logs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28900,25 +35068,51 @@ protected function getRulesetsRequest($applicationId, $campaignId, $pageSize = 1 if ($sort !== null) { $queryParams['sort'] = $sort; } - - - // path params + // 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) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); + $queryParams['applicationId'] = $applicationId; + } + // query params + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); } - // path params if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); + $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; @@ -28994,38 +35188,54 @@ protected function getRulesetsRequest($applicationId, $campaignId, $pageSize = 1 } /** - * Operation getStore + * Operation getWebhookLogs * - * Get store + * List webhook log entries * - * @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 $pageSize The number of items in 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\Store|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20039 */ - public function getStore($applicationId, $storeId) + 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->getStoreWithHttpInfo($applicationId, $storeId); + list($response) = $this->getWebhookLogsWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); return $response; } /** - * Operation getStoreWithHttpInfo + * Operation getWebhookLogsWithHttpInfo * - * Get store + * List webhook log entries * - * @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 $pageSize The number of items in 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\Store|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20039, HTTP status code, HTTP response headers (array of strings) */ - public function getStoreWithHttpInfo($applicationId, $storeId) + 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->getStoreRequest($applicationId, $storeId); + $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); try { $options = $this->createHttpClientOption(); @@ -29058,32 +35268,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\InlineResponse20039' === '\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\InlineResponse20039', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Store'; + $returnType = '\TalonOne\Client\Model\InlineResponse20039'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -29102,15 +35300,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\InlineResponse20039', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -29121,19 +35311,27 @@ public function getStoreWithHttpInfo($applicationId, $storeId) } /** - * Operation getStoreAsync + * Operation getWebhookLogsAsync * - * Get store + * List webhook log entries * - * @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 $pageSize The number of items in 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 getStoreAsync($applicationId, $storeId) + 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->getStoreAsyncWithHttpInfo($applicationId, $storeId) + return $this->getWebhookLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) ->then( function ($response) { return $response[0]; @@ -29142,20 +35340,28 @@ function ($response) { } /** - * Operation getStoreAsyncWithHttpInfo + * Operation getWebhookLogsAsyncWithHttpInfo * - * Get store + * List webhook log entries * - * @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 $pageSize The number of items in 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 getStoreAsyncWithHttpInfo($applicationId, $storeId) + 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\Store'; - $request = $this->getStoreRequest($applicationId, $storeId); + $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()) @@ -29192,55 +35398,112 @@ function ($exception) { } /** - * Create request for operation 'getStore' + * Create request for operation 'getWebhookLogs' * - * @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 $pageSize The number of items in 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 getStoreRequest($applicationId, $storeId) + protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = 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' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be smaller than or equal to 1000.'); } - // 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' - ); + 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/applications/{applicationId}/stores/{storeId}'; + + $resourcePath = '/v1/webhook_logs'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - - // path params + // 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) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); + $queryParams['applicationId'] = $applicationId; } - // path params - if ($storeId !== null) { - $resourcePath = str_replace( - '{' . 'storeId' . '}', - ObjectSerializer::toPathValue($storeId), - $resourcePath - ); + // 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; @@ -29316,36 +35579,50 @@ protected function getStoreRequest($applicationId, $storeId) } /** - * Operation getUser + * Operation getWebhooks * - * Get user + * List webhooks * - * @param int $userId The ID of the user. (required) + * @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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\User + * @return \TalonOne\Client\Model\InlineResponse20037 */ - public function getUser($userId) + public function getWebhooks($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - list($response) = $this->getUserWithHttpInfo($userId); + list($response) = $this->getWebhooksWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); return $response; } /** - * Operation getUserWithHttpInfo + * Operation getWebhooksWithHttpInfo * - * Get user + * List webhooks * - * @param int $userId The ID of the user. (required) + * @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) * * @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\InlineResponse20037, HTTP status code, HTTP response headers (array of strings) */ - public function getUserWithHttpInfo($userId) + public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - $request = $this->getUserRequest($userId); + $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); try { $options = $this->createHttpClientOption(); @@ -29378,20 +35655,20 @@ public function getUserWithHttpInfo($userId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\User' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20037' === '\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\InlineResponse20037', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\User'; + $returnType = '\TalonOne\Client\Model\InlineResponse20037'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -29410,7 +35687,7 @@ public function getUserWithHttpInfo($userId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\User', + '\TalonOne\Client\Model\InlineResponse20037', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -29421,18 +35698,25 @@ public function getUserWithHttpInfo($userId) } /** - * Operation getUserAsync + * Operation getWebhooksAsync * - * Get user + * List webhooks * - * @param int $userId The ID of the user. (required) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserAsync($userId) + public function getWebhooksAsync($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - return $this->getUserAsyncWithHttpInfo($userId) + return $this->getWebhooksAsyncWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) ->then( function ($response) { return $response[0]; @@ -29441,19 +35725,26 @@ function ($response) { } /** - * Operation getUserAsyncWithHttpInfo + * Operation getWebhooksAsyncWithHttpInfo * - * Get user + * List webhooks * - * @param int $userId The ID of the user. (required) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserAsyncWithHttpInfo($userId) + public function getWebhooksAsyncWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - $returnType = '\TalonOne\Client\Model\User'; - $request = $this->getUserRequest($userId); + $returnType = '\TalonOne\Client\Model\InlineResponse20037'; + $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29490,39 +35781,95 @@ function ($exception) { } /** - * Create request for operation 'getUser' + * Create request for operation 'getWebhooks' * - * @param int $userId The ID of the user. (required) + * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getUserRequest($userId) + protected function getWebhooksRequest($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - // 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' - ); + 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/users/{userId}'; + + $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; + } - // path params - if ($userId !== null) { - $resourcePath = str_replace( - '{' . 'userId' . '}', - ObjectSerializer::toPathValue($userId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -29599,40 +35946,38 @@ protected function getUserRequest($userId) } /** - * Operation getUsers + * Operation importAccountCollection * - * List users in account + * Import data into existing account-level collection * - * @param int $pageSize The number of items in this 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) + * @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\InlineResponse20039 + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getUsers($pageSize = 1000, $skip = null, $sort = null) + public function importAccountCollection($collectionId, $upFile = null) { - list($response) = $this->getUsersWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->importAccountCollectionWithHttpInfo($collectionId, $upFile); return $response; } /** - * Operation getUsersWithHttpInfo + * Operation importAccountCollectionWithHttpInfo * - * List users in account + * Import data into existing account-level collection * - * @param int $pageSize The number of items in this 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) + * @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\InlineResponse20039, HTTP status code, HTTP response headers (array of strings) + * @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 getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function importAccountCollectionWithHttpInfo($collectionId, $upFile = null) { - $request = $this->getUsersRequest($pageSize, $skip, $sort); + $request = $this->importAccountCollectionRequest($collectionId, $upFile); try { $options = $this->createHttpClientOption(); @@ -29665,20 +36010,44 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20039' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Import' === '\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\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\InlineResponse20039'; + $returnType = '\TalonOne\Client\Model\Import'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -29697,7 +36066,23 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20039', + '\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); @@ -29708,20 +36093,19 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul } /** - * Operation getUsersAsync + * Operation importAccountCollectionAsync * - * List users in account + * Import data into existing account-level collection * - * @param int $pageSize The number of items in this 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) + * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUsersAsync($pageSize = 1000, $skip = null, $sort = null) + public function importAccountCollectionAsync($collectionId, $upFile = null) { - return $this->getUsersAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile) ->then( function ($response) { return $response[0]; @@ -29730,21 +36114,20 @@ function ($response) { } /** - * Operation getUsersAsyncWithHttpInfo + * Operation importAccountCollectionAsyncWithHttpInfo * - * List users in account + * Import data into existing account-level collection * - * @param int $pageSize The number of items in this 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) + * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUsersAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20039'; - $request = $this->getUsersRequest($pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importAccountCollectionRequest($collectionId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29781,56 +36164,45 @@ function ($exception) { } /** - * Create request for operation 'getUsers' + * Create request for operation 'importAccountCollection' * - * @param int $pageSize The number of items in this 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) + * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) + protected function importAccountCollectionRequest($collectionId, $upFile = null) { - if ($pageSize !== null && $pageSize > 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.getUsers, 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 importAccountCollection' + ); } - - $resourcePath = '/v1/users'; + $resourcePath = '/v1/collections/{collectionId}/import'; $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 ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } // body params $_tempBody = null; @@ -29841,7 +36213,7 @@ protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['multipart/form-data'] ); } @@ -29898,7 +36270,7 @@ protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -29906,36 +36278,38 @@ protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) } /** - * Operation getWebhook + * Operation importAllowedList * - * Get webhook + * Import allowed values for attribute * - * @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 $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\Webhook + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getWebhook($webhookId) + public function importAllowedList($attributeId, $upFile = null) { - list($response) = $this->getWebhookWithHttpInfo($webhookId); + list($response) = $this->importAllowedListWithHttpInfo($attributeId, $upFile); return $response; } /** - * Operation getWebhookWithHttpInfo + * Operation importAllowedListWithHttpInfo * - * Get webhook + * Import allowed values for attribute * - * @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 $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\Webhook, HTTP status code, HTTP response headers (array of strings) + * @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 getWebhookWithHttpInfo($webhookId) + public function importAllowedListWithHttpInfo($attributeId, $upFile = null) { - $request = $this->getWebhookRequest($webhookId); + $request = $this->importAllowedListRequest($attributeId, $upFile); try { $options = $this->createHttpClientOption(); @@ -29968,20 +36342,56 @@ public function getWebhookWithHttpInfo($webhookId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Webhook' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Import' === '\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\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\Webhook'; + $returnType = '\TalonOne\Client\Model\Import'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -30000,7 +36410,31 @@ public function getWebhookWithHttpInfo($webhookId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Webhook', + '\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); @@ -30011,18 +36445,19 @@ public function getWebhookWithHttpInfo($webhookId) } /** - * Operation getWebhookAsync + * Operation importAllowedListAsync * - * Get webhook + * Import allowed values for attribute * - * @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 $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 getWebhookAsync($webhookId) + public function importAllowedListAsync($attributeId, $upFile = null) { - return $this->getWebhookAsyncWithHttpInfo($webhookId) + return $this->importAllowedListAsyncWithHttpInfo($attributeId, $upFile) ->then( function ($response) { return $response[0]; @@ -30031,19 +36466,20 @@ function ($response) { } /** - * Operation getWebhookAsyncWithHttpInfo + * Operation importAllowedListAsyncWithHttpInfo * - * Get webhook + * Import allowed values for attribute * - * @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 $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 getWebhookAsyncWithHttpInfo($webhookId) + public function importAllowedListAsyncWithHttpInfo($attributeId, $upFile = null) { - $returnType = '\TalonOne\Client\Model\Webhook'; - $request = $this->getWebhookRequest($webhookId); + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importAllowedListRequest($attributeId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30080,23 +36516,24 @@ function ($exception) { } /** - * Create request for operation 'getWebhook' + * Create request for operation 'importAllowedList' * - * @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 $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 getWebhookRequest($webhookId) + protected function importAllowedListRequest($attributeId, $upFile = null) { - // verify the required parameter 'webhookId' is set - if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { + // verify the required parameter 'attributeId' is set + if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $webhookId when calling getWebhook' + 'Missing the required parameter $attributeId when calling importAllowedList' ); } - $resourcePath = '/v1/webhooks/{webhookId}'; + $resourcePath = '/v1/attributes/{attributeId}/allowed_list/import'; $formParams = []; $queryParams = []; $headerParams = []; @@ -30106,14 +36543,18 @@ protected function getWebhookRequest($webhookId) // path params - if ($webhookId !== null) { + if ($attributeId !== null) { $resourcePath = str_replace( - '{' . 'webhookId' . '}', - ObjectSerializer::toPathValue($webhookId), + '{' . 'attributeId' . '}', + ObjectSerializer::toPathValue($attributeId), $resourcePath ); } + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } // body params $_tempBody = null; @@ -30124,7 +36565,7 @@ protected function getWebhookRequest($webhookId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['multipart/form-data'] ); } @@ -30181,7 +36622,7 @@ protected function getWebhookRequest($webhookId) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -30189,52 +36630,38 @@ protected function getWebhookRequest($webhookId) } /** - * Operation getWebhookActivationLogs + * Operation importAudiencesMemberships * - * List webhook activation log entries + * Import audience members * - * @param int $pageSize The number of items in this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. (optional) + * @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\InlineResponse20036 + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\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 importAudiencesMemberships($audienceId, $upFile = null) { - list($response) = $this->getWebhookActivationLogsWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + list($response) = $this->importAudiencesMembershipsWithHttpInfo($audienceId, $upFile); return $response; } /** - * Operation getWebhookActivationLogsWithHttpInfo + * Operation importAudiencesMembershipsWithHttpInfo * - * List webhook activation log entries + * Import audience members * - * @param int $pageSize The number of items in this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. (optional) + * @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\InlineResponse20036, HTTP status code, HTTP response headers (array of strings) + * @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 getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = null) { - $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); try { $options = $this->createHttpClientOption(); @@ -30267,20 +36694,56 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20036' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Import' === '\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\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\InlineResponse20036'; + $returnType = '\TalonOne\Client\Model\Import'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -30299,7 +36762,31 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20036', + '\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); @@ -30310,26 +36797,19 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n } /** - * Operation getWebhookActivationLogsAsync + * Operation importAudiencesMembershipsAsync * - * List webhook activation log entries + * Import audience members * - * @param int $pageSize The number of items in this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. (optional) + * @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 getWebhookActivationLogsAsync($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + public function importAudiencesMembershipsAsync($audienceId, $upFile = null) { - return $this->getWebhookActivationLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) + return $this->importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile) ->then( function ($response) { return $response[0]; @@ -30338,27 +36818,20 @@ function ($response) { } /** - * Operation getWebhookActivationLogsAsyncWithHttpInfo + * Operation importAudiencesMembershipsAsyncWithHttpInfo * - * List webhook activation log entries + * Import audience members * - * @param int $pageSize The number of items in this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. (optional) + * @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 getWebhookActivationLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + public function importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20036'; - $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30395,104 +36868,45 @@ function ($exception) { } /** - * Create request for operation 'getWebhookActivationLogs' + * Create request for operation 'importAudiencesMemberships' * - * @param int $pageSize The number of items in this 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 timezone. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally. (optional) + * @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 getWebhookActivationLogsRequest($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + protected function importAudiencesMembershipsRequest($audienceId, $upFile = 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.'); + // 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/webhook_activation_logs'; + $resourcePath = '/v1/audiences/{audienceId}/memberships/import'; $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; - } + // 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; @@ -30503,7 +36917,7 @@ protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = nul } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['multipart/form-data'] ); } @@ -30560,7 +36974,7 @@ protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = nul $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -30568,54 +36982,42 @@ protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = nul } /** - * Operation getWebhookLogs + * Operation importCollection * - * List webhook log entries + * Import data into existing campaign-level collection * - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 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\InlineResponse20037 + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus */ - 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 importCollection($applicationId, $campaignId, $collectionId, $upFile = null) { - list($response) = $this->getWebhookLogsWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + list($response) = $this->importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile); return $response; } /** - * Operation getWebhookLogsWithHttpInfo + * Operation importCollectionWithHttpInfo * - * List webhook log entries + * Import data into existing campaign-level collection * - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 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\InlineResponse20037, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) { - $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); try { $options = $this->createHttpClientOption(); @@ -30648,20 +37050,32 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20037' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Import' === '\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\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\InlineResponse20037'; + $returnType = '\TalonOne\Client\Model\Import'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -30680,7 +37094,15 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20037', + '\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); @@ -30691,27 +37113,21 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort } /** - * Operation getWebhookLogsAsync + * Operation importCollectionAsync * - * List webhook log entries + * Import data into existing campaign-level collection * - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 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 getWebhookLogsAsync($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function importCollectionAsync($applicationId, $campaignId, $collectionId, $upFile = null) { - return $this->getWebhookLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) + return $this->importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile) ->then( function ($response) { return $response[0]; @@ -30720,28 +37136,22 @@ function ($response) { } /** - * Operation getWebhookLogsAsyncWithHttpInfo + * Operation importCollectionAsyncWithHttpInfo * - * List webhook log entries + * Import data into existing campaign-level collection * - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 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 getWebhookLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20037'; - $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30778,112 +37188,75 @@ function ($exception) { } /** - * Create request for operation 'getWebhookLogs' + * Create request for operation 'importCollection' * - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 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 getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + protected function importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile = 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.'); + // 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' + ); } - 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 '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/webhook_logs'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import'; $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); - } + + + // path params if ($applicationId !== null) { - $queryParams['applicationId'] = $applicationId; - } - // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); } + // path params 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); + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; + // 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; @@ -30894,7 +37267,7 @@ protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['multipart/form-data'] ); } @@ -30951,7 +37324,7 @@ protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -30959,50 +37332,42 @@ protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = } /** - * Operation getWebhooks + * Operation importCoupons * - * List webhooks + * Import coupons * - * @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 this 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 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\InlineResponse20035 + * @return \TalonOne\Client\Model\Import */ - public function getWebhooks($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function importCoupons($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { - list($response) = $this->getWebhooksWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + list($response) = $this->importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile); return $response; } /** - * Operation getWebhooksWithHttpInfo + * Operation importCouponsWithHttpInfo * - * List webhooks + * Import coupons * - * @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 this 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 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\InlineResponse20035, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Import, 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 importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { - $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); try { $options = $this->createHttpClientOption(); @@ -31035,20 +37400,20 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20035' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Import' === '\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\Import', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20035'; + $returnType = '\TalonOne\Client\Model\Import'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -31067,7 +37432,7 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20035', + '\TalonOne\Client\Model\Import', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -31078,25 +37443,21 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p } /** - * Operation getWebhooksAsync + * Operation importCouponsAsync * - * List webhooks + * Import coupons * - * @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 this 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 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 getWebhooksAsync($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function importCouponsAsync($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { - return $this->getWebhooksAsyncWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) + return $this->importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile) ->then( function ($response) { return $response[0]; @@ -31105,26 +37466,22 @@ function ($response) { } /** - * Operation getWebhooksAsyncWithHttpInfo + * Operation importCouponsAsyncWithHttpInfo * - * List webhooks + * Import coupons * - * @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 this 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 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 getWebhooksAsyncWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20035'; - $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31161,31 +37518,32 @@ function ($exception) { } /** - * Create request for operation 'getWebhooks' + * Create request for operation 'importCoupons' * - * @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 this 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 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 getWebhooksRequest($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + protected function importCouponsRequest($applicationId, $campaignId, $skipDuplicates = null, $upFile = 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.'); + // 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' + ); } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhooks, 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 importCoupons' + ); } - - $resourcePath = '/v1/webhooks'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31193,64 +37551,35 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag $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 (is_array($skipDuplicates)) { + $skipDuplicates = ObjectSerializer::serializeCollection($skipDuplicates, '', 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; + 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; @@ -31261,7 +37590,7 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['multipart/form-data'] ); } @@ -31318,7 +37647,7 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -31326,38 +37655,38 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag } /** - * Operation importAccountCollection + * Operation importLoyaltyCards * - * Import data into existing account-level collection + * Import loyalty cards * - * @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 with the information about the data that should be imported. (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 $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) + public function importLoyaltyCards($loyaltyProgramId, $upFile = null) { - list($response) = $this->importAccountCollectionWithHttpInfo($collectionId, $upFile); + list($response) = $this->importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile); return $response; } /** - * Operation importAccountCollectionWithHttpInfo + * Operation importLoyaltyCardsWithHttpInfo * - * Import data into existing account-level collection + * Import loyalty cards * - * @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 with the information about the data that should be imported. (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 $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) + public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null) { - $request = $this->importAccountCollectionRequest($collectionId, $upFile); + $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); try { $options = $this->createHttpClientOption(); @@ -31401,7 +37730,7 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -31413,7 +37742,7 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 404: if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -31451,7 +37780,7 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -31459,7 +37788,7 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\ErrorResponseWithStatus', @@ -31473,19 +37802,19 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul } /** - * Operation importAccountCollectionAsync + * Operation importLoyaltyCardsAsync * - * Import data into existing account-level collection + * Import loyalty cards * - * @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 with the information about the data that should be imported. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAccountCollectionAsync($collectionId, $upFile = null) + public function importLoyaltyCardsAsync($loyaltyProgramId, $upFile = null) { - return $this->importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile) + return $this->importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile) ->then( function ($response) { return $response[0]; @@ -31494,20 +37823,20 @@ function ($response) { } /** - * Operation importAccountCollectionAsyncWithHttpInfo + * Operation importLoyaltyCardsAsyncWithHttpInfo * - * Import data into existing account-level collection + * Import loyalty cards * - * @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 with the information about the data that should be imported. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile = null) + public function importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAccountCollectionRequest($collectionId, $upFile); + $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31544,24 +37873,24 @@ function ($exception) { } /** - * Create request for operation 'importAccountCollection' + * Create request for operation 'importLoyaltyCards' * - * @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 with the information about the data that should be imported. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importAccountCollectionRequest($collectionId, $upFile = null) + protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) { - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling importAccountCollection' + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCards' ); } - $resourcePath = '/v1/collections/{collectionId}/import'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_cards'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31571,10 +37900,10 @@ protected function importAccountCollectionRequest($collectionId, $upFile = null) // path params - if ($collectionId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -31658,38 +37987,38 @@ protected function importAccountCollectionRequest($collectionId, $upFile = null) } /** - * Operation importAllowedList + * Operation importLoyaltyCustomersTiers * - * Import allowed values for attribute + * Import customers into loyalty tiers * - * @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 with the information about the data that should be imported. (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) + * @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 + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importAllowedList($attributeId, $upFile = null) + public function importLoyaltyCustomersTiers($loyaltyProgramId, $upFile = null) { - list($response) = $this->importAllowedListWithHttpInfo($attributeId, $upFile); + list($response) = $this->importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile); return $response; } /** - * Operation importAllowedListWithHttpInfo + * Operation importLoyaltyCustomersTiersWithHttpInfo * - * Import allowed values for attribute + * Import customers into loyalty tiers * - * @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 with the information about the data that should be imported. (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) + * @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) + * @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 importAllowedListWithHttpInfo($attributeId, $upFile = null) + public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile = null) { - $request = $this->importAllowedListRequest($attributeId, $upFile); + $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); try { $options = $this->createHttpClientOption(); @@ -31734,14 +38063,14 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) $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() ]; @@ -31798,7 +38127,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); @@ -31825,19 +38154,19 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) } /** - * Operation importAllowedListAsync + * Operation importLoyaltyCustomersTiersAsync * - * Import allowed values for attribute + * Import customers into loyalty tiers * - * @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 with the information about the data that should be imported. (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) + * @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) + public function importLoyaltyCustomersTiersAsync($loyaltyProgramId, $upFile = null) { - return $this->importAllowedListAsyncWithHttpInfo($attributeId, $upFile) + return $this->importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile) ->then( function ($response) { return $response[0]; @@ -31846,20 +38175,20 @@ function ($response) { } /** - * Operation importAllowedListAsyncWithHttpInfo + * Operation importLoyaltyCustomersTiersAsyncWithHttpInfo * - * Import allowed values for attribute + * Import customers into loyalty tiers * - * @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 with the information about the data that should be imported. (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) + * @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) + public function importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAllowedListRequest($attributeId, $upFile); + $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31896,24 +38225,24 @@ function ($exception) { } /** - * Create request for operation 'importAllowedList' + * Create request for operation 'importLoyaltyCustomersTiers' * - * @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 with the information about the data that should be imported. (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) + * @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) + protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile = null) { - // verify the required parameter 'attributeId' is set - if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $attributeId when calling importAllowedList' + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCustomersTiers' ); } - $resourcePath = '/v1/attributes/{attributeId}/allowed_list/import'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31923,10 +38252,10 @@ protected function importAllowedListRequest($attributeId, $upFile = null) // path params - if ($attributeId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'attributeId' . '}', - ObjectSerializer::toPathValue($attributeId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -32010,42 +38339,38 @@ protected function importAllowedListRequest($attributeId, $upFile = null) } /** - * Operation importCollection + * Operation importLoyaltyPoints * - * Import data into existing campaign-level collection + * Import 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 $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 with the information about the data that should be imported. (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) + * @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\Import */ - public function importCollection($applicationId, $campaignId, $collectionId, $upFile = null) + public function importLoyaltyPoints($loyaltyProgramId, $upFile = null) { - list($response) = $this->importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile); + list($response) = $this->importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile); return $response; } /** - * Operation importCollectionWithHttpInfo + * Operation importLoyaltyPointsWithHttpInfo * - * Import data into existing campaign-level collection + * Import 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 $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 with the information about the data that should be imported. (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) + * @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\Import, HTTP status code, HTTP response headers (array of strings) */ - public function importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) + public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = null) { - $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); try { $options = $this->createHttpClientOption(); @@ -32089,18 +38414,6 @@ public function importCollectionWithHttpInfo($applicationId, $campaignId, $colle $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'; @@ -32127,35 +38440,25 @@ public function importCollectionWithHttpInfo($applicationId, $campaignId, $colle ); $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 + * Operation importLoyaltyPointsAsync * - * Import data into existing campaign-level collection + * Import 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 $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 with the information about the data that should be imported. (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) + * @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 importLoyaltyPointsAsync($loyaltyProgramId, $upFile = null) { - return $this->importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile) + return $this->importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile) ->then( function ($response) { return $response[0]; @@ -32164,22 +38467,20 @@ function ($response) { } /** - * Operation importCollectionAsyncWithHttpInfo + * Operation importLoyaltyPointsAsyncWithHttpInfo * - * Import data into existing campaign-level collection + * Import 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 $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 with the information about the data that should be imported. (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) + * @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 importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32216,38 +38517,24 @@ function ($exception) { } /** - * Create request for operation 'importCollection' + * Create request for operation 'importLoyaltyPoints' * - * @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 with the information about the data that should be imported. (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) + * @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 importLoyaltyPointsRequest($loyaltyProgramId, $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)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling importCollection' + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyPoints' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32257,26 +38544,10 @@ 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) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -32360,40 +38631,38 @@ protected function importCollectionRequest($applicationId, $campaignId, $collect } /** - * Operation importCoupons + * Operation importPoolGiveaways * - * Import coupons + * Import giveaway codes into a giveaway pool * - * @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 with the information about the data that should be imported. (optional) + * @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 importCoupons($applicationId, $campaignId, $upFile = null) + public function importPoolGiveaways($poolId, $upFile = null) { - list($response) = $this->importCouponsWithHttpInfo($applicationId, $campaignId, $upFile); + list($response) = $this->importPoolGiveawaysWithHttpInfo($poolId, $upFile); return $response; } /** - * Operation importCouponsWithHttpInfo + * Operation importPoolGiveawaysWithHttpInfo * - * Import coupons + * Import giveaway codes into a giveaway pool * - * @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 with the information about the data that should be imported. (optional) + * @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 importCouponsWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) { - $request = $this->importCouponsRequest($applicationId, $campaignId, $upFile); + $request = $this->importPoolGiveawaysRequest($poolId, $upFile); try { $options = $this->createHttpClientOption(); @@ -32469,20 +38738,19 @@ public function importCouponsWithHttpInfo($applicationId, $campaignId, $upFile = } /** - * Operation importCouponsAsync + * Operation importPoolGiveawaysAsync * - * Import coupons + * Import giveaway codes into a giveaway pool * - * @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 with the information about the data that should be imported. (optional) + * @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 importCouponsAsync($applicationId, $campaignId, $upFile = null) + public function importPoolGiveawaysAsync($poolId, $upFile = null) { - return $this->importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $upFile) + return $this->importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile) ->then( function ($response) { return $response[0]; @@ -32491,21 +38759,20 @@ function ($response) { } /** - * Operation importCouponsAsyncWithHttpInfo + * Operation importPoolGiveawaysAsyncWithHttpInfo * - * Import coupons + * Import giveaway codes into a giveaway pool * - * @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 with the information about the data that should be imported. (optional) + * @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 importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importCouponsRequest($applicationId, $campaignId, $upFile); + $request = $this->importPoolGiveawaysRequest($poolId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32542,31 +38809,24 @@ function ($exception) { } /** - * Create request for operation 'importCoupons' + * Create request for operation 'importPoolGiveaways' * - * @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 with the information about the data that should be imported. (optional) + * @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 importCouponsRequest($applicationId, $campaignId, $upFile = null) + protected function importPoolGiveawaysRequest($poolId, $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)) { + // verify the required parameter 'poolId' is set + if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling importCoupons' + 'Missing the required parameter $poolId when calling importPoolGiveaways' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons'; + $resourcePath = '/v1/giveaways/pools/{poolId}/import'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32576,18 +38836,10 @@ protected function importCouponsRequest($applicationId, $campaignId, $upFile = n // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($poolId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'poolId' . '}', + ObjectSerializer::toPathValue($poolId), $resourcePath ); } @@ -32671,38 +38923,40 @@ protected function importCouponsRequest($applicationId, $campaignId, $upFile = n } /** - * Operation importLoyaltyCards + * Operation importReferrals * - * Import loyalty cards + * Import referrals * - * @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 with the information about the data that should be 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 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 + * @return \TalonOne\Client\Model\Import */ - public function importLoyaltyCards($loyaltyProgramId, $upFile = null) + public function importReferrals($applicationId, $campaignId, $upFile = null) { - list($response) = $this->importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->importReferralsWithHttpInfo($applicationId, $campaignId, $upFile); return $response; } /** - * Operation importLoyaltyCardsWithHttpInfo + * Operation importReferralsWithHttpInfo * - * Import loyalty cards + * Import referrals * - * @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 with the information about the data that should be 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 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) + * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) */ - public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile = null) { - $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); try { $options = $this->createHttpClientOption(); @@ -32746,30 +39000,6 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = 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 = '\TalonOne\Client\Model\Import'; @@ -32796,41 +39026,26 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = 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 importLoyaltyCardsAsync + * Operation importReferralsAsync * - * Import loyalty cards + * Import referrals * - * @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 with the information about the data that should be 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 string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCardsAsync($loyaltyProgramId, $upFile = null) + public function importReferralsAsync($applicationId, $campaignId, $upFile = null) { - return $this->importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile) ->then( function ($response) { return $response[0]; @@ -32839,20 +39054,21 @@ function ($response) { } /** - * Operation importLoyaltyCardsAsyncWithHttpInfo + * Operation importReferralsAsyncWithHttpInfo * - * Import loyalty cards + * Import referrals * - * @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 with the information about the data that should be 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 string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32889,24 +39105,31 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyCards' + * Create request for operation 'importReferrals' * - * @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 with the information about the data that should be 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 string $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) + protected function importReferralsRequest($applicationId, $campaignId, $upFile = 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 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/loyalty_programs/{loyaltyProgramId}/import_cards'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32916,10 +39139,18 @@ protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) // 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 ); } @@ -33003,38 +39234,44 @@ protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) } /** - * Operation importLoyaltyCustomersTiers + * Operation listAccountCollections * - * Import customers into loyalty tiers + * List collections in account * - * @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 with the information about the data that should be 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\ErrorResponseWithStatus|\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 importLoyaltyCustomersTiers($loyaltyProgramId, $upFile = null) + public function listAccountCollections($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - list($response) = $this->importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->listAccountCollectionsWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name); return $response; } /** - * Operation importLoyaltyCustomersTiersWithHttpInfo + * Operation listAccountCollectionsWithHttpInfo * - * Import customers into loyalty tiers + * List collections in account * - * @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 with the information about the data that should be 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\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|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); + $request = $this->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); try { $options = $this->createHttpClientOption(); @@ -33067,14 +39304,14 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi $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() ]; @@ -33116,7 +39353,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 @@ -33135,7 +39372,7 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', + '\TalonOne\Client\Model\InlineResponse20017', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33170,19 +39407,22 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi } /** - * Operation importLoyaltyCustomersTiersAsync + * Operation listAccountCollectionsAsync * - * Import customers into loyalty tiers + * List collections in account * - * @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 with the information about the data that should be 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 importLoyaltyCustomersTiersAsync($loyaltyProgramId, $upFile = null) + public function listAccountCollectionsAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - return $this->importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->listAccountCollectionsAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name) ->then( function ($response) { return $response[0]; @@ -33191,20 +39431,23 @@ function ($response) { } /** - * Operation importLoyaltyCustomersTiersAsyncWithHttpInfo + * Operation listAccountCollectionsAsyncWithHttpInfo * - * Import customers into loyalty tiers + * List collections in account * - * @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 with the information about the data that should be 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 importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listAccountCollectionsAsyncWithHttpInfo($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->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33241,45 +39484,72 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyCustomersTiers' + * Create request for operation 'listAccountCollections' * - * @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 with the information about the data that should be 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 importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile = null) + protected function listAccountCollectionsRequest($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)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCustomersTiers' - ); + 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/loyalty_programs/{loyaltyProgramId}/import_customers_tiers'; + + $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 ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -33290,7 +39560,7 @@ protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -33347,7 +39617,7 @@ protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -33355,38 +39625,44 @@ protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile } /** - * Operation importLoyaltyPoints + * Operation listAchievements * - * Import loyalty points + * List achievements * - * @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 with the information about the data that should be 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 + * @return \TalonOne\Client\Model\InlineResponse20046 */ - public function importLoyaltyPoints($loyaltyProgramId, $upFile = null) + public function listAchievements($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - list($response) = $this->importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->listAchievementsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $title); return $response; } /** - * Operation importLoyaltyPointsWithHttpInfo + * Operation listAchievementsWithHttpInfo * - * Import loyalty points + * List achievements * - * @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 with the information about the data that should be 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, 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 importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listAchievementsWithHttpInfo($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + $request = $this->listAchievementsRequest($applicationId, $campaignId, $pageSize, $skip, $title); try { $options = $this->createHttpClientOption(); @@ -33419,20 +39695,20 @@ public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20046' === '\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\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 @@ -33451,7 +39727,7 @@ public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', + '\TalonOne\Client\Model\InlineResponse20046', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33462,19 +39738,22 @@ public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = nul } /** - * Operation importLoyaltyPointsAsync + * Operation listAchievementsAsync * - * Import loyalty points + * List achievements * - * @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 with the information about the data that should be 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 importLoyaltyPointsAsync($loyaltyProgramId, $upFile = null) + public function listAchievementsAsync($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - return $this->importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->listAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $title) ->then( function ($response) { return $response[0]; @@ -33483,20 +39762,23 @@ function ($response) { } /** - * Operation importLoyaltyPointsAsyncWithHttpInfo + * Operation listAchievementsAsyncWithHttpInfo * - * Import loyalty points + * List achievements * - * @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 with the information about the data that should be 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 importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function listAchievementsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20046'; + $request = $this->listAchievementsRequest($applicationId, $campaignId, $pageSize, $skip, $title); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33533,45 +39815,86 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyPoints' + * Create request for operation 'listAchievements' * - * @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 with the information about the data that should be 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 importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) + protected function listAchievementsRequest($applicationId, $campaignId, $pageSize = 50, $skip = null, $title = 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 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/loyalty_programs/{loyaltyProgramId}/import_points'; + + $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 ($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; @@ -33582,7 +39905,7 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -33639,7 +39962,7 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -33647,38 +39970,46 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) } /** - * Operation importPoolGiveaways + * Operation listCatalogItems * - * Import giveaway codes into a giveaway pool + * List items in a catalog * - * @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 with the information about the data that should be 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 importPoolGiveaways($poolId, $upFile = null) + public function listCatalogItems($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - list($response) = $this->importPoolGiveawaysWithHttpInfo($poolId, $upFile); + list($response) = $this->listCatalogItemsWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); return $response; } /** - * Operation importPoolGiveawaysWithHttpInfo + * Operation listCatalogItemsWithHttpInfo * - * Import giveaway codes into a giveaway pool + * List items in a catalog * - * @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 with the information about the data that should be 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 importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) + public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); try { $options = $this->createHttpClientOption(); @@ -33711,20 +40042,20 @@ public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) $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 @@ -33743,7 +40074,7 @@ public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', + '\TalonOne\Client\Model\InlineResponse20035', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33754,19 +40085,23 @@ public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) } /** - * Operation importPoolGiveawaysAsync + * Operation listCatalogItemsAsync * - * Import giveaway codes into a giveaway pool + * List items in a catalog * - * @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 with the information about the data that should be 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 importPoolGiveawaysAsync($poolId, $upFile = null) + public function listCatalogItemsAsync($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - return $this->importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile) + return $this->listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames) ->then( function ($response) { return $response[0]; @@ -33775,20 +40110,24 @@ function ($response) { } /** - * Operation importPoolGiveawaysAsyncWithHttpInfo + * Operation listCatalogItemsAsyncWithHttpInfo * - * Import giveaway codes into a giveaway pool + * List items in a catalog * - * @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 with the information about the data that should be 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 importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile = null) + public function listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20035'; + $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33825,45 +40164,87 @@ function ($exception) { } /** - * Create request for operation 'importPoolGiveaways' + * Create request for operation 'listCatalogItems' * - * @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 with the information about the data that should be 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 importPoolGiveawaysRequest($poolId, $upFile = null) + protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null, $productNames = null) { - // verify the required parameter 'poolId' is set - if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { + // verify the required parameter 'catalogId' is set + if ($catalogId === null || (is_array($catalogId) && count($catalogId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $poolId when calling importPoolGiveaways' + 'Missing the required parameter $catalogId when calling listCatalogItems' ); } + 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/giveaways/pools/{poolId}/import'; + + $resourcePath = '/v1/catalogs/{catalogId}/items'; $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 ($poolId !== null) { + if ($catalogId !== null) { $resourcePath = str_replace( - '{' . 'poolId' . '}', - ObjectSerializer::toPathValue($poolId), + '{' . 'catalogId' . '}', + ObjectSerializer::toPathValue($catalogId), $resourcePath ); } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -33874,7 +40255,7 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -33931,7 +40312,7 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -33939,40 +40320,48 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) } /** - * Operation importReferrals + * Operation listCollections * - * Import referrals + * List collections in 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 $upFile The file with the information about the data that should be 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 + * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importReferrals($applicationId, $campaignId, $upFile = null) + public function listCollections($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - list($response) = $this->importReferralsWithHttpInfo($applicationId, $campaignId, $upFile); + list($response) = $this->listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $response; } /** - * Operation importReferralsWithHttpInfo + * Operation listCollectionsWithHttpInfo * - * Import referrals + * List collections in 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 $upFile The file with the information about the data that should be 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, 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 importReferralsWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); try { $options = $this->createHttpClientOption(); @@ -34005,20 +40394,32 @@ public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile $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 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'; + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34037,7 +40438,15 @@ public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Import', + '\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); @@ -34048,20 +40457,24 @@ public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile } /** - * Operation importReferralsAsync + * Operation listCollectionsAsync * - * Import referrals + * List collections in 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 $upFile The file with the information about the data that should be 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 importReferralsAsync($applicationId, $campaignId, $upFile = null) + public function listCollectionsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - return $this->importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile) + return $this->listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name) ->then( function ($response) { return $response[0]; @@ -34070,21 +40483,25 @@ function ($response) { } /** - * Operation importReferralsAsyncWithHttpInfo + * Operation listCollectionsAsyncWithHttpInfo * - * Import referrals + * List collections in 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 $upFile The file with the information about the data that should be 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 importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34121,37 +40538,83 @@ function ($exception) { } /** - * Create request for operation 'importReferrals' + * Create request for operation 'listCollections' * * @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 with the information about the data that should be 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 importReferralsRequest($applicationId, $campaignId, $upFile = null) + protected function listCollectionsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = 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' + '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 importReferrals' + '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/applications/{applicationId}/campaigns/{campaignId}/import_referrals'; + + $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 @@ -34171,10 +40634,6 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = ); } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; @@ -34185,7 +40644,7 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['multipart/form-data'] + [] ); } @@ -34242,7 +40701,7 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -34250,11 +40709,12 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = } /** - * Operation listAccountCollections + * Operation listCollectionsInApplication * - * List collections in account + * List collections in Application * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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) @@ -34262,20 +40722,21 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20016|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\InlineResponse20017|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function listAccountCollections($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function listCollectionsInApplication($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - list($response) = $this->listAccountCollectionsWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name); + list($response) = $this->listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $response; } /** - * Operation listAccountCollectionsWithHttpInfo + * Operation listCollectionsInApplicationWithHttpInfo * - * List collections in account + * List collections in Application * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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) @@ -34283,11 +40744,11 @@ public function listAccountCollections($pageSize = 1000, $skip = null, $sort = n * * @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|\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 listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $request = $this->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); + $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); try { $options = $this->createHttpClientOption(); @@ -34320,38 +40781,14 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul $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 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() ]; @@ -34369,7 +40806,7 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20016'; + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34388,23 +40825,7 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20016', - $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); @@ -34423,11 +40844,12 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul } /** - * Operation listAccountCollectionsAsync + * Operation listCollectionsInApplicationAsync * - * List collections in account + * List collections in Application * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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) @@ -34436,9 +40858,9 @@ public function listAccountCollectionsWithHttpInfo($pageSize = 1000, $skip = nul * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAccountCollectionsAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function listCollectionsInApplicationAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - return $this->listAccountCollectionsAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize, $name) + return $this->listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name) ->then( function ($response) { return $response[0]; @@ -34447,11 +40869,12 @@ function ($response) { } /** - * Operation listAccountCollectionsAsyncWithHttpInfo + * Operation listCollectionsInApplicationAsyncWithHttpInfo * - * List collections in account + * List collections in Application * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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) @@ -34460,10 +40883,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAccountCollectionsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20016'; - $request = $this->listAccountCollectionsRequest($pageSize, $skip, $sort, $withTotalResultSize, $name); + $returnType = '\TalonOne\Client\Model\InlineResponse20017'; + $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34500,9 +40923,10 @@ function ($exception) { } /** - * Create request for operation 'listAccountCollections' + * Create request for operation 'listCollectionsInApplication' * - * @param int $pageSize The number of items in this response. (optional, default to 1000) + * @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) @@ -34511,17 +40935,23 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + protected function listCollectionsInApplicationRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = 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 listCollectionsInApplication' + ); + } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listAccountCollections, must be smaller than or equal to 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.listAccountCollections, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCollectionsInApplication, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/collections'; + $resourcePath = '/v1/applications/{applicationId}/collections'; $formParams = []; $queryParams = []; $headerParams = []; @@ -34565,6 +40995,14 @@ protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, } + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -34641,44 +41079,52 @@ protected function listAccountCollectionsRequest($pageSize = 1000, $skip = null, } /** - * Operation listCatalogItems + * Operation listStores * - * List items in a catalog + * List stores * - * @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 this response. (optional, default to 1000) + * @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 $sku The SKU of the item. (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\InlineResponse20033 + * @return \TalonOne\Client\Model\InlineResponse20045 */ - public function listCatalogItems($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null) + public function listStores($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - list($response) = $this->listCatalogItemsWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku); + list($response) = $this->listStoresWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); return $response; } /** - * Operation listCatalogItemsWithHttpInfo + * Operation listStoresWithHttpInfo * - * List items in a catalog + * List stores * - * @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 this response. (optional, default to 1000) + * @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 $sku The SKU of the item. (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\InlineResponse20033, 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 listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null) + public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku); + $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); try { $options = $this->createHttpClientOption(); @@ -34711,20 +41157,20 @@ public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20033' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20045' === '\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\InlineResponse20045', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20033'; + $returnType = '\TalonOne\Client\Model\InlineResponse20045'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34743,7 +41189,7 @@ public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20033', + '\TalonOne\Client\Model\InlineResponse20045', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34754,22 +41200,26 @@ public function listCatalogItemsWithHttpInfo($catalogId, $pageSize = 1000, $skip } /** - * Operation listCatalogItemsAsync + * Operation listStoresAsync * - * List items in a catalog + * List stores * - * @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 this response. (optional, default to 1000) + * @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 $sku The SKU of the item. (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 listCatalogItemsAsync($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = null) + public function listStoresAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null, $query = null) { - return $this->listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize, $skip, $withTotalResultSize, $sku) + return $this->listStoresAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query) ->then( function ($response) { return $response[0]; @@ -34778,23 +41228,27 @@ function ($response) { } /** - * Operation listCatalogItemsAsyncWithHttpInfo + * Operation listStoresAsyncWithHttpInfo * - * List items in a catalog + * List stores * - * @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 this response. (optional, default to 1000) + * @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 $sku The SKU of the item. (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 listCatalogItemsAsyncWithHttpInfo($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = 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\InlineResponse20033'; - $request = $this->listCatalogItemsRequest($catalogId, $pageSize, $skip, $withTotalResultSize, $sku); + $returnType = '\TalonOne\Client\Model\InlineResponse20045'; + $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId, $query); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34831,34 +41285,38 @@ function ($exception) { } /** - * Create request for operation 'listCatalogItems' + * Create request for operation 'listStores' * - * @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 this response. (optional, default to 1000) + * @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 $sku The SKU of the item. (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 listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = null, $withTotalResultSize = null, $sku = 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 'catalogId' is set - if ($catalogId === null || (is_array($catalogId) && count($catalogId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $catalogId when calling listCatalogItems' + 'Missing the required parameter $applicationId when calling listStores' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listCatalogItems, must be smaller than or equal to 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.listCatalogItems, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.listStores, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/catalogs/{catalogId}/items'; + $resourcePath = '/v1/applications/{applicationId}/stores'; $formParams = []; $queryParams = []; $headerParams = []; @@ -34880,6 +41338,13 @@ protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = $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); } @@ -34887,19 +41352,40 @@ protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = $queryParams['withTotalResultSize'] = $withTotalResultSize; } // query params - if (is_array($sku)) { - $sku = ObjectSerializer::serializeCollection($sku, '', true); + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); } - if ($sku !== null) { - $queryParams['sku'] = $sku; + 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 ($catalogId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'catalogId' . '}', - ObjectSerializer::toPathValue($catalogId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -34979,48 +41465,37 @@ protected function listCatalogItemsRequest($catalogId, $pageSize = 1000, $skip = } /** - * Operation listCollections + * Operation notificationActivation * - * List collections in campaign + * Activate or deactivate notification * - * @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 this 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 $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\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return void */ - public function listCollections($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function notificationActivation($notificationId, $body) { - list($response) = $this->listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); - return $response; + $this->notificationActivationWithHttpInfo($notificationId, $body); } /** - * Operation listCollectionsWithHttpInfo + * Operation notificationActivationWithHttpInfo * - * List collections in campaign + * Activate or deactivate notification * - * @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 this 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 $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\InlineResponse20018|\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 listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function notificationActivationWithHttpInfo($notificationId, $body) { - $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $request = $this->notificationActivationRequest($notificationId, $body); try { $options = $this->createHttpClientOption(); @@ -35050,90 +41525,29 @@ public function listCollectionsWithHttpInfo($applicationId, $campaignId, $pageSi ); } - $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') { - $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\InlineResponse20018'; - $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\InlineResponse20018', - $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 listCollectionsAsync + * Operation notificationActivationAsync * - * List collections in campaign + * Activate or deactivate notification * - * @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 this 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 $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 listCollectionsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function notificationActivationAsync($notificationId, $body) { - return $this->listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name) + return $this->notificationActivationAsyncWithHttpInfo($notificationId, $body) ->then( function ($response) { return $response[0]; @@ -35142,42 +41556,26 @@ function ($response) { } /** - * Operation listCollectionsAsyncWithHttpInfo + * Operation notificationActivationAsyncWithHttpInfo * - * List collections in campaign + * Activate or deactivate notification * - * @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 this 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 $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 listCollectionsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function notificationActivationAsyncWithHttpInfo($notificationId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20018'; - $request = $this->listCollectionsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $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(); @@ -35197,113 +41595,61 @@ function ($exception) { } /** - * Create request for operation 'listCollections' + * Create request for operation 'notificationActivation' * - * @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 this 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 $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 listCollectionsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + protected function notificationActivationRequest($notificationId, $body) { - // verify the required parameter 'applicationId' is set - if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + // verify the required parameter 'notificationId' is set + if ($notificationId === null || (is_array($notificationId) && count($notificationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling listCollections' + 'Missing the required parameter $notificationId when calling notificationActivation' ); } - // 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 listCollections' + 'Missing the required parameter $body when calling notificationActivation' ); } - 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/applications/{applicationId}/campaigns/{campaignId}/collections'; + $resourcePath = '/v1/notifications/{notificationId}/activation'; $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) { + if ($notificationId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . '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'] ); } @@ -35360,7 +41706,7 @@ protected function listCollectionsRequest($applicationId, $campaignId, $pageSize $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -35368,46 +41714,38 @@ protected function listCollectionsRequest($applicationId, $campaignId, $pageSize } /** - * Operation listCollectionsInApplication + * Operation postAddedDeductedPointsNotification * - * List collections in Application + * Create notification about added or deducted loyalty points * - * @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 this 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 $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\InlineResponse20018|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function listCollectionsInApplication($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postAddedDeductedPointsNotification($loyaltyProgramId, $body) { - list($response) = $this->listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + list($response) = $this->postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body); return $response; } /** - * Operation listCollectionsInApplicationWithHttpInfo + * Operation postAddedDeductedPointsNotificationWithHttpInfo * - * List collections in Application + * Create notification about added or deducted loyalty points * - * @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 this 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 $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\InlineResponse20018|\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 listCollectionsInApplicationWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body) { - $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); try { $options = $this->createHttpClientOption(); @@ -35440,14 +41778,38 @@ public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSi $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20018' === '\SplFileObject') { + if ('\TalonOne\Client\Model\BaseNotification' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20018', []), + 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() ]; @@ -35465,7 +41827,7 @@ public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSi ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20018'; + $returnType = '\TalonOne\Client\Model\BaseNotification'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -35484,7 +41846,23 @@ public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20018', + '\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); @@ -35503,23 +41881,19 @@ public function listCollectionsInApplicationWithHttpInfo($applicationId, $pageSi } /** - * Operation listCollectionsInApplicationAsync + * Operation postAddedDeductedPointsNotificationAsync * - * List collections in Application + * Create notification about added or deducted loyalty points * - * @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 this 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 $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 listCollectionsInApplicationAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postAddedDeductedPointsNotificationAsync($loyaltyProgramId, $body) { - return $this->listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name) + return $this->postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) ->then( function ($response) { return $response[0]; @@ -35528,24 +41902,20 @@ function ($response) { } /** - * Operation listCollectionsInApplicationAsyncWithHttpInfo + * Operation postAddedDeductedPointsNotificationAsyncWithHttpInfo * - * List collections in Application + * Create notification about added or deducted loyalty points * - * @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 this 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 $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 listCollectionsInApplicationAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + public function postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20018'; - $request = $this->listCollectionsInApplicationRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $name); + $returnType = '\TalonOne\Client\Model\BaseNotification'; + $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35582,89 +41952,52 @@ function ($exception) { } /** - * Create request for operation 'listCollectionsInApplication' + * Create request for operation 'postAddedDeductedPointsNotification' * - * @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 this 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 $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 listCollectionsInApplicationRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $name = null) + protected function postAddedDeductedPointsNotificationRequest($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 listCollectionsInApplication' + 'Missing the required parameter $loyaltyProgramId when calling postAddedDeductedPointsNotification' ); } - 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.'); + // 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/applications/{applicationId}/collections'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_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($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 ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -35673,7 +42006,7 @@ protected function listCollectionsInApplicationRequest($applicationId, $pageSize } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -35730,7 +42063,7 @@ protected function listCollectionsInApplicationRequest($applicationId, $pageSize $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -35738,50 +42071,38 @@ protected function listCollectionsInApplicationRequest($applicationId, $pageSize } /** - * Operation listStores + * Operation postCatalogsStrikethroughNotification * - * List stores + * Create strikethrough notification * * @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 this 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 \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20043 + * @return \TalonOne\Client\Model\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function listStores($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null) + public function postCatalogsStrikethroughNotification($applicationId, $body) { - list($response) = $this->listStoresWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId); + list($response) = $this->postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body); return $response; } /** - * Operation listStoresWithHttpInfo + * Operation postCatalogsStrikethroughNotificationWithHttpInfo * - * List stores + * Create strikethrough notification * * @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 this 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 \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @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\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, 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) + public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body) { - $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId); + $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); try { $options = $this->createHttpClientOption(); @@ -35814,20 +42135,56 @@ public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20043' === '\SplFileObject') { + if ('\TalonOne\Client\Model\BaseNotification' === '\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\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\InlineResponse20043'; + $returnType = '\TalonOne\Client\Model\BaseNotification'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -35846,7 +42203,31 @@ public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20043', + '\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); @@ -35857,25 +42238,19 @@ public function listStoresWithHttpInfo($applicationId, $pageSize = 1000, $skip = } /** - * Operation listStoresAsync + * Operation postCatalogsStrikethroughNotificationAsync * - * List stores + * Create strikethrough notification * * @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 this 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 \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listStoresAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null) + public function postCatalogsStrikethroughNotificationAsync($applicationId, $body) { - return $this->listStoresAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId) + return $this->postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) ->then( function ($response) { return $response[0]; @@ -35884,26 +42259,20 @@ function ($response) { } /** - * Operation listStoresAsyncWithHttpInfo + * Operation postCatalogsStrikethroughNotificationAsyncWithHttpInfo * - * List stores + * Create strikethrough notification * * @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 this 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 \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listStoresAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null) + public function postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse20043'; - $request = $this->listStoresRequest($applicationId, $pageSize, $skip, $sort, $withTotalResultSize, $campaignId, $name, $integrationId); + $returnType = '\TalonOne\Client\Model\BaseNotification'; + $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35940,92 +42309,36 @@ function ($exception) { } /** - * Create request for operation 'listStores' + * Create request for operation 'postCatalogsStrikethroughNotification' * * @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 this 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 \TalonOne\Client\Model\NewBaseNotification $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null, $campaignId = null, $name = null, $integrationId = null) + protected function postCatalogsStrikethroughNotificationRequest($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 listStores' + 'Missing the required parameter $applicationId when calling postCatalogsStrikethroughNotification' ); } - 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.'); + // 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/applications/{applicationId}/stores'; + $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($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; - } // path params @@ -36039,6 +42352,9 @@ protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = n // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -36047,7 +42363,7 @@ protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = n } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -36104,7 +42420,7 @@ protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = n $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36112,37 +42428,38 @@ protected function listStoresRequest($applicationId, $pageSize = 1000, $skip = n } /** - * Operation notificationActivation + * Operation postPendingPointsNotification * - * Activate or deactivate notification + * Create notification about pending loyalty points * - * @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) + * @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 notificationActivation($notificationId, $body) + public function postPendingPointsNotification($loyaltyProgramId, $body) { - $this->notificationActivationWithHttpInfo($notificationId, $body); + list($response) = $this->postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body); + return $response; } /** - * Operation notificationActivationWithHttpInfo + * Operation postPendingPointsNotificationWithHttpInfo * - * Activate or deactivate notification + * Create notification about pending loyalty points * - * @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) + * @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 notificationActivationWithHttpInfo($notificationId, $body) + public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body) { - $request = $this->notificationActivationRequest($notificationId, $body); + $request = $this->postPendingPointsNotificationRequest($loyaltyProgramId, $body); try { $options = $this->createHttpClientOption(); @@ -36172,29 +42489,125 @@ public function notificationActivationWithHttpInfo($notificationId, $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 notificationActivationAsync + * Operation postPendingPointsNotificationAsync * - * Activate or deactivate notification + * Create notification about pending loyalty points * - * @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) + * @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 notificationActivationAsync($notificationId, $body) + public function postPendingPointsNotificationAsync($loyaltyProgramId, $body) { - return $this->notificationActivationAsyncWithHttpInfo($notificationId, $body) + return $this->postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) ->then( function ($response) { return $response[0]; @@ -36203,26 +42616,37 @@ function ($response) { } /** - * Operation notificationActivationAsyncWithHttpInfo + * Operation postPendingPointsNotificationAsyncWithHttpInfo * - * Activate or deactivate notification + * Create notification about pending loyalty points * - * @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) + * @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 notificationActivationAsyncWithHttpInfo($notificationId, $body) + public function postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) { - $returnType = ''; - $request = $this->notificationActivationRequest($notificationId, $body); + $returnType = '\TalonOne\Client\Model\BaseNotification'; + $request = $this->postPendingPointsNotificationRequest($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(); @@ -36242,30 +42666,30 @@ function ($exception) { } /** - * Create request for operation 'notificationActivation' + * Create request for operation 'postPendingPointsNotification' * - * @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) + * @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 notificationActivationRequest($notificationId, $body) + protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body) { - // verify the required parameter 'notificationId' is set - if ($notificationId === null || (is_array($notificationId) && count($notificationId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $notificationId when calling notificationActivation' + '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 notificationActivation' + 'Missing the required parameter $body when calling postPendingPointsNotification' ); } - $resourcePath = '/v1/notifications/{notificationId}/activation'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/pending_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36275,10 +42699,10 @@ protected function notificationActivationRequest($notificationId, $body) // path params - if ($notificationId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'notificationId' . '}', - ObjectSerializer::toPathValue($notificationId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -36291,11 +42715,11 @@ protected function notificationActivationRequest($notificationId, $body) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], ['application/json'] ); } @@ -36353,7 +42777,7 @@ protected function notificationActivationRequest($notificationId, $body) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36361,38 +42785,39 @@ protected function notificationActivationRequest($notificationId, $body) } /** - * Operation postAddedDeductedPointsNotification + * Operation removeLoyaltyPoints * - * Create notification about added or deducted loyalty points + * Deduct points from customer profile * - * @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) + * @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\BaseNotification|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return void */ - public function postAddedDeductedPointsNotification($loyaltyProgramId, $body) + public function removeLoyaltyPoints($loyaltyProgramId, $integrationId, $body) { - list($response) = $this->postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body); - return $response; + $this->removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body); } /** - * Operation postAddedDeductedPointsNotificationWithHttpInfo + * Operation removeLoyaltyPointsWithHttpInfo * - * Create notification about added or deducted loyalty points + * Deduct points from customer profile * - * @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) + * @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\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 null, HTTP status code, HTTP response headers (array of strings) */ - public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramId, $body) + public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body) { - $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); + $request = $this->removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body); try { $options = $this->createHttpClientOption(); @@ -36422,82 +42847,10 @@ 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') { - $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() - ]; + return [null, $statusCode, $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; + switch ($e->getCode()) { case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36528,19 +42881,20 @@ public function postAddedDeductedPointsNotificationWithHttpInfo($loyaltyProgramI } /** - * Operation postAddedDeductedPointsNotificationAsync + * Operation removeLoyaltyPointsAsync * - * Create notification about added or deducted loyalty points + * Deduct points from customer profile * - * @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) + * @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 postAddedDeductedPointsNotificationAsync($loyaltyProgramId, $body) + public function removeLoyaltyPointsAsync($loyaltyProgramId, $integrationId, $body) { - return $this->postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + return $this->removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) ->then( function ($response) { return $response[0]; @@ -36549,37 +42903,27 @@ function ($response) { } /** - * Operation postAddedDeductedPointsNotificationAsyncWithHttpInfo + * Operation removeLoyaltyPointsAsyncWithHttpInfo * - * Create notification about added or deducted loyalty points + * Deduct points from customer profile * - * @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) + * @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 postAddedDeductedPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + public function removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) { - $returnType = '\TalonOne\Client\Model\BaseNotification'; - $request = $this->postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body); + $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(); @@ -36599,30 +42943,37 @@ function ($exception) { } /** - * Create request for operation 'postAddedDeductedPointsNotification' + * Create request for operation 'removeLoyaltyPoints' * - * @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) + * @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 postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $body) + 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 postAddedDeductedPointsNotification' + '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 postAddedDeductedPointsNotification' + 'Missing the required parameter $body when calling removeLoyaltyPoints' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_points'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36639,6 +42990,14 @@ protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $resourcePath ); } + // path params + if ($integrationId !== null) { + $resourcePath = str_replace( + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -36710,7 +43069,7 @@ protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36718,38 +43077,36 @@ protected function postAddedDeductedPointsNotificationRequest($loyaltyProgramId, } /** - * Operation postCatalogsStrikethroughNotification + * Operation resetPassword * - * Create strikethrough notification + * Reset password * - * @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 \TalonOne\Client\Model\NewPassword $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\NewPassword */ - public function postCatalogsStrikethroughNotification($applicationId, $body) + public function resetPassword($body) { - list($response) = $this->postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body); + list($response) = $this->resetPasswordWithHttpInfo($body); return $response; } /** - * Operation postCatalogsStrikethroughNotificationWithHttpInfo + * Operation resetPasswordWithHttpInfo * - * Create strikethrough notification + * Reset password * - * @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 \TalonOne\Client\Model\NewPassword $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\NewPassword, HTTP status code, HTTP response headers (array of strings) */ - public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId, $body) + public function resetPasswordWithHttpInfo($body) { - $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); + $request = $this->resetPasswordRequest($body); try { $options = $this->createHttpClientOption(); @@ -36781,57 +43138,21 @@ 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') { - $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') { + 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\ErrorResponseWithStatus', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\NewPassword', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\BaseNotification'; + $returnType = '\TalonOne\Client\Model\NewPassword'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -36847,34 +43168,10 @@ public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId } 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: + case 204: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\NewPassword', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36885,19 +43182,18 @@ public function postCatalogsStrikethroughNotificationWithHttpInfo($applicationId } /** - * Operation postCatalogsStrikethroughNotificationAsync + * Operation resetPasswordAsync * - * Create strikethrough notification + * Reset password * - * @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 \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postCatalogsStrikethroughNotificationAsync($applicationId, $body) + public function resetPasswordAsync($body) { - return $this->postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) + return $this->resetPasswordAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -36906,20 +43202,19 @@ function ($response) { } /** - * Operation postCatalogsStrikethroughNotificationAsyncWithHttpInfo + * Operation resetPasswordAsyncWithHttpInfo * - * Create strikethrough notification + * Reset password * - * @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 \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postCatalogsStrikethroughNotificationAsyncWithHttpInfo($applicationId, $body) + public function resetPasswordAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\BaseNotification'; - $request = $this->postCatalogsStrikethroughNotificationRequest($applicationId, $body); + $returnType = '\TalonOne\Client\Model\NewPassword'; + $request = $this->resetPasswordRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36956,30 +43251,23 @@ function ($exception) { } /** - * Create request for operation 'postCatalogsStrikethroughNotification' + * Create request for operation 'resetPassword' * - * @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 \TalonOne\Client\Model\NewPassword $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postCatalogsStrikethroughNotificationRequest($applicationId, $body) + protected function resetPasswordRequest($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 postCatalogsStrikethroughNotification' - ); - } // 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' + 'Missing the required parameter $body when calling resetPassword' ); } - $resourcePath = '/v1/applications/{applicationId}/catalogs/notifications/strikethrough'; + $resourcePath = '/v1/reset_password'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36988,14 +43276,6 @@ protected function postCatalogsStrikethroughNotificationRequest($applicationId, - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -37075,38 +43355,64 @@ protected function postCatalogsStrikethroughNotificationRequest($applicationId, } /** - * Operation postPendingPointsNotification + * Operation searchCouponsAdvancedApplicationWideWithoutTotalCount * - * Create notification about pending loyalty points + * List coupons that match the given attributes (without total count) * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param object $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 $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. - `draft`: Campaigns that are drafts. (optional) * * @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\InlineResponse2009 */ - public function postPendingPointsNotification($loyaltyProgramId, $body) + public function searchCouponsAdvancedApplicationWideWithoutTotalCount($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) { - list($response) = $this->postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body); + list($response) = $this->searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState); return $response; } /** - * Operation postPendingPointsNotificationWithHttpInfo + * Operation searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInfo * - * Create notification about pending loyalty points + * List coupons that match the given attributes (without total count) * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param object $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 $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. - `draft`: Campaigns that are drafts. (optional) * * @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\InlineResponse2009, HTTP status code, HTTP response headers (array of strings) */ - public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $body) + public function searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) { - $request = $this->postPendingPointsNotificationRequest($loyaltyProgramId, $body); + $request = $this->searchCouponsAdvancedApplicationWideWithoutTotalCountRequest($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState); try { $options = $this->createHttpClientOption(); @@ -37139,56 +43445,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\InlineResponse2009' === '\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\InlineResponse2009', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\BaseNotification'; + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -37207,31 +43477,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\InlineResponse2009', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37242,19 +43488,32 @@ public function postPendingPointsNotificationWithHttpInfo($loyaltyProgramId, $bo } /** - * Operation postPendingPointsNotificationAsync + * Operation searchCouponsAdvancedApplicationWideWithoutTotalCountAsync * - * Create notification about pending loyalty points + * List coupons that match the given attributes (without total count) * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param object $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 $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. - `draft`: Campaigns that are drafts. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postPendingPointsNotificationAsync($loyaltyProgramId, $body) + public function searchCouponsAdvancedApplicationWideWithoutTotalCountAsync($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) { - return $this->postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + return $this->searchCouponsAdvancedApplicationWideWithoutTotalCountAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState) ->then( function ($response) { return $response[0]; @@ -37263,20 +43522,33 @@ function ($response) { } /** - * Operation postPendingPointsNotificationAsyncWithHttpInfo + * Operation searchCouponsAdvancedApplicationWideWithoutTotalCountAsyncWithHttpInfo * - * Create notification about pending loyalty points + * List coupons that match the given attributes (without total count) * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param object $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 $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. - `draft`: Campaigns that are drafts. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function postPendingPointsNotificationAsyncWithHttpInfo($loyaltyProgramId, $body) + public function searchCouponsAdvancedApplicationWideWithoutTotalCountAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) { - $returnType = '\TalonOne\Client\Model\BaseNotification'; - $request = $this->postPendingPointsNotificationRequest($loyaltyProgramId, $body); + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; + $request = $this->searchCouponsAdvancedApplicationWideWithoutTotalCountRequest($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37313,43 +43585,154 @@ function ($exception) { } /** - * Create request for operation 'postPendingPointsNotification' + * Create request for operation 'searchCouponsAdvancedApplicationWideWithoutTotalCount' * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param object $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 $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. - `draft`: Campaigns that are drafts. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body) + protected function searchCouponsAdvancedApplicationWideWithoutTotalCountRequest($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = 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 postPendingPointsNotification' + 'Missing the required parameter $applicationId when calling searchCouponsAdvancedApplicationWideWithoutTotalCount' + ); + } + // 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 searchCouponsAdvancedApplicationWideWithoutTotalCount' ); } - // 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' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedApplicationWideWithoutTotalCount, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedApplicationWideWithoutTotalCount, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/applications/{applicationId}/coupons_search_advanced/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($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($campaignState)) { + $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); + } + if ($campaignState !== null) { + $queryParams['campaignState'] = $campaignState; } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/pending_points'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } @@ -37432,39 +43815,64 @@ protected function postPendingPointsNotificationRequest($loyaltyProgramId, $body } /** - * Operation removeLoyaltyPoints + * Operation searchCouponsAdvancedWithoutTotalCount * - * Deduct points from customer profile + * List coupons that match the given attributes in campaign (without total count) * - * @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 $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 object $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 $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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $batchId Filter results by batches of coupons (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\InlineResponse2009 */ - public function removeLoyaltyPoints($loyaltyProgramId, $integrationId, $body) + public function searchCouponsAdvancedWithoutTotalCount($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) { - $this->removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body); + list($response) = $this->searchCouponsAdvancedWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId); + return $response; } /** - * Operation removeLoyaltyPointsWithHttpInfo + * Operation searchCouponsAdvancedWithoutTotalCountWithHttpInfo * - * Deduct points from customer profile + * List coupons that match the given attributes in campaign (without total count) * - * @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 $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 object $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 $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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $batchId Filter results by batches of coupons (optional) * * @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\InlineResponse2009, HTTP status code, HTTP response headers (array of strings) */ - public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationId, $body) + public function searchCouponsAdvancedWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) { - $request = $this->removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body); + $request = $this->searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId); try { $options = $this->createHttpClientOption(); @@ -37494,30 +43902,42 @@ public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationI ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\InlineResponse2009' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse2009', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; + $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\InlineResponse2009', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -37528,20 +43948,32 @@ public function removeLoyaltyPointsWithHttpInfo($loyaltyProgramId, $integrationI } /** - * Operation removeLoyaltyPointsAsync + * Operation searchCouponsAdvancedWithoutTotalCountAsync * - * Deduct points from customer profile + * List coupons that match the given attributes in campaign (without total count) * - * @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 $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 object $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 $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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $batchId Filter results by batches of coupons (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeLoyaltyPointsAsync($loyaltyProgramId, $integrationId, $body) + public function searchCouponsAdvancedWithoutTotalCountAsync($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) { - return $this->removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) + return $this->searchCouponsAdvancedWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId) ->then( function ($response) { return $response[0]; @@ -37550,27 +43982,50 @@ function ($response) { } /** - * Operation removeLoyaltyPointsAsyncWithHttpInfo + * Operation searchCouponsAdvancedWithoutTotalCountAsyncWithHttpInfo * - * Deduct points from customer profile + * List coupons that match the given attributes in campaign (without total count) * - * @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 $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 object $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 $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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $batchId Filter results by batches of coupons (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $body) + public function searchCouponsAdvancedWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) { - $returnType = ''; - $request = $this->removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body); + $returnType = '\TalonOne\Client\Model\InlineResponse2009'; + $request = $this->searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId); 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(); @@ -37590,58 +44045,161 @@ function ($exception) { } /** - * Create request for operation 'removeLoyaltyPoints' + * Create request for operation 'searchCouponsAdvancedWithoutTotalCount' * - * @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 $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 object $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 $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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) + * @param string $batchId Filter results by batches of coupons (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $body) + protected function searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = 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 removeLoyaltyPoints' + 'Missing the required parameter $applicationId when calling searchCouponsAdvancedWithoutTotalCount' ); } - // verify the required parameter 'integrationId' is set - if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $integrationId when calling removeLoyaltyPoints' + 'Missing the required parameter $campaignId when calling searchCouponsAdvancedWithoutTotalCount' ); } // 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 searchCouponsAdvancedWithoutTotalCount' ); } + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedWithoutTotalCount, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedWithoutTotalCount, must be bigger than or equal to 1.'); + } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/deduct_points'; + + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/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($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; + } + // query params + if (is_array($batchId)) { + $batchId = ObjectSerializer::serializeCollection($batchId, '', true); + } + if ($batchId !== null) { + $queryParams['batchId'] = $batchId; + } // path params - if ($loyaltyProgramId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), $resourcePath ); } // path params - if ($integrationId !== null) { + if ($campaignId !== null) { $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -37716,7 +44274,7 @@ protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -37724,36 +44282,39 @@ protected function removeLoyaltyPointsRequest($loyaltyProgramId, $integrationId, } /** - * Operation resetPassword + * Operation transferLoyaltyCard * - * Reset password + * Transfer card data * - * @param \TalonOne\Client\Model\NewPassword $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 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\TransferLoyaltyCard $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\NewPassword + * @return void */ - public function resetPassword($body) + public function transferLoyaltyCard($loyaltyProgramId, $loyaltyCardId, $body) { - list($response) = $this->resetPasswordWithHttpInfo($body); - return $response; + $this->transferLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); } /** - * Operation resetPasswordWithHttpInfo + * Operation transferLoyaltyCardWithHttpInfo * - * Reset password + * Transfer card data * - * @param \TalonOne\Client\Model\NewPassword $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 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\TransferLoyaltyCard $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 null, HTTP status code, HTTP response headers (array of strings) */ - public function resetPasswordWithHttpInfo($body) + public function transferLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { - $request = $this->resetPasswordRequest($body); + $request = $this->transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body); try { $options = $this->createHttpClientOption(); @@ -37783,42 +44344,30 @@ public function resetPasswordWithHttpInfo($body) ); } - $responseBody = $response->getBody(); - switch($statusCode) { - 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\NewPassword', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\NewPassword'; - $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 204: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\NewPassword', + '\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); @@ -37829,18 +44378,20 @@ public function resetPasswordWithHttpInfo($body) } /** - * Operation resetPasswordAsync + * Operation transferLoyaltyCardAsync * - * Reset password + * Transfer card data * - * @param \TalonOne\Client\Model\NewPassword $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 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\TransferLoyaltyCard $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function resetPasswordAsync($body) + public function transferLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId, $body) { - return $this->resetPasswordAsyncWithHttpInfo($body) + return $this->transferLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) ->then( function ($response) { return $response[0]; @@ -37849,36 +44400,27 @@ function ($response) { } /** - * Operation resetPasswordAsyncWithHttpInfo + * Operation transferLoyaltyCardAsyncWithHttpInfo * - * Reset password + * Transfer card data * - * @param \TalonOne\Client\Model\NewPassword $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 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\TransferLoyaltyCard $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function resetPasswordAsyncWithHttpInfo($body) + public function transferLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { - $returnType = '\TalonOne\Client\Model\NewPassword'; - $request = $this->resetPasswordRequest($body); + $returnType = ''; + $request = $this->transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $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(); @@ -37898,23 +44440,41 @@ function ($exception) { } /** - * Create request for operation 'resetPassword' + * Create request for operation 'transferLoyaltyCard' * - * @param \TalonOne\Client\Model\NewPassword $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 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\TransferLoyaltyCard $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function resetPasswordRequest($body) + protected function transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $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 transferLoyaltyCard' + ); + } + // 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 transferLoyaltyCard' + ); + } + if (strlen($loyaltyCardId) > 108) { + throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.transferLoyaltyCard, 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 resetPassword' + 'Missing the required parameter $body when calling transferLoyaltyCard' ); } - $resourcePath = '/v1/reset_password'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transfer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -37923,6 +44483,22 @@ protected function resetPasswordRequest($body) + // 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; @@ -37994,7 +44570,7 @@ protected function resetPasswordRequest($body) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38002,64 +44578,38 @@ protected function resetPasswordRequest($body) } /** - * Operation searchCouponsAdvancedApplicationWideWithoutTotalCount + * Operation updateAccountCollection * - * List coupons that match the given attributes (without total count) + * Update account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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. - `draft`: Campaigns that are drafts. (optional) + * @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\UpdateCollection $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2009 + * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function searchCouponsAdvancedApplicationWideWithoutTotalCount($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) + public function updateAccountCollection($collectionId, $body) { - list($response) = $this->searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState); + list($response) = $this->updateAccountCollectionWithHttpInfo($collectionId, $body); return $response; } /** - * Operation searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInfo + * Operation updateAccountCollectionWithHttpInfo * - * List coupons that match the given attributes (without total count) + * Update account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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. - `draft`: Campaigns that are drafts. (optional) + * @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\UpdateCollection $body body (required) * * @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\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) + public function updateAccountCollectionWithHttpInfo($collectionId, $body) { - $request = $this->searchCouponsAdvancedApplicationWideWithoutTotalCountRequest($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState); + $request = $this->updateAccountCollectionRequest($collectionId, $body); try { $options = $this->createHttpClientOption(); @@ -38092,20 +44642,56 @@ public function searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInf $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2009' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Collection' === '\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\Collection', []), + $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 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\InlineResponse2009'; + $returnType = '\TalonOne\Client\Model\Collection'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -38124,7 +44710,31 @@ public function searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInf case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2009', + '\TalonOne\Client\Model\Collection', + $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 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -38135,32 +44745,19 @@ public function searchCouponsAdvancedApplicationWideWithoutTotalCountWithHttpInf } /** - * Operation searchCouponsAdvancedApplicationWideWithoutTotalCountAsync + * Operation updateAccountCollectionAsync * - * List coupons that match the given attributes (without total count) + * Update account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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. - `draft`: Campaigns that are drafts. (optional) + * @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\UpdateCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchCouponsAdvancedApplicationWideWithoutTotalCountAsync($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) + public function updateAccountCollectionAsync($collectionId, $body) { - return $this->searchCouponsAdvancedApplicationWideWithoutTotalCountAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState) + return $this->updateAccountCollectionAsyncWithHttpInfo($collectionId, $body) ->then( function ($response) { return $response[0]; @@ -38169,33 +44766,20 @@ function ($response) { } /** - * Operation searchCouponsAdvancedApplicationWideWithoutTotalCountAsyncWithHttpInfo + * Operation updateAccountCollectionAsyncWithHttpInfo * - * List coupons that match the given attributes (without total count) + * Update account-level collection * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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. - `draft`: Campaigns that are drafts. (optional) + * @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\UpdateCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchCouponsAdvancedApplicationWideWithoutTotalCountAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) + public function updateAccountCollectionAsyncWithHttpInfo($collectionId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse2009'; - $request = $this->searchCouponsAdvancedApplicationWideWithoutTotalCountRequest($applicationId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $batchId, $exactMatch, $campaignState); + $returnType = '\TalonOne\Client\Model\Collection'; + $request = $this->updateAccountCollectionRequest($collectionId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38232,154 +44816,43 @@ function ($exception) { } /** - * Create request for operation 'searchCouponsAdvancedApplicationWideWithoutTotalCount' + * Create request for operation 'updateAccountCollection' * - * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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. - `draft`: Campaigns that are drafts. (optional) + * @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\UpdateCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function searchCouponsAdvancedApplicationWideWithoutTotalCountRequest($applicationId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $batchId = null, $exactMatch = false, $campaignState = null) + protected function updateAccountCollectionRequest($collectionId, $body) { - // 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 searchCouponsAdvancedApplicationWideWithoutTotalCount' + 'Missing the required parameter $collectionId when calling updateAccountCollection' ); } // 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 searchCouponsAdvancedApplicationWideWithoutTotalCount' + 'Missing the required parameter $body when calling updateAccountCollection' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedApplicationWideWithoutTotalCount, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedApplicationWideWithoutTotalCount, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/coupons_search_advanced/no_total'; + $resourcePath = '/v1/collections/{collectionId}'; $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($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($campaignState)) { - $campaignState = ObjectSerializer::serializeCollection($campaignState, '', true); - } - if ($campaignState !== null) { - $queryParams['campaignState'] = $campaignState; - } // path params - if ($applicationId !== null) { + if ($collectionId !== null) { $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), $resourcePath ); } @@ -38454,7 +44927,7 @@ protected function searchCouponsAdvancedApplicationWideWithoutTotalCountRequest( $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38462,64 +44935,42 @@ protected function searchCouponsAdvancedApplicationWideWithoutTotalCountRequest( } /** - * Operation searchCouponsAdvancedWithoutTotalCount + * Operation updateAchievement * - * List coupons that match the given attributes in campaign (without total count) + * Update 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 object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $batchId Filter results by batches of coupons (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. (required) + * @param \TalonOne\Client\Model\UpdateAchievement $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse2009 + * @return \TalonOne\Client\Model\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function searchCouponsAdvancedWithoutTotalCount($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) + public function updateAchievement($applicationId, $campaignId, $achievementId, $body) { - list($response) = $this->searchCouponsAdvancedWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId); + list($response) = $this->updateAchievementWithHttpInfo($applicationId, $campaignId, $achievementId, $body); return $response; } /** - * Operation searchCouponsAdvancedWithoutTotalCountWithHttpInfo + * Operation updateAchievementWithHttpInfo * - * List coupons that match the given attributes in campaign (without total count) + * Update 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 object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $batchId Filter results by batches of coupons (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. (required) + * @param \TalonOne\Client\Model\UpdateAchievement $body body (required) * * @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\Achievement|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function searchCouponsAdvancedWithoutTotalCountWithHttpInfo($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) + public function updateAchievementWithHttpInfo($applicationId, $campaignId, $achievementId, $body) { - $request = $this->searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId); + $request = $this->updateAchievementRequest($applicationId, $campaignId, $achievementId, $body); try { $options = $this->createHttpClientOption(); @@ -38552,20 +45003,56 @@ public function searchCouponsAdvancedWithoutTotalCountWithHttpInfo($applicationI $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2009' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Achievement' === '\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\Achievement', []), + $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\InlineResponse2009'; + $returnType = '\TalonOne\Client\Model\Achievement'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -38584,7 +45071,31 @@ public function searchCouponsAdvancedWithoutTotalCountWithHttpInfo($applicationI case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2009', + '\TalonOne\Client\Model\Achievement', + $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); @@ -38595,32 +45106,21 @@ public function searchCouponsAdvancedWithoutTotalCountWithHttpInfo($applicationI } /** - * Operation searchCouponsAdvancedWithoutTotalCountAsync + * Operation updateAchievementAsync * - * List coupons that match the given attributes in campaign (without total count) + * Update 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 object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $batchId Filter results by batches of coupons (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. (required) + * @param \TalonOne\Client\Model\UpdateAchievement $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchCouponsAdvancedWithoutTotalCountAsync($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) + public function updateAchievementAsync($applicationId, $campaignId, $achievementId, $body) { - return $this->searchCouponsAdvancedWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId) + return $this->updateAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId, $body) ->then( function ($response) { return $response[0]; @@ -38629,33 +45129,22 @@ function ($response) { } /** - * Operation searchCouponsAdvancedWithoutTotalCountAsyncWithHttpInfo + * Operation updateAchievementAsyncWithHttpInfo * - * List coupons that match the given attributes in campaign (without total count) + * Update 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 object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $batchId Filter results by batches of coupons (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. (required) + * @param \TalonOne\Client\Model\UpdateAchievement $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchCouponsAdvancedWithoutTotalCountAsyncWithHttpInfo($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) + public function updateAchievementAsyncWithHttpInfo($applicationId, $campaignId, $achievementId, $body) { - $returnType = '\TalonOne\Client\Model\InlineResponse2009'; - $request = $this->searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $campaignId, $body, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $valid, $usable, $referralId, $recipientIntegrationId, $exactMatch, $batchId); + $returnType = '\TalonOne\Client\Model\Achievement'; + $request = $this->updateAchievementRequest($applicationId, $campaignId, $achievementId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38692,146 +45181,50 @@ function ($exception) { } /** - * Create request for operation 'searchCouponsAdvancedWithoutTotalCount' + * Create request for operation 'updateAchievement' * * @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 object $body body (required) - * @param int $pageSize The number of items in this 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 timezone. 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 timezone. 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 bool $exactMatch Filter results to an exact case-insensitive matching against the coupon code (optional, default to false) - * @param string $batchId Filter results by batches of coupons (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. (required) + * @param \TalonOne\Client\Model\UpdateAchievement $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $campaignId, $body, $pageSize = 1000, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $valid = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false, $batchId = null) + protected function updateAchievementRequest($applicationId, $campaignId, $achievementId, $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 searchCouponsAdvancedWithoutTotalCount' + 'Missing the required parameter $applicationId when calling updateAchievement' ); } // 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 searchCouponsAdvancedWithoutTotalCount' + 'Missing the required parameter $campaignId when calling updateAchievement' + ); + } + // 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 updateAchievement' ); } // 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 searchCouponsAdvancedWithoutTotalCount' + 'Missing the required parameter $body when calling updateAchievement' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedWithoutTotalCount, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.searchCouponsAdvancedWithoutTotalCount, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}'; $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($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; - } - // query params - if (is_array($batchId)) { - $batchId = ObjectSerializer::serializeCollection($batchId, '', true); - } - if ($batchId !== null) { - $queryParams['batchId'] = $batchId; - } // path params @@ -38850,6 +45243,14 @@ protected function searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $resourcePath ); } + // path params + if ($achievementId !== null) { + $resourcePath = str_replace( + '{' . 'achievementId' . '}', + ObjectSerializer::toPathValue($achievementId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -38921,7 +45322,7 @@ protected function searchCouponsAdvancedWithoutTotalCountRequest($applicationId, $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38929,39 +45330,38 @@ protected function searchCouponsAdvancedWithoutTotalCountRequest($applicationId, } /** - * Operation transferLoyaltyCard + * Operation updateAdditionalCost * - * Transfer card data + * Update additional cost * - * @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\TransferLoyaltyCard $body body (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) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\AccountAdditionalCost */ - public function transferLoyaltyCard($loyaltyProgramId, $loyaltyCardId, $body) + public function updateAdditionalCost($additionalCostId, $body) { - $this->transferLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); + list($response) = $this->updateAdditionalCostWithHttpInfo($additionalCostId, $body); + return $response; } /** - * Operation transferLoyaltyCardWithHttpInfo + * Operation updateAdditionalCostWithHttpInfo * - * Transfer card data + * Update additional cost * - * @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\TransferLoyaltyCard $body body (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) + * @param \TalonOne\Client\Model\NewAdditionalCost $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\AccountAdditionalCost, HTTP status code, HTTP response headers (array of strings) */ - public function transferLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function updateAdditionalCostWithHttpInfo($additionalCostId, $body) { - $request = $this->transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body); + $request = $this->updateAdditionalCostRequest($additionalCostId, $body); try { $options = $this->createHttpClientOption(); @@ -38991,30 +45391,42 @@ public function transferLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardI ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\AccountAdditionalCost' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AccountAdditionalCost', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $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\AccountAdditionalCost', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39025,20 +45437,19 @@ public function transferLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardI } /** - * Operation transferLoyaltyCardAsync + * Operation updateAdditionalCostAsync * - * Transfer card data + * Update additional cost * - * @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\TransferLoyaltyCard $body body (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) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId, $body) + public function updateAdditionalCostAsync($additionalCostId, $body) { - return $this->transferLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + return $this->updateAdditionalCostAsyncWithHttpInfo($additionalCostId, $body) ->then( function ($response) { return $response[0]; @@ -39047,27 +45458,37 @@ function ($response) { } /** - * Operation transferLoyaltyCardAsyncWithHttpInfo + * Operation updateAdditionalCostAsyncWithHttpInfo * - * Transfer card data + * Update additional cost * - * @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\TransferLoyaltyCard $body body (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) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function updateAdditionalCostAsyncWithHttpInfo($additionalCostId, $body) { - $returnType = ''; - $request = $this->transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body); + $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $request = $this->updateAdditionalCostRequest($additionalCostId, $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(); @@ -39087,41 +45508,30 @@ function ($exception) { } /** - * Create request for operation 'transferLoyaltyCard' + * Create request for operation 'updateAdditionalCost' * - * @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\TransferLoyaltyCard $body body (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) + * @param \TalonOne\Client\Model\NewAdditionalCost $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body) + protected function updateAdditionalCostRequest($additionalCostId, $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 transferLoyaltyCard' - ); - } - // verify the required parameter 'loyaltyCardId' is set - if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + // verify the required parameter 'additionalCostId' is set + if ($additionalCostId === null || (is_array($additionalCostId) && count($additionalCostId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling transferLoyaltyCard' + 'Missing the required parameter $additionalCostId when calling updateAdditionalCost' ); } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.transferLoyaltyCard, 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 transferLoyaltyCard' + 'Missing the required parameter $body when calling updateAdditionalCost' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transfer'; + $resourcePath = '/v1/additional_costs/{additionalCostId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39131,18 +45541,10 @@ protected function transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } - // path params - if ($loyaltyCardId !== null) { + if ($additionalCostId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), + '{' . 'additionalCostId' . '}', + ObjectSerializer::toPathValue($additionalCostId), $resourcePath ); } @@ -39225,38 +45627,38 @@ protected function transferLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, } /** - * Operation updateAccountCollection + * Operation updateAttribute * - * Update account-level collection + * Update custom attribute * - * @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\UpdateCollection $body body (required) + * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Attribute */ - public function updateAccountCollection($collectionId, $body) + public function updateAttribute($attributeId, $body) { - list($response) = $this->updateAccountCollectionWithHttpInfo($collectionId, $body); + list($response) = $this->updateAttributeWithHttpInfo($attributeId, $body); return $response; } /** - * Operation updateAccountCollectionWithHttpInfo + * Operation updateAttributeWithHttpInfo * - * Update account-level collection + * Update custom attribute * - * @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\UpdateCollection $body body (required) + * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Collection|\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\Attribute, HTTP status code, HTTP response headers (array of strings) */ - public function updateAccountCollectionWithHttpInfo($collectionId, $body) + public function updateAttributeWithHttpInfo($attributeId, $body) { - $request = $this->updateAccountCollectionRequest($collectionId, $body); + $request = $this->updateAttributeRequest($attributeId, $body); try { $options = $this->createHttpClientOption(); @@ -39289,56 +45691,20 @@ public function updateAccountCollectionWithHttpInfo($collectionId, $body) $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 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 409: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Attribute' === '\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\Attribute', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Collection'; + $returnType = '\TalonOne\Client\Model\Attribute'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -39357,31 +45723,7 @@ public function updateAccountCollectionWithHttpInfo($collectionId, $body) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Collection', - $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 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\Attribute', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39392,19 +45734,19 @@ public function updateAccountCollectionWithHttpInfo($collectionId, $body) } /** - * Operation updateAccountCollectionAsync + * Operation updateAttributeAsync * - * Update account-level collection + * Update custom attribute * - * @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\UpdateCollection $body body (required) + * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccountCollectionAsync($collectionId, $body) + public function updateAttributeAsync($attributeId, $body) { - return $this->updateAccountCollectionAsyncWithHttpInfo($collectionId, $body) + return $this->updateAttributeAsyncWithHttpInfo($attributeId, $body) ->then( function ($response) { return $response[0]; @@ -39413,20 +45755,20 @@ function ($response) { } /** - * Operation updateAccountCollectionAsyncWithHttpInfo + * Operation updateAttributeAsyncWithHttpInfo * - * Update account-level collection + * Update custom attribute * - * @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\UpdateCollection $body body (required) + * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAccountCollectionAsyncWithHttpInfo($collectionId, $body) + public function updateAttributeAsyncWithHttpInfo($attributeId, $body) { - $returnType = '\TalonOne\Client\Model\Collection'; - $request = $this->updateAccountCollectionRequest($collectionId, $body); + $returnType = '\TalonOne\Client\Model\Attribute'; + $request = $this->updateAttributeRequest($attributeId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39463,30 +45805,30 @@ function ($exception) { } /** - * Create request for operation 'updateAccountCollection' + * Create request for operation 'updateAttribute' * - * @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\UpdateCollection $body body (required) + * @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 \TalonOne\Client\Model\NewAttribute $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAccountCollectionRequest($collectionId, $body) + protected function updateAttributeRequest($attributeId, $body) { - // verify the required parameter 'collectionId' is set - if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + // verify the required parameter 'attributeId' is set + if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $collectionId when calling updateAccountCollection' + 'Missing the required parameter $attributeId when calling updateAttribute' ); } // 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 updateAccountCollection' + 'Missing the required parameter $body when calling updateAttribute' ); } - $resourcePath = '/v1/collections/{collectionId}'; + $resourcePath = '/v1/attributes/{attributeId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39496,10 +45838,10 @@ protected function updateAccountCollectionRequest($collectionId, $body) // path params - if ($collectionId !== null) { + if ($attributeId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'attributeId' . '}', + ObjectSerializer::toPathValue($attributeId), $resourcePath ); } @@ -39582,38 +45924,40 @@ protected function updateAccountCollectionRequest($collectionId, $body) } /** - * Operation updateAdditionalCost + * Operation updateCampaign * - * Update additional cost + * Update campaign * - * @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 \TalonOne\Client\Model\NewAdditionalCost $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\UpdateCampaign $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\AccountAdditionalCost + * @return \TalonOne\Client\Model\Campaign */ - public function updateAdditionalCost($additionalCostId, $body) + public function updateCampaign($applicationId, $campaignId, $body) { - list($response) = $this->updateAdditionalCostWithHttpInfo($additionalCostId, $body); + list($response) = $this->updateCampaignWithHttpInfo($applicationId, $campaignId, $body); return $response; } /** - * Operation updateAdditionalCostWithHttpInfo + * Operation updateCampaignWithHttpInfo * - * Update additional cost + * Update campaign * - * @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 \TalonOne\Client\Model\NewAdditionalCost $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\UpdateCampaign $body body (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\Campaign, HTTP status code, HTTP response headers (array of strings) */ - public function updateAdditionalCostWithHttpInfo($additionalCostId, $body) + public function updateCampaignWithHttpInfo($applicationId, $campaignId, $body) { - $request = $this->updateAdditionalCostRequest($additionalCostId, $body); + $request = $this->updateCampaignRequest($applicationId, $campaignId, $body); try { $options = $this->createHttpClientOption(); @@ -39646,20 +45990,20 @@ public function updateAdditionalCostWithHttpInfo($additionalCostId, $body) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\AccountAdditionalCost' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Campaign' === '\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\Campaign', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; + $returnType = '\TalonOne\Client\Model\Campaign'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -39678,7 +46022,7 @@ public function updateAdditionalCostWithHttpInfo($additionalCostId, $body) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\AccountAdditionalCost', + '\TalonOne\Client\Model\Campaign', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39689,19 +46033,20 @@ public function updateAdditionalCostWithHttpInfo($additionalCostId, $body) } /** - * Operation updateAdditionalCostAsync + * Operation updateCampaignAsync * - * Update additional cost + * Update campaign * - * @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 \TalonOne\Client\Model\NewAdditionalCost $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\UpdateCampaign $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAdditionalCostAsync($additionalCostId, $body) + public function updateCampaignAsync($applicationId, $campaignId, $body) { - return $this->updateAdditionalCostAsyncWithHttpInfo($additionalCostId, $body) + return $this->updateCampaignAsyncWithHttpInfo($applicationId, $campaignId, $body) ->then( function ($response) { return $response[0]; @@ -39710,20 +46055,21 @@ function ($response) { } /** - * Operation updateAdditionalCostAsyncWithHttpInfo + * Operation updateCampaignAsyncWithHttpInfo * - * Update additional cost + * Update campaign * - * @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 \TalonOne\Client\Model\NewAdditionalCost $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\UpdateCampaign $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAdditionalCostAsyncWithHttpInfo($additionalCostId, $body) + public function updateCampaignAsyncWithHttpInfo($applicationId, $campaignId, $body) { - $returnType = '\TalonOne\Client\Model\AccountAdditionalCost'; - $request = $this->updateAdditionalCostRequest($additionalCostId, $body); + $returnType = '\TalonOne\Client\Model\Campaign'; + $request = $this->updateCampaignRequest($applicationId, $campaignId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39760,30 +46106,37 @@ function ($exception) { } /** - * Create request for operation 'updateAdditionalCost' + * Create request for operation 'updateCampaign' * - * @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 \TalonOne\Client\Model\NewAdditionalCost $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\UpdateCampaign $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAdditionalCostRequest($additionalCostId, $body) + protected function updateCampaignRequest($applicationId, $campaignId, $body) { - // verify the required parameter 'additionalCostId' is set - if ($additionalCostId === null || (is_array($additionalCostId) && count($additionalCostId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $additionalCostId when calling updateAdditionalCost' + 'Missing the required parameter $applicationId when calling updateCampaign' + ); + } + // 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 updateCampaign' ); } // 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 updateAdditionalCost' + 'Missing the required parameter $body when calling updateCampaign' ); } - $resourcePath = '/v1/additional_costs/{additionalCostId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39793,10 +46146,18 @@ protected function updateAdditionalCostRequest($additionalCostId, $body) // path params - if ($additionalCostId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'additionalCostId' . '}', - ObjectSerializer::toPathValue($additionalCostId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -39879,38 +46240,42 @@ protected function updateAdditionalCostRequest($additionalCostId, $body) } /** - * Operation updateAttribute + * Operation updateCollection * - * Update custom attribute + * Update campaign-level collection's description * - * @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 \TalonOne\Client\Model\NewAttribute $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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Attribute + * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function updateAttribute($attributeId, $body) + public function updateCollection($applicationId, $campaignId, $collectionId, $body) { - list($response) = $this->updateAttributeWithHttpInfo($attributeId, $body); + list($response) = $this->updateCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $body); return $response; } /** - * Operation updateAttributeWithHttpInfo + * Operation updateCollectionWithHttpInfo * - * Update custom attribute + * Update campaign-level collection's description * - * @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 \TalonOne\Client\Model\NewAttribute $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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) * * @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\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function updateAttributeWithHttpInfo($attributeId, $body) + public function updateCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $body) { - $request = $this->updateAttributeRequest($attributeId, $body); + $request = $this->updateCollectionRequest($applicationId, $campaignId, $collectionId, $body); try { $options = $this->createHttpClientOption(); @@ -39943,20 +46308,32 @@ public function updateAttributeWithHttpInfo($attributeId, $body) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Attribute' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Collection' === '\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\Collection', []), + $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\Attribute'; + $returnType = '\TalonOne\Client\Model\Collection'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -39975,7 +46352,15 @@ public function updateAttributeWithHttpInfo($attributeId, $body) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Attribute', + '\TalonOne\Client\Model\Collection', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -39986,19 +46371,21 @@ public function updateAttributeWithHttpInfo($attributeId, $body) } /** - * Operation updateAttributeAsync + * Operation updateCollectionAsync * - * Update custom attribute + * Update campaign-level collection's description * - * @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 \TalonOne\Client\Model\NewAttribute $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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAttributeAsync($attributeId, $body) + public function updateCollectionAsync($applicationId, $campaignId, $collectionId, $body) { - return $this->updateAttributeAsyncWithHttpInfo($attributeId, $body) + return $this->updateCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $body) ->then( function ($response) { return $response[0]; @@ -40007,20 +46394,22 @@ function ($response) { } /** - * Operation updateAttributeAsyncWithHttpInfo + * Operation updateCollectionAsyncWithHttpInfo * - * Update custom attribute + * Update campaign-level collection's description * - * @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 \TalonOne\Client\Model\NewAttribute $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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAttributeAsyncWithHttpInfo($attributeId, $body) + public function updateCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $body) { - $returnType = '\TalonOne\Client\Model\Attribute'; - $request = $this->updateAttributeRequest($attributeId, $body); + $returnType = '\TalonOne\Client\Model\Collection'; + $request = $this->updateCollectionRequest($applicationId, $campaignId, $collectionId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40057,30 +46446,44 @@ function ($exception) { } /** - * Create request for operation 'updateAttribute' + * Create request for operation 'updateCollection' * - * @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 \TalonOne\Client\Model\NewAttribute $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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAttributeRequest($attributeId, $body) + protected function updateCollectionRequest($applicationId, $campaignId, $collectionId, $body) { - // 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 updateAttribute' + 'Missing the required parameter $applicationId when calling updateCollection' + ); + } + // 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 updateCollection' + ); + } + // 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 updateCollection' ); } // 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 updateAttribute' + 'Missing the required parameter $body when calling updateCollection' ); } - $resourcePath = '/v1/attributes/{attributeId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -40090,10 +46493,26 @@ protected function updateAttributeRequest($attributeId, $body) // path params - if ($attributeId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'attributeId' . '}', - ObjectSerializer::toPathValue($attributeId), + '{' . '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 ); } @@ -40176,40 +46595,42 @@ protected function updateAttributeRequest($attributeId, $body) } /** - * Operation updateCampaign + * Operation updateCoupon * - * Update campaign + * Update coupon * * @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\UpdateCampaign $body body (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) + * @param \TalonOne\Client\Model\UpdateCoupon $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Campaign + * @return \TalonOne\Client\Model\Coupon */ - public function updateCampaign($applicationId, $campaignId, $body) + public function updateCoupon($applicationId, $campaignId, $couponId, $body) { - list($response) = $this->updateCampaignWithHttpInfo($applicationId, $campaignId, $body); + list($response) = $this->updateCouponWithHttpInfo($applicationId, $campaignId, $couponId, $body); return $response; } /** - * Operation updateCampaignWithHttpInfo + * Operation updateCouponWithHttpInfo * - * Update campaign + * Update coupon * * @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\UpdateCampaign $body body (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) + * @param \TalonOne\Client\Model\UpdateCoupon $body body (required) * * @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\Coupon, HTTP status code, HTTP response headers (array of strings) */ - public function updateCampaignWithHttpInfo($applicationId, $campaignId, $body) + public function updateCouponWithHttpInfo($applicationId, $campaignId, $couponId, $body) { - $request = $this->updateCampaignRequest($applicationId, $campaignId, $body); + $request = $this->updateCouponRequest($applicationId, $campaignId, $couponId, $body); try { $options = $this->createHttpClientOption(); @@ -40242,20 +46663,20 @@ public function updateCampaignWithHttpInfo($applicationId, $campaignId, $body) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Campaign' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Coupon' === '\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\Coupon', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Campaign'; + $returnType = '\TalonOne\Client\Model\Coupon'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -40274,7 +46695,7 @@ public function updateCampaignWithHttpInfo($applicationId, $campaignId, $body) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Campaign', + '\TalonOne\Client\Model\Coupon', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -40285,20 +46706,21 @@ public function updateCampaignWithHttpInfo($applicationId, $campaignId, $body) } /** - * Operation updateCampaignAsync + * Operation updateCouponAsync * - * Update campaign + * Update coupon * * @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\UpdateCampaign $body body (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) + * @param \TalonOne\Client\Model\UpdateCoupon $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignAsync($applicationId, $campaignId, $body) + public function updateCouponAsync($applicationId, $campaignId, $couponId, $body) { - return $this->updateCampaignAsyncWithHttpInfo($applicationId, $campaignId, $body) + return $this->updateCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId, $body) ->then( function ($response) { return $response[0]; @@ -40307,21 +46729,22 @@ function ($response) { } /** - * Operation updateCampaignAsyncWithHttpInfo + * Operation updateCouponAsyncWithHttpInfo * - * Update campaign + * Update coupon * * @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\UpdateCampaign $body body (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) + * @param \TalonOne\Client\Model\UpdateCoupon $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignAsyncWithHttpInfo($applicationId, $campaignId, $body) + public function updateCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId, $body) { - $returnType = '\TalonOne\Client\Model\Campaign'; - $request = $this->updateCampaignRequest($applicationId, $campaignId, $body); + $returnType = '\TalonOne\Client\Model\Coupon'; + $request = $this->updateCouponRequest($applicationId, $campaignId, $couponId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40358,37 +46781,44 @@ function ($exception) { } /** - * Create request for operation 'updateCampaign' + * Create request for operation 'updateCoupon' * * @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\UpdateCampaign $body body (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) + * @param \TalonOne\Client\Model\UpdateCoupon $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateCampaignRequest($applicationId, $campaignId, $body) + protected function updateCouponRequest($applicationId, $campaignId, $couponId, $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 updateCampaign' + 'Missing the required parameter $applicationId when calling updateCoupon' ); } // 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 updateCampaign' + 'Missing the required parameter $campaignId when calling updateCoupon' + ); + } + // 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 updateCoupon' ); } // 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 updateCampaign' + 'Missing the required parameter $body when calling updateCoupon' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -40413,6 +46843,14 @@ protected function updateCampaignRequest($applicationId, $campaignId, $body) $resourcePath ); } + // path params + if ($couponId !== null) { + $resourcePath = str_replace( + '{' . 'couponId' . '}', + ObjectSerializer::toPathValue($couponId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -40492,42 +46930,39 @@ protected function updateCampaignRequest($applicationId, $campaignId, $body) } /** - * Operation updateCollection + * Operation updateCouponBatch * - * Update campaign-level collection's description + * Update 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\UpdateCouponBatch $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Collection|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return void */ - public function updateCollection($applicationId, $campaignId, $collectionId, $body) + public function updateCouponBatch($applicationId, $campaignId, $body) { - list($response) = $this->updateCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $body); - return $response; + $this->updateCouponBatchWithHttpInfo($applicationId, $campaignId, $body); } /** - * Operation updateCollectionWithHttpInfo + * Operation updateCouponBatchWithHttpInfo * - * Update campaign-level collection's description + * Update 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\UpdateCouponBatch $body body (required) * * @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 null, HTTP status code, HTTP response headers (array of strings) */ - public function updateCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $body) + public function updateCouponBatchWithHttpInfo($applicationId, $campaignId, $body) { - $request = $this->updateCollectionRequest($applicationId, $campaignId, $collectionId, $body); + $request = $this->updateCouponBatchRequest($applicationId, $campaignId, $body); try { $options = $this->createHttpClientOption(); @@ -40557,87 +46992,30 @@ public function updateCollectionWithHttpInfo($applicationId, $campaignId, $colle ); } - $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 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\Collection'; - $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\Collection', - $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 updateCollectionAsync + * Operation updateCouponBatchAsync * - * Update campaign-level collection's description + * Update 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\UpdateCouponBatch $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCollectionAsync($applicationId, $campaignId, $collectionId, $body) + public function updateCouponBatchAsync($applicationId, $campaignId, $body) { - return $this->updateCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $body) + return $this->updateCouponBatchAsyncWithHttpInfo($applicationId, $campaignId, $body) ->then( function ($response) { return $response[0]; @@ -40646,39 +47024,27 @@ function ($response) { } /** - * Operation updateCollectionAsyncWithHttpInfo + * Operation updateCouponBatchAsyncWithHttpInfo * - * Update campaign-level collection's description + * Update 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 int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) - * @param \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\UpdateCouponBatch $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $body) + public function updateCouponBatchAsyncWithHttpInfo($applicationId, $campaignId, $body) { - $returnType = '\TalonOne\Client\Model\Collection'; - $request = $this->updateCollectionRequest($applicationId, $campaignId, $collectionId, $body); + $returnType = ''; + $request = $this->updateCouponBatchRequest($applicationId, $campaignId, $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(); @@ -40698,44 +47064,37 @@ function ($exception) { } /** - * Create request for operation 'updateCollection' + * Create request for operation 'updateCouponBatch' * * @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 \TalonOne\Client\Model\UpdateCampaignCollection $body body (required) + * @param \TalonOne\Client\Model\UpdateCouponBatch $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateCollectionRequest($applicationId, $campaignId, $collectionId, $body) + protected function updateCouponBatchRequest($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 updateCollection' + 'Missing the required parameter $applicationId when calling updateCouponBatch' ); } // 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 updateCollection' - ); - } - // 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 updateCollection' + 'Missing the required parameter $campaignId when calling updateCouponBatch' ); } // 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 updateCollection' + 'Missing the required parameter $body when calling updateCouponBatch' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'; $formParams = []; $queryParams = []; $headerParams = []; @@ -40760,14 +47119,6 @@ protected function updateCollectionRequest($applicationId, $campaignId, $collect $resourcePath ); } - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -40777,11 +47128,11 @@ protected function updateCollectionRequest($applicationId, $campaignId, $collect if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], ['application/json'] ); } @@ -40847,42 +47198,40 @@ protected function updateCollectionRequest($applicationId, $campaignId, $collect } /** - * Operation updateCoupon + * Operation updateLoyaltyCard * - * Update coupon + * Update loyalty card status * - * @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) - * @param \TalonOne\Client\Model\UpdateCoupon $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 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\UpdateLoyaltyCard $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Coupon + * @return \TalonOne\Client\Model\LoyaltyCard|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function updateCoupon($applicationId, $campaignId, $couponId, $body) + public function updateLoyaltyCard($loyaltyProgramId, $loyaltyCardId, $body) { - list($response) = $this->updateCouponWithHttpInfo($applicationId, $campaignId, $couponId, $body); + list($response) = $this->updateLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); return $response; } /** - * Operation updateCouponWithHttpInfo + * Operation updateLoyaltyCardWithHttpInfo * - * Update coupon + * Update loyalty card status * - * @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) - * @param \TalonOne\Client\Model\UpdateCoupon $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 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\UpdateLoyaltyCard $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Coupon, 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 updateCouponWithHttpInfo($applicationId, $campaignId, $couponId, $body) + public function updateLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { - $request = $this->updateCouponRequest($applicationId, $campaignId, $couponId, $body); + $request = $this->updateLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body); try { $options = $this->createHttpClientOption(); @@ -40915,20 +47264,56 @@ public function updateCouponWithHttpInfo($applicationId, $campaignId, $couponId, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Coupon' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyCard' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Coupon', []), + 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\Coupon'; + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -40947,7 +47332,31 @@ public function updateCouponWithHttpInfo($applicationId, $campaignId, $couponId, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Coupon', + '\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); @@ -40958,21 +47367,20 @@ public function updateCouponWithHttpInfo($applicationId, $campaignId, $couponId, } /** - * Operation updateCouponAsync + * Operation updateLoyaltyCardAsync * - * Update coupon + * Update loyalty card status * - * @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) - * @param \TalonOne\Client\Model\UpdateCoupon $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 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\UpdateLoyaltyCard $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCouponAsync($applicationId, $campaignId, $couponId, $body) + public function updateLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId, $body) { - return $this->updateCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId, $body) + return $this->updateLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) ->then( function ($response) { return $response[0]; @@ -40981,22 +47389,21 @@ function ($response) { } /** - * Operation updateCouponAsyncWithHttpInfo + * Operation updateLoyaltyCardAsyncWithHttpInfo * - * Update coupon + * Update loyalty card status * - * @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) - * @param \TalonOne\Client\Model\UpdateCoupon $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 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\UpdateLoyaltyCard $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId, $body) + public function updateLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) { - $returnType = '\TalonOne\Client\Model\Coupon'; - $request = $this->updateCouponRequest($applicationId, $campaignId, $couponId, $body); + $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $request = $this->updateLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41033,44 +47440,41 @@ function ($exception) { } /** - * Create request for operation 'updateCoupon' + * Create request for operation 'updateLoyaltyCard' * - * @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) - * @param \TalonOne\Client\Model\UpdateCoupon $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 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\UpdateLoyaltyCard $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateCouponRequest($applicationId, $campaignId, $couponId, $body) + protected function updateLoyaltyCardRequest($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 updateCoupon' + 'Missing the required parameter $loyaltyProgramId when calling updateLoyaltyCard' ); } - // 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 updateCoupon' + 'Missing the required parameter $loyaltyCardId when calling updateLoyaltyCard' ); } - // 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 updateCoupon' - ); + if (strlen($loyaltyCardId) > 108) { + throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.updateLoyaltyCard, 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 updateCoupon' + 'Missing the required parameter $body when calling updateLoyaltyCard' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41080,26 +47484,18 @@ protected function updateCouponRequest($applicationId, $campaignId, $couponId, $ // 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 ($couponId !== null) { + if ($loyaltyCardId !== null) { $resourcePath = str_replace( - '{' . 'couponId' . '}', - ObjectSerializer::toPathValue($couponId), + '{' . 'loyaltyCardId' . '}', + ObjectSerializer::toPathValue($loyaltyCardId), $resourcePath ); } @@ -41182,39 +47578,42 @@ protected function updateCouponRequest($applicationId, $campaignId, $couponId, $ } /** - * Operation updateCouponBatch + * Operation updateReferral * - * Update coupons + * Update referral * * @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\UpdateCouponBatch $body body (required) + * @param string $referralId The ID of the referral code. (required) + * @param \TalonOne\Client\Model\UpdateReferral $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \TalonOne\Client\Model\Referral */ - public function updateCouponBatch($applicationId, $campaignId, $body) + public function updateReferral($applicationId, $campaignId, $referralId, $body) { - $this->updateCouponBatchWithHttpInfo($applicationId, $campaignId, $body); + list($response) = $this->updateReferralWithHttpInfo($applicationId, $campaignId, $referralId, $body); + return $response; } /** - * Operation updateCouponBatchWithHttpInfo + * Operation updateReferralWithHttpInfo * - * Update coupons + * Update referral * * @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\UpdateCouponBatch $body body (required) + * @param string $referralId The ID of the referral code. (required) + * @param \TalonOne\Client\Model\UpdateReferral $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\Referral, HTTP status code, HTTP response headers (array of strings) */ - public function updateCouponBatchWithHttpInfo($applicationId, $campaignId, $body) + public function updateReferralWithHttpInfo($applicationId, $campaignId, $referralId, $body) { - $request = $this->updateCouponBatchRequest($applicationId, $campaignId, $body); + $request = $this->updateReferralRequest($applicationId, $campaignId, $referralId, $body); try { $options = $this->createHttpClientOption(); @@ -41244,30 +47643,67 @@ public function updateCouponBatchWithHttpInfo($applicationId, $campaignId, $body ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\Referral' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Referral', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\Referral'; + $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\Referral', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation updateCouponBatchAsync + * Operation updateReferralAsync * - * Update coupons + * Update referral * * @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\UpdateCouponBatch $body body (required) + * @param string $referralId The ID of the referral code. (required) + * @param \TalonOne\Client\Model\UpdateReferral $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCouponBatchAsync($applicationId, $campaignId, $body) + public function updateReferralAsync($applicationId, $campaignId, $referralId, $body) { - return $this->updateCouponBatchAsyncWithHttpInfo($applicationId, $campaignId, $body) + return $this->updateReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId, $body) ->then( function ($response) { return $response[0]; @@ -41276,27 +47712,39 @@ function ($response) { } /** - * Operation updateCouponBatchAsyncWithHttpInfo + * Operation updateReferralAsyncWithHttpInfo * - * Update coupons + * Update referral * * @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\UpdateCouponBatch $body body (required) + * @param string $referralId The ID of the referral code. (required) + * @param \TalonOne\Client\Model\UpdateReferral $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCouponBatchAsyncWithHttpInfo($applicationId, $campaignId, $body) + public function updateReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId, $body) { - $returnType = ''; - $request = $this->updateCouponBatchRequest($applicationId, $campaignId, $body); + $returnType = '\TalonOne\Client\Model\Referral'; + $request = $this->updateReferralRequest($applicationId, $campaignId, $referralId, $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(); @@ -41316,37 +47764,44 @@ function ($exception) { } /** - * Create request for operation 'updateCouponBatch' + * Create request for operation 'updateReferral' * * @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\UpdateCouponBatch $body body (required) + * @param string $referralId The ID of the referral code. (required) + * @param \TalonOne\Client\Model\UpdateReferral $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateCouponBatchRequest($applicationId, $campaignId, $body) + protected function updateReferralRequest($applicationId, $campaignId, $referralId, $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 updateCouponBatch' + 'Missing the required parameter $applicationId when calling updateReferral' ); } // 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 updateCouponBatch' + 'Missing the required parameter $campaignId when calling updateReferral' + ); + } + // 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 updateReferral' ); } // 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 updateCouponBatch' + 'Missing the required parameter $body when calling updateReferral' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41371,6 +47826,14 @@ protected function updateCouponBatchRequest($applicationId, $campaignId, $body) $resourcePath ); } + // path params + if ($referralId !== null) { + $resourcePath = str_replace( + '{' . 'referralId' . '}', + ObjectSerializer::toPathValue($referralId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -41380,11 +47843,11 @@ protected function updateCouponBatchRequest($applicationId, $campaignId, $body) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], + ['application/json'], ['application/json'] ); } @@ -41450,40 +47913,38 @@ protected function updateCouponBatchRequest($applicationId, $campaignId, $body) } /** - * Operation updateLoyaltyCard + * Operation updateRoleV2 * - * Update loyalty card status + * Update role * - * @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\UpdateLoyaltyCard $body body (required) + * @param int $roleId The ID of role. (required) + * @param \TalonOne\Client\Model\RoleV2Base $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|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\RoleV2 */ - public function updateLoyaltyCard($loyaltyProgramId, $loyaltyCardId, $body) + public function updateRoleV2($roleId, $body) { - list($response) = $this->updateLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body); + list($response) = $this->updateRoleV2WithHttpInfo($roleId, $body); return $response; } /** - * Operation updateLoyaltyCardWithHttpInfo + * Operation updateRoleV2WithHttpInfo * - * Update loyalty card status + * Update role * - * @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\UpdateLoyaltyCard $body body (required) + * @param int $roleId The ID of role. (required) + * @param \TalonOne\Client\Model\RoleV2Base $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|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 updateLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function updateRoleV2WithHttpInfo($roleId, $body) { - $request = $this->updateLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body); + $request = $this->updateRoleV2Request($roleId, $body); try { $options = $this->createHttpClientOption(); @@ -41516,56 +47977,20 @@ public function updateLoyaltyCardWithHttpInfo($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\RoleV2' === '\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\RoleV2', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyCard'; + $returnType = '\TalonOne\Client\Model\RoleV2'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -41584,31 +48009,7 @@ public function updateLoyaltyCardWithHttpInfo($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\RoleV2', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -41619,20 +48020,19 @@ public function updateLoyaltyCardWithHttpInfo($loyaltyProgramId, $loyaltyCardId, } /** - * Operation updateLoyaltyCardAsync + * Operation updateRoleV2Async * - * Update loyalty card status + * Update role * - * @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\UpdateLoyaltyCard $body body (required) + * @param int $roleId The ID of role. (required) + * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLoyaltyCardAsync($loyaltyProgramId, $loyaltyCardId, $body) + public function updateRoleV2Async($roleId, $body) { - return $this->updateLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + return $this->updateRoleV2AsyncWithHttpInfo($roleId, $body) ->then( function ($response) { return $response[0]; @@ -41641,21 +48041,20 @@ function ($response) { } /** - * Operation updateLoyaltyCardAsyncWithHttpInfo + * Operation updateRoleV2AsyncWithHttpInfo * - * Update loyalty card status + * Update role * - * @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\UpdateLoyaltyCard $body body (required) + * @param int $roleId The ID of role. (required) + * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLoyaltyCardAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $body) + public function updateRoleV2AsyncWithHttpInfo($roleId, $body) { - $returnType = '\TalonOne\Client\Model\LoyaltyCard'; - $request = $this->updateLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body); + $returnType = '\TalonOne\Client\Model\RoleV2'; + $request = $this->updateRoleV2Request($roleId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41692,41 +48091,30 @@ function ($exception) { } /** - * Create request for operation 'updateLoyaltyCard' + * Create request for operation 'updateRoleV2' * - * @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\UpdateLoyaltyCard $body body (required) + * @param int $roleId The ID of role. (required) + * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $body) + protected function updateRoleV2Request($roleId, $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 updateLoyaltyCard' - ); - } - // verify the required parameter 'loyaltyCardId' is set - if ($loyaltyCardId === null || (is_array($loyaltyCardId) && count($loyaltyCardId) === 0)) { + // verify the required parameter 'roleId' is set + if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyCardId when calling updateLoyaltyCard' + 'Missing the required parameter $roleId when calling updateRoleV2' ); } - if (strlen($loyaltyCardId) > 108) { - throw new \InvalidArgumentException('invalid length for "$loyaltyCardId" when calling ManagementApi.updateLoyaltyCard, 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 updateLoyaltyCard' + 'Missing the required parameter $body when calling updateRoleV2' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}'; + $resourcePath = '/v2/roles/{roleId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41736,18 +48124,10 @@ protected function updateLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $ // path params - if ($loyaltyProgramId !== null) { - $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), - $resourcePath - ); - } - // path params - if ($loyaltyCardId !== null) { + if ($roleId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyCardId' . '}', - ObjectSerializer::toPathValue($loyaltyCardId), + '{' . 'roleId' . '}', + ObjectSerializer::toPathValue($roleId), $resourcePath ); } @@ -41830,42 +48210,40 @@ protected function updateLoyaltyCardRequest($loyaltyProgramId, $loyaltyCardId, $ } /** - * Operation updateReferral + * Operation updateStore * - * Update referral + * Update store * * @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 \TalonOne\Client\Model\UpdateReferral $body body (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 \TalonOne\Client\Model\NewStore $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Referral + * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function updateReferral($applicationId, $campaignId, $referralId, $body) + public function updateStore($applicationId, $storeId, $body) { - list($response) = $this->updateReferralWithHttpInfo($applicationId, $campaignId, $referralId, $body); + list($response) = $this->updateStoreWithHttpInfo($applicationId, $storeId, $body); return $response; } /** - * Operation updateReferralWithHttpInfo + * Operation updateStoreWithHttpInfo * - * Update referral + * Update store * * @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 \TalonOne\Client\Model\UpdateReferral $body body (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 \TalonOne\Client\Model\NewStore $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Referral, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function updateReferralWithHttpInfo($applicationId, $campaignId, $referralId, $body) + public function updateStoreWithHttpInfo($applicationId, $storeId, $body) { - $request = $this->updateReferralRequest($applicationId, $campaignId, $referralId, $body); + $request = $this->updateStoreRequest($applicationId, $storeId, $body); try { $options = $this->createHttpClientOption(); @@ -41898,20 +48276,44 @@ public function updateReferralWithHttpInfo($applicationId, $campaignId, $referra $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Referral' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Store' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Referral', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Store', []), + $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 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\Referral'; + $returnType = '\TalonOne\Client\Model\Store'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -41930,7 +48332,23 @@ public function updateReferralWithHttpInfo($applicationId, $campaignId, $referra case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Referral', + '\TalonOne\Client\Model\Store', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $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); @@ -41941,21 +48359,20 @@ public function updateReferralWithHttpInfo($applicationId, $campaignId, $referra } /** - * Operation updateReferralAsync + * Operation updateStoreAsync * - * Update referral + * Update store * * @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 \TalonOne\Client\Model\UpdateReferral $body body (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 \TalonOne\Client\Model\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateReferralAsync($applicationId, $campaignId, $referralId, $body) + public function updateStoreAsync($applicationId, $storeId, $body) { - return $this->updateReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId, $body) + return $this->updateStoreAsyncWithHttpInfo($applicationId, $storeId, $body) ->then( function ($response) { return $response[0]; @@ -41964,22 +48381,21 @@ function ($response) { } /** - * Operation updateReferralAsyncWithHttpInfo + * Operation updateStoreAsyncWithHttpInfo * - * Update referral + * Update store * * @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 \TalonOne\Client\Model\UpdateReferral $body body (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 \TalonOne\Client\Model\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateReferralAsyncWithHttpInfo($applicationId, $campaignId, $referralId, $body) + public function updateStoreAsyncWithHttpInfo($applicationId, $storeId, $body) { - $returnType = '\TalonOne\Client\Model\Referral'; - $request = $this->updateReferralRequest($applicationId, $campaignId, $referralId, $body); + $returnType = '\TalonOne\Client\Model\Store'; + $request = $this->updateStoreRequest($applicationId, $storeId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42016,44 +48432,37 @@ function ($exception) { } /** - * Create request for operation 'updateReferral' + * Create request for operation 'updateStore' * * @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 \TalonOne\Client\Model\UpdateReferral $body body (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 \TalonOne\Client\Model\NewStore $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateReferralRequest($applicationId, $campaignId, $referralId, $body) + protected function updateStoreRequest($applicationId, $storeId, $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 updateReferral' - ); - } - // 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 updateReferral' + 'Missing the required parameter $applicationId when calling updateStore' ); } - // verify the required parameter 'referralId' is set - if ($referralId === null || (is_array($referralId) && count($referralId) === 0)) { + // verify the required parameter 'storeId' is set + if ($storeId === null || (is_array($storeId) && count($storeId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $referralId when calling updateReferral' + 'Missing the required parameter $storeId when calling updateStore' ); } // 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 updateReferral' + 'Missing the required parameter $body when calling updateStore' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}'; + $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42071,18 +48480,10 @@ protected function updateReferralRequest($applicationId, $campaignId, $referralI ); } // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } - // path params - if ($referralId !== null) { + if ($storeId !== null) { $resourcePath = str_replace( - '{' . 'referralId' . '}', - ObjectSerializer::toPathValue($referralId), + '{' . 'storeId' . '}', + ObjectSerializer::toPathValue($storeId), $resourcePath ); } @@ -42165,40 +48566,38 @@ protected function updateReferralRequest($applicationId, $campaignId, $referralI } /** - * Operation updateStore + * Operation updateUser * - * Update store + * Update user * - * @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 \TalonOne\Client\Model\NewStore $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\UpdateUser $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\User */ - public function updateStore($applicationId, $storeId, $body) + public function updateUser($userId, $body) { - list($response) = $this->updateStoreWithHttpInfo($applicationId, $storeId, $body); + list($response) = $this->updateUserWithHttpInfo($userId, $body); return $response; } /** - * Operation updateStoreWithHttpInfo + * Operation updateUserWithHttpInfo * - * Update store + * Update user * - * @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 \TalonOne\Client\Model\NewStore $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\UpdateUser $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 updateStoreWithHttpInfo($applicationId, $storeId, $body) + public function updateUserWithHttpInfo($userId, $body) { - $request = $this->updateStoreRequest($applicationId, $storeId, $body); + $request = $this->updateUserRequest($userId, $body); try { $options = $this->createHttpClientOption(); @@ -42231,44 +48630,20 @@ public function updateStoreWithHttpInfo($applicationId, $storeId, $body) $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 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 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { + if ('\TalonOne\Client\Model\User' === '\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\User', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Store'; + $returnType = '\TalonOne\Client\Model\User'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -42287,23 +48662,7 @@ public function updateStoreWithHttpInfo($applicationId, $storeId, $body) case 200: $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\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -42314,20 +48673,19 @@ public function updateStoreWithHttpInfo($applicationId, $storeId, $body) } /** - * Operation updateStoreAsync + * Operation updateUserAsync * - * Update store + * Update user * - * @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 \TalonOne\Client\Model\NewStore $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\UpdateUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStoreAsync($applicationId, $storeId, $body) + public function updateUserAsync($userId, $body) { - return $this->updateStoreAsyncWithHttpInfo($applicationId, $storeId, $body) + return $this->updateUserAsyncWithHttpInfo($userId, $body) ->then( function ($response) { return $response[0]; @@ -42336,21 +48694,20 @@ function ($response) { } /** - * Operation updateStoreAsyncWithHttpInfo + * Operation updateUserAsyncWithHttpInfo * - * Update store + * Update user * - * @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 \TalonOne\Client\Model\NewStore $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\UpdateUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStoreAsyncWithHttpInfo($applicationId, $storeId, $body) + public function updateUserAsyncWithHttpInfo($userId, $body) { - $returnType = '\TalonOne\Client\Model\Store'; - $request = $this->updateStoreRequest($applicationId, $storeId, $body); + $returnType = '\TalonOne\Client\Model\User'; + $request = $this->updateUserRequest($userId, $body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42387,37 +48744,30 @@ function ($exception) { } /** - * Create request for operation 'updateStore' + * Create request for operation 'updateUser' * - * @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 \TalonOne\Client\Model\NewStore $body body (required) + * @param int $userId The ID of the user. (required) + * @param \TalonOne\Client\Model\UpdateUser $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateStoreRequest($applicationId, $storeId, $body) + protected function updateUserRequest($userId, $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 updateStore' - ); - } - // verify the required parameter 'storeId' is set - if ($storeId === null || (is_array($storeId) && count($storeId) === 0)) { + // verify the required parameter 'userId' is set + if ($userId === null || (is_array($userId) && count($userId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $storeId when calling updateStore' + 'Missing the required parameter $userId when calling updateUser' ); } // 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 updateStore' + 'Missing the required parameter $body when calling updateUser' ); } - $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; + $resourcePath = '/v1/users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42427,18 +48777,10 @@ protected function updateStoreRequest($applicationId, $storeId, $body) // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($storeId !== null) { + if ($userId !== null) { $resourcePath = str_replace( - '{' . 'storeId' . '}', - ObjectSerializer::toPathValue($storeId), + '{' . 'userId' . '}', + ObjectSerializer::toPathValue($userId), $resourcePath ); } diff --git a/lib/Configuration.php b/lib/Configuration.php index ed113147..9c8e2f16 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/6.0.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/7.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: 6.0.0' . PHP_EOL; + $report .= ' SDK Package Version: 7.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AccountDashboardStatistic.php b/lib/Model/AccountDashboardStatistic.php index 4a663bbd..1617f285 100644 --- a/lib/Model/AccountDashboardStatistic.php +++ b/lib/Model/AccountDashboardStatistic.php @@ -61,7 +61,6 @@ class AccountDashboardStatistic implements ModelInterface, ArrayAccess 'discounts' => '\TalonOne\Client\Model\AccountDashboardStatisticDiscount[]', 'loyaltyPoints' => '\TalonOne\Client\Model\AccountDashboardStatisticLoyaltyPoints[]', 'referrals' => '\TalonOne\Client\Model\AccountDashboardStatisticReferrals[]', - 'apiCalls' => '\TalonOne\Client\Model\AccountDashboardStatisticApiCalls[]', 'campaigns' => '\TalonOne\Client\Model\AccountDashboardStatisticCampaigns' ]; @@ -75,7 +74,6 @@ class AccountDashboardStatistic implements ModelInterface, ArrayAccess 'discounts' => null, 'loyaltyPoints' => null, 'referrals' => null, - 'apiCalls' => null, 'campaigns' => null ]; @@ -110,7 +108,6 @@ public static function openAPIFormats() 'discounts' => 'discounts', 'loyaltyPoints' => 'loyaltyPoints', 'referrals' => 'referrals', - 'apiCalls' => 'apiCalls', 'campaigns' => 'campaigns' ]; @@ -124,7 +121,6 @@ public static function openAPIFormats() 'discounts' => 'setDiscounts', 'loyaltyPoints' => 'setLoyaltyPoints', 'referrals' => 'setReferrals', - 'apiCalls' => 'setApiCalls', 'campaigns' => 'setCampaigns' ]; @@ -138,7 +134,6 @@ public static function openAPIFormats() 'discounts' => 'getDiscounts', 'loyaltyPoints' => 'getLoyaltyPoints', 'referrals' => 'getReferrals', - 'apiCalls' => 'getApiCalls', 'campaigns' => 'getCampaigns' ]; @@ -206,7 +201,6 @@ public function __construct(array $data = null) $this->container['discounts'] = isset($data['discounts']) ? $data['discounts'] : null; $this->container['loyaltyPoints'] = isset($data['loyaltyPoints']) ? $data['loyaltyPoints'] : null; $this->container['referrals'] = isset($data['referrals']) ? $data['referrals'] : null; - $this->container['apiCalls'] = isset($data['apiCalls']) ? $data['apiCalls'] : null; $this->container['campaigns'] = isset($data['campaigns']) ? $data['campaigns'] : null; } @@ -333,30 +327,6 @@ public function setReferrals($referrals) return $this; } - /** - * Gets apiCalls - * - * @return \TalonOne\Client\Model\AccountDashboardStatisticApiCalls[]|null - */ - public function getApiCalls() - { - return $this->container['apiCalls']; - } - - /** - * Sets apiCalls - * - * @param \TalonOne\Client\Model\AccountDashboardStatisticApiCalls[]|null $apiCalls Aggregated statistic for the number of account API calls. - * - * @return $this - */ - public function setApiCalls($apiCalls) - { - $this->container['apiCalls'] = $apiCalls; - - return $this; - } - /** * Gets campaigns * diff --git a/lib/Model/Achievement.php b/lib/Model/Achievement.php new file mode 100644 index 00000000..db19dae6 --- /dev/null +++ b/lib/Model/Achievement.php @@ -0,0 +1,691 @@ + 'int', + 'created' => '\DateTime', + 'name' => 'string', + 'title' => 'string', + 'description' => 'string', + 'target' => 'float', + 'period' => 'string', + 'periodEndOverride' => '\TalonOne\Client\Model\TimePoint', + 'campaignId' => 'int', + 'userId' => 'int', + 'createdBy' => 'string', + 'hasProgress' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'created' => 'date-time', + 'name' => null, + 'title' => null, + 'description' => 'string', + 'target' => null, + 'period' => null, + 'periodEndOverride' => null, + 'campaignId' => null, + 'userId' => null, + 'createdBy' => null, + 'hasProgress' => 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', + 'name' => 'name', + 'title' => 'title', + 'description' => 'description', + 'target' => 'target', + 'period' => 'period', + 'periodEndOverride' => 'periodEndOverride', + 'campaignId' => 'campaignId', + 'userId' => 'userId', + 'createdBy' => 'createdBy', + 'hasProgress' => 'hasProgress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'created' => 'setCreated', + 'name' => 'setName', + 'title' => 'setTitle', + 'description' => 'setDescription', + 'target' => 'setTarget', + 'period' => 'setPeriod', + 'periodEndOverride' => 'setPeriodEndOverride', + 'campaignId' => 'setCampaignId', + 'userId' => 'setUserId', + 'createdBy' => 'setCreatedBy', + 'hasProgress' => 'setHasProgress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'created' => 'getCreated', + 'name' => 'getName', + 'title' => 'getTitle', + 'description' => 'getDescription', + 'target' => 'getTarget', + 'period' => 'getPeriod', + 'periodEndOverride' => 'getPeriodEndOverride', + 'campaignId' => 'getCampaignId', + 'userId' => 'getUserId', + 'createdBy' => 'getCreatedBy', + 'hasProgress' => 'getHasProgress' + ]; + + /** + * 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['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['target'] = isset($data['target']) ? $data['target'] : null; + $this->container['period'] = isset($data['period']) ? $data['period'] : null; + $this->container['periodEndOverride'] = isset($data['periodEndOverride']) ? $data['periodEndOverride'] : null; + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['userId'] = isset($data['userId']) ? $data['userId'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['hasProgress'] = isset($data['hasProgress']) ? $data['hasProgress'] : 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['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 1000)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 1000."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^[a-zA-Z]\\w+$/", $this->container['name'])) { + $invalidProperties[] = "invalid value for 'name', must be conform to the pattern /^[a-zA-Z]\\w+$/."; + } + + 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['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } + if ($this->container['period'] === null) { + $invalidProperties[] = "'period' can't be null"; + } + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['userId'] === null) { + $invalidProperties[] = "'userId' 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 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. + * + * @return $this + */ + public function setName($name) + { + if ((mb_strlen($name) > 1000)) { + throw new \InvalidArgumentException('invalid length for $name when calling Achievement., must be smaller than or equal to 1000.'); + } + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling Achievement., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^[a-zA-Z]\\w+$/", $name))) { + throw new \InvalidArgumentException("invalid value for $name when calling Achievement., must conform to the pattern /^[a-zA-Z]\\w+$/."); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The display name for the achievement in the Campaign Manager. + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description A description of the achievement. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets target + * + * @return float + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param float $target The required number of actions or the transactional milestone to complete the achievement. + * + * @return $this + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets period + * + * @return string + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string $period The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** 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 also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. + * + * @return $this + */ + public function setPeriod($period) + { + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodEndOverride + * + * @return \TalonOne\Client\Model\TimePoint|null + */ + public function getPeriodEndOverride() + { + return $this->container['periodEndOverride']; + } + + /** + * Sets periodEndOverride + * + * @param \TalonOne\Client\Model\TimePoint|null $periodEndOverride periodEndOverride + * + * @return $this + */ + public function setPeriodEndOverride($periodEndOverride) + { + $this->container['periodEndOverride'] = $periodEndOverride; + + return $this; + } + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign, to which the achievement belongs to + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets userId + * + * @return int + */ + public function getUserId() + { + return $this->container['userId']; + } + + /** + * Sets userId + * + * @param int $userId ID of the user that created this achievement. + * + * @return $this + */ + public function setUserId($userId) + { + $this->container['userId'] = $userId; + + return $this; + } + + /** + * Gets createdBy + * + * @return string + */ + public function getCreatedBy() + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param string $createdBy Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. + * + * @return $this + */ + public function setCreatedBy($createdBy) + { + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets hasProgress + * + * @return bool|null + */ + public function getHasProgress() + { + return $this->container['hasProgress']; + } + + /** + * Sets hasProgress + * + * @param bool|null $hasProgress Indicates if a customer has made progress in the achievement. + * + * @return $this + */ + public function setHasProgress($hasProgress) + { + $this->container['hasProgress'] = $hasProgress; + + 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/AchievementAdditionalProperties.php b/lib/Model/AchievementAdditionalProperties.php new file mode 100644 index 00000000..086f202a --- /dev/null +++ b/lib/Model/AchievementAdditionalProperties.php @@ -0,0 +1,407 @@ + 'int', + 'userId' => 'int', + 'createdBy' => 'string', + 'hasProgress' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'campaignId' => null, + 'userId' => null, + 'createdBy' => null, + 'hasProgress' => 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', + 'userId' => 'userId', + 'createdBy' => 'createdBy', + 'hasProgress' => 'hasProgress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'userId' => 'setUserId', + 'createdBy' => 'setCreatedBy', + 'hasProgress' => 'setHasProgress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'userId' => 'getUserId', + 'createdBy' => 'getCreatedBy', + 'hasProgress' => 'getHasProgress' + ]; + + /** + * 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; + $this->container['userId'] = isset($data['userId']) ? $data['userId'] : null; + $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; + $this->container['hasProgress'] = isset($data['hasProgress']) ? $data['hasProgress'] : 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"; + } + if ($this->container['userId'] === null) { + $invalidProperties[] = "'userId' 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 campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign, to which the achievement belongs to + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets userId + * + * @return int + */ + public function getUserId() + { + return $this->container['userId']; + } + + /** + * Sets userId + * + * @param int $userId ID of the user that created this achievement. + * + * @return $this + */ + public function setUserId($userId) + { + $this->container['userId'] = $userId; + + return $this; + } + + /** + * Gets createdBy + * + * @return string + */ + public function getCreatedBy() + { + return $this->container['createdBy']; + } + + /** + * Sets createdBy + * + * @param string $createdBy Name of the user that created the achievement. **Note**: This is not available if the user has been deleted. + * + * @return $this + */ + public function setCreatedBy($createdBy) + { + $this->container['createdBy'] = $createdBy; + + return $this; + } + + /** + * Gets hasProgress + * + * @return bool|null + */ + public function getHasProgress() + { + return $this->container['hasProgress']; + } + + /** + * Sets hasProgress + * + * @param bool|null $hasProgress Indicates if a customer has made progress in the achievement. + * + * @return $this + */ + public function setHasProgress($hasProgress) + { + $this->container['hasProgress'] = $hasProgress; + + 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/AchievementProgress.php b/lib/Model/AchievementProgress.php new file mode 100644 index 00000000..bcb2d599 --- /dev/null +++ b/lib/Model/AchievementProgress.php @@ -0,0 +1,658 @@ + 'int', + 'name' => 'string', + 'title' => 'string', + 'campaignId' => 'int', + 'status' => 'string', + 'target' => 'float', + 'progress' => 'float', + 'startDate' => '\DateTime', + 'completionDate' => '\DateTime', + 'endDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'achievementId' => null, + 'name' => null, + 'title' => null, + 'campaignId' => null, + 'status' => null, + 'target' => null, + 'progress' => null, + 'startDate' => 'date-time', + 'completionDate' => 'date-time', + 'endDate' => '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 = [ + 'achievementId' => 'achievementId', + 'name' => 'name', + 'title' => 'title', + 'campaignId' => 'campaignId', + 'status' => 'status', + 'target' => 'target', + 'progress' => 'progress', + 'startDate' => 'startDate', + 'completionDate' => 'completionDate', + 'endDate' => 'endDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'achievementId' => 'setAchievementId', + 'name' => 'setName', + 'title' => 'setTitle', + 'campaignId' => 'setCampaignId', + 'status' => 'setStatus', + 'target' => 'setTarget', + 'progress' => 'setProgress', + 'startDate' => 'setStartDate', + 'completionDate' => 'setCompletionDate', + 'endDate' => 'setEndDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'achievementId' => 'getAchievementId', + 'name' => 'getName', + 'title' => 'getTitle', + 'campaignId' => 'getCampaignId', + 'status' => 'getStatus', + 'target' => 'getTarget', + 'progress' => 'getProgress', + 'startDate' => 'getStartDate', + 'completionDate' => 'getCompletionDate', + 'endDate' => 'getEndDate' + ]; + + /** + * 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_INPROGRESS = 'inprogress'; + const STATUS_COMPLETED = 'completed'; + const STATUS_EXPIRED = 'expired'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_INPROGRESS, + self::STATUS_COMPLETED, + self::STATUS_EXPIRED, + ]; + } + + + /** + * 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['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : 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; + $this->container['progress'] = isset($data['progress']) ? $data['progress'] : null; + $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null; + $this->container['completionDate'] = isset($data['completionDate']) ? $data['completionDate'] : null; + $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : 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['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 1000)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 1000."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^[a-zA-Z]\\w+$/", $this->container['name'])) { + $invalidProperties[] = "invalid value for 'name', must be conform to the pattern /^[a-zA-Z]\\w+$/."; + } + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $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) + ); + } + + if ($this->container['progress'] === null) { + $invalidProperties[] = "'progress' can't be null"; + } + if ($this->container['startDate'] === null) { + $invalidProperties[] = "'startDate' can't be null"; + } + if ($this->container['endDate'] === null) { + $invalidProperties[] = "'endDate' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The internal name of the achievement used in API requests. + * + * @return $this + */ + public function setName($name) + { + if ((mb_strlen($name) > 1000)) { + throw new \InvalidArgumentException('invalid length for $name when calling AchievementProgress., must be smaller than or equal to 1000.'); + } + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling AchievementProgress., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^[a-zA-Z]\\w+$/", $name))) { + throw new \InvalidArgumentException("invalid value for $name when calling AchievementProgress., must conform to the pattern /^[a-zA-Z]\\w+$/."); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The display name of the achievement in the Campaign Manager. + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId The ID of the campaign the achievement belongs to. + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the achievement. + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!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; + } + + /** + * Gets target + * + * @return float|null + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param float|null $target The required number of actions or the transactional milestone to complete the achievement. + * + * @return $this + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets progress + * + * @return float + */ + public function getProgress() + { + return $this->container['progress']; + } + + /** + * Sets progress + * + * @param float $progress The current progress of the customer in the achievement. + * + * @return $this + */ + public function setProgress($progress) + { + $this->container['progress'] = $progress; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime + */ + public function getStartDate() + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime $startDate Timestamp at which the customer started the achievement. + * + * @return $this + */ + public function setStartDate($startDate) + { + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets completionDate + * + * @return \DateTime|null + */ + public function getCompletionDate() + { + return $this->container['completionDate']; + } + + /** + * Sets completionDate + * + * @param \DateTime|null $completionDate Timestamp at which point the customer completed the achievement. + * + * @return $this + */ + public function setCompletionDate($completionDate) + { + $this->container['completionDate'] = $completionDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime + */ + public function getEndDate() + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime $endDate Timestamp at which point the achievement ends and resets for the customer. + * + * @return $this + */ + public function setEndDate($endDate) + { + $this->container['endDate'] = $endDate; + + 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/AddItemCatalogAction.php b/lib/Model/AddItemCatalogAction.php index 4901dafb..71c4e334 100644 --- a/lib/Model/AddItemCatalogAction.php +++ b/lib/Model/AddItemCatalogAction.php @@ -61,6 +61,7 @@ class AddItemCatalogAction implements ModelInterface, ArrayAccess 'sku' => 'string', 'price' => 'float', 'attributes' => 'object', + 'product' => '\TalonOne\Client\Model\Product', 'replaceIfExists' => 'bool' ]; @@ -73,6 +74,7 @@ class AddItemCatalogAction implements ModelInterface, ArrayAccess 'sku' => null, 'price' => null, 'attributes' => null, + 'product' => null, 'replaceIfExists' => null ]; @@ -106,6 +108,7 @@ public static function openAPIFormats() 'sku' => 'sku', 'price' => 'price', 'attributes' => 'attributes', + 'product' => 'product', 'replaceIfExists' => 'replaceIfExists' ]; @@ -118,6 +121,7 @@ public static function openAPIFormats() 'sku' => 'setSku', 'price' => 'setPrice', 'attributes' => 'setAttributes', + 'product' => 'setProduct', 'replaceIfExists' => 'setReplaceIfExists' ]; @@ -130,6 +134,7 @@ public static function openAPIFormats() 'sku' => 'getSku', 'price' => 'getPrice', 'attributes' => 'getAttributes', + 'product' => 'getProduct', 'replaceIfExists' => 'getReplaceIfExists' ]; @@ -196,6 +201,7 @@ public function __construct(array $data = null) $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['product'] = isset($data['product']) ? $data['product'] : null; $this->container['replaceIfExists'] = isset($data['replaceIfExists']) ? $data['replaceIfExists'] : false; } @@ -298,6 +304,30 @@ public function setAttributes($attributes) return $this; } + /** + * Gets product + * + * @return \TalonOne\Client\Model\Product|null + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \TalonOne\Client\Model\Product|null $product product + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + /** * Gets replaceIfExists * @@ -311,7 +341,7 @@ public function getReplaceIfExists() /** * Sets replaceIfExists * - * @param bool|null $replaceIfExists Indicates whether to replace the attributes of the item if the same SKU exists. + * @param bool|null $replaceIfExists Indicates whether to replace the attributes of the item if the same SKU exists. **Note**: When set to `true`: - If you do not provide a new `price` value, the existing `price` value is retained. - If you do not provide a new `product` value, the `product` value is set to `null`. * * @return $this */ diff --git a/lib/Model/AdditionalCampaignProperties.php b/lib/Model/AdditionalCampaignProperties.php index eb523230..57557385 100644 --- a/lib/Model/AdditionalCampaignProperties.php +++ b/lib/Model/AdditionalCampaignProperties.php @@ -77,7 +77,8 @@ class AdditionalCampaignProperties implements ModelInterface, ArrayAccess 'updated' => '\DateTime', 'createdBy' => 'string', 'updatedBy' => 'string', - 'templateId' => 'int' + 'templateId' => 'int', + 'frontendState' => 'string' ]; /** @@ -106,7 +107,8 @@ class AdditionalCampaignProperties implements ModelInterface, ArrayAccess 'updated' => 'date-time', 'createdBy' => null, 'updatedBy' => null, - 'templateId' => null + 'templateId' => null, + 'frontendState' => null ]; /** @@ -156,7 +158,8 @@ public static function openAPIFormats() 'updated' => 'updated', 'createdBy' => 'createdBy', 'updatedBy' => 'updatedBy', - 'templateId' => 'templateId' + 'templateId' => 'templateId', + 'frontendState' => 'frontendState' ]; /** @@ -185,7 +188,8 @@ public static function openAPIFormats() 'updated' => 'setUpdated', 'createdBy' => 'setCreatedBy', 'updatedBy' => 'setUpdatedBy', - 'templateId' => 'setTemplateId' + 'templateId' => 'setTemplateId', + 'frontendState' => 'setFrontendState' ]; /** @@ -214,7 +218,8 @@ public static function openAPIFormats() 'updated' => 'getUpdated', 'createdBy' => 'getCreatedBy', 'updatedBy' => 'getUpdatedBy', - 'templateId' => 'getTemplateId' + 'templateId' => 'getTemplateId', + 'frontendState' => 'getFrontendState' ]; /** @@ -258,9 +263,28 @@ public function getModelName() return self::$openAPIModelName; } + const FRONTEND_STATE_EXPIRED = 'expired'; + const FRONTEND_STATE_SCHEDULED = 'scheduled'; + const FRONTEND_STATE_RUNNING = 'running'; + const FRONTEND_STATE_DRAFT = 'draft'; + /** + * 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, + ]; + } + /** * Associative array for storing property values @@ -298,6 +322,7 @@ public function __construct(array $data = 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; } /** @@ -312,6 +337,17 @@ public function listInvalidProperties() 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; } @@ -830,6 +866,39 @@ public function setTemplateId($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. * diff --git a/lib/Model/ApplicationAPIKey.php b/lib/Model/ApplicationAPIKey.php index 7fe2f8d8..9682c811 100644 --- a/lib/Model/ApplicationAPIKey.php +++ b/lib/Model/ApplicationAPIKey.php @@ -61,6 +61,8 @@ class ApplicationAPIKey implements ModelInterface, ArrayAccess 'title' => 'string', 'expires' => '\DateTime', 'platform' => 'string', + 'type' => 'string', + 'timeOffset' => 'int', 'id' => 'int', 'createdBy' => 'int', 'accountID' => 'int', @@ -77,6 +79,8 @@ class ApplicationAPIKey implements ModelInterface, ArrayAccess 'title' => null, 'expires' => 'date-time', 'platform' => null, + 'type' => null, + 'timeOffset' => null, 'id' => null, 'createdBy' => null, 'accountID' => null, @@ -114,6 +118,8 @@ public static function openAPIFormats() 'title' => 'title', 'expires' => 'expires', 'platform' => 'platform', + 'type' => 'type', + 'timeOffset' => 'timeOffset', 'id' => 'id', 'createdBy' => 'createdBy', 'accountID' => 'accountID', @@ -130,6 +136,8 @@ public static function openAPIFormats() 'title' => 'setTitle', 'expires' => 'setExpires', 'platform' => 'setPlatform', + 'type' => 'setType', + 'timeOffset' => 'setTimeOffset', 'id' => 'setId', 'createdBy' => 'setCreatedBy', 'accountID' => 'setAccountID', @@ -146,6 +154,8 @@ public static function openAPIFormats() 'title' => 'getTitle', 'expires' => 'getExpires', 'platform' => 'getPlatform', + 'type' => 'getType', + 'timeOffset' => 'getTimeOffset', 'id' => 'getId', 'createdBy' => 'getCreatedBy', 'accountID' => 'getAccountID', @@ -203,6 +213,8 @@ public function getModelName() const PLATFORM_CUSTOMER_ENGAGEMENT = 'customer_engagement'; const PLATFORM_CUSTOMER_DATA = 'customer_data'; const PLATFORM_SALESFORCE = 'salesforce'; + const PLATFORM_EMARSYS = 'emarsys'; + const TYPE_STAGING = 'staging'; @@ -223,6 +235,19 @@ public function getPlatformAllowableValues() self::PLATFORM_CUSTOMER_ENGAGEMENT, self::PLATFORM_CUSTOMER_DATA, self::PLATFORM_SALESFORCE, + self::PLATFORM_EMARSYS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_STAGING, ]; } @@ -245,6 +270,8 @@ public function __construct(array $data = null) $this->container['title'] = isset($data['title']) ? $data['title'] : null; $this->container['expires'] = isset($data['expires']) ? $data['expires'] : null; $this->container['platform'] = isset($data['platform']) ? $data['platform'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['timeOffset'] = isset($data['timeOffset']) ? $data['timeOffset'] : null; $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; $this->container['accountID'] = isset($data['accountID']) ? $data['accountID'] : null; @@ -275,6 +302,14 @@ public function listInvalidProperties() ); } + $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['id'] === null) { $invalidProperties[] = "'id' can't be null"; } @@ -318,7 +353,7 @@ public function getTitle() /** * Sets title * - * @param string $title Title for API Key. + * @param string $title Title of the API key. * * @return $this */ @@ -342,7 +377,7 @@ public function getExpires() /** * Sets expires * - * @param \DateTime $expires The date the API key expired. + * @param \DateTime $expires The date the API key expires. * * @return $this */ @@ -386,6 +421,63 @@ public function setPlatform($platform) return $this; } + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 timeOffset + * + * @return int|null + */ + public function getTimeOffset() + { + return $this->container['timeOffset']; + } + + /** + * Sets timeOffset + * + * @param int|null $timeOffset A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. + * + * @return $this + */ + public function setTimeOffset($timeOffset) + { + $this->container['timeOffset'] = $timeOffset; + + return $this; + } + /** * Gets id * diff --git a/lib/Model/ApplicationAnalyticsDataPoint.php b/lib/Model/ApplicationAnalyticsDataPoint.php new file mode 100644 index 00000000..d4864e7a --- /dev/null +++ b/lib/Model/ApplicationAnalyticsDataPoint.php @@ -0,0 +1,518 @@ + '\DateTime', + 'endTime' => '\DateTime', + 'totalRevenue' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointTotalRevenue', + 'sessionsCount' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointSessionsCount', + 'avgItemsPerSession' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgItemsPerSession', + 'avgSessionValue' => '\TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgSessionValue', + 'totalDiscounts' => 'float', + 'couponsCount' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'startTime' => 'date-time', + 'endTime' => 'date-time', + 'totalRevenue' => null, + 'sessionsCount' => null, + 'avgItemsPerSession' => null, + 'avgSessionValue' => null, + 'totalDiscounts' => null, + 'couponsCount' => 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 = [ + 'startTime' => 'startTime', + 'endTime' => 'endTime', + 'totalRevenue' => 'totalRevenue', + 'sessionsCount' => 'sessionsCount', + 'avgItemsPerSession' => 'avgItemsPerSession', + 'avgSessionValue' => 'avgSessionValue', + 'totalDiscounts' => 'totalDiscounts', + 'couponsCount' => 'couponsCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'startTime' => 'setStartTime', + 'endTime' => 'setEndTime', + 'totalRevenue' => 'setTotalRevenue', + 'sessionsCount' => 'setSessionsCount', + 'avgItemsPerSession' => 'setAvgItemsPerSession', + 'avgSessionValue' => 'setAvgSessionValue', + 'totalDiscounts' => 'setTotalDiscounts', + 'couponsCount' => 'setCouponsCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'startTime' => 'getStartTime', + 'endTime' => 'getEndTime', + 'totalRevenue' => 'getTotalRevenue', + 'sessionsCount' => 'getSessionsCount', + 'avgItemsPerSession' => 'getAvgItemsPerSession', + 'avgSessionValue' => 'getAvgSessionValue', + 'totalDiscounts' => 'getTotalDiscounts', + 'couponsCount' => 'getCouponsCount' + ]; + + /** + * 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['startTime'] = isset($data['startTime']) ? $data['startTime'] : null; + $this->container['endTime'] = isset($data['endTime']) ? $data['endTime'] : 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; + $this->container['avgSessionValue'] = isset($data['avgSessionValue']) ? $data['avgSessionValue'] : null; + $this->container['totalDiscounts'] = isset($data['totalDiscounts']) ? $data['totalDiscounts'] : null; + $this->container['couponsCount'] = isset($data['couponsCount']) ? $data['couponsCount'] : 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 startTime + * + * @return \DateTime|null + */ + public function getStartTime() + { + return $this->container['startTime']; + } + + /** + * Sets startTime + * + * @param \DateTime|null $startTime The start of the aggregation time frame in UTC. + * + * @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 The end of the aggregation time frame in UTC. + * + * @return $this + */ + public function setEndTime($endTime) + { + $this->container['endTime'] = $endTime; + + return $this; + } + + /** + * Gets totalRevenue + * + * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointTotalRevenue|null + */ + public function getTotalRevenue() + { + return $this->container['totalRevenue']; + } + + /** + * Sets totalRevenue + * + * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointTotalRevenue|null $totalRevenue totalRevenue + * + * @return $this + */ + public function setTotalRevenue($totalRevenue) + { + $this->container['totalRevenue'] = $totalRevenue; + + return $this; + } + + /** + * Gets sessionsCount + * + * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointSessionsCount|null + */ + public function getSessionsCount() + { + return $this->container['sessionsCount']; + } + + /** + * Sets sessionsCount + * + * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointSessionsCount|null $sessionsCount sessionsCount + * + * @return $this + */ + public function setSessionsCount($sessionsCount) + { + $this->container['sessionsCount'] = $sessionsCount; + + return $this; + } + + /** + * Gets avgItemsPerSession + * + * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgItemsPerSession|null + */ + public function getAvgItemsPerSession() + { + return $this->container['avgItemsPerSession']; + } + + /** + * Sets avgItemsPerSession + * + * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgItemsPerSession|null $avgItemsPerSession avgItemsPerSession + * + * @return $this + */ + public function setAvgItemsPerSession($avgItemsPerSession) + { + $this->container['avgItemsPerSession'] = $avgItemsPerSession; + + return $this; + } + + /** + * Gets avgSessionValue + * + * @return \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgSessionValue|null + */ + public function getAvgSessionValue() + { + return $this->container['avgSessionValue']; + } + + /** + * Sets avgSessionValue + * + * @param \TalonOne\Client\Model\ApplicationAnalyticsDataPointAvgSessionValue|null $avgSessionValue avgSessionValue + * + * @return $this + */ + public function setAvgSessionValue($avgSessionValue) + { + $this->container['avgSessionValue'] = $avgSessionValue; + + return $this; + } + + /** + * Gets totalDiscounts + * + * @return float|null + */ + public function getTotalDiscounts() + { + return $this->container['totalDiscounts']; + } + + /** + * Sets totalDiscounts + * + * @param float|null $totalDiscounts The total value of discounts given for cart items in influenced sessions. + * + * @return $this + */ + public function setTotalDiscounts($totalDiscounts) + { + $this->container['totalDiscounts'] = $totalDiscounts; + + return $this; + } + + /** + * Gets couponsCount + * + * @return float|null + */ + public function getCouponsCount() + { + return $this->container['couponsCount']; + } + + /** + * Sets couponsCount + * + * @param float|null $couponsCount The number of times a coupon was successfully redeemed in influenced sessions. + * + * @return $this + */ + public function setCouponsCount($couponsCount) + { + $this->container['couponsCount'] = $couponsCount; + + 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/ApplicationAnalyticsDataPointAvgItemsPerSession.php b/lib/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.php new file mode 100644 index 00000000..d77e2f63 --- /dev/null +++ b/lib/Model/ApplicationAnalyticsDataPointAvgItemsPerSession.php @@ -0,0 +1,339 @@ + 'float', + 'influenced' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'total' => null, + 'influenced' => 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 = [ + 'total' => 'total', + 'influenced' => 'influenced' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'influenced' => 'setInfluenced' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'influenced' => 'getInfluenced' + ]; + + /** + * 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['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['influenced'] = isset($data['influenced']) ? $data['influenced'] : 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 total + * + * @return float|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets influenced + * + * @return float|null + */ + public function getInfluenced() + { + return $this->container['influenced']; + } + + /** + * Sets influenced + * + * @param float|null $influenced influenced + * + * @return $this + */ + public function setInfluenced($influenced) + { + $this->container['influenced'] = $influenced; + + 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/ApplicationAnalyticsDataPointAvgSessionValue.php b/lib/Model/ApplicationAnalyticsDataPointAvgSessionValue.php new file mode 100644 index 00000000..2d01935e --- /dev/null +++ b/lib/Model/ApplicationAnalyticsDataPointAvgSessionValue.php @@ -0,0 +1,339 @@ + 'float', + 'influenced' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'total' => null, + 'influenced' => 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 = [ + 'total' => 'total', + 'influenced' => 'influenced' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'influenced' => 'setInfluenced' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'influenced' => 'getInfluenced' + ]; + + /** + * 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['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['influenced'] = isset($data['influenced']) ? $data['influenced'] : 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 total + * + * @return float|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets influenced + * + * @return float|null + */ + public function getInfluenced() + { + return $this->container['influenced']; + } + + /** + * Sets influenced + * + * @param float|null $influenced influenced + * + * @return $this + */ + public function setInfluenced($influenced) + { + $this->container['influenced'] = $influenced; + + 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/ApplicationAnalyticsDataPointSessionsCount.php b/lib/Model/ApplicationAnalyticsDataPointSessionsCount.php new file mode 100644 index 00000000..3f92392c --- /dev/null +++ b/lib/Model/ApplicationAnalyticsDataPointSessionsCount.php @@ -0,0 +1,339 @@ + 'float', + 'influenced' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'total' => null, + 'influenced' => 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 = [ + 'total' => 'total', + 'influenced' => 'influenced' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'influenced' => 'setInfluenced' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'influenced' => 'getInfluenced' + ]; + + /** + * 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['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['influenced'] = isset($data['influenced']) ? $data['influenced'] : 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 total + * + * @return float|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets influenced + * + * @return float|null + */ + public function getInfluenced() + { + return $this->container['influenced']; + } + + /** + * Sets influenced + * + * @param float|null $influenced influenced + * + * @return $this + */ + public function setInfluenced($influenced) + { + $this->container['influenced'] = $influenced; + + 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/ApplicationAnalyticsDataPointTotalRevenue.php b/lib/Model/ApplicationAnalyticsDataPointTotalRevenue.php new file mode 100644 index 00000000..b8145119 --- /dev/null +++ b/lib/Model/ApplicationAnalyticsDataPointTotalRevenue.php @@ -0,0 +1,339 @@ + 'float', + 'influenced' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'total' => null, + 'influenced' => 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 = [ + 'total' => 'total', + 'influenced' => 'influenced' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'influenced' => 'setInfluenced' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'influenced' => 'getInfluenced' + ]; + + /** + * 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['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['influenced'] = isset($data['influenced']) ? $data['influenced'] : 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 total + * + * @return float|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float|null $total total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets influenced + * + * @return float|null + */ + public function getInfluenced() + { + return $this->container['influenced']; + } + + /** + * Sets influenced + * + * @param float|null $influenced influenced + * + * @return $this + */ + public function setInfluenced($influenced) + { + $this->container['influenced'] = $influenced; + + 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/ApplicationCampaignAnalytics.php b/lib/Model/ApplicationCampaignAnalytics.php new file mode 100644 index 00000000..d0dc2435 --- /dev/null +++ b/lib/Model/ApplicationCampaignAnalytics.php @@ -0,0 +1,762 @@ + '\DateTime', + 'endTime' => '\DateTime', + 'campaignId' => 'int', + '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' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'startTime' => 'date-time', + 'endTime' => 'date-time', + 'campaignId' => null, + 'campaignName' => null, + 'campaignTags' => null, + 'campaignState' => null, + 'campaignActiveRulesetId' => null, + 'campaignStartTime' => 'date-time', + 'campaignEndTime' => 'date-time', + 'totalRevenue' => null, + 'sessionsCount' => null, + 'avgItemsPerSession' => null, + 'avgSessionValue' => null, + 'totalDiscounts' => null, + 'couponsCount' => 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 = [ + 'startTime' => 'startTime', + 'endTime' => 'endTime', + 'campaignId' => 'campaignId', + 'campaignName' => 'campaignName', + 'campaignTags' => 'campaignTags', + 'campaignState' => 'campaignState', + 'campaignActiveRulesetId' => 'campaignActiveRulesetId', + 'campaignStartTime' => 'campaignStartTime', + 'campaignEndTime' => 'campaignEndTime', + 'totalRevenue' => 'totalRevenue', + 'sessionsCount' => 'sessionsCount', + 'avgItemsPerSession' => 'avgItemsPerSession', + 'avgSessionValue' => 'avgSessionValue', + 'totalDiscounts' => 'totalDiscounts', + 'couponsCount' => 'couponsCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'startTime' => 'setStartTime', + 'endTime' => 'setEndTime', + 'campaignId' => 'setCampaignId', + 'campaignName' => 'setCampaignName', + 'campaignTags' => 'setCampaignTags', + 'campaignState' => 'setCampaignState', + 'campaignActiveRulesetId' => 'setCampaignActiveRulesetId', + 'campaignStartTime' => 'setCampaignStartTime', + 'campaignEndTime' => 'setCampaignEndTime', + 'totalRevenue' => 'setTotalRevenue', + 'sessionsCount' => 'setSessionsCount', + 'avgItemsPerSession' => 'setAvgItemsPerSession', + 'avgSessionValue' => 'setAvgSessionValue', + 'totalDiscounts' => 'setTotalDiscounts', + 'couponsCount' => 'setCouponsCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'startTime' => 'getStartTime', + 'endTime' => 'getEndTime', + 'campaignId' => 'getCampaignId', + 'campaignName' => 'getCampaignName', + 'campaignTags' => 'getCampaignTags', + 'campaignState' => 'getCampaignState', + 'campaignActiveRulesetId' => 'getCampaignActiveRulesetId', + 'campaignStartTime' => 'getCampaignStartTime', + 'campaignEndTime' => 'getCampaignEndTime', + 'totalRevenue' => 'getTotalRevenue', + 'sessionsCount' => 'getSessionsCount', + 'avgItemsPerSession' => 'getAvgItemsPerSession', + 'avgSessionValue' => 'getAvgSessionValue', + 'totalDiscounts' => 'getTotalDiscounts', + 'couponsCount' => 'getCouponsCount' + ]; + + /** + * 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 CAMPAIGN_STATE_ENABLED = 'enabled'; + const CAMPAIGN_STATE_DISABLED = 'disabled'; + const CAMPAIGN_STATE_ARCHIVED = 'archived'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCampaignStateAllowableValues() + { + return [ + self::CAMPAIGN_STATE_ENABLED, + self::CAMPAIGN_STATE_DISABLED, + self::CAMPAIGN_STATE_ARCHIVED, + ]; + } + + + /** + * 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['startTime'] = isset($data['startTime']) ? $data['startTime'] : null; + $this->container['endTime'] = isset($data['endTime']) ? $data['endTime'] : 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['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; + $this->container['avgSessionValue'] = isset($data['avgSessionValue']) ? $data['avgSessionValue'] : null; + $this->container['totalDiscounts'] = isset($data['totalDiscounts']) ? $data['totalDiscounts'] : null; + $this->container['couponsCount'] = isset($data['couponsCount']) ? $data['couponsCount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCampaignStateAllowableValues(); + if (!is_null($this->container['campaignState']) && !in_array($this->container['campaignState'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'campaignState', 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 startTime + * + * @return \DateTime|null + */ + public function getStartTime() + { + return $this->container['startTime']; + } + + /** + * Sets startTime + * + * @param \DateTime|null $startTime The start of the aggregation time frame in UTC. + * + * @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 The end of the aggregation time frame in UTC. + * + * @return $this + */ + public function setEndTime($endTime) + { + $this->container['endTime'] = $endTime; + + return $this; + } + + /** + * Gets campaignId + * + * @return int|null + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int|null $campaignId The ID of the campaign. + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets campaignName + * + * @return string|null + */ + public function getCampaignName() + { + return $this->container['campaignName']; + } + + /** + * Sets campaignName + * + * @param string|null $campaignName The name of the campaign. + * + * @return $this + */ + public function setCampaignName($campaignName) + { + $this->container['campaignName'] = $campaignName; + + return $this; + } + + /** + * Gets campaignTags + * + * @return string[]|null + */ + public function getCampaignTags() + { + return $this->container['campaignTags']; + } + + /** + * Sets campaignTags + * + * @param string[]|null $campaignTags A list of tags for the campaign. + * + * @return $this + */ + public function setCampaignTags($campaignTags) + { + $this->container['campaignTags'] = $campaignTags; + + return $this; + } + + /** + * Gets campaignState + * + * @return string|null + */ + public function getCampaignState() + { + return $this->container['campaignState']; + } + + /** + * Sets campaignState + * + * @param string|null $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)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'campaignState', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['campaignState'] = $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 + */ + public function getTotalRevenue() + { + return $this->container['totalRevenue']; + } + + /** + * Sets totalRevenue + * + * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalRevenue|null $totalRevenue totalRevenue + * + * @return $this + */ + public function setTotalRevenue($totalRevenue) + { + $this->container['totalRevenue'] = $totalRevenue; + + return $this; + } + + /** + * Gets sessionsCount + * + * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsSessionsCount|null + */ + public function getSessionsCount() + { + return $this->container['sessionsCount']; + } + + /** + * Sets sessionsCount + * + * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsSessionsCount|null $sessionsCount sessionsCount + * + * @return $this + */ + public function setSessionsCount($sessionsCount) + { + $this->container['sessionsCount'] = $sessionsCount; + + return $this; + } + + /** + * Gets avgItemsPerSession + * + * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgItemsPerSession|null + */ + public function getAvgItemsPerSession() + { + return $this->container['avgItemsPerSession']; + } + + /** + * Sets avgItemsPerSession + * + * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgItemsPerSession|null $avgItemsPerSession avgItemsPerSession + * + * @return $this + */ + public function setAvgItemsPerSession($avgItemsPerSession) + { + $this->container['avgItemsPerSession'] = $avgItemsPerSession; + + return $this; + } + + /** + * Gets avgSessionValue + * + * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgSessionValue|null + */ + public function getAvgSessionValue() + { + return $this->container['avgSessionValue']; + } + + /** + * Sets avgSessionValue + * + * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsAvgSessionValue|null $avgSessionValue avgSessionValue + * + * @return $this + */ + public function setAvgSessionValue($avgSessionValue) + { + $this->container['avgSessionValue'] = $avgSessionValue; + + return $this; + } + + /** + * Gets totalDiscounts + * + * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalDiscounts|null + */ + public function getTotalDiscounts() + { + return $this->container['totalDiscounts']; + } + + /** + * Sets totalDiscounts + * + * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsTotalDiscounts|null $totalDiscounts totalDiscounts + * + * @return $this + */ + public function setTotalDiscounts($totalDiscounts) + { + $this->container['totalDiscounts'] = $totalDiscounts; + + return $this; + } + + /** + * Gets couponsCount + * + * @return \TalonOne\Client\Model\ApplicationCampaignAnalyticsCouponsCount|null + */ + public function getCouponsCount() + { + return $this->container['couponsCount']; + } + + /** + * Sets couponsCount + * + * @param \TalonOne\Client\Model\ApplicationCampaignAnalyticsCouponsCount|null $couponsCount couponsCount + * + * @return $this + */ + public function setCouponsCount($couponsCount) + { + $this->container['couponsCount'] = $couponsCount; + + 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/ApplicationCampaignAnalyticsAvgItemsPerSession.php b/lib/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.php new file mode 100644 index 00000000..62412967 --- /dev/null +++ b/lib/Model/ApplicationCampaignAnalyticsAvgItemsPerSession.php @@ -0,0 +1,369 @@ + 'float', + 'uplift' => 'float', + 'trend' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'value' => null, + 'uplift' => null, + 'trend' => 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 = [ + 'value' => 'value', + 'uplift' => 'uplift', + 'trend' => 'trend' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'uplift' => 'setUplift', + 'trend' => 'setTrend' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'uplift' => 'getUplift', + 'trend' => 'getTrend' + ]; + + /** + * 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['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; + } + + /** + * 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 value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets uplift + * + * @return float|null + */ + public function getUplift() + { + return $this->container['uplift']; + } + + /** + * Sets uplift + * + * @param float|null $uplift uplift + * + * @return $this + */ + public function setUplift($uplift) + { + $this->container['uplift'] = $uplift; + + return $this; + } + + /** + * Gets trend + * + * @return float|null + */ + public function getTrend() + { + return $this->container['trend']; + } + + /** + * Sets trend + * + * @param float|null $trend trend + * + * @return $this + */ + public function setTrend($trend) + { + $this->container['trend'] = $trend; + + 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/ApplicationCampaignAnalyticsAvgSessionValue.php new file mode 100644 index 00000000..64c481fb --- /dev/null +++ b/lib/Model/ApplicationCampaignAnalyticsAvgSessionValue.php @@ -0,0 +1,369 @@ + 'float', + 'uplift' => 'float', + 'trend' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'value' => null, + 'uplift' => null, + 'trend' => 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 = [ + 'value' => 'value', + 'uplift' => 'uplift', + 'trend' => 'trend' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'uplift' => 'setUplift', + 'trend' => 'setTrend' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'uplift' => 'getUplift', + 'trend' => 'getTrend' + ]; + + /** + * 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['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; + } + + /** + * 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 value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets uplift + * + * @return float|null + */ + public function getUplift() + { + return $this->container['uplift']; + } + + /** + * Sets uplift + * + * @param float|null $uplift uplift + * + * @return $this + */ + public function setUplift($uplift) + { + $this->container['uplift'] = $uplift; + + return $this; + } + + /** + * Gets trend + * + * @return float|null + */ + public function getTrend() + { + return $this->container['trend']; + } + + /** + * Sets trend + * + * @param float|null $trend trend + * + * @return $this + */ + public function setTrend($trend) + { + $this->container['trend'] = $trend; + + 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/ApplicationCampaignAnalyticsCouponsCount.php b/lib/Model/ApplicationCampaignAnalyticsCouponsCount.php new file mode 100644 index 00000000..5f288725 --- /dev/null +++ b/lib/Model/ApplicationCampaignAnalyticsCouponsCount.php @@ -0,0 +1,339 @@ + 'float', + 'trend' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'value' => null, + 'trend' => 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 = [ + 'value' => 'value', + 'trend' => 'trend' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'trend' => 'setTrend' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'trend' => 'getTrend' + ]; + + /** + * 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['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['trend'] = isset($data['trend']) ? $data['trend'] : 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 value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets trend + * + * @return float|null + */ + public function getTrend() + { + return $this->container['trend']; + } + + /** + * Sets trend + * + * @param float|null $trend trend + * + * @return $this + */ + public function setTrend($trend) + { + $this->container['trend'] = $trend; + + 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/ApplicationCampaignAnalyticsSessionsCount.php new file mode 100644 index 00000000..a816a5ef --- /dev/null +++ b/lib/Model/ApplicationCampaignAnalyticsSessionsCount.php @@ -0,0 +1,369 @@ + 'float', + 'influenceRate' => 'float', + 'trend' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'value' => null, + 'influenceRate' => null, + 'trend' => 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 = [ + 'value' => 'value', + 'influenceRate' => 'influence_rate', + 'trend' => 'trend' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'influenceRate' => 'setInfluenceRate', + 'trend' => 'setTrend' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'influenceRate' => 'getInfluenceRate', + 'trend' => 'getTrend' + ]; + + /** + * 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['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; + } + + /** + * 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 value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets influenceRate + * + * @return float|null + */ + public function getInfluenceRate() + { + return $this->container['influenceRate']; + } + + /** + * Sets influenceRate + * + * @param float|null $influenceRate influenceRate + * + * @return $this + */ + public function setInfluenceRate($influenceRate) + { + $this->container['influenceRate'] = $influenceRate; + + return $this; + } + + /** + * Gets trend + * + * @return float|null + */ + public function getTrend() + { + return $this->container['trend']; + } + + /** + * Sets trend + * + * @param float|null $trend trend + * + * @return $this + */ + public function setTrend($trend) + { + $this->container['trend'] = $trend; + + 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/ApplicationCampaignAnalyticsTotalDiscounts.php b/lib/Model/ApplicationCampaignAnalyticsTotalDiscounts.php new file mode 100644 index 00000000..ea8b42a5 --- /dev/null +++ b/lib/Model/ApplicationCampaignAnalyticsTotalDiscounts.php @@ -0,0 +1,339 @@ + 'float', + 'trend' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'value' => null, + 'trend' => 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 = [ + 'value' => 'value', + 'trend' => 'trend' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'trend' => 'setTrend' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'trend' => 'getTrend' + ]; + + /** + * 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['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['trend'] = isset($data['trend']) ? $data['trend'] : 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 value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets trend + * + * @return float|null + */ + public function getTrend() + { + return $this->container['trend']; + } + + /** + * Sets trend + * + * @param float|null $trend trend + * + * @return $this + */ + public function setTrend($trend) + { + $this->container['trend'] = $trend; + + 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/ApplicationCampaignAnalyticsTotalRevenue.php b/lib/Model/ApplicationCampaignAnalyticsTotalRevenue.php new file mode 100644 index 00000000..ad460f6b --- /dev/null +++ b/lib/Model/ApplicationCampaignAnalyticsTotalRevenue.php @@ -0,0 +1,369 @@ + 'float', + 'influenceRate' => 'float', + 'trend' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'value' => null, + 'influenceRate' => null, + 'trend' => 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 = [ + 'value' => 'value', + 'influenceRate' => 'influence_rate', + 'trend' => 'trend' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'influenceRate' => 'setInfluenceRate', + 'trend' => 'setTrend' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'influenceRate' => 'getInfluenceRate', + 'trend' => 'getTrend' + ]; + + /** + * 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['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; + } + + /** + * 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 value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets influenceRate + * + * @return float|null + */ + public function getInfluenceRate() + { + return $this->container['influenceRate']; + } + + /** + * Sets influenceRate + * + * @param float|null $influenceRate influenceRate + * + * @return $this + */ + public function setInfluenceRate($influenceRate) + { + $this->container['influenceRate'] = $influenceRate; + + return $this; + } + + /** + * Gets trend + * + * @return float|null + */ + public function getTrend() + { + return $this->container['trend']; + } + + /** + * Sets trend + * + * @param float|null $trend trend + * + * @return $this + */ + public function setTrend($trend) + { + $this->container['trend'] = $trend; + + 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/ApplicationCustomer.php b/lib/Model/ApplicationCustomer.php index eb8264b4..b3b273aa 100644 --- a/lib/Model/ApplicationCustomer.php +++ b/lib/Model/ApplicationCustomer.php @@ -560,7 +560,7 @@ public function getSandbox() /** * Sets sandbox * - * @param bool|null $sandbox Shows whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). + * @param bool|null $sandbox An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). * * @return $this */ diff --git a/lib/Model/AudienceAnalytics.php b/lib/Model/AudienceAnalytics.php index 6d143c2c..9375b04b 100644 --- a/lib/Model/AudienceAnalytics.php +++ b/lib/Model/AudienceAnalytics.php @@ -36,7 +36,7 @@ * AudienceAnalytics Class Doc Comment * * @category Class - * @description The audiences and their members count. + * @description The audiences and their member count. * @package TalonOne\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -248,7 +248,7 @@ public function getMembersCount() /** * Sets membersCount * - * @param int|null $membersCount The count of members under a single audience. + * @param int|null $membersCount The member count of the audience. * * @return $this */ diff --git a/lib/Model/AudienceCustomer.php b/lib/Model/AudienceCustomer.php index a0abbd24..002262db 100644 --- a/lib/Model/AudienceCustomer.php +++ b/lib/Model/AudienceCustomer.php @@ -562,7 +562,7 @@ public function getSandbox() /** * Sets sandbox * - * @param bool|null $sandbox Shows whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). + * @param bool|null $sandbox An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). * * @return $this */ diff --git a/lib/Model/BaseCampaign.php b/lib/Model/BaseCampaign.php index 3c792a0c..c9ad2140 100644 --- a/lib/Model/BaseCampaign.php +++ b/lib/Model/BaseCampaign.php @@ -70,7 +70,6 @@ class BaseCampaign implements ModelInterface, ArrayAccess 'referralSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'limits' => '\TalonOne\Client\Model\LimitConfig[]', 'campaignGroups' => 'int[]', - 'evaluationGroupId' => 'int', 'type' => 'string', 'linkedStoreIds' => 'int[]' ]; @@ -94,7 +93,6 @@ class BaseCampaign implements ModelInterface, ArrayAccess 'referralSettings' => null, 'limits' => null, 'campaignGroups' => null, - 'evaluationGroupId' => null, 'type' => null, 'linkedStoreIds' => null ]; @@ -139,7 +137,6 @@ public static function openAPIFormats() 'referralSettings' => 'referralSettings', 'limits' => 'limits', 'campaignGroups' => 'campaignGroups', - 'evaluationGroupId' => 'evaluationGroupId', 'type' => 'type', 'linkedStoreIds' => 'linkedStoreIds' ]; @@ -163,7 +160,6 @@ public static function openAPIFormats() 'referralSettings' => 'setReferralSettings', 'limits' => 'setLimits', 'campaignGroups' => 'setCampaignGroups', - 'evaluationGroupId' => 'setEvaluationGroupId', 'type' => 'setType', 'linkedStoreIds' => 'setLinkedStoreIds' ]; @@ -187,7 +183,6 @@ public static function openAPIFormats() 'referralSettings' => 'getReferralSettings', 'limits' => 'getLimits', 'campaignGroups' => 'getCampaignGroups', - 'evaluationGroupId' => 'getEvaluationGroupId', 'type' => 'getType', 'linkedStoreIds' => 'getLinkedStoreIds' ]; @@ -241,6 +236,7 @@ public function getModelName() const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; const TYPE_CART_ITEM = 'cartItem'; const TYPE_ADVANCED = 'advanced'; @@ -273,6 +269,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, ]; } @@ -318,7 +315,6 @@ public function __construct(array $data = 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; } @@ -717,30 +713,6 @@ public function setCampaignGroups($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 * diff --git a/lib/Model/BaseLoyaltyProgram.php b/lib/Model/BaseLoyaltyProgram.php index ec9e0003..74cf4efb 100644 --- a/lib/Model/BaseLoyaltyProgram.php +++ b/lib/Model/BaseLoyaltyProgram.php @@ -65,8 +65,10 @@ class BaseLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'tiersExpirationPolicy' => 'string', 'tiersExpireIn' => 'string', - 'tiersDowngradePolicy' => 'string' + 'tiersDowngradePolicy' => 'string', + 'programJoinPolicy' => 'string' ]; /** @@ -83,8 +85,10 @@ class BaseLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'tiersExpirationPolicy' => null, 'tiersExpireIn' => null, - 'tiersDowngradePolicy' => null + 'tiersDowngradePolicy' => null, + 'programJoinPolicy' => null ]; /** @@ -122,8 +126,10 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'tiersExpirationPolicy' => 'tiersExpirationPolicy', 'tiersExpireIn' => 'tiersExpireIn', - 'tiersDowngradePolicy' => 'tiersDowngradePolicy' + 'tiersDowngradePolicy' => 'tiersDowngradePolicy', + 'programJoinPolicy' => 'programJoinPolicy' ]; /** @@ -140,8 +146,10 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', 'tiersExpireIn' => 'setTiersExpireIn', - 'tiersDowngradePolicy' => 'setTiersDowngradePolicy' + 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', + 'programJoinPolicy' => 'setProgramJoinPolicy' ]; /** @@ -158,8 +166,10 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', 'tiersExpireIn' => 'getTiersExpireIn', - 'tiersDowngradePolicy' => 'getTiersDowngradePolicy' + 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', + 'programJoinPolicy' => 'getProgramJoinPolicy' ]; /** @@ -203,11 +213,29 @@ public function getModelName() return self::$openAPIModelName; } + const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; + const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; 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'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTiersExpirationPolicyAllowableValues() + { + return [ + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + ]; + } + /** * Gets allowable values of the enum * @@ -221,6 +249,20 @@ public function getTiersDowngradePolicyAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getProgramJoinPolicyAllowableValues() + { + return [ + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + ]; + } + /** * Associative array for storing property values @@ -245,8 +287,10 @@ 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['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : 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; } /** @@ -262,6 +306,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'usersPerCardLimit', must be bigger than or equal to 0."; } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersDowngradePolicyAllowableValues(); if (!is_null($this->container['tiersDowngradePolicy']) && !in_array($this->container['tiersDowngradePolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -270,6 +322,14 @@ 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; } @@ -482,6 +542,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets tiersExpirationPolicy + * + * @return string|null + */ + public function getTiersExpirationPolicy() + { + return $this->container['tiersExpirationPolicy']; + } + + /** + * 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. + * + * @return $this + */ + public function setTiersExpirationPolicy($tiersExpirationPolicy) + { + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($tiersExpirationPolicy) && !in_array($tiersExpirationPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['tiersExpirationPolicy'] = $tiersExpirationPolicy; + + return $this; + } + /** * Gets tiersExpireIn * @@ -495,7 +588,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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. 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 */ @@ -538,6 +631,39 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) 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; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/BaseNotification.php b/lib/Model/BaseNotification.php index 38410d0d..34971007 100644 --- a/lib/Model/BaseNotification.php +++ b/lib/Model/BaseNotification.php @@ -182,7 +182,9 @@ public function getModelName() const TYPE_CAMPAIGN = 'campaign'; const TYPE_LOYALTY_ADDED_DEDUCTED_POINTS = 'loyalty_added_deducted_points'; const TYPE_COUPON = 'coupon'; + const TYPE_EXPIRING_COUPONS = 'expiring_coupons'; const TYPE_EXPIRING_POINTS = 'expiring_points'; + const TYPE_CARD_EXPIRING_POINTS = 'card_expiring_points'; const TYPE_PENDING_TO_ACTIVE_POINTS = 'pending_to_active_points'; const TYPE_STRIKETHROUGH_PRICING = 'strikethrough_pricing'; const TYPE_TIER_DOWNGRADE = 'tier_downgrade'; @@ -202,7 +204,9 @@ public function getTypeAllowableValues() self::TYPE_CAMPAIGN, self::TYPE_LOYALTY_ADDED_DEDUCTED_POINTS, self::TYPE_COUPON, + self::TYPE_EXPIRING_COUPONS, self::TYPE_EXPIRING_POINTS, + self::TYPE_CARD_EXPIRING_POINTS, self::TYPE_PENDING_TO_ACTIVE_POINTS, self::TYPE_STRIKETHROUGH_PRICING, self::TYPE_TIER_DOWNGRADE, diff --git a/lib/Model/Campaign.php b/lib/Model/Campaign.php index 418175ab..d9d6c16e 100644 --- a/lib/Model/Campaign.php +++ b/lib/Model/Campaign.php @@ -75,7 +75,6 @@ class Campaign implements ModelInterface, ArrayAccess 'referralSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'limits' => '\TalonOne\Client\Model\LimitConfig[]', 'campaignGroups' => 'int[]', - 'evaluationGroupId' => 'int', 'type' => 'string', 'linkedStoreIds' => 'int[]', 'budgets' => '\TalonOne\Client\Model\CampaignBudget[]', @@ -98,7 +97,8 @@ class Campaign implements ModelInterface, ArrayAccess 'updated' => '\DateTime', 'createdBy' => 'string', 'updatedBy' => 'string', - 'templateId' => 'int' + 'templateId' => 'int', + 'frontendState' => 'string' ]; /** @@ -124,7 +124,6 @@ class Campaign implements ModelInterface, ArrayAccess 'referralSettings' => null, 'limits' => null, 'campaignGroups' => null, - 'evaluationGroupId' => null, 'type' => null, 'linkedStoreIds' => null, 'budgets' => null, @@ -147,7 +146,8 @@ class Campaign implements ModelInterface, ArrayAccess 'updated' => 'date-time', 'createdBy' => null, 'updatedBy' => null, - 'templateId' => null + 'templateId' => null, + 'frontendState' => null ]; /** @@ -194,7 +194,6 @@ public static function openAPIFormats() 'referralSettings' => 'referralSettings', 'limits' => 'limits', 'campaignGroups' => 'campaignGroups', - 'evaluationGroupId' => 'evaluationGroupId', 'type' => 'type', 'linkedStoreIds' => 'linkedStoreIds', 'budgets' => 'budgets', @@ -217,7 +216,8 @@ public static function openAPIFormats() 'updated' => 'updated', 'createdBy' => 'createdBy', 'updatedBy' => 'updatedBy', - 'templateId' => 'templateId' + 'templateId' => 'templateId', + 'frontendState' => 'frontendState' ]; /** @@ -243,7 +243,6 @@ public static function openAPIFormats() 'referralSettings' => 'setReferralSettings', 'limits' => 'setLimits', 'campaignGroups' => 'setCampaignGroups', - 'evaluationGroupId' => 'setEvaluationGroupId', 'type' => 'setType', 'linkedStoreIds' => 'setLinkedStoreIds', 'budgets' => 'setBudgets', @@ -266,7 +265,8 @@ public static function openAPIFormats() 'updated' => 'setUpdated', 'createdBy' => 'setCreatedBy', 'updatedBy' => 'setUpdatedBy', - 'templateId' => 'setTemplateId' + 'templateId' => 'setTemplateId', + 'frontendState' => 'setFrontendState' ]; /** @@ -292,7 +292,6 @@ public static function openAPIFormats() 'referralSettings' => 'getReferralSettings', 'limits' => 'getLimits', 'campaignGroups' => 'getCampaignGroups', - 'evaluationGroupId' => 'getEvaluationGroupId', 'type' => 'getType', 'linkedStoreIds' => 'getLinkedStoreIds', 'budgets' => 'getBudgets', @@ -315,7 +314,8 @@ public static function openAPIFormats() 'updated' => 'getUpdated', 'createdBy' => 'getCreatedBy', 'updatedBy' => 'getUpdatedBy', - 'templateId' => 'getTemplateId' + 'templateId' => 'getTemplateId', + 'frontendState' => 'getFrontendState' ]; /** @@ -367,8 +367,13 @@ public function getModelName() const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; 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'; @@ -399,6 +404,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, ]; } @@ -415,6 +421,21 @@ public function getTypeAllowableValues() ]; } + /** + * 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, + ]; + } + /** * Associative array for storing property values @@ -448,7 +469,6 @@ public function __construct(array $data = 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; @@ -472,6 +492,7 @@ public function __construct(array $data = 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; } /** @@ -539,6 +560,17 @@ public function listInvalidProperties() 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; } @@ -985,30 +1017,6 @@ public function setCampaignGroups($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 * @@ -1569,6 +1577,39 @@ public function setTemplateId($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. * diff --git a/lib/Model/CampaignCreatedNotification.php b/lib/Model/CampaignCreatedNotification.php index 02399fd9..adf37a4d 100644 --- a/lib/Model/CampaignCreatedNotification.php +++ b/lib/Model/CampaignCreatedNotification.php @@ -58,7 +58,7 @@ class CampaignCreatedNotification implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'campaign' => '\TalonOne\Client\Model\CampaignStateNotification', + 'campaign' => '\TalonOne\Client\Model\Campaign', 'ruleset' => '\TalonOne\Client\Model\Ruleset', 'evaluationPosition' => '\TalonOne\Client\Model\CampaignEvaluationPosition' ]; @@ -226,7 +226,7 @@ public function valid() /** * Gets campaign * - * @return \TalonOne\Client\Model\CampaignStateNotification + * @return \TalonOne\Client\Model\Campaign */ public function getCampaign() { @@ -236,7 +236,7 @@ public function getCampaign() /** * Sets campaign * - * @param \TalonOne\Client\Model\CampaignStateNotification $campaign campaign + * @param \TalonOne\Client\Model\Campaign $campaign campaign * * @return $this */ diff --git a/lib/Model/CampaignDeletedNotification.php b/lib/Model/CampaignDeletedNotification.php index 596da76b..0de63141 100644 --- a/lib/Model/CampaignDeletedNotification.php +++ b/lib/Model/CampaignDeletedNotification.php @@ -58,7 +58,7 @@ class CampaignDeletedNotification implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'campaign' => '\TalonOne\Client\Model\CampaignStateNotification', + 'campaign' => '\TalonOne\Client\Model\Campaign', 'deletedAt' => '\DateTime' ]; @@ -220,7 +220,7 @@ public function valid() /** * Gets campaign * - * @return \TalonOne\Client\Model\CampaignStateNotification + * @return \TalonOne\Client\Model\Campaign */ public function getCampaign() { @@ -230,7 +230,7 @@ public function getCampaign() /** * Sets campaign * - * @param \TalonOne\Client\Model\CampaignStateNotification $campaign campaign + * @param \TalonOne\Client\Model\Campaign $campaign campaign * * @return $this */ diff --git a/lib/Model/CampaignEditedNotification.php b/lib/Model/CampaignEditedNotification.php index 07819675..dfa2ed8d 100644 --- a/lib/Model/CampaignEditedNotification.php +++ b/lib/Model/CampaignEditedNotification.php @@ -58,8 +58,8 @@ class CampaignEditedNotification implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'campaign' => '\TalonOne\Client\Model\CampaignStateNotification', - 'oldCampaign' => '\TalonOne\Client\Model\CampaignStateNotification', + 'campaign' => '\TalonOne\Client\Model\Campaign', + 'oldCampaign' => '\TalonOne\Client\Model\Campaign', 'ruleset' => '\TalonOne\Client\Model\Ruleset' ]; @@ -226,7 +226,7 @@ public function valid() /** * Gets campaign * - * @return \TalonOne\Client\Model\CampaignStateNotification + * @return \TalonOne\Client\Model\Campaign */ public function getCampaign() { @@ -236,7 +236,7 @@ public function getCampaign() /** * Sets campaign * - * @param \TalonOne\Client\Model\CampaignStateNotification $campaign campaign + * @param \TalonOne\Client\Model\Campaign $campaign campaign * * @return $this */ @@ -250,7 +250,7 @@ public function setCampaign($campaign) /** * Gets oldCampaign * - * @return \TalonOne\Client\Model\CampaignStateNotification + * @return \TalonOne\Client\Model\Campaign */ public function getOldCampaign() { @@ -260,7 +260,7 @@ public function getOldCampaign() /** * Sets oldCampaign * - * @param \TalonOne\Client\Model\CampaignStateNotification $oldCampaign oldCampaign + * @param \TalonOne\Client\Model\Campaign $oldCampaign oldCampaign * * @return $this */ diff --git a/lib/Model/CampaignGroup.php b/lib/Model/CampaignGroup.php index a2f9da75..aae94287 100644 --- a/lib/Model/CampaignGroup.php +++ b/lib/Model/CampaignGroup.php @@ -375,7 +375,7 @@ public function getName() /** * Sets name * - * @param string $name The name of this campaign access group. + * @param string $name The name of the campaign access group. * * @return $this */ diff --git a/lib/Model/CampaignRulesetChangedNotification.php b/lib/Model/CampaignRulesetChangedNotification.php index b3fed2ec..de5ee836 100644 --- a/lib/Model/CampaignRulesetChangedNotification.php +++ b/lib/Model/CampaignRulesetChangedNotification.php @@ -58,7 +58,7 @@ class CampaignRulesetChangedNotification implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'campaign' => '\TalonOne\Client\Model\CampaignStateNotification', + 'campaign' => '\TalonOne\Client\Model\Campaign', 'oldRuleset' => '\TalonOne\Client\Model\Ruleset', 'ruleset' => '\TalonOne\Client\Model\Ruleset' ]; @@ -223,7 +223,7 @@ public function valid() /** * Gets campaign * - * @return \TalonOne\Client\Model\CampaignStateNotification + * @return \TalonOne\Client\Model\Campaign */ public function getCampaign() { @@ -233,7 +233,7 @@ public function getCampaign() /** * Sets campaign * - * @param \TalonOne\Client\Model\CampaignStateNotification $campaign campaign + * @param \TalonOne\Client\Model\Campaign $campaign campaign * * @return $this */ diff --git a/lib/Model/CampaignStateChangedNotification.php b/lib/Model/CampaignStateChangedNotification.php index 290cc35d..c030b7c0 100644 --- a/lib/Model/CampaignStateChangedNotification.php +++ b/lib/Model/CampaignStateChangedNotification.php @@ -58,7 +58,7 @@ class CampaignStateChangedNotification implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'campaign' => '\TalonOne\Client\Model\CampaignForNotification', + 'campaign' => '\TalonOne\Client\Model\Campaign', 'oldState' => 'string', 'newState' => 'string', 'ruleset' => '\TalonOne\Client\Model\Ruleset' @@ -235,7 +235,7 @@ public function valid() /** * Gets campaign * - * @return \TalonOne\Client\Model\CampaignForNotification + * @return \TalonOne\Client\Model\Campaign */ public function getCampaign() { @@ -245,7 +245,7 @@ public function getCampaign() /** * Sets campaign * - * @param \TalonOne\Client\Model\CampaignForNotification $campaign campaign + * @param \TalonOne\Client\Model\Campaign $campaign campaign * * @return $this */ diff --git a/lib/Model/CampaignTemplate.php b/lib/Model/CampaignTemplate.php index cc9835f4..8b1c5abd 100644 --- a/lib/Model/CampaignTemplate.php +++ b/lib/Model/CampaignTemplate.php @@ -282,6 +282,7 @@ public function getModelName() const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; const CAMPAIGN_TYPE_CART_ITEM = 'cartItem'; const CAMPAIGN_TYPE_ADVANCED = 'advanced'; @@ -314,6 +315,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, ]; } diff --git a/lib/Model/CardExpiringPointsNotificationPolicy.php b/lib/Model/CardExpiringPointsNotificationPolicy.php new file mode 100644 index 00000000..83a44005 --- /dev/null +++ b/lib/Model/CardExpiringPointsNotificationPolicy.php @@ -0,0 +1,383 @@ + 'string', + 'triggers' => '\TalonOne\Client\Model\CardExpiringPointsNotificationTrigger[]', + 'batchingEnabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'triggers' => null, + 'batchingEnabled' => 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', + 'triggers' => 'triggers', + 'batchingEnabled' => 'batchingEnabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'triggers' => 'setTriggers', + 'batchingEnabled' => 'setBatchingEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'triggers' => 'getTriggers', + 'batchingEnabled' => 'getBatchingEnabled' + ]; + + /** + * 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['triggers'] = isset($data['triggers']) ? $data['triggers'] : null; + $this->container['batchingEnabled'] = isset($data['batchingEnabled']) ? $data['batchingEnabled'] : true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((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['triggers'] === null) { + $invalidProperties[] = "'triggers' 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 Notification name. + * + * @return $this + */ + public function setName($name) + { + + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling CardExpiringPointsNotificationPolicy., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets triggers + * + * @return \TalonOne\Client\Model\CardExpiringPointsNotificationTrigger[] + */ + public function getTriggers() + { + return $this->container['triggers']; + } + + /** + * Sets triggers + * + * @param \TalonOne\Client\Model\CardExpiringPointsNotificationTrigger[] $triggers triggers + * + * @return $this + */ + public function setTriggers($triggers) + { + $this->container['triggers'] = $triggers; + + 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. + * + * @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/CardExpiringPointsNotificationTrigger.php b/lib/Model/CardExpiringPointsNotificationTrigger.php new file mode 100644 index 00000000..5b222ee6 --- /dev/null +++ b/lib/Model/CardExpiringPointsNotificationTrigger.php @@ -0,0 +1,385 @@ + 'int', + 'period' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'period' => 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 = [ + 'amount' => 'amount', + 'period' => 'period' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'period' => 'setPeriod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'period' => 'getPeriod' + ]; + + /** + * 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 PERIOD_W = 'w'; + const PERIOD_D = 'd'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPeriodAllowableValues() + { + return [ + self::PERIOD_W, + self::PERIOD_D, + ]; + } + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['period'] = isset($data['period']) ? $data['period'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if (($this->container['amount'] < 1)) { + $invalidProperties[] = "invalid value for 'amount', must be bigger than or equal to 1."; + } + + if ($this->container['period'] === null) { + $invalidProperties[] = "'period' can't be null"; + } + $allowedValues = $this->getPeriodAllowableValues(); + if (!is_null($this->container['period']) && !in_array($this->container['period'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'period', 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 amount + * + * @return int + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param int $amount The amount of period. + * + * @return $this + */ + public function setAmount($amount) + { + + if (($amount < 1)) { + throw new \InvalidArgumentException('invalid value for $amount when calling CardExpiringPointsNotificationTrigger., must be bigger than or equal to 1.'); + } + + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets period + * + * @return string + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string $period Notification period indicated by a letter; \"w\" means week, \"d\" means day. + * + * @return $this + */ + public function setPeriod($period) + { + $allowedValues = $this->getPeriodAllowableValues(); + if (!in_array($period, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'period', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['period'] = $period; + + 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/CartItem.php b/lib/Model/CartItem.php index 202442d0..c9510cb0 100644 --- a/lib/Model/CartItem.php +++ b/lib/Model/CartItem.php @@ -64,6 +64,7 @@ class CartItem implements ModelInterface, ArrayAccess 'remainingQuantity' => 'int', 'price' => 'float', 'category' => 'string', + 'product' => '\TalonOne\Client\Model\Product', 'weight' => 'float', 'height' => 'float', 'width' => 'float', @@ -87,6 +88,7 @@ class CartItem implements ModelInterface, ArrayAccess 'remainingQuantity' => null, 'price' => null, 'category' => null, + 'product' => null, 'weight' => null, 'height' => null, 'width' => null, @@ -131,6 +133,7 @@ public static function openAPIFormats() 'remainingQuantity' => 'remainingQuantity', 'price' => 'price', 'category' => 'category', + 'product' => 'product', 'weight' => 'weight', 'height' => 'height', 'width' => 'width', @@ -154,6 +157,7 @@ public static function openAPIFormats() 'remainingQuantity' => 'setRemainingQuantity', 'price' => 'setPrice', 'category' => 'setCategory', + 'product' => 'setProduct', 'weight' => 'setWeight', 'height' => 'setHeight', 'width' => 'setWidth', @@ -177,6 +181,7 @@ public static function openAPIFormats() 'remainingQuantity' => 'getRemainingQuantity', 'price' => 'getPrice', 'category' => 'getCategory', + 'product' => 'getProduct', 'weight' => 'getWeight', 'height' => 'getHeight', 'width' => 'getWidth', @@ -254,6 +259,7 @@ public function __construct(array $data = null) $this->container['remainingQuantity'] = isset($data['remainingQuantity']) ? $data['remainingQuantity'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['category'] = isset($data['category']) ? $data['category'] : null; + $this->container['product'] = isset($data['product']) ? $data['product'] : null; $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; $this->container['height'] = isset($data['height']) ? $data['height'] : null; $this->container['width'] = isset($data['width']) ? $data['width'] : null; @@ -480,6 +486,30 @@ public function setCategory($category) return $this; } + /** + * Gets product + * + * @return \TalonOne\Client\Model\Product|null + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \TalonOne\Client\Model\Product|null $product product + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + /** * Gets weight * diff --git a/lib/Model/CatalogItem.php b/lib/Model/CatalogItem.php index c3463fbb..37f5af62 100644 --- a/lib/Model/CatalogItem.php +++ b/lib/Model/CatalogItem.php @@ -64,7 +64,8 @@ class CatalogItem implements ModelInterface, ArrayAccess 'price' => 'float', 'catalogid' => 'int', 'version' => 'int', - 'attributes' => '\TalonOne\Client\Model\ItemAttribute[]' + 'attributes' => '\TalonOne\Client\Model\ItemAttribute[]', + 'product' => '\TalonOne\Client\Model\Product' ]; /** @@ -79,7 +80,8 @@ class CatalogItem implements ModelInterface, ArrayAccess 'price' => null, 'catalogid' => null, 'version' => null, - 'attributes' => null + 'attributes' => null, + 'product' => null ]; /** @@ -115,7 +117,8 @@ public static function openAPIFormats() 'price' => 'price', 'catalogid' => 'catalogid', 'version' => 'version', - 'attributes' => 'attributes' + 'attributes' => 'attributes', + 'product' => 'product' ]; /** @@ -130,7 +133,8 @@ public static function openAPIFormats() 'price' => 'setPrice', 'catalogid' => 'setCatalogid', 'version' => 'setVersion', - 'attributes' => 'setAttributes' + 'attributes' => 'setAttributes', + 'product' => 'setProduct' ]; /** @@ -145,7 +149,8 @@ public static function openAPIFormats() 'price' => 'getPrice', 'catalogid' => 'getCatalogid', 'version' => 'getVersion', - 'attributes' => 'getAttributes' + 'attributes' => 'getAttributes', + 'product' => 'getProduct' ]; /** @@ -215,6 +220,7 @@ public function __construct(array $data = null) $this->container['catalogid'] = isset($data['catalogid']) ? $data['catalogid'] : null; $this->container['version'] = isset($data['version']) ? $data['version'] : null; $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['product'] = isset($data['product']) ? $data['product'] : null; } /** @@ -432,6 +438,30 @@ public function setAttributes($attributes) return $this; } + + /** + * Gets product + * + * @return \TalonOne\Client\Model\Product|null + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \TalonOne\Client\Model\Product|null $product product + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ChangeLoyaltyTierLevelEffectProps.php b/lib/Model/ChangeLoyaltyTierLevelEffectProps.php new file mode 100644 index 00000000..d74fe322 --- /dev/null +++ b/lib/Model/ChangeLoyaltyTierLevelEffectProps.php @@ -0,0 +1,471 @@ + 'string', + 'programId' => 'int', + 'subLedgerId' => 'string', + 'previousTierName' => 'string', + 'newTierName' => 'string', + 'expiryDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'ruleTitle' => null, + 'programId' => null, + 'subLedgerId' => null, + 'previousTierName' => null, + 'newTierName' => null, + 'expiryDate' => '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 = [ + 'ruleTitle' => 'ruleTitle', + 'programId' => 'programId', + 'subLedgerId' => 'subLedgerId', + 'previousTierName' => 'previousTierName', + 'newTierName' => 'newTierName', + 'expiryDate' => 'expiryDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ruleTitle' => 'setRuleTitle', + 'programId' => 'setProgramId', + 'subLedgerId' => 'setSubLedgerId', + 'previousTierName' => 'setPreviousTierName', + 'newTierName' => 'setNewTierName', + 'expiryDate' => 'setExpiryDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ruleTitle' => 'getRuleTitle', + 'programId' => 'getProgramId', + 'subLedgerId' => 'getSubLedgerId', + 'previousTierName' => 'getPreviousTierName', + 'newTierName' => 'getNewTierName', + 'expiryDate' => 'getExpiryDate' + ]; + + /** + * 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['ruleTitle'] = isset($data['ruleTitle']) ? $data['ruleTitle'] : null; + $this->container['programId'] = isset($data['programId']) ? $data['programId'] : null; + $this->container['subLedgerId'] = isset($data['subLedgerId']) ? $data['subLedgerId'] : null; + $this->container['previousTierName'] = isset($data['previousTierName']) ? $data['previousTierName'] : null; + $this->container['newTierName'] = isset($data['newTierName']) ? $data['newTierName'] : null; + $this->container['expiryDate'] = isset($data['expiryDate']) ? $data['expiryDate'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ruleTitle'] === null) { + $invalidProperties[] = "'ruleTitle' can't be null"; + } + if ($this->container['programId'] === null) { + $invalidProperties[] = "'programId' can't be null"; + } + if ($this->container['subLedgerId'] === null) { + $invalidProperties[] = "'subLedgerId' can't be null"; + } + if ($this->container['newTierName'] === null) { + $invalidProperties[] = "'newTierName' 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 ruleTitle + * + * @return string + */ + public function getRuleTitle() + { + return $this->container['ruleTitle']; + } + + /** + * Sets ruleTitle + * + * @param string $ruleTitle The title of the rule that triggered the tier upgrade. + * + * @return $this + */ + public function setRuleTitle($ruleTitle) + { + $this->container['ruleTitle'] = $ruleTitle; + + return $this; + } + + /** + * Gets programId + * + * @return int + */ + public function getProgramId() + { + return $this->container['programId']; + } + + /** + * Sets programId + * + * @param int $programId The ID of the loyalty program where these points were added. + * + * @return $this + */ + public function setProgramId($programId) + { + $this->container['programId'] = $programId; + + return $this; + } + + /** + * Gets subLedgerId + * + * @return string + */ + public function getSubLedgerId() + { + return $this->container['subLedgerId']; + } + + /** + * Sets subLedgerId + * + * @param string $subLedgerId The ID of the subledger within the loyalty program where these points were added. + * + * @return $this + */ + public function setSubLedgerId($subLedgerId) + { + $this->container['subLedgerId'] = $subLedgerId; + + return $this; + } + + /** + * Gets previousTierName + * + * @return string|null + */ + public function getPreviousTierName() + { + return $this->container['previousTierName']; + } + + /** + * Sets previousTierName + * + * @param string|null $previousTierName The name of the tier from which the user was upgraded. + * + * @return $this + */ + public function setPreviousTierName($previousTierName) + { + $this->container['previousTierName'] = $previousTierName; + + return $this; + } + + /** + * Gets newTierName + * + * @return string + */ + public function getNewTierName() + { + return $this->container['newTierName']; + } + + /** + * Sets newTierName + * + * @param string $newTierName The name of the tier to which the user has been upgraded. + * + * @return $this + */ + public function setNewTierName($newTierName) + { + $this->container['newTierName'] = $newTierName; + + return $this; + } + + /** + * Gets expiryDate + * + * @return \DateTime|null + */ + public function getExpiryDate() + { + return $this->container['expiryDate']; + } + + /** + * Sets expiryDate + * + * @param \DateTime|null $expiryDate The expiration date of the new tier. + * + * @return $this + */ + public function setExpiryDate($expiryDate) + { + $this->container['expiryDate'] = $expiryDate; + + 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/Coupon.php b/lib/Model/Coupon.php index 7aa7d56b..d0bc5d88 100644 --- a/lib/Model/Coupon.php +++ b/lib/Model/Coupon.php @@ -303,7 +303,7 @@ public function __construct(array $data = null) $this->container['importId'] = isset($data['importId']) ? $data['importId'] : null; $this->container['reservation'] = isset($data['reservation']) ? $data['reservation'] : true; $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null; - $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : true; + $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : false; $this->container['implicitlyReserved'] = isset($data['implicitlyReserved']) ? $data['implicitlyReserved'] : null; } diff --git a/lib/Model/CouponCreationJob.php b/lib/Model/CouponCreationJob.php index ee1e91fd..f62fc815 100644 --- a/lib/Model/CouponCreationJob.php +++ b/lib/Model/CouponCreationJob.php @@ -792,7 +792,7 @@ public function getStatus() /** * Sets status * - * @param string $status The current status of this request. Possible values: - `pending` - `completed` - `failed` - `coupon pattern full` + * @param string $status The current status of this request. Possible values: - `pending verification` - `pending` - `completed` - `failed` - `coupon pattern full` * * @return $this */ diff --git a/lib/Model/CouponsNotificationPolicy.php b/lib/Model/CouponsNotificationPolicy.php index cacd293f..b2bb2113 100644 --- a/lib/Model/CouponsNotificationPolicy.php +++ b/lib/Model/CouponsNotificationPolicy.php @@ -58,7 +58,8 @@ class CouponsNotificationPolicy implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'name' => 'string', - 'scopes' => 'string[]' + 'scopes' => 'string[]', + 'batchingEnabled' => 'bool' ]; /** @@ -68,7 +69,8 @@ class CouponsNotificationPolicy implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'name' => null, - 'scopes' => null + 'scopes' => null, + 'batchingEnabled' => null ]; /** @@ -99,7 +101,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'scopes' => 'scopes' + 'scopes' => 'scopes', + 'batchingEnabled' => 'batchingEnabled' ]; /** @@ -109,7 +112,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'name' => 'setName', - 'scopes' => 'setScopes' + 'scopes' => 'setScopes', + 'batchingEnabled' => 'setBatchingEnabled' ]; /** @@ -119,7 +123,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'name' => 'getName', - 'scopes' => 'getScopes' + 'scopes' => 'getScopes', + 'batchingEnabled' => 'getBatchingEnabled' ]; /** @@ -203,6 +208,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['scopes'] = isset($data['scopes']) ? $data['scopes'] : null; + $this->container['batchingEnabled'] = isset($data['batchingEnabled']) ? $data['batchingEnabled'] : true; } /** @@ -300,6 +306,30 @@ public function setScopes($scopes) 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/CreateAchievement.php b/lib/Model/CreateAchievement.php new file mode 100644 index 00000000..18b21a9a --- /dev/null +++ b/lib/Model/CreateAchievement.php @@ -0,0 +1,495 @@ + 'string', + 'title' => 'string', + 'description' => 'string', + 'target' => 'float', + 'period' => 'string', + 'periodEndOverride' => '\TalonOne\Client\Model\TimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'title' => null, + 'description' => 'string', + 'target' => null, + 'period' => null, + 'periodEndOverride' => 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', + 'title' => 'title', + 'description' => 'description', + 'target' => 'target', + 'period' => 'period', + 'periodEndOverride' => 'periodEndOverride' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'title' => 'setTitle', + 'description' => 'setDescription', + 'target' => 'setTarget', + 'period' => 'setPeriod', + 'periodEndOverride' => 'setPeriodEndOverride' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'title' => 'getTitle', + 'description' => 'getDescription', + 'target' => 'getTarget', + 'period' => 'getPeriod', + 'periodEndOverride' => 'getPeriodEndOverride' + ]; + + /** + * 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['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['target'] = isset($data['target']) ? $data['target'] : null; + $this->container['period'] = isset($data['period']) ? $data['period'] : null; + $this->container['periodEndOverride'] = isset($data['periodEndOverride']) ? $data['periodEndOverride'] : 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"; + } + if ((mb_strlen($this->container['name']) > 1000)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 1000."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^[a-zA-Z]\\w+$/", $this->container['name'])) { + $invalidProperties[] = "invalid value for 'name', must be conform to the pattern /^[a-zA-Z]\\w+$/."; + } + + 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['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } + if ($this->container['period'] === null) { + $invalidProperties[] = "'period' 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 internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created. + * + * @return $this + */ + public function setName($name) + { + if ((mb_strlen($name) > 1000)) { + throw new \InvalidArgumentException('invalid length for $name when calling CreateAchievement., must be smaller than or equal to 1000.'); + } + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling CreateAchievement., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^[a-zA-Z]\\w+$/", $name))) { + throw new \InvalidArgumentException("invalid value for $name when calling CreateAchievement., must conform to the pattern /^[a-zA-Z]\\w+$/."); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The display name for the achievement in the Campaign Manager. + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description A description of the achievement. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets target + * + * @return float + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param float $target The required number of actions or the transactional milestone to complete the achievement. + * + * @return $this + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets period + * + * @return string + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string $period The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** 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 also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period. + * + * @return $this + */ + public function setPeriod($period) + { + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodEndOverride + * + * @return \TalonOne\Client\Model\TimePoint|null + */ + public function getPeriodEndOverride() + { + return $this->container['periodEndOverride']; + } + + /** + * Sets periodEndOverride + * + * @param \TalonOne\Client\Model\TimePoint|null $periodEndOverride periodEndOverride + * + * @return $this + */ + public function setPeriodEndOverride($periodEndOverride) + { + $this->container['periodEndOverride'] = $periodEndOverride; + + 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/CreateApplicationAPIKey.php b/lib/Model/CreateApplicationAPIKey.php index 41f21a20..30ddda6f 100644 --- a/lib/Model/CreateApplicationAPIKey.php +++ b/lib/Model/CreateApplicationAPIKey.php @@ -59,7 +59,9 @@ class CreateApplicationAPIKey implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'title' => 'string', 'expires' => '\DateTime', - 'platform' => 'string' + 'platform' => 'string', + 'type' => 'string', + 'timeOffset' => 'int' ]; /** @@ -70,7 +72,9 @@ class CreateApplicationAPIKey implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'title' => null, 'expires' => 'date-time', - 'platform' => null + 'platform' => null, + 'type' => null, + 'timeOffset' => null ]; /** @@ -102,7 +106,9 @@ public static function openAPIFormats() protected static $attributeMap = [ 'title' => 'title', 'expires' => 'expires', - 'platform' => 'platform' + 'platform' => 'platform', + 'type' => 'type', + 'timeOffset' => 'timeOffset' ]; /** @@ -113,7 +119,9 @@ public static function openAPIFormats() protected static $setters = [ 'title' => 'setTitle', 'expires' => 'setExpires', - 'platform' => 'setPlatform' + 'platform' => 'setPlatform', + 'type' => 'setType', + 'timeOffset' => 'setTimeOffset' ]; /** @@ -124,7 +132,9 @@ public static function openAPIFormats() protected static $getters = [ 'title' => 'getTitle', 'expires' => 'getExpires', - 'platform' => 'getPlatform' + 'platform' => 'getPlatform', + 'type' => 'getType', + 'timeOffset' => 'getTimeOffset' ]; /** @@ -177,6 +187,8 @@ public function getModelName() const PLATFORM_CUSTOMER_ENGAGEMENT = 'customer_engagement'; const PLATFORM_CUSTOMER_DATA = 'customer_data'; const PLATFORM_SALESFORCE = 'salesforce'; + const PLATFORM_EMARSYS = 'emarsys'; + const TYPE_STAGING = 'staging'; @@ -197,6 +209,19 @@ public function getPlatformAllowableValues() self::PLATFORM_CUSTOMER_ENGAGEMENT, self::PLATFORM_CUSTOMER_DATA, self::PLATFORM_SALESFORCE, + self::PLATFORM_EMARSYS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_STAGING, ]; } @@ -219,6 +244,8 @@ public function __construct(array $data = null) $this->container['title'] = isset($data['title']) ? $data['title'] : null; $this->container['expires'] = isset($data['expires']) ? $data['expires'] : null; $this->container['platform'] = isset($data['platform']) ? $data['platform'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['timeOffset'] = isset($data['timeOffset']) ? $data['timeOffset'] : null; } /** @@ -244,6 +271,14 @@ public function listInvalidProperties() ); } + $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) + ); + } + return $invalidProperties; } @@ -272,7 +307,7 @@ public function getTitle() /** * Sets title * - * @param string $title Title for API Key. + * @param string $title Title of the API key. * * @return $this */ @@ -296,7 +331,7 @@ public function getExpires() /** * Sets expires * - * @param \DateTime $expires The date the API key expired. + * @param \DateTime $expires The date the API key expires. * * @return $this */ @@ -339,6 +374,63 @@ public function setPlatform($platform) return $this; } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 timeOffset + * + * @return int|null + */ + public function getTimeOffset() + { + return $this->container['timeOffset']; + } + + /** + * Sets timeOffset + * + * @param int|null $timeOffset A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. + * + * @return $this + */ + public function setTimeOffset($timeOffset) + { + $this->container['timeOffset'] = $timeOffset; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CustomerInventory.php b/lib/Model/CustomerInventory.php index 2cbc5547..6eb9a375 100644 --- a/lib/Model/CustomerInventory.php +++ b/lib/Model/CustomerInventory.php @@ -61,7 +61,8 @@ class CustomerInventory implements ModelInterface, ArrayAccess 'loyalty' => '\TalonOne\Client\Model\Loyalty', 'referrals' => '\TalonOne\Client\Model\InventoryReferral[]', 'coupons' => '\TalonOne\Client\Model\InventoryCoupon[]', - 'giveaways' => '\TalonOne\Client\Model\Giveaway[]' + 'giveaways' => '\TalonOne\Client\Model\Giveaway[]', + 'achievements' => '\TalonOne\Client\Model\AchievementProgress[]' ]; /** @@ -74,7 +75,8 @@ class CustomerInventory implements ModelInterface, ArrayAccess 'loyalty' => null, 'referrals' => null, 'coupons' => null, - 'giveaways' => null + 'giveaways' => null, + 'achievements' => null ]; /** @@ -108,7 +110,8 @@ public static function openAPIFormats() 'loyalty' => 'loyalty', 'referrals' => 'referrals', 'coupons' => 'coupons', - 'giveaways' => 'giveaways' + 'giveaways' => 'giveaways', + 'achievements' => 'achievements' ]; /** @@ -121,7 +124,8 @@ public static function openAPIFormats() 'loyalty' => 'setLoyalty', 'referrals' => 'setReferrals', 'coupons' => 'setCoupons', - 'giveaways' => 'setGiveaways' + 'giveaways' => 'setGiveaways', + 'achievements' => 'setAchievements' ]; /** @@ -134,7 +138,8 @@ public static function openAPIFormats() 'loyalty' => 'getLoyalty', 'referrals' => 'getReferrals', 'coupons' => 'getCoupons', - 'giveaways' => 'getGiveaways' + 'giveaways' => 'getGiveaways', + 'achievements' => 'getAchievements' ]; /** @@ -202,6 +207,7 @@ public function __construct(array $data = null) $this->container['referrals'] = isset($data['referrals']) ? $data['referrals'] : null; $this->container['coupons'] = isset($data['coupons']) ? $data['coupons'] : null; $this->container['giveaways'] = isset($data['giveaways']) ? $data['giveaways'] : null; + $this->container['achievements'] = isset($data['achievements']) ? $data['achievements'] : null; } /** @@ -347,6 +353,30 @@ public function setGiveaways($giveaways) return $this; } + + /** + * Gets achievements + * + * @return \TalonOne\Client\Model\AchievementProgress[]|null + */ + public function getAchievements() + { + return $this->container['achievements']; + } + + /** + * Sets achievements + * + * @param \TalonOne\Client\Model\AchievementProgress[]|null $achievements achievements + * + * @return $this + */ + public function setAchievements($achievements) + { + $this->container['achievements'] = $achievements; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CustomerProfile.php b/lib/Model/CustomerProfile.php index 64f9b0f6..c01ffb49 100644 --- a/lib/Model/CustomerProfile.php +++ b/lib/Model/CustomerProfile.php @@ -550,7 +550,7 @@ public function getSandbox() /** * Sets sandbox * - * @param bool|null $sandbox Shows whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). + * @param bool|null $sandbox An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments). * * @return $this */ diff --git a/lib/Model/CustomerProfileAudienceRequestItem.php b/lib/Model/CustomerProfileAudienceRequestItem.php index 12f9ea37..05af5c59 100644 --- a/lib/Model/CustomerProfileAudienceRequestItem.php +++ b/lib/Model/CustomerProfileAudienceRequestItem.php @@ -265,7 +265,7 @@ public function getAction() /** * Sets action * - * @param string $action Defines the action to perform: - `add`: Adds the customer profile to the audience. - `delete`: Removes the customer profile from the audience. + * @param string $action Defines the action to perform: - `add`: Adds the customer profile to the audience. If the customer profile does not exist, it will be created. - `delete`: Removes the customer profile from the audience. * * @return $this */ diff --git a/lib/Model/CustomerSessionV2.php b/lib/Model/CustomerSessionV2.php index a13aec78..26c4d239 100644 --- a/lib/Model/CustomerSessionV2.php +++ b/lib/Model/CustomerSessionV2.php @@ -645,7 +645,7 @@ public function getLoyaltyCards() /** * Sets loyaltyCards * - * @param string[]|null $loyaltyCards Any loyalty cards used. + * @param string[]|null $loyaltyCards Identifier of a loyalty card. * * @return $this */ diff --git a/lib/Model/DeactivateUserRequest.php b/lib/Model/DeactivateUserRequest.php new file mode 100644 index 00000000..9527d544 --- /dev/null +++ b/lib/Model/DeactivateUserRequest.php @@ -0,0 +1,312 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'email' => 'email' + ]; + + /** + * 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 = [ + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' 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 email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address associated with the user profile. + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/DeleteUserRequest.php b/lib/Model/DeleteUserRequest.php new file mode 100644 index 00000000..3e7f2644 --- /dev/null +++ b/lib/Model/DeleteUserRequest.php @@ -0,0 +1,312 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'email' => 'email' + ]; + + /** + * 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 = [ + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' 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 email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address associated with the user profile. + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/EmailEntity.php b/lib/Model/EmailEntity.php index 7df98667..3ca7ef72 100644 --- a/lib/Model/EmailEntity.php +++ b/lib/Model/EmailEntity.php @@ -220,7 +220,7 @@ public function getEmail() /** * Sets email * - * @param string $email The email address associated with your account. + * @param string $email The email address associated with the user profile. * * @return $this */ diff --git a/lib/Model/Environment.php b/lib/Model/Environment.php index e368c1c2..812d9f11 100644 --- a/lib/Model/Environment.php +++ b/lib/Model/Environment.php @@ -67,6 +67,7 @@ class Environment implements ModelInterface, ArrayAccess 'variables' => 'string', 'giveawaysPools' => '\TalonOne\Client\Model\GiveawaysPool[]', 'loyaltyPrograms' => '\TalonOne\Client\Model\LoyaltyProgram[]', + 'achievements' => '\TalonOne\Client\Model\Achievement[]', 'attributes' => '\TalonOne\Client\Model\Attribute[]', 'additionalCosts' => '\TalonOne\Client\Model\AccountAdditionalCost[]', 'audiences' => '\TalonOne\Client\Model\Audience[]', @@ -88,6 +89,7 @@ class Environment implements ModelInterface, ArrayAccess 'variables' => null, 'giveawaysPools' => null, 'loyaltyPrograms' => null, + 'achievements' => null, 'attributes' => null, 'additionalCosts' => null, 'audiences' => null, @@ -130,6 +132,7 @@ public static function openAPIFormats() 'variables' => 'variables', 'giveawaysPools' => 'giveawaysPools', 'loyaltyPrograms' => 'loyaltyPrograms', + 'achievements' => 'achievements', 'attributes' => 'attributes', 'additionalCosts' => 'additionalCosts', 'audiences' => 'audiences', @@ -151,6 +154,7 @@ public static function openAPIFormats() 'variables' => 'setVariables', 'giveawaysPools' => 'setGiveawaysPools', 'loyaltyPrograms' => 'setLoyaltyPrograms', + 'achievements' => 'setAchievements', 'attributes' => 'setAttributes', 'additionalCosts' => 'setAdditionalCosts', 'audiences' => 'setAudiences', @@ -172,6 +176,7 @@ public static function openAPIFormats() 'variables' => 'getVariables', 'giveawaysPools' => 'getGiveawaysPools', 'loyaltyPrograms' => 'getLoyaltyPrograms', + 'achievements' => 'getAchievements', 'attributes' => 'getAttributes', 'additionalCosts' => 'getAdditionalCosts', 'audiences' => 'getAudiences', @@ -247,6 +252,7 @@ public function __construct(array $data = null) $this->container['variables'] = isset($data['variables']) ? $data['variables'] : null; $this->container['giveawaysPools'] = isset($data['giveawaysPools']) ? $data['giveawaysPools'] : null; $this->container['loyaltyPrograms'] = isset($data['loyaltyPrograms']) ? $data['loyaltyPrograms'] : null; + $this->container['achievements'] = isset($data['achievements']) ? $data['achievements'] : null; $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; $this->container['additionalCosts'] = isset($data['additionalCosts']) ? $data['additionalCosts'] : null; $this->container['audiences'] = isset($data['audiences']) ? $data['audiences'] : null; @@ -514,6 +520,30 @@ public function setLoyaltyPrograms($loyaltyPrograms) return $this; } + /** + * Gets achievements + * + * @return \TalonOne\Client\Model\Achievement[]|null + */ + public function getAchievements() + { + return $this->container['achievements']; + } + + /** + * Sets achievements + * + * @param \TalonOne\Client\Model\Achievement[]|null $achievements The achievements, linked to the campaigns, belonging to the application. + * + * @return $this + */ + public function setAchievements($achievements) + { + $this->container['achievements'] = $achievements; + + return $this; + } + /** * Gets attributes * diff --git a/lib/Model/ExpiringCouponsNotificationPolicy.php b/lib/Model/ExpiringCouponsNotificationPolicy.php new file mode 100644 index 00000000..33d6292f --- /dev/null +++ b/lib/Model/ExpiringCouponsNotificationPolicy.php @@ -0,0 +1,383 @@ + 'string', + 'triggers' => '\TalonOne\Client\Model\ExpiringCouponsNotificationTrigger[]', + 'batchingEnabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'triggers' => null, + 'batchingEnabled' => 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', + 'triggers' => 'triggers', + 'batchingEnabled' => 'batchingEnabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'triggers' => 'setTriggers', + 'batchingEnabled' => 'setBatchingEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'triggers' => 'getTriggers', + 'batchingEnabled' => 'getBatchingEnabled' + ]; + + /** + * 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['triggers'] = isset($data['triggers']) ? $data['triggers'] : null; + $this->container['batchingEnabled'] = isset($data['batchingEnabled']) ? $data['batchingEnabled'] : true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((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['triggers'] === null) { + $invalidProperties[] = "'triggers' 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 Notification name. + * + * @return $this + */ + public function setName($name) + { + + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling ExpiringCouponsNotificationPolicy., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets triggers + * + * @return \TalonOne\Client\Model\ExpiringCouponsNotificationTrigger[] + */ + public function getTriggers() + { + return $this->container['triggers']; + } + + /** + * Sets triggers + * + * @param \TalonOne\Client\Model\ExpiringCouponsNotificationTrigger[] $triggers triggers + * + * @return $this + */ + public function setTriggers($triggers) + { + $this->container['triggers'] = $triggers; + + 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. + * + * @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/ExpiringCouponsNotificationTrigger.php b/lib/Model/ExpiringCouponsNotificationTrigger.php new file mode 100644 index 00000000..2f1c50c6 --- /dev/null +++ b/lib/Model/ExpiringCouponsNotificationTrigger.php @@ -0,0 +1,385 @@ + 'int', + 'period' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'period' => 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 = [ + 'amount' => 'amount', + 'period' => 'period' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'period' => 'setPeriod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'period' => 'getPeriod' + ]; + + /** + * 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 PERIOD_W = 'w'; + const PERIOD_D = 'd'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPeriodAllowableValues() + { + return [ + self::PERIOD_W, + self::PERIOD_D, + ]; + } + + + /** + * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['period'] = isset($data['period']) ? $data['period'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if (($this->container['amount'] < 0)) { + $invalidProperties[] = "invalid value for 'amount', must be bigger than or equal to 0."; + } + + if ($this->container['period'] === null) { + $invalidProperties[] = "'period' can't be null"; + } + $allowedValues = $this->getPeriodAllowableValues(); + if (!is_null($this->container['period']) && !in_array($this->container['period'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'period', 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 amount + * + * @return int + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param int $amount The amount of period. + * + * @return $this + */ + public function setAmount($amount) + { + + if (($amount < 0)) { + throw new \InvalidArgumentException('invalid value for $amount when calling ExpiringCouponsNotificationTrigger., must be bigger than or equal to 0.'); + } + + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets period + * + * @return string + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string $period Notification period indicated by a letter; \"w\" means week, \"d\" means day. + * + * @return $this + */ + public function setPeriod($period) + { + $allowedValues = $this->getPeriodAllowableValues(); + if (!in_array($period, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'period', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['period'] = $period; + + 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/ExpiringPointsNotificationPolicy.php b/lib/Model/ExpiringPointsNotificationPolicy.php index 19ca7823..2b12b8de 100644 --- a/lib/Model/ExpiringPointsNotificationPolicy.php +++ b/lib/Model/ExpiringPointsNotificationPolicy.php @@ -58,7 +58,8 @@ class ExpiringPointsNotificationPolicy implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'name' => 'string', - 'triggers' => '\TalonOne\Client\Model\ExpiringPointsNotificationTrigger[]' + 'triggers' => '\TalonOne\Client\Model\ExpiringPointsNotificationTrigger[]', + 'batchingEnabled' => 'bool' ]; /** @@ -68,7 +69,8 @@ class ExpiringPointsNotificationPolicy implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'name' => null, - 'triggers' => null + 'triggers' => null, + 'batchingEnabled' => null ]; /** @@ -99,7 +101,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'triggers' => 'triggers' + 'triggers' => 'triggers', + 'batchingEnabled' => 'batchingEnabled' ]; /** @@ -109,7 +112,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'name' => 'setName', - 'triggers' => 'setTriggers' + 'triggers' => 'setTriggers', + 'batchingEnabled' => 'setBatchingEnabled' ]; /** @@ -119,7 +123,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'name' => 'getName', - 'triggers' => 'getTriggers' + 'triggers' => 'getTriggers', + 'batchingEnabled' => 'getBatchingEnabled' ]; /** @@ -184,6 +189,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['triggers'] = isset($data['triggers']) ? $data['triggers'] : null; + $this->container['batchingEnabled'] = isset($data['batchingEnabled']) ? $data['batchingEnabled'] : true; } /** @@ -272,6 +278,30 @@ public function setTriggers($triggers) 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/FuncArgDef.php b/lib/Model/FuncArgDef.php index 9c3debac..22d0f26e 100644 --- a/lib/Model/FuncArgDef.php +++ b/lib/Model/FuncArgDef.php @@ -231,9 +231,6 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'type', the character length must be bigger than or equal to 1."; } - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' can't be null"; - } return $invalidProperties; } @@ -290,7 +287,7 @@ public function setType($type) /** * Gets description * - * @return string + * @return string|null */ public function getDescription() { @@ -300,7 +297,7 @@ public function getDescription() /** * Sets description * - * @param string $description A campaigner-friendly description of the argument, this will also be shown in the rule editor. + * @param string|null $description A campaigner-friendly description of the argument, this will also be shown in the rule editor. * * @return $this */ diff --git a/lib/Model/GetIntegrationCouponRequest.php b/lib/Model/GetIntegrationCouponRequest.php new file mode 100644 index 00000000..45f16c5b --- /dev/null +++ b/lib/Model/GetIntegrationCouponRequest.php @@ -0,0 +1,360 @@ + 'int[]', + 'limit' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'campaignIds' => null, + 'limit' => 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 = [ + 'campaignIds' => 'campaignIds', + 'limit' => 'limit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignIds' => 'setCampaignIds', + 'limit' => 'setLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignIds' => 'getCampaignIds', + 'limit' => 'getLimit' + ]; + + /** + * 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['campaignIds'] = isset($data['campaignIds']) ? $data['campaignIds'] : null; + $this->container['limit'] = isset($data['limit']) ? $data['limit'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignIds'] === null) { + $invalidProperties[] = "'campaignIds' can't be null"; + } + if ($this->container['limit'] === null) { + $invalidProperties[] = "'limit' can't be null"; + } + if (($this->container['limit'] > 1000)) { + $invalidProperties[] = "invalid value for 'limit', must be smaller than or equal to 1000."; + } + + if (($this->container['limit'] < 1)) { + $invalidProperties[] = "invalid value for 'limit', 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 campaignIds + * + * @return int[] + */ + public function getCampaignIds() + { + return $this->container['campaignIds']; + } + + /** + * Sets campaignIds + * + * @param int[] $campaignIds A list of IDs of the campaigns to get coupons from. + * + * @return $this + */ + public function setCampaignIds($campaignIds) + { + $this->container['campaignIds'] = $campaignIds; + + return $this; + } + + /** + * Gets limit + * + * @return int + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int $limit The maximum number of coupons included in the response. + * + * @return $this + */ + public function setLimit($limit) + { + + if (($limit > 1000)) { + throw new \InvalidArgumentException('invalid value for $limit when calling GetIntegrationCouponRequest., must be smaller than or equal to 1000.'); + } + if (($limit < 1)) { + throw new \InvalidArgumentException('invalid value for $limit when calling GetIntegrationCouponRequest., must be bigger than or equal to 1.'); + } + + $this->container['limit'] = $limit; + + 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/IncreaseAchievementProgressEffectProps.php b/lib/Model/IncreaseAchievementProgressEffectProps.php new file mode 100644 index 00000000..d8dd8661 --- /dev/null +++ b/lib/Model/IncreaseAchievementProgressEffectProps.php @@ -0,0 +1,507 @@ + 'int', + 'achievementName' => 'string', + 'progressTrackerId' => 'int', + 'delta' => 'float', + 'value' => 'float', + 'target' => 'float', + 'isJustCompleted' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'achievementId' => null, + 'achievementName' => null, + 'progressTrackerId' => null, + 'delta' => null, + 'value' => null, + 'target' => null, + 'isJustCompleted' => 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', + 'delta' => 'delta', + 'value' => 'value', + 'target' => 'target', + 'isJustCompleted' => 'isJustCompleted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'achievementId' => 'setAchievementId', + 'achievementName' => 'setAchievementName', + 'progressTrackerId' => 'setProgressTrackerId', + 'delta' => 'setDelta', + 'value' => 'setValue', + 'target' => 'setTarget', + 'isJustCompleted' => 'setIsJustCompleted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'achievementId' => 'getAchievementId', + 'achievementName' => 'getAchievementName', + 'progressTrackerId' => 'getProgressTrackerId', + 'delta' => 'getDelta', + 'value' => 'getValue', + 'target' => 'getTarget', + 'isJustCompleted' => 'getIsJustCompleted' + ]; + + /** + * 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['delta'] = isset($data['delta']) ? $data['delta'] : null; + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['target'] = isset($data['target']) ? $data['target'] : null; + $this->container['isJustCompleted'] = isset($data['isJustCompleted']) ? $data['isJustCompleted'] : 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['delta'] === null) { + $invalidProperties[] = "'delta' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } + if ($this->container['isJustCompleted'] === null) { + $invalidProperties[] = "'isJustCompleted' 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|null + */ + public function getProgressTrackerId() + { + return $this->container['progressTrackerId']; + } + + /** + * Sets progressTrackerId + * + * @param int|null $progressTrackerId The internal ID of the achievement progress tracker. + * + * @return $this + */ + public function setProgressTrackerId($progressTrackerId) + { + $this->container['progressTrackerId'] = $progressTrackerId; + + return $this; + } + + /** + * Gets delta + * + * @return float + */ + public function getDelta() + { + return $this->container['delta']; + } + + /** + * Sets delta + * + * @param float $delta The value by which the customer's current progress in the achievement is increased. + * + * @return $this + */ + public function setDelta($delta) + { + $this->container['delta'] = $delta; + + return $this; + } + + /** + * Gets value + * + * @return float + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float $value The current progress of the customer in the achievement. + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets target + * + * @return float + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param float $target The required number of actions or the transactional milestone to complete the achievement. + * + * @return $this + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets isJustCompleted + * + * @return bool + */ + public function getIsJustCompleted() + { + return $this->container['isJustCompleted']; + } + + /** + * Sets isJustCompleted + * + * @param bool $isJustCompleted Indicates if the customer has completed the achievement in the current session. + * + * @return $this + */ + public function setIsJustCompleted($isJustCompleted) + { + $this->container['isJustCompleted'] = $isJustCompleted; + + 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/InlineResponse20011.php b/lib/Model/InlineResponse20011.php index 6ae77096..2fb38fd1 100644 --- a/lib/Model/InlineResponse20011.php +++ b/lib/Model/InlineResponse20011.php @@ -57,8 +57,8 @@ class InlineResponse20011 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'hasMore' => 'bool', - 'data' => '\TalonOne\Client\Model\CampaignTemplate[]' + 'totalResultSize' => 'int', + 'data' => '\TalonOne\Client\Model\CampaignGroup[]' ]; /** @@ -67,7 +67,7 @@ class InlineResponse20011 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'hasMore' => null, + 'totalResultSize' => null, 'data' => null ]; @@ -98,7 +98,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'hasMore' => 'hasMore', + 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -108,7 +108,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'hasMore' => 'setHasMore', + 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -118,7 +118,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'hasMore' => 'getHasMore', + 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -182,7 +182,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; + $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -195,8 +195,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['hasMore'] === null) { - $invalidProperties[] = "'hasMore' can't be null"; + if ($this->container['totalResultSize'] === null) { + $invalidProperties[] = "'totalResultSize' can't be null"; } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; @@ -217,25 +217,25 @@ public function valid() /** - * Gets hasMore + * Gets totalResultSize * - * @return bool + * @return int */ - public function getHasMore() + public function getTotalResultSize() { - return $this->container['hasMore']; + return $this->container['totalResultSize']; } /** - * Sets hasMore + * Sets totalResultSize * - * @param bool $hasMore hasMore + * @param int $totalResultSize totalResultSize * * @return $this */ - public function setHasMore($hasMore) + public function setTotalResultSize($totalResultSize) { - $this->container['hasMore'] = $hasMore; + $this->container['totalResultSize'] = $totalResultSize; return $this; } @@ -243,7 +243,7 @@ public function setHasMore($hasMore) /** * Gets data * - * @return \TalonOne\Client\Model\CampaignTemplate[] + * @return \TalonOne\Client\Model\CampaignGroup[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\CampaignTemplate[] $data data + * @param \TalonOne\Client\Model\CampaignGroup[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20012.php b/lib/Model/InlineResponse20012.php index c779e24a..a5f2dac6 100644 --- a/lib/Model/InlineResponse20012.php +++ b/lib/Model/InlineResponse20012.php @@ -57,8 +57,8 @@ class InlineResponse20012 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\LoyaltyProgram[]' + 'hasMore' => 'bool', + 'data' => '\TalonOne\Client\Model\CampaignTemplate[]' ]; /** @@ -67,7 +67,7 @@ class InlineResponse20012 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'totalResultSize' => null, + 'hasMore' => null, 'data' => null ]; @@ -98,7 +98,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'totalResultSize' => 'totalResultSize', + 'hasMore' => 'hasMore', 'data' => 'data' ]; @@ -108,7 +108,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'totalResultSize' => 'setTotalResultSize', + 'hasMore' => 'setHasMore', 'data' => 'setData' ]; @@ -118,7 +118,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'totalResultSize' => 'getTotalResultSize', + 'hasMore' => 'getHasMore', 'data' => 'getData' ]; @@ -182,7 +182,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; + $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -195,8 +195,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['totalResultSize'] === null) { - $invalidProperties[] = "'totalResultSize' can't be null"; + if ($this->container['hasMore'] === null) { + $invalidProperties[] = "'hasMore' can't be null"; } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; @@ -217,25 +217,25 @@ public function valid() /** - * Gets totalResultSize + * Gets hasMore * - * @return int + * @return bool */ - public function getTotalResultSize() + public function getHasMore() { - return $this->container['totalResultSize']; + return $this->container['hasMore']; } /** - * Sets totalResultSize + * Sets hasMore * - * @param int $totalResultSize totalResultSize + * @param bool $hasMore hasMore * * @return $this */ - public function setTotalResultSize($totalResultSize) + public function setHasMore($hasMore) { - $this->container['totalResultSize'] = $totalResultSize; + $this->container['hasMore'] = $hasMore; return $this; } @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\LoyaltyProgram[] + * @return \TalonOne\Client\Model\CampaignTemplate[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\LoyaltyProgram[] $data data + * @param \TalonOne\Client\Model\CampaignTemplate[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20013.php b/lib/Model/InlineResponse20013.php index 26304f83..08773088 100644 --- a/lib/Model/InlineResponse20013.php +++ b/lib/Model/InlineResponse20013.php @@ -57,8 +57,8 @@ class InlineResponse20013 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'hasMore' => 'bool', - 'data' => '\TalonOne\Client\Model\LoyaltyProgramTransaction[]' + 'totalResultSize' => 'int', + 'data' => '\TalonOne\Client\Model\LoyaltyProgram[]' ]; /** @@ -67,7 +67,7 @@ class InlineResponse20013 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'hasMore' => null, + 'totalResultSize' => null, 'data' => null ]; @@ -98,7 +98,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'hasMore' => 'hasMore', + 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -108,7 +108,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'hasMore' => 'setHasMore', + 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -118,7 +118,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'hasMore' => 'getHasMore', + 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -182,7 +182,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; + $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -195,8 +195,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['hasMore'] === null) { - $invalidProperties[] = "'hasMore' can't be null"; + if ($this->container['totalResultSize'] === null) { + $invalidProperties[] = "'totalResultSize' can't be null"; } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; @@ -217,25 +217,25 @@ public function valid() /** - * Gets hasMore + * Gets totalResultSize * - * @return bool + * @return int */ - public function getHasMore() + public function getTotalResultSize() { - return $this->container['hasMore']; + return $this->container['totalResultSize']; } /** - * Sets hasMore + * Sets totalResultSize * - * @param bool $hasMore hasMore + * @param int $totalResultSize totalResultSize * * @return $this */ - public function setHasMore($hasMore) + public function setTotalResultSize($totalResultSize) { - $this->container['hasMore'] = $hasMore; + $this->container['totalResultSize'] = $totalResultSize; return $this; } @@ -243,7 +243,7 @@ public function setHasMore($hasMore) /** * Gets data * - * @return \TalonOne\Client\Model\LoyaltyProgramTransaction[] + * @return \TalonOne\Client\Model\LoyaltyProgram[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\LoyaltyProgramTransaction[] $data data + * @param \TalonOne\Client\Model\LoyaltyProgram[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20014.php b/lib/Model/InlineResponse20014.php index d4ef33de..c3aeaf25 100644 --- a/lib/Model/InlineResponse20014.php +++ b/lib/Model/InlineResponse20014.php @@ -58,7 +58,7 @@ class InlineResponse20014 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'hasMore' => 'bool', - 'data' => '\TalonOne\Client\Model\LoyaltyCard[]' + 'data' => '\TalonOne\Client\Model\LoyaltyProgramTransaction[]' ]; /** @@ -243,7 +243,7 @@ public function setHasMore($hasMore) /** * Gets data * - * @return \TalonOne\Client\Model\LoyaltyCard[] + * @return \TalonOne\Client\Model\LoyaltyProgramTransaction[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\LoyaltyCard[] $data data + * @param \TalonOne\Client\Model\LoyaltyProgramTransaction[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20015.php b/lib/Model/InlineResponse20015.php index 72da2dea..adc1a93b 100644 --- a/lib/Model/InlineResponse20015.php +++ b/lib/Model/InlineResponse20015.php @@ -58,7 +58,7 @@ class InlineResponse20015 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'hasMore' => 'bool', - 'data' => '\TalonOne\Client\Model\CardLedgerTransactionLogEntry[]' + 'data' => '\TalonOne\Client\Model\LoyaltyCard[]' ]; /** @@ -229,7 +229,7 @@ public function getHasMore() /** * Sets hasMore * - * @param bool $hasMore true means there is more data in the source collection to request.. + * @param bool $hasMore hasMore * * @return $this */ @@ -243,7 +243,7 @@ public function setHasMore($hasMore) /** * Gets data * - * @return \TalonOne\Client\Model\CardLedgerTransactionLogEntry[] + * @return \TalonOne\Client\Model\LoyaltyCard[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\CardLedgerTransactionLogEntry[] $data List of loyalty card transaction logs. + * @param \TalonOne\Client\Model\LoyaltyCard[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20016.php b/lib/Model/InlineResponse20016.php index 72cc53ce..0098d075 100644 --- a/lib/Model/InlineResponse20016.php +++ b/lib/Model/InlineResponse20016.php @@ -58,8 +58,7 @@ class InlineResponse20016 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'hasMore' => 'bool', - 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\CollectionWithoutPayload[]' + 'data' => '\TalonOne\Client\Model\CardLedgerTransactionLogEntry[]' ]; /** @@ -69,7 +68,6 @@ class InlineResponse20016 implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'hasMore' => null, - 'totalResultSize' => null, 'data' => null ]; @@ -101,7 +99,6 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'hasMore' => 'hasMore', - 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -112,7 +109,6 @@ public static function openAPIFormats() */ protected static $setters = [ 'hasMore' => 'setHasMore', - 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -123,7 +119,6 @@ public static function openAPIFormats() */ protected static $getters = [ 'hasMore' => 'getHasMore', - 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -188,7 +183,6 @@ public function getModelName() public function __construct(array $data = null) { $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; - $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -201,6 +195,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['hasMore'] === null) { + $invalidProperties[] = "'hasMore' can't be null"; + } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -222,7 +219,7 @@ public function valid() /** * Gets hasMore * - * @return bool|null + * @return bool */ public function getHasMore() { @@ -232,7 +229,7 @@ public function getHasMore() /** * Sets hasMore * - * @param bool|null $hasMore hasMore + * @param bool $hasMore true means there is more data in the source collection to request.. * * @return $this */ @@ -243,34 +240,10 @@ public function setHasMore($hasMore) return $this; } - /** - * Gets totalResultSize - * - * @return int|null - */ - public function getTotalResultSize() - { - return $this->container['totalResultSize']; - } - - /** - * Sets totalResultSize - * - * @param int|null $totalResultSize totalResultSize - * - * @return $this - */ - public function setTotalResultSize($totalResultSize) - { - $this->container['totalResultSize'] = $totalResultSize; - - return $this; - } - /** * Gets data * - * @return \TalonOne\Client\Model\CollectionWithoutPayload[] + * @return \TalonOne\Client\Model\CardLedgerTransactionLogEntry[] */ public function getData() { @@ -280,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\CollectionWithoutPayload[] $data data + * @param \TalonOne\Client\Model\CardLedgerTransactionLogEntry[] $data List of loyalty card transaction logs. * * @return $this */ diff --git a/lib/Model/InlineResponse20017.php b/lib/Model/InlineResponse20017.php index fbd2f95b..8bb1ae5e 100644 --- a/lib/Model/InlineResponse20017.php +++ b/lib/Model/InlineResponse20017.php @@ -58,7 +58,8 @@ class InlineResponse20017 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'hasMore' => 'bool', - 'data' => '\TalonOne\Client\Model\CollectionItem[]' + 'totalResultSize' => 'int', + 'data' => '\TalonOne\Client\Model\CollectionWithoutPayload[]' ]; /** @@ -68,6 +69,7 @@ class InlineResponse20017 implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'hasMore' => null, + 'totalResultSize' => null, 'data' => null ]; @@ -99,6 +101,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'hasMore' => 'hasMore', + 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -109,6 +112,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'hasMore' => 'setHasMore', + 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -119,6 +123,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'hasMore' => 'getHasMore', + 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -183,6 +188,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; + $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -195,9 +201,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['hasMore'] === null) { - $invalidProperties[] = "'hasMore' can't be null"; - } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -219,7 +222,7 @@ public function valid() /** * Gets hasMore * - * @return bool + * @return bool|null */ public function getHasMore() { @@ -229,7 +232,7 @@ public function getHasMore() /** * Sets hasMore * - * @param bool $hasMore hasMore + * @param bool|null $hasMore hasMore * * @return $this */ @@ -240,10 +243,34 @@ public function setHasMore($hasMore) return $this; } + /** + * Gets totalResultSize + * + * @return int|null + */ + public function getTotalResultSize() + { + return $this->container['totalResultSize']; + } + + /** + * Sets totalResultSize + * + * @param int|null $totalResultSize totalResultSize + * + * @return $this + */ + public function setTotalResultSize($totalResultSize) + { + $this->container['totalResultSize'] = $totalResultSize; + + return $this; + } + /** * Gets data * - * @return \TalonOne\Client\Model\CollectionItem[] + * @return \TalonOne\Client\Model\CollectionWithoutPayload[] */ public function getData() { @@ -253,7 +280,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\CollectionItem[] $data data + * @param \TalonOne\Client\Model\CollectionWithoutPayload[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20018.php b/lib/Model/InlineResponse20018.php index ed65f0da..7e2fd06b 100644 --- a/lib/Model/InlineResponse20018.php +++ b/lib/Model/InlineResponse20018.php @@ -58,8 +58,7 @@ class InlineResponse20018 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'hasMore' => 'bool', - 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\Collection[]' + 'data' => '\TalonOne\Client\Model\CollectionItem[]' ]; /** @@ -69,7 +68,6 @@ class InlineResponse20018 implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'hasMore' => null, - 'totalResultSize' => null, 'data' => null ]; @@ -101,7 +99,6 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'hasMore' => 'hasMore', - 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -112,7 +109,6 @@ public static function openAPIFormats() */ protected static $setters = [ 'hasMore' => 'setHasMore', - 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -123,7 +119,6 @@ public static function openAPIFormats() */ protected static $getters = [ 'hasMore' => 'getHasMore', - 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -188,7 +183,6 @@ public function getModelName() public function __construct(array $data = null) { $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; - $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -201,6 +195,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['hasMore'] === null) { + $invalidProperties[] = "'hasMore' can't be null"; + } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -222,7 +219,7 @@ public function valid() /** * Gets hasMore * - * @return bool|null + * @return bool */ public function getHasMore() { @@ -232,7 +229,7 @@ public function getHasMore() /** * Sets hasMore * - * @param bool|null $hasMore hasMore + * @param bool $hasMore hasMore * * @return $this */ @@ -243,34 +240,10 @@ public function setHasMore($hasMore) return $this; } - /** - * Gets totalResultSize - * - * @return int|null - */ - public function getTotalResultSize() - { - return $this->container['totalResultSize']; - } - - /** - * Sets totalResultSize - * - * @param int|null $totalResultSize totalResultSize - * - * @return $this - */ - public function setTotalResultSize($totalResultSize) - { - $this->container['totalResultSize'] = $totalResultSize; - - return $this; - } - /** * Gets data * - * @return \TalonOne\Client\Model\Collection[] + * @return \TalonOne\Client\Model\CollectionItem[] */ public function getData() { @@ -280,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\Collection[] $data data + * @param \TalonOne\Client\Model\CollectionItem[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20031.php b/lib/Model/InlineResponse20031.php index a69fd571..1753fb80 100644 --- a/lib/Model/InlineResponse20031.php +++ b/lib/Model/InlineResponse20031.php @@ -58,8 +58,7 @@ class InlineResponse20031 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'hasMore' => 'bool', - 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\ApplicationReferee[]' + 'data' => '\TalonOne\Client\Model\AudienceAnalytics[]' ]; /** @@ -69,7 +68,6 @@ class InlineResponse20031 implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'hasMore' => null, - 'totalResultSize' => null, 'data' => null ]; @@ -101,7 +99,6 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'hasMore' => 'hasMore', - 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -112,7 +109,6 @@ public static function openAPIFormats() */ protected static $setters = [ 'hasMore' => 'setHasMore', - 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -123,7 +119,6 @@ public static function openAPIFormats() */ protected static $getters = [ 'hasMore' => 'getHasMore', - 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -188,7 +183,6 @@ public function getModelName() public function __construct(array $data = null) { $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; - $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -243,34 +237,10 @@ public function setHasMore($hasMore) return $this; } - /** - * Gets totalResultSize - * - * @return int|null - */ - public function getTotalResultSize() - { - return $this->container['totalResultSize']; - } - - /** - * Sets totalResultSize - * - * @param int|null $totalResultSize totalResultSize - * - * @return $this - */ - public function setTotalResultSize($totalResultSize) - { - $this->container['totalResultSize'] = $totalResultSize; - - return $this; - } - /** * Gets data * - * @return \TalonOne\Client\Model\ApplicationReferee[] + * @return \TalonOne\Client\Model\AudienceAnalytics[] */ public function getData() { @@ -280,7 +250,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\ApplicationReferee[] $data data + * @param \TalonOne\Client\Model\AudienceAnalytics[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20032.php b/lib/Model/InlineResponse20032.php index 08c69641..903d6c91 100644 --- a/lib/Model/InlineResponse20032.php +++ b/lib/Model/InlineResponse20032.php @@ -57,8 +57,8 @@ class InlineResponse20032 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\Attribute[]' + 'hasMore' => 'bool', + 'data' => '\TalonOne\Client\Model\CustomerProfile[]' ]; /** @@ -67,7 +67,7 @@ class InlineResponse20032 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'totalResultSize' => null, + 'hasMore' => null, 'data' => null ]; @@ -98,7 +98,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'totalResultSize' => 'totalResultSize', + 'hasMore' => 'hasMore', 'data' => 'data' ]; @@ -108,7 +108,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'totalResultSize' => 'setTotalResultSize', + 'hasMore' => 'setHasMore', 'data' => 'setData' ]; @@ -118,7 +118,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'totalResultSize' => 'getTotalResultSize', + 'hasMore' => 'getHasMore', 'data' => 'getData' ]; @@ -182,7 +182,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; + $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -195,9 +195,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['totalResultSize'] === null) { - $invalidProperties[] = "'totalResultSize' can't be null"; - } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -217,25 +214,25 @@ public function valid() /** - * Gets totalResultSize + * Gets hasMore * - * @return int + * @return bool|null */ - public function getTotalResultSize() + public function getHasMore() { - return $this->container['totalResultSize']; + return $this->container['hasMore']; } /** - * Sets totalResultSize + * Sets hasMore * - * @param int $totalResultSize totalResultSize + * @param bool|null $hasMore hasMore * * @return $this */ - public function setTotalResultSize($totalResultSize) + public function setHasMore($hasMore) { - $this->container['totalResultSize'] = $totalResultSize; + $this->container['hasMore'] = $hasMore; return $this; } @@ -243,7 +240,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\Attribute[] + * @return \TalonOne\Client\Model\CustomerProfile[] */ public function getData() { @@ -253,7 +250,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\Attribute[] $data data + * @param \TalonOne\Client\Model\CustomerProfile[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20033.php b/lib/Model/InlineResponse20033.php index 85b5df83..2c0d6fec 100644 --- a/lib/Model/InlineResponse20033.php +++ b/lib/Model/InlineResponse20033.php @@ -59,7 +59,7 @@ class InlineResponse20033 implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'hasMore' => 'bool', 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\CatalogItem[]' + 'data' => '\TalonOne\Client\Model\ApplicationReferee[]' ]; /** @@ -270,7 +270,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\CatalogItem[] + * @return \TalonOne\Client\Model\ApplicationReferee[] */ public function getData() { @@ -280,7 +280,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\CatalogItem[] $data data + * @param \TalonOne\Client\Model\ApplicationReferee[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20034.php b/lib/Model/InlineResponse20034.php index 7fbf0036..e087687e 100644 --- a/lib/Model/InlineResponse20034.php +++ b/lib/Model/InlineResponse20034.php @@ -58,7 +58,7 @@ class InlineResponse20034 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\AccountAdditionalCost[]' + 'data' => '\TalonOne\Client\Model\Attribute[]' ]; /** @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\AccountAdditionalCost[] + * @return \TalonOne\Client\Model\Attribute[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\AccountAdditionalCost[] $data data + * @param \TalonOne\Client\Model\Attribute[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20035.php b/lib/Model/InlineResponse20035.php index 760087e3..d93af5c5 100644 --- a/lib/Model/InlineResponse20035.php +++ b/lib/Model/InlineResponse20035.php @@ -57,8 +57,9 @@ class InlineResponse20035 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ + 'hasMore' => 'bool', 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[]' + 'data' => '\TalonOne\Client\Model\CatalogItem[]' ]; /** @@ -67,6 +68,7 @@ class InlineResponse20035 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ + 'hasMore' => null, 'totalResultSize' => null, 'data' => null ]; @@ -98,6 +100,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'hasMore' => 'hasMore', 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -108,6 +111,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'hasMore' => 'setHasMore', 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -118,6 +122,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'hasMore' => 'getHasMore', 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -182,6 +187,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -195,9 +201,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['totalResultSize'] === null) { - $invalidProperties[] = "'totalResultSize' can't be null"; - } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -216,10 +219,34 @@ public function valid() } + /** + * Gets hasMore + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['hasMore']; + } + + /** + * Sets hasMore + * + * @param bool|null $hasMore hasMore + * + * @return $this + */ + public function setHasMore($hasMore) + { + $this->container['hasMore'] = $hasMore; + + return $this; + } + /** * Gets totalResultSize * - * @return int + * @return int|null */ public function getTotalResultSize() { @@ -229,7 +256,7 @@ public function getTotalResultSize() /** * Sets totalResultSize * - * @param int $totalResultSize totalResultSize + * @param int|null $totalResultSize totalResultSize * * @return $this */ @@ -243,7 +270,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[] + * @return \TalonOne\Client\Model\CatalogItem[] */ public function getData() { @@ -253,7 +280,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[] $data data + * @param \TalonOne\Client\Model\CatalogItem[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20036.php b/lib/Model/InlineResponse20036.php index e5a9376c..77277735 100644 --- a/lib/Model/InlineResponse20036.php +++ b/lib/Model/InlineResponse20036.php @@ -58,7 +58,7 @@ class InlineResponse20036 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\WebhookActivationLogEntry[]' + 'data' => '\TalonOne\Client\Model\AccountAdditionalCost[]' ]; /** @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\WebhookActivationLogEntry[] + * @return \TalonOne\Client\Model\AccountAdditionalCost[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\WebhookActivationLogEntry[] $data data + * @param \TalonOne\Client\Model\AccountAdditionalCost[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20037.php b/lib/Model/InlineResponse20037.php index 9e6bcb60..51a5cbf9 100644 --- a/lib/Model/InlineResponse20037.php +++ b/lib/Model/InlineResponse20037.php @@ -58,7 +58,7 @@ class InlineResponse20037 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\WebhookLogEntry[]' + 'data' => '\TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[]' ]; /** @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\WebhookLogEntry[] + * @return \TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\WebhookLogEntry[] $data data + * @param \TalonOne\Client\Model\WebhookWithOutgoingIntegrationDetails[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20038.php b/lib/Model/InlineResponse20038.php index 5f6d709a..b6197a94 100644 --- a/lib/Model/InlineResponse20038.php +++ b/lib/Model/InlineResponse20038.php @@ -58,7 +58,7 @@ class InlineResponse20038 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\EventType[]' + 'data' => '\TalonOne\Client\Model\WebhookActivationLogEntry[]' ]; /** @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\EventType[] + * @return \TalonOne\Client\Model\WebhookActivationLogEntry[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\EventType[] $data data + * @param \TalonOne\Client\Model\WebhookActivationLogEntry[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20039.php b/lib/Model/InlineResponse20039.php index 088348c9..5d9ec9a6 100644 --- a/lib/Model/InlineResponse20039.php +++ b/lib/Model/InlineResponse20039.php @@ -58,7 +58,7 @@ class InlineResponse20039 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\User[]' + 'data' => '\TalonOne\Client\Model\WebhookLogEntry[]' ]; /** @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\User[] + * @return \TalonOne\Client\Model\WebhookLogEntry[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\User[] $data data + * @param \TalonOne\Client\Model\WebhookLogEntry[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20040.php b/lib/Model/InlineResponse20040.php index 0c852b71..b653c591 100644 --- a/lib/Model/InlineResponse20040.php +++ b/lib/Model/InlineResponse20040.php @@ -58,8 +58,7 @@ class InlineResponse20040 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'hasMore' => 'bool', - 'data' => '\TalonOne\Client\Model\Change[]' + 'data' => '\TalonOne\Client\Model\EventType[]' ]; /** @@ -69,7 +68,6 @@ class InlineResponse20040 implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'totalResultSize' => null, - 'hasMore' => null, 'data' => null ]; @@ -101,7 +99,6 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'totalResultSize' => 'totalResultSize', - 'hasMore' => 'hasMore', 'data' => 'data' ]; @@ -112,7 +109,6 @@ public static function openAPIFormats() */ protected static $setters = [ 'totalResultSize' => 'setTotalResultSize', - 'hasMore' => 'setHasMore', 'data' => 'setData' ]; @@ -123,7 +119,6 @@ public static function openAPIFormats() */ protected static $getters = [ 'totalResultSize' => 'getTotalResultSize', - 'hasMore' => 'getHasMore', 'data' => 'getData' ]; @@ -188,7 +183,6 @@ public function getModelName() public function __construct(array $data = null) { $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; - $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -201,6 +195,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['totalResultSize'] === null) { + $invalidProperties[] = "'totalResultSize' can't be null"; + } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -222,7 +219,7 @@ public function valid() /** * Gets totalResultSize * - * @return int|null + * @return int */ public function getTotalResultSize() { @@ -232,7 +229,7 @@ public function getTotalResultSize() /** * Sets totalResultSize * - * @param int|null $totalResultSize totalResultSize + * @param int $totalResultSize totalResultSize * * @return $this */ @@ -243,34 +240,10 @@ public function setTotalResultSize($totalResultSize) return $this; } - /** - * Gets hasMore - * - * @return bool|null - */ - public function getHasMore() - { - return $this->container['hasMore']; - } - - /** - * Sets hasMore - * - * @param bool|null $hasMore hasMore - * - * @return $this - */ - public function setHasMore($hasMore) - { - $this->container['hasMore'] = $hasMore; - - return $this; - } - /** * Gets data * - * @return \TalonOne\Client\Model\Change[] + * @return \TalonOne\Client\Model\EventType[] */ public function getData() { @@ -280,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\Change[] $data data + * @param \TalonOne\Client\Model\EventType[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20041.php b/lib/Model/InlineResponse20041.php index 62fe72bf..9406163c 100644 --- a/lib/Model/InlineResponse20041.php +++ b/lib/Model/InlineResponse20041.php @@ -58,7 +58,7 @@ class InlineResponse20041 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\Export[]' + 'data' => '\TalonOne\Client\Model\User[]' ]; /** @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\Export[] + * @return \TalonOne\Client\Model\User[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\Export[] $data data + * @param \TalonOne\Client\Model\User[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20042.php b/lib/Model/InlineResponse20042.php index f24181c9..da3bc7f1 100644 --- a/lib/Model/InlineResponse20042.php +++ b/lib/Model/InlineResponse20042.php @@ -58,7 +58,8 @@ class InlineResponse20042 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\Role[]' + 'hasMore' => 'bool', + 'data' => '\TalonOne\Client\Model\Change[]' ]; /** @@ -68,6 +69,7 @@ class InlineResponse20042 implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'totalResultSize' => null, + 'hasMore' => null, 'data' => null ]; @@ -99,6 +101,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'totalResultSize' => 'totalResultSize', + 'hasMore' => 'hasMore', 'data' => 'data' ]; @@ -109,6 +112,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'totalResultSize' => 'setTotalResultSize', + 'hasMore' => 'setHasMore', 'data' => 'setData' ]; @@ -119,6 +123,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'totalResultSize' => 'getTotalResultSize', + 'hasMore' => 'getHasMore', 'data' => 'getData' ]; @@ -183,6 +188,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; + $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -195,9 +201,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['totalResultSize'] === null) { - $invalidProperties[] = "'totalResultSize' can't be null"; - } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -219,7 +222,7 @@ public function valid() /** * Gets totalResultSize * - * @return int + * @return int|null */ public function getTotalResultSize() { @@ -229,7 +232,7 @@ public function getTotalResultSize() /** * Sets totalResultSize * - * @param int $totalResultSize totalResultSize + * @param int|null $totalResultSize totalResultSize * * @return $this */ @@ -240,10 +243,34 @@ public function setTotalResultSize($totalResultSize) return $this; } + /** + * Gets hasMore + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['hasMore']; + } + + /** + * Sets hasMore + * + * @param bool|null $hasMore hasMore + * + * @return $this + */ + public function setHasMore($hasMore) + { + $this->container['hasMore'] = $hasMore; + + return $this; + } + /** * Gets data * - * @return \TalonOne\Client\Model\Role[] + * @return \TalonOne\Client\Model\Change[] */ public function getData() { @@ -253,7 +280,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\Role[] $data data + * @param \TalonOne\Client\Model\Change[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20043.php b/lib/Model/InlineResponse20043.php index 7bce1784..e098301f 100644 --- a/lib/Model/InlineResponse20043.php +++ b/lib/Model/InlineResponse20043.php @@ -57,9 +57,8 @@ class InlineResponse20043 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'hasMore' => 'bool', 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\Store[]' + 'data' => '\TalonOne\Client\Model\Export[]' ]; /** @@ -68,7 +67,6 @@ class InlineResponse20043 implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'hasMore' => null, 'totalResultSize' => null, 'data' => null ]; @@ -100,7 +98,6 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'hasMore' => 'hasMore', 'totalResultSize' => 'totalResultSize', 'data' => 'data' ]; @@ -111,7 +108,6 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'hasMore' => 'setHasMore', 'totalResultSize' => 'setTotalResultSize', 'data' => 'setData' ]; @@ -122,7 +118,6 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'hasMore' => 'getHasMore', 'totalResultSize' => 'getTotalResultSize', 'data' => 'getData' ]; @@ -187,7 +182,6 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; $this->container['data'] = isset($data['data']) ? $data['data'] : null; } @@ -201,6 +195,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['totalResultSize'] === null) { + $invalidProperties[] = "'totalResultSize' can't be null"; + } if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } @@ -219,34 +216,10 @@ public function valid() } - /** - * Gets hasMore - * - * @return bool|null - */ - public function getHasMore() - { - return $this->container['hasMore']; - } - - /** - * Sets hasMore - * - * @param bool|null $hasMore hasMore - * - * @return $this - */ - public function setHasMore($hasMore) - { - $this->container['hasMore'] = $hasMore; - - return $this; - } - /** * Gets totalResultSize * - * @return int|null + * @return int */ public function getTotalResultSize() { @@ -256,7 +229,7 @@ public function getTotalResultSize() /** * Sets totalResultSize * - * @param int|null $totalResultSize totalResultSize + * @param int $totalResultSize totalResultSize * * @return $this */ @@ -270,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\Store[] + * @return \TalonOne\Client\Model\Export[] */ public function getData() { @@ -280,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\Store[] $data data + * @param \TalonOne\Client\Model\Export[] $data data * * @return $this */ diff --git a/lib/Model/InlineResponse20044.php b/lib/Model/InlineResponse20044.php new file mode 100644 index 00000000..db2979d4 --- /dev/null +++ b/lib/Model/InlineResponse20044.php @@ -0,0 +1,344 @@ + 'int', + 'data' => '\TalonOne\Client\Model\Role[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'totalResultSize' => null, + 'data' => 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 = [ + 'totalResultSize' => 'totalResultSize', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'totalResultSize' => 'setTotalResultSize', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'totalResultSize' => 'getTotalResultSize', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['totalResultSize'] === null) { + $invalidProperties[] = "'totalResultSize' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets totalResultSize + * + * @return int + */ + public function getTotalResultSize() + { + return $this->container['totalResultSize']; + } + + /** + * Sets totalResultSize + * + * @param int $totalResultSize totalResultSize + * + * @return $this + */ + public function setTotalResultSize($totalResultSize) + { + $this->container['totalResultSize'] = $totalResultSize; + + return $this; + } + + /** + * Gets data + * + * @return \TalonOne\Client\Model\Role[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \TalonOne\Client\Model\Role[] $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/InlineResponse20045.php b/lib/Model/InlineResponse20045.php new file mode 100644 index 00000000..e00d0f20 --- /dev/null +++ b/lib/Model/InlineResponse20045.php @@ -0,0 +1,371 @@ + 'bool', + 'totalResultSize' => 'int', + 'data' => '\TalonOne\Client\Model\Store[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'hasMore' => null, + 'totalResultSize' => null, + 'data' => 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 = [ + 'hasMore' => 'hasMore', + 'totalResultSize' => 'totalResultSize', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hasMore' => 'setHasMore', + 'totalResultSize' => 'setTotalResultSize', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hasMore' => 'getHasMore', + 'totalResultSize' => 'getTotalResultSize', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; + $this->container['totalResultSize'] = isset($data['totalResultSize']) ? $data['totalResultSize'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets hasMore + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['hasMore']; + } + + /** + * Sets hasMore + * + * @param bool|null $hasMore hasMore + * + * @return $this + */ + public function setHasMore($hasMore) + { + $this->container['hasMore'] = $hasMore; + + return $this; + } + + /** + * Gets totalResultSize + * + * @return int|null + */ + public function getTotalResultSize() + { + return $this->container['totalResultSize']; + } + + /** + * Sets totalResultSize + * + * @param int|null $totalResultSize totalResultSize + * + * @return $this + */ + public function setTotalResultSize($totalResultSize) + { + $this->container['totalResultSize'] = $totalResultSize; + + return $this; + } + + /** + * Gets data + * + * @return \TalonOne\Client\Model\Store[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \TalonOne\Client\Model\Store[] $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/InlineResponse20046.php b/lib/Model/InlineResponse20046.php new file mode 100644 index 00000000..8e7485bc --- /dev/null +++ b/lib/Model/InlineResponse20046.php @@ -0,0 +1,341 @@ + 'bool', + 'data' => '\TalonOne\Client\Model\Achievement[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'hasMore' => null, + 'data' => 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 = [ + 'hasMore' => 'hasMore', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hasMore' => 'setHasMore', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hasMore' => 'getHasMore', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets hasMore + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['hasMore']; + } + + /** + * Sets hasMore + * + * @param bool|null $hasMore hasMore + * + * @return $this + */ + public function setHasMore($hasMore) + { + $this->container['hasMore'] = $hasMore; + + return $this; + } + + /** + * Gets data + * + * @return \TalonOne\Client\Model\Achievement[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \TalonOne\Client\Model\Achievement[] $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/InlineResponse20047.php b/lib/Model/InlineResponse20047.php new file mode 100644 index 00000000..56de5daa --- /dev/null +++ b/lib/Model/InlineResponse20047.php @@ -0,0 +1,344 @@ + 'bool', + 'data' => '\TalonOne\Client\Model\AchievementProgress[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'hasMore' => null, + 'data' => 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 = [ + 'hasMore' => 'hasMore', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hasMore' => 'setHasMore', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hasMore' => 'getHasMore', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hasMore'] = isset($data['hasMore']) ? $data['hasMore'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hasMore'] === null) { + $invalidProperties[] = "'hasMore' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets hasMore + * + * @return bool + */ + public function getHasMore() + { + return $this->container['hasMore']; + } + + /** + * Sets hasMore + * + * @param bool $hasMore hasMore + * + * @return $this + */ + public function setHasMore($hasMore) + { + $this->container['hasMore'] = $hasMore; + + return $this; + } + + /** + * Gets data + * + * @return \TalonOne\Client\Model\AchievementProgress[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \TalonOne\Client\Model\AchievementProgress[] $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/IntegrationCoupon.php b/lib/Model/IntegrationCoupon.php index 09487f69..4ecdad15 100644 --- a/lib/Model/IntegrationCoupon.php +++ b/lib/Model/IntegrationCoupon.php @@ -308,7 +308,7 @@ public function __construct(array $data = null) $this->container['importId'] = isset($data['importId']) ? $data['importId'] : null; $this->container['reservation'] = isset($data['reservation']) ? $data['reservation'] : true; $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null; - $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : true; + $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : false; $this->container['implicitlyReserved'] = isset($data['implicitlyReserved']) ? $data['implicitlyReserved'] : null; $this->container['profileRedemptionCount'] = isset($data['profileRedemptionCount']) ? $data['profileRedemptionCount'] : null; } diff --git a/lib/Model/InventoryCoupon.php b/lib/Model/InventoryCoupon.php index 9666810e..e4b4ec37 100644 --- a/lib/Model/InventoryCoupon.php +++ b/lib/Model/InventoryCoupon.php @@ -313,7 +313,7 @@ public function __construct(array $data = null) $this->container['importId'] = isset($data['importId']) ? $data['importId'] : null; $this->container['reservation'] = isset($data['reservation']) ? $data['reservation'] : true; $this->container['batchId'] = isset($data['batchId']) ? $data['batchId'] : null; - $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : true; + $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : false; $this->container['implicitlyReserved'] = isset($data['implicitlyReserved']) ? $data['implicitlyReserved'] : null; $this->container['profileRedemptionCount'] = isset($data['profileRedemptionCount']) ? $data['profileRedemptionCount'] : null; $this->container['state'] = isset($data['state']) ? $data['state'] : null; @@ -997,7 +997,7 @@ public function getState() /** * Sets state * - * @param string $state Can be: - `active`: The coupon can be used. It is a reserved coupon that is neither pending, used nor expired, and has a non-exhausted limit counter. - `used`: The coupon has been redeemed and cannot be used again. It is not pending and has reached its redemption limit or was redeemed by the profile before expiration. - `expired`: The coupon was never redeemed and it is now expired. It is non-pending, non-active and non-used by the profile. - `pending`: The coupon will be usable in the future. - `disabled`: The coupon is part of a non-active campaign. + * @param string $state Can be: - `active`: The coupon can be used. It is a reserved coupon that is not pending, used, or expired, and it has a non-exhausted limit counter. **Note:** This coupon state is returned for [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule), but the coupon cannot be used until the campaign is **running**. - `used`: The coupon has been redeemed and cannot be used again. It is not pending and has reached its redemption limit or was redeemed by the profile before expiration. - `expired`: The coupon was never redeemed, and it is now expired. It is non-pending, non-active, and non-used by the profile. - `pending`: The coupon will be usable in the future. - `disabled`: The coupon is part of a non-active campaign. * * @return $this */ diff --git a/lib/Model/LoginParams.php b/lib/Model/LoginParams.php index 88ceabc2..4182f815 100644 --- a/lib/Model/LoginParams.php +++ b/lib/Model/LoginParams.php @@ -230,7 +230,7 @@ public function getEmail() /** * Sets email * - * @param string $email The email address associated with your account. + * @param string $email The email address associated with the user profile. * * @return $this */ diff --git a/lib/Model/LoyaltyLedgerTransactions.php b/lib/Model/LoyaltyLedgerTransactions.php index a4d2288f..6f1ece37 100644 --- a/lib/Model/LoyaltyLedgerTransactions.php +++ b/lib/Model/LoyaltyLedgerTransactions.php @@ -224,7 +224,7 @@ public function getHasMore() /** * Sets hasMore * - * @param bool|null $hasMore true means there is more data in the source collection to request. + * @param bool|null $hasMore If `true`, it means that there is more data to request in the source collection. * * @return $this */ diff --git a/lib/Model/LoyaltyProgram.php b/lib/Model/LoyaltyProgram.php index 0a59dc86..8bbaedf6 100644 --- a/lib/Model/LoyaltyProgram.php +++ b/lib/Model/LoyaltyProgram.php @@ -68,14 +68,17 @@ class LoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'tiersExpirationPolicy' => 'string', 'tiersExpireIn' => 'string', 'tiersDowngradePolicy' => 'string', + 'programJoinPolicy' => 'string', 'accountID' => 'int', 'name' => 'string', 'tiers' => '\TalonOne\Client\Model\LoyaltyTier[]', 'timezone' => 'string', 'cardBased' => 'bool', 'canUpdateTiers' => 'bool', + 'canUpdateJoinPolicy' => 'bool', 'canUpgradeToAdvancedTiers' => 'bool' ]; @@ -95,14 +98,17 @@ class LoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'tiersExpirationPolicy' => null, 'tiersExpireIn' => null, 'tiersDowngradePolicy' => null, + 'programJoinPolicy' => null, 'accountID' => null, 'name' => null, 'tiers' => null, 'timezone' => null, 'cardBased' => null, 'canUpdateTiers' => null, + 'canUpdateJoinPolicy' => null, 'canUpgradeToAdvancedTiers' => null ]; @@ -143,14 +149,17 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'tiersExpirationPolicy' => 'tiersExpirationPolicy', 'tiersExpireIn' => 'tiersExpireIn', 'tiersDowngradePolicy' => 'tiersDowngradePolicy', + 'programJoinPolicy' => 'programJoinPolicy', 'accountID' => 'accountID', 'name' => 'name', 'tiers' => 'tiers', 'timezone' => 'timezone', 'cardBased' => 'cardBased', 'canUpdateTiers' => 'canUpdateTiers', + 'canUpdateJoinPolicy' => 'canUpdateJoinPolicy', 'canUpgradeToAdvancedTiers' => 'canUpgradeToAdvancedTiers' ]; @@ -170,14 +179,17 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', 'tiersExpireIn' => 'setTiersExpireIn', 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', + 'programJoinPolicy' => 'setProgramJoinPolicy', 'accountID' => 'setAccountID', 'name' => 'setName', 'tiers' => 'setTiers', 'timezone' => 'setTimezone', 'cardBased' => 'setCardBased', 'canUpdateTiers' => 'setCanUpdateTiers', + 'canUpdateJoinPolicy' => 'setCanUpdateJoinPolicy', 'canUpgradeToAdvancedTiers' => 'setCanUpgradeToAdvancedTiers' ]; @@ -197,14 +209,17 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', 'tiersExpireIn' => 'getTiersExpireIn', 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', + 'programJoinPolicy' => 'getProgramJoinPolicy', 'accountID' => 'getAccountID', 'name' => 'getName', 'tiers' => 'getTiers', 'timezone' => 'getTimezone', 'cardBased' => 'getCardBased', 'canUpdateTiers' => 'getCanUpdateTiers', + 'canUpdateJoinPolicy' => 'getCanUpdateJoinPolicy', 'canUpgradeToAdvancedTiers' => 'getCanUpgradeToAdvancedTiers' ]; @@ -249,11 +264,29 @@ public function getModelName() return self::$openAPIModelName; } + const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; + const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; 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'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTiersExpirationPolicyAllowableValues() + { + return [ + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + ]; + } + /** * Gets allowable values of the enum * @@ -267,6 +300,20 @@ public function getTiersDowngradePolicyAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getProgramJoinPolicyAllowableValues() + { + return [ + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + ]; + } + /** * Associative array for storing property values @@ -293,14 +340,17 @@ 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['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : 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['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; $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : 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['canUpgradeToAdvancedTiers'] = isset($data['canUpgradeToAdvancedTiers']) ? $data['canUpgradeToAdvancedTiers'] : false; } @@ -344,6 +394,14 @@ public function listInvalidProperties() if ($this->container['sandbox'] === null) { $invalidProperties[] = "'sandbox' can't be null"; } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersDowngradePolicyAllowableValues(); if (!is_null($this->container['tiersDowngradePolicy']) && !in_array($this->container['tiersDowngradePolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -352,6 +410,14 @@ 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"; } @@ -628,6 +694,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets tiersExpirationPolicy + * + * @return string|null + */ + public function getTiersExpirationPolicy() + { + return $this->container['tiersExpirationPolicy']; + } + + /** + * 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. + * + * @return $this + */ + public function setTiersExpirationPolicy($tiersExpirationPolicy) + { + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($tiersExpirationPolicy) && !in_array($tiersExpirationPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['tiersExpirationPolicy'] = $tiersExpirationPolicy; + + return $this; + } + /** * Gets tiersExpireIn * @@ -641,7 +740,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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. 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 */ @@ -685,6 +784,39 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) 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 accountID * @@ -834,6 +966,30 @@ public function setCanUpdateTiers($canUpdateTiers) return $this; } + /** + * Gets canUpdateJoinPolicy + * + * @return bool|null + */ + public function getCanUpdateJoinPolicy() + { + return $this->container['canUpdateJoinPolicy']; + } + + /** + * 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`. + * + * @return $this + */ + public function setCanUpdateJoinPolicy($canUpdateJoinPolicy) + { + $this->container['canUpdateJoinPolicy'] = $canUpdateJoinPolicy; + + return $this; + } + /** * Gets canUpgradeToAdvancedTiers * diff --git a/lib/Model/LoyaltyProgramLedgers.php b/lib/Model/LoyaltyProgramLedgers.php index 1683aee2..46a268a9 100644 --- a/lib/Model/LoyaltyProgramLedgers.php +++ b/lib/Model/LoyaltyProgramLedgers.php @@ -61,6 +61,7 @@ class LoyaltyProgramLedgers implements ModelInterface, ArrayAccess 'id' => 'int', 'title' => 'string', 'name' => 'string', + 'joinDate' => '\DateTime', 'ledger' => '\TalonOne\Client\Model\LedgerInfo', 'subLedgers' => 'map[string,\TalonOne\Client\Model\LedgerInfo]' ]; @@ -74,6 +75,7 @@ class LoyaltyProgramLedgers implements ModelInterface, ArrayAccess 'id' => null, 'title' => null, 'name' => null, + 'joinDate' => 'date-time', 'ledger' => null, 'subLedgers' => null ]; @@ -108,6 +110,7 @@ public static function openAPIFormats() 'id' => 'id', 'title' => 'title', 'name' => 'name', + 'joinDate' => 'joinDate', 'ledger' => 'ledger', 'subLedgers' => 'subLedgers' ]; @@ -121,6 +124,7 @@ public static function openAPIFormats() 'id' => 'setId', 'title' => 'setTitle', 'name' => 'setName', + 'joinDate' => 'setJoinDate', 'ledger' => 'setLedger', 'subLedgers' => 'setSubLedgers' ]; @@ -134,6 +138,7 @@ public static function openAPIFormats() 'id' => 'getId', 'title' => 'getTitle', 'name' => 'getName', + 'joinDate' => 'getJoinDate', 'ledger' => 'getLedger', 'subLedgers' => 'getSubLedgers' ]; @@ -201,6 +206,7 @@ public function __construct(array $data = null) $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['title'] = isset($data['title']) ? $data['title'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['joinDate'] = isset($data['joinDate']) ? $data['joinDate'] : null; $this->container['ledger'] = isset($data['ledger']) ? $data['ledger'] : null; $this->container['subLedgers'] = isset($data['subLedgers']) ? $data['subLedgers'] : null; } @@ -313,6 +319,30 @@ public function setName($name) return $this; } + /** + * Gets joinDate + * + * @return \DateTime|null + */ + public function getJoinDate() + { + return $this->container['joinDate']; + } + + /** + * Sets joinDate + * + * @param \DateTime|null $joinDate The date on which the customer joined the loyalty program in RFC3339. **Note**: This is in the loyalty program's time zone. + * + * @return $this + */ + public function setJoinDate($joinDate) + { + $this->container['joinDate'] = $joinDate; + + return $this; + } + /** * Gets ledger * diff --git a/lib/Model/LoyaltyProgramTransaction.php b/lib/Model/LoyaltyProgramTransaction.php index fc65d356..c636fa5d 100644 --- a/lib/Model/LoyaltyProgramTransaction.php +++ b/lib/Model/LoyaltyProgramTransaction.php @@ -59,6 +59,7 @@ class LoyaltyProgramTransaction implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'int', 'programId' => 'int', + 'campaignId' => 'int', 'created' => '\DateTime', 'type' => 'string', 'amount' => 'float', @@ -84,6 +85,7 @@ class LoyaltyProgramTransaction implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'programId' => null, + 'campaignId' => null, 'created' => 'date-time', 'type' => null, 'amount' => null, @@ -130,6 +132,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'programId' => 'programId', + 'campaignId' => 'campaignId', 'created' => 'created', 'type' => 'type', 'amount' => 'amount', @@ -155,6 +158,7 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'programId' => 'setProgramId', + 'campaignId' => 'setCampaignId', 'created' => 'setCreated', 'type' => 'setType', 'amount' => 'setAmount', @@ -180,6 +184,7 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'programId' => 'getProgramId', + 'campaignId' => 'getCampaignId', 'created' => 'getCreated', 'type' => 'getType', 'amount' => 'getAmount', @@ -274,6 +279,7 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['programId'] = isset($data['programId']) ? $data['programId'] : null; + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; $this->container['created'] = isset($data['created']) ? $data['created'] : null; $this->container['type'] = isset($data['type']) ? $data['type'] : null; $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; @@ -426,6 +432,30 @@ public function setProgramId($programId) return $this; } + /** + * Gets campaignId + * + * @return int|null + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int|null $campaignId ID of the campaign. + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + /** * Gets created * diff --git a/lib/Model/MessageLogEntries.php b/lib/Model/MessageLogEntries.php new file mode 100644 index 00000000..c8458862 --- /dev/null +++ b/lib/Model/MessageLogEntries.php @@ -0,0 +1,350 @@ + 'string', + 'data' => '\TalonOne\Client\Model\MessageLogEntry[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'nextCursor' => 'byte', + 'data' => 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 = [ + 'nextCursor' => 'nextCursor', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nextCursor' => 'setNextCursor', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nextCursor' => 'getNextCursor', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['nextCursor'] = isset($data['nextCursor']) ? $data['nextCursor'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['nextCursor']) && !preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['nextCursor'])) { + $invalidProperties[] = "invalid value for 'nextCursor', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nextCursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['nextCursor']; + } + + /** + * Sets nextCursor + * + * @param string|null $nextCursor The next value in the database. **Note:** If this value is not present, it means that there are no more values in the database for this combination of request parameters. + * + * @return $this + */ + public function setNextCursor($nextCursor) + { + + if (!is_null($nextCursor) && (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $nextCursor))) { + throw new \InvalidArgumentException("invalid value for $nextCursor when calling MessageLogEntries., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); + } + + $this->container['nextCursor'] = $nextCursor; + + return $this; + } + + /** + * Gets data + * + * @return \TalonOne\Client\Model\MessageLogEntry[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \TalonOne\Client\Model\MessageLogEntry[] $data List of message logs. + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/MessageLogEntry.php b/lib/Model/MessageLogEntry.php new file mode 100644 index 00000000..2350249b --- /dev/null +++ b/lib/Model/MessageLogEntry.php @@ -0,0 +1,700 @@ + 'string', + 'service' => 'string', + 'changeType' => 'string', + 'notificationId' => 'int', + 'notificationName' => 'string', + 'request' => '\TalonOne\Client\Model\MessageLogRequest', + 'response' => '\TalonOne\Client\Model\MessageLogResponse', + 'createdAt' => '\DateTime', + 'entityType' => 'string', + 'url' => 'string', + 'applicationId' => 'int', + 'loyaltyProgramId' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'service' => null, + 'changeType' => null, + 'notificationId' => null, + 'notificationName' => null, + 'request' => null, + 'response' => null, + 'createdAt' => 'date-time', + 'entityType' => null, + 'url' => null, + 'applicationId' => null, + 'loyaltyProgramId' => 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', + 'service' => 'service', + 'changeType' => 'changeType', + 'notificationId' => 'notificationId', + 'notificationName' => 'notificationName', + 'request' => 'request', + 'response' => 'response', + 'createdAt' => 'createdAt', + 'entityType' => 'entityType', + 'url' => 'url', + 'applicationId' => 'applicationId', + 'loyaltyProgramId' => 'loyaltyProgramId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'service' => 'setService', + 'changeType' => 'setChangeType', + 'notificationId' => 'setNotificationId', + 'notificationName' => 'setNotificationName', + 'request' => 'setRequest', + 'response' => 'setResponse', + 'createdAt' => 'setCreatedAt', + 'entityType' => 'setEntityType', + 'url' => 'setUrl', + 'applicationId' => 'setApplicationId', + 'loyaltyProgramId' => 'setLoyaltyProgramId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'service' => 'getService', + 'changeType' => 'getChangeType', + 'notificationId' => 'getNotificationId', + 'notificationName' => 'getNotificationName', + 'request' => 'getRequest', + 'response' => 'getResponse', + 'createdAt' => 'getCreatedAt', + 'entityType' => 'getEntityType', + 'url' => 'getUrl', + 'applicationId' => 'getApplicationId', + 'loyaltyProgramId' => 'getLoyaltyProgramId' + ]; + + /** + * 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 ENTITY_TYPE_APPLICATION = 'application'; + const ENTITY_TYPE_LOYALTY_PROGRAM = 'loyalty_program'; + const ENTITY_TYPE_WEBHOOK = 'webhook'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEntityTypeAllowableValues() + { + return [ + self::ENTITY_TYPE_APPLICATION, + self::ENTITY_TYPE_LOYALTY_PROGRAM, + self::ENTITY_TYPE_WEBHOOK, + ]; + } + + + /** + * 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['service'] = isset($data['service']) ? $data['service'] : null; + $this->container['changeType'] = isset($data['changeType']) ? $data['changeType'] : null; + $this->container['notificationId'] = isset($data['notificationId']) ? $data['notificationId'] : null; + $this->container['notificationName'] = isset($data['notificationName']) ? $data['notificationName'] : null; + $this->container['request'] = isset($data['request']) ? $data['request'] : null; + $this->container['response'] = isset($data['response']) ? $data['response'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['entityType'] = isset($data['entityType']) ? $data['entityType'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['applicationId'] = isset($data['applicationId']) ? $data['applicationId'] : null; + $this->container['loyaltyProgramId'] = isset($data['loyaltyProgramId']) ? $data['loyaltyProgramId'] : 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['service'] === null) { + $invalidProperties[] = "'service' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!is_null($this->container['entityType']) && !in_array($this->container['entityType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'entityType', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['applicationId']) && ($this->container['applicationId'] < 1)) { + $invalidProperties[] = "invalid value for 'applicationId', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['loyaltyProgramId']) && ($this->container['loyaltyProgramId'] < 1)) { + $invalidProperties[] = "invalid value for 'loyaltyProgramId', 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of the message. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets service + * + * @return string + */ + public function getService() + { + return $this->container['service']; + } + + /** + * Sets service + * + * @param string $service Name of the service that generated the log entry. + * + * @return $this + */ + public function setService($service) + { + $this->container['service'] = $service; + + return $this; + } + + /** + * Gets changeType + * + * @return string|null + */ + public function getChangeType() + { + return $this->container['changeType']; + } + + /** + * Sets changeType + * + * @param string|null $changeType Type of change that triggered the notification. + * + * @return $this + */ + public function setChangeType($changeType) + { + $this->container['changeType'] = $changeType; + + return $this; + } + + /** + * Gets notificationId + * + * @return int|null + */ + public function getNotificationId() + { + return $this->container['notificationId']; + } + + /** + * Sets notificationId + * + * @param int|null $notificationId ID of the notification. + * + * @return $this + */ + public function setNotificationId($notificationId) + { + $this->container['notificationId'] = $notificationId; + + return $this; + } + + /** + * Gets notificationName + * + * @return string|null + */ + public function getNotificationName() + { + return $this->container['notificationName']; + } + + /** + * Sets notificationName + * + * @param string|null $notificationName The name of the notification. + * + * @return $this + */ + public function setNotificationName($notificationName) + { + $this->container['notificationName'] = $notificationName; + + return $this; + } + + /** + * Gets request + * + * @return \TalonOne\Client\Model\MessageLogRequest|null + */ + public function getRequest() + { + return $this->container['request']; + } + + /** + * Sets request + * + * @param \TalonOne\Client\Model\MessageLogRequest|null $request request + * + * @return $this + */ + public function setRequest($request) + { + $this->container['request'] = $request; + + return $this; + } + + /** + * Gets response + * + * @return \TalonOne\Client\Model\MessageLogResponse|null + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param \TalonOne\Client\Model\MessageLogResponse|null $response response + * + * @return $this + */ + public function setResponse($response) + { + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp when the log entry was created. + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets entityType + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param string|null $entityType The entity type the log is related to. + * + * @return $this + */ + public function setEntityType($entityType) + { + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!is_null($entityType) && !in_array($entityType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'entityType', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The target URL of the request. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets applicationId + * + * @return int|null + */ + public function getApplicationId() + { + return $this->container['applicationId']; + } + + /** + * Sets applicationId + * + * @param int|null $applicationId Identifier of the Application. + * + * @return $this + */ + public function setApplicationId($applicationId) + { + + if (!is_null($applicationId) && ($applicationId < 1)) { + throw new \InvalidArgumentException('invalid value for $applicationId when calling MessageLogEntry., must be bigger than or equal to 1.'); + } + + $this->container['applicationId'] = $applicationId; + + return $this; + } + + /** + * Gets loyaltyProgramId + * + * @return int|null + */ + public function getLoyaltyProgramId() + { + return $this->container['loyaltyProgramId']; + } + + /** + * Sets loyaltyProgramId + * + * @param int|null $loyaltyProgramId Identifier of the loyalty program. + * + * @return $this + */ + public function setLoyaltyProgramId($loyaltyProgramId) + { + + if (!is_null($loyaltyProgramId) && ($loyaltyProgramId < 1)) { + throw new \InvalidArgumentException('invalid value for $loyaltyProgramId when calling MessageLogEntry., must be bigger than or equal to 1.'); + } + + $this->container['loyaltyProgramId'] = $loyaltyProgramId; + + 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/MessageLogRequest.php b/lib/Model/MessageLogRequest.php new file mode 100644 index 00000000..c3fb3e73 --- /dev/null +++ b/lib/Model/MessageLogRequest.php @@ -0,0 +1,354 @@ + '\DateTime', + 'request' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time', + 'request' => 'byte' + ]; + + /** + * 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 = [ + 'createdAt' => 'createdAt', + 'request' => 'request' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'request' => 'setRequest' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'request' => 'getRequest' + ]; + + /** + * 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['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['request'] = isset($data['request']) ? $data['request'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['request'] === null) { + $invalidProperties[] = "'request' can't be null"; + } + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['request'])) { + $invalidProperties[] = "invalid value for 'request', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + } + + 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp when the request was made. + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets request + * + * @return string + */ + public function getRequest() + { + return $this->container['request']; + } + + /** + * Sets request + * + * @param string $request Raw request data. + * + * @return $this + */ + public function setRequest($request) + { + + if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $request))) { + throw new \InvalidArgumentException("invalid value for $request when calling MessageLogRequest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); + } + + $this->container['request'] = $request; + + 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/MessageLogResponse.php b/lib/Model/MessageLogResponse.php new file mode 100644 index 00000000..1a13459e --- /dev/null +++ b/lib/Model/MessageLogResponse.php @@ -0,0 +1,387 @@ + '\DateTime', + 'response' => 'string', + 'status' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time', + 'response' => 'byte', + '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 = [ + 'createdAt' => 'createdAt', + 'response' => 'response', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'response' => 'setResponse', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'response' => 'getResponse', + '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; + } + + + + + + /** + * 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['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['response'] = isset($data['response']) ? $data['response'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + 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'])) { + $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; + } + + /** + * 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Timestamp when the response was received. + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets response + * + * @return string + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param string $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))) { + 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}=)?$/."); + } + + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int $status HTTP status code of the response. + * + * @return $this + */ + public function setStatus($status) + { + $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/NewAccountSignUp.php b/lib/Model/NewAccountSignUp.php index aa6219ce..8d574bf3 100644 --- a/lib/Model/NewAccountSignUp.php +++ b/lib/Model/NewAccountSignUp.php @@ -243,7 +243,7 @@ public function getEmail() /** * Sets email * - * @param string $email The email address associated with your account. + * @param string $email The email address associated with the user profile. * * @return $this */ diff --git a/lib/Model/NewApplicationAPIKey.php b/lib/Model/NewApplicationAPIKey.php index 87f42a51..1436721a 100644 --- a/lib/Model/NewApplicationAPIKey.php +++ b/lib/Model/NewApplicationAPIKey.php @@ -61,6 +61,8 @@ class NewApplicationAPIKey implements ModelInterface, ArrayAccess 'title' => 'string', 'expires' => '\DateTime', 'platform' => 'string', + 'type' => 'string', + 'timeOffset' => 'int', 'id' => 'int', 'createdBy' => 'int', 'accountID' => 'int', @@ -78,6 +80,8 @@ class NewApplicationAPIKey implements ModelInterface, ArrayAccess 'title' => null, 'expires' => 'date-time', 'platform' => null, + 'type' => null, + 'timeOffset' => null, 'id' => null, 'createdBy' => null, 'accountID' => null, @@ -116,6 +120,8 @@ public static function openAPIFormats() 'title' => 'title', 'expires' => 'expires', 'platform' => 'platform', + 'type' => 'type', + 'timeOffset' => 'timeOffset', 'id' => 'id', 'createdBy' => 'createdBy', 'accountID' => 'accountID', @@ -133,6 +139,8 @@ public static function openAPIFormats() 'title' => 'setTitle', 'expires' => 'setExpires', 'platform' => 'setPlatform', + 'type' => 'setType', + 'timeOffset' => 'setTimeOffset', 'id' => 'setId', 'createdBy' => 'setCreatedBy', 'accountID' => 'setAccountID', @@ -150,6 +158,8 @@ public static function openAPIFormats() 'title' => 'getTitle', 'expires' => 'getExpires', 'platform' => 'getPlatform', + 'type' => 'getType', + 'timeOffset' => 'getTimeOffset', 'id' => 'getId', 'createdBy' => 'getCreatedBy', 'accountID' => 'getAccountID', @@ -208,6 +218,8 @@ public function getModelName() const PLATFORM_CUSTOMER_ENGAGEMENT = 'customer_engagement'; const PLATFORM_CUSTOMER_DATA = 'customer_data'; const PLATFORM_SALESFORCE = 'salesforce'; + const PLATFORM_EMARSYS = 'emarsys'; + const TYPE_STAGING = 'staging'; @@ -228,6 +240,19 @@ public function getPlatformAllowableValues() self::PLATFORM_CUSTOMER_ENGAGEMENT, self::PLATFORM_CUSTOMER_DATA, self::PLATFORM_SALESFORCE, + self::PLATFORM_EMARSYS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_STAGING, ]; } @@ -250,6 +275,8 @@ public function __construct(array $data = null) $this->container['title'] = isset($data['title']) ? $data['title'] : null; $this->container['expires'] = isset($data['expires']) ? $data['expires'] : null; $this->container['platform'] = isset($data['platform']) ? $data['platform'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['timeOffset'] = isset($data['timeOffset']) ? $data['timeOffset'] : null; $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['createdBy'] = isset($data['createdBy']) ? $data['createdBy'] : null; $this->container['accountID'] = isset($data['accountID']) ? $data['accountID'] : null; @@ -281,6 +308,14 @@ public function listInvalidProperties() ); } + $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['id'] === null) { $invalidProperties[] = "'id' can't be null"; } @@ -327,7 +362,7 @@ public function getTitle() /** * Sets title * - * @param string $title Title for API Key. + * @param string $title Title of the API key. * * @return $this */ @@ -351,7 +386,7 @@ public function getExpires() /** * Sets expires * - * @param \DateTime $expires The date the API key expired. + * @param \DateTime $expires The date the API key expires. * * @return $this */ @@ -395,6 +430,63 @@ public function setPlatform($platform) return $this; } + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The API key type. Can be empty or `staging`. Staging API keys can only be used for dry requests with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint, [Update customer profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint, and [Track event](https://docs.talon.one/integration-api#tag/Events/operation/trackEventV2) endpoint. When using the _Update customer profile_ endpoint with a staging API key, the query parameter `runRuleEngine` must be `true`. + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !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 timeOffset + * + * @return int|null + */ + public function getTimeOffset() + { + return $this->container['timeOffset']; + } + + /** + * Sets timeOffset + * + * @param int|null $timeOffset A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. + * + * @return $this + */ + public function setTimeOffset($timeOffset) + { + $this->container['timeOffset'] = $timeOffset; + + return $this; + } + /** * Gets id * diff --git a/lib/Model/NewCampaign.php b/lib/Model/NewCampaign.php index c27f55bd..5d92fbd4 100644 --- a/lib/Model/NewCampaign.php +++ b/lib/Model/NewCampaign.php @@ -71,9 +71,9 @@ class NewCampaign implements ModelInterface, ArrayAccess 'referralSettings' => '\TalonOne\Client\Model\CodeGeneratorSettings', 'limits' => '\TalonOne\Client\Model\LimitConfig[]', 'campaignGroups' => 'int[]', - 'evaluationGroupId' => 'int', 'type' => 'string', - 'linkedStoreIds' => 'int[]' + 'linkedStoreIds' => 'int[]', + 'evaluationGroupId' => 'int' ]; /** @@ -95,9 +95,9 @@ class NewCampaign implements ModelInterface, ArrayAccess 'referralSettings' => null, 'limits' => null, 'campaignGroups' => null, - 'evaluationGroupId' => null, 'type' => null, - 'linkedStoreIds' => null + 'linkedStoreIds' => null, + 'evaluationGroupId' => null ]; /** @@ -140,9 +140,9 @@ public static function openAPIFormats() 'referralSettings' => 'referralSettings', 'limits' => 'limits', 'campaignGroups' => 'campaignGroups', - 'evaluationGroupId' => 'evaluationGroupId', 'type' => 'type', - 'linkedStoreIds' => 'linkedStoreIds' + 'linkedStoreIds' => 'linkedStoreIds', + 'evaluationGroupId' => 'evaluationGroupId' ]; /** @@ -164,9 +164,9 @@ public static function openAPIFormats() 'referralSettings' => 'setReferralSettings', 'limits' => 'setLimits', 'campaignGroups' => 'setCampaignGroups', - 'evaluationGroupId' => 'setEvaluationGroupId', 'type' => 'setType', - 'linkedStoreIds' => 'setLinkedStoreIds' + 'linkedStoreIds' => 'setLinkedStoreIds', + 'evaluationGroupId' => 'setEvaluationGroupId' ]; /** @@ -188,9 +188,9 @@ public static function openAPIFormats() 'referralSettings' => 'getReferralSettings', 'limits' => 'getLimits', 'campaignGroups' => 'getCampaignGroups', - 'evaluationGroupId' => 'getEvaluationGroupId', 'type' => 'getType', - 'linkedStoreIds' => 'getLinkedStoreIds' + 'linkedStoreIds' => 'getLinkedStoreIds', + 'evaluationGroupId' => 'getEvaluationGroupId' ]; /** @@ -242,6 +242,7 @@ public function getModelName() const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; const TYPE_CART_ITEM = 'cartItem'; const TYPE_ADVANCED = 'advanced'; @@ -274,6 +275,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, ]; } @@ -319,9 +321,9 @@ public function __construct(array $data = 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['evaluationGroupId'] = isset($data['evaluationGroupId']) ? $data['evaluationGroupId'] : null; } /** @@ -718,30 +720,6 @@ public function setCampaignGroups($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 * @@ -798,6 +776,30 @@ public function setLinkedStoreIds($linkedStoreIds) 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; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/NewCampaignGroup.php b/lib/Model/NewCampaignGroup.php index a9f62541..2dfaf6d6 100644 --- a/lib/Model/NewCampaignGroup.php +++ b/lib/Model/NewCampaignGroup.php @@ -242,7 +242,7 @@ public function getName() /** * Sets name * - * @param string $name The name of this campaign access group. + * @param string $name The name of the campaign access group. * * @return $this */ diff --git a/lib/Model/NewCampaignTemplate.php b/lib/Model/NewCampaignTemplate.php index 24e74844..e43a7619 100644 --- a/lib/Model/NewCampaignTemplate.php +++ b/lib/Model/NewCampaignTemplate.php @@ -236,6 +236,7 @@ public function getModelName() const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; const CAMPAIGN_TYPE_CART_ITEM = 'cartItem'; const CAMPAIGN_TYPE_ADVANCED = 'advanced'; @@ -268,6 +269,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, ]; } diff --git a/lib/Model/NewCoupons.php b/lib/Model/NewCoupons.php index 0f8255c2..e381052b 100644 --- a/lib/Model/NewCoupons.php +++ b/lib/Model/NewCoupons.php @@ -255,7 +255,7 @@ public function __construct(array $data = null) $this->container['recipientIntegrationId'] = isset($data['recipientIntegrationId']) ? $data['recipientIntegrationId'] : null; $this->container['validCharacters'] = isset($data['validCharacters']) ? $data['validCharacters'] : null; $this->container['couponPattern'] = isset($data['couponPattern']) ? $data['couponPattern'] : null; - $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : true; + $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : false; $this->container['implicitlyReserved'] = isset($data['implicitlyReserved']) ? $data['implicitlyReserved'] : null; } diff --git a/lib/Model/NewCustomerSessionV2.php b/lib/Model/NewCustomerSessionV2.php index f9827ee9..8fcd5e3b 100644 --- a/lib/Model/NewCustomerSessionV2.php +++ b/lib/Model/NewCustomerSessionV2.php @@ -448,7 +448,7 @@ public function getLoyaltyCards() /** * Sets loyaltyCards * - * @param string[]|null $loyaltyCards Any loyalty cards used. + * @param string[]|null $loyaltyCards Identifier of a loyalty card. * * @return $this */ diff --git a/lib/Model/NewInvitation.php b/lib/Model/NewInvitation.php index a4cf31ab..abc1853e 100644 --- a/lib/Model/NewInvitation.php +++ b/lib/Model/NewInvitation.php @@ -60,9 +60,9 @@ class NewInvitation implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'name' => 'string', 'email' => 'string', - 'acl' => 'string', 'isAdmin' => 'bool', - 'roles' => 'int[]' + 'roles' => 'int[]', + 'acl' => 'string' ]; /** @@ -73,9 +73,9 @@ class NewInvitation implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'name' => null, 'email' => 'email', - 'acl' => null, 'isAdmin' => null, - 'roles' => null + 'roles' => null, + 'acl' => null ]; /** @@ -107,9 +107,9 @@ public static function openAPIFormats() protected static $attributeMap = [ 'name' => 'name', 'email' => 'email', - 'acl' => 'acl', 'isAdmin' => 'isAdmin', - 'roles' => 'roles' + 'roles' => 'roles', + 'acl' => 'acl' ]; /** @@ -120,9 +120,9 @@ public static function openAPIFormats() protected static $setters = [ 'name' => 'setName', 'email' => 'setEmail', - 'acl' => 'setAcl', 'isAdmin' => 'setIsAdmin', - 'roles' => 'setRoles' + 'roles' => 'setRoles', + 'acl' => 'setAcl' ]; /** @@ -133,9 +133,9 @@ public static function openAPIFormats() protected static $getters = [ 'name' => 'getName', 'email' => 'getEmail', - 'acl' => 'getAcl', 'isAdmin' => 'getIsAdmin', - 'roles' => 'getRoles' + 'roles' => 'getRoles', + 'acl' => 'getAcl' ]; /** @@ -200,9 +200,9 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['acl'] = isset($data['acl']) ? $data['acl'] : null; $this->container['isAdmin'] = isset($data['isAdmin']) ? $data['isAdmin'] : null; $this->container['roles'] = isset($data['roles']) ? $data['roles'] : null; + $this->container['acl'] = isset($data['acl']) ? $data['acl'] : null; } /** @@ -245,7 +245,7 @@ public function getName() /** * Sets name * - * @param string|null $name Name of the user being invited. + * @param string|null $name Name of the user. * * @return $this */ @@ -269,7 +269,7 @@ public function getEmail() /** * Sets email * - * @param string $email email + * @param string $email Email address of the user. * * @return $this */ @@ -281,73 +281,73 @@ public function setEmail($email) } /** - * Gets acl + * Gets isAdmin * - * @return string|null + * @return bool|null */ - public function getAcl() + public function getIsAdmin() { - return $this->container['acl']; + return $this->container['isAdmin']; } /** - * Sets acl + * Sets isAdmin * - * @param string|null $acl The `Access Control List` json defining the role of the user. This represents the access control on the user level. Use one of the following: - normal user: `{\"Role\": 0}` - admin: `{\"Role\": 127}` + * @param bool|null $isAdmin Indicates whether the user is an `admin`. * * @return $this */ - public function setAcl($acl) + public function setIsAdmin($isAdmin) { - $this->container['acl'] = $acl; + $this->container['isAdmin'] = $isAdmin; return $this; } /** - * Gets isAdmin + * Gets roles * - * @return bool|null + * @return int[]|null */ - public function getIsAdmin() + public function getRoles() { - return $this->container['isAdmin']; + return $this->container['roles']; } /** - * Sets isAdmin + * Sets roles * - * @param bool|null $isAdmin An indication of whether the user has admin permissions. We recommend using this flag over using the `acl` with value `{\"Role\": 127}`. + * @param int[]|null $roles A list of the IDs of the roles assigned to the user. * * @return $this */ - public function setIsAdmin($isAdmin) + public function setRoles($roles) { - $this->container['isAdmin'] = $isAdmin; + $this->container['roles'] = $roles; return $this; } /** - * Gets roles + * Gets acl * - * @return int[]|null + * @return string|null */ - public function getRoles() + public function getAcl() { - return $this->container['roles']; + return $this->container['acl']; } /** - * Sets roles + * Sets acl * - * @param int[]|null $roles An array of role IDs to assign to the new user. + * @param string|null $acl Indicates the access level of the user. * * @return $this */ - public function setRoles($roles) + public function setAcl($acl) { - $this->container['roles'] = $roles; + $this->container['acl'] = $acl; return $this; } diff --git a/lib/Model/NewInviteEmail.php b/lib/Model/NewInviteEmail.php index acdb2913..a9891a4b 100644 --- a/lib/Model/NewInviteEmail.php +++ b/lib/Model/NewInviteEmail.php @@ -198,17 +198,9 @@ public function listInvalidProperties() if ($this->container['email'] === null) { $invalidProperties[] = "'email' can't be null"; } - if ((mb_strlen($this->container['email']) < 1)) { - $invalidProperties[] = "invalid value for 'email', the character length must be bigger than or equal to 1."; - } - if ($this->container['token'] === null) { $invalidProperties[] = "'token' can't be null"; } - if ((mb_strlen($this->container['token']) < 1)) { - $invalidProperties[] = "invalid value for 'token', the character length must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -237,17 +229,12 @@ public function getEmail() /** * Sets email * - * @param string $email email + * @param string $email Email address of the user. * * @return $this */ public function setEmail($email) { - - if ((mb_strlen($email) < 1)) { - throw new \InvalidArgumentException('invalid length for $email when calling NewInviteEmail., must be bigger than or equal to 1.'); - } - $this->container['email'] = $email; return $this; @@ -266,17 +253,12 @@ public function getToken() /** * Sets token * - * @param string $token token + * @param string $token Invitation token of the user. * * @return $this */ public function setToken($token) { - - if ((mb_strlen($token) < 1)) { - throw new \InvalidArgumentException('invalid length for $token when calling NewInviteEmail., must be bigger than or equal to 1.'); - } - $this->container['token'] = $token; return $this; diff --git a/lib/Model/NewLoyaltyProgram.php b/lib/Model/NewLoyaltyProgram.php index adf9ff85..f61c70e1 100644 --- a/lib/Model/NewLoyaltyProgram.php +++ b/lib/Model/NewLoyaltyProgram.php @@ -66,8 +66,10 @@ class NewLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'tiersExpirationPolicy' => 'string', 'tiersExpireIn' => 'string', 'tiersDowngradePolicy' => 'string', + 'programJoinPolicy' => 'string', 'name' => 'string', 'tiers' => '\TalonOne\Client\Model\NewLoyaltyTier[]', 'timezone' => 'string', @@ -88,8 +90,10 @@ class NewLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'tiersExpirationPolicy' => null, 'tiersExpireIn' => null, 'tiersDowngradePolicy' => null, + 'programJoinPolicy' => null, 'name' => null, 'tiers' => null, 'timezone' => null, @@ -131,8 +135,10 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'tiersExpirationPolicy' => 'tiersExpirationPolicy', 'tiersExpireIn' => 'tiersExpireIn', 'tiersDowngradePolicy' => 'tiersDowngradePolicy', + 'programJoinPolicy' => 'programJoinPolicy', 'name' => 'name', 'tiers' => 'tiers', 'timezone' => 'timezone', @@ -153,8 +159,10 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', 'tiersExpireIn' => 'setTiersExpireIn', 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', + 'programJoinPolicy' => 'setProgramJoinPolicy', 'name' => 'setName', 'tiers' => 'setTiers', 'timezone' => 'setTimezone', @@ -175,8 +183,10 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', 'tiersExpireIn' => 'getTiersExpireIn', 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', + 'programJoinPolicy' => 'getProgramJoinPolicy', 'name' => 'getName', 'tiers' => 'getTiers', 'timezone' => 'getTimezone', @@ -224,11 +234,29 @@ public function getModelName() return self::$openAPIModelName; } + const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; + const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; 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'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTiersExpirationPolicyAllowableValues() + { + return [ + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + ]; + } + /** * Gets allowable values of the enum * @@ -242,6 +270,20 @@ public function getTiersDowngradePolicyAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getProgramJoinPolicyAllowableValues() + { + return [ + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + ]; + } + /** * Associative array for storing property values @@ -266,8 +308,10 @@ 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['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : 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['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; @@ -302,6 +346,14 @@ public function listInvalidProperties() if ($this->container['sandbox'] === null) { $invalidProperties[] = "'sandbox' can't be null"; } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersDowngradePolicyAllowableValues(); if (!is_null($this->container['tiersDowngradePolicy']) && !in_array($this->container['tiersDowngradePolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -310,6 +362,14 @@ 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"; } @@ -535,6 +595,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets tiersExpirationPolicy + * + * @return string|null + */ + public function getTiersExpirationPolicy() + { + return $this->container['tiersExpirationPolicy']; + } + + /** + * 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. + * + * @return $this + */ + public function setTiersExpirationPolicy($tiersExpirationPolicy) + { + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($tiersExpirationPolicy) && !in_array($tiersExpirationPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['tiersExpirationPolicy'] = $tiersExpirationPolicy; + + return $this; + } + /** * Gets tiersExpireIn * @@ -548,7 +641,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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. 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 */ @@ -592,6 +685,39 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) 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 name * diff --git a/lib/Model/NewNotificationTest.php b/lib/Model/NewNotificationTest.php new file mode 100644 index 00000000..a8e1322f --- /dev/null +++ b/lib/Model/NewNotificationTest.php @@ -0,0 +1,558 @@ + 'string', + 'queryParams' => 'map[string,string]', + 'headers' => 'map[string,string]', + 'verb' => 'string', + 'url' => 'string', + 'payload' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'type' => null, + 'queryParams' => null, + 'headers' => null, + 'verb' => null, + 'url' => null, + 'payload' => 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', + 'queryParams' => 'queryParams', + 'headers' => 'headers', + 'verb' => 'verb', + 'url' => 'url', + 'payload' => 'payload' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'queryParams' => 'setQueryParams', + 'headers' => 'setHeaders', + 'verb' => 'setVerb', + 'url' => 'setUrl', + 'payload' => 'setPayload' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'queryParams' => 'getQueryParams', + 'headers' => 'getHeaders', + 'verb' => 'getVerb', + 'url' => 'getUrl', + 'payload' => 'getPayload' + ]; + + /** + * 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 TYPE_CAMPAIGN = 'campaign'; + const TYPE_LOYALTY_ADDED_DEDUCTED_POINTS = 'loyalty_added_deducted_points'; + const TYPE_COUPON = 'coupon'; + const TYPE_EXPIRING_COUPONS = 'expiring_coupons'; + const TYPE_EXPIRING_POINTS = 'expiring_points'; + const TYPE_PENDING_TO_ACTIVE_POINTS = 'pending_to_active_points'; + const TYPE_STRIKETHROUGH_PRICING = 'strikethrough_pricing'; + const TYPE_TIER_DOWNGRADE = 'tier_downgrade'; + const TYPE_TIER_UPGRADE = 'tier_upgrade'; + const TYPE_TIER_WILL_DOWNGRADE = 'tier_will_downgrade'; + const TYPE_CARD_EXPIRING_POINTS = 'card_expiring_points'; + const VERB_POST = 'POST'; + const VERB_PUT = 'PUT'; + const VERB_GET = 'GET'; + const VERB_DELETE = 'DELETE'; + const VERB_PATCH = 'PATCH'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CAMPAIGN, + self::TYPE_LOYALTY_ADDED_DEDUCTED_POINTS, + self::TYPE_COUPON, + self::TYPE_EXPIRING_COUPONS, + self::TYPE_EXPIRING_POINTS, + self::TYPE_PENDING_TO_ACTIVE_POINTS, + self::TYPE_STRIKETHROUGH_PRICING, + self::TYPE_TIER_DOWNGRADE, + self::TYPE_TIER_UPGRADE, + self::TYPE_TIER_WILL_DOWNGRADE, + self::TYPE_CARD_EXPIRING_POINTS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerbAllowableValues() + { + return [ + self::VERB_POST, + self::VERB_PUT, + self::VERB_GET, + self::VERB_DELETE, + self::VERB_PATCH, + ]; + } + + + /** + * 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['queryParams'] = isset($data['queryParams']) ? $data['queryParams'] : null; + $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null; + $this->container['verb'] = isset($data['verb']) ? $data['verb'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['payload'] = isset($data['payload']) ? $data['payload'] : 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"; + } + $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['verb'] === null) { + $invalidProperties[] = "'verb' can't be null"; + } + $allowedValues = $this->getVerbAllowableValues(); + if (!is_null($this->container['verb']) && !in_array($this->container['verb'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'verb', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['payload'] === null) { + $invalidProperties[] = "'payload' 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 The notification type. + * + * @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 queryParams + * + * @return map[string,string]|null + */ + public function getQueryParams() + { + return $this->container['queryParams']; + } + + /** + * Sets queryParams + * + * @param map[string,string]|null $queryParams Array of query parameters. + * + * @return $this + */ + public function setQueryParams($queryParams) + { + $this->container['queryParams'] = $queryParams; + + return $this; + } + + /** + * Gets headers + * + * @return map[string,string]|null + */ + public function getHeaders() + { + return $this->container['headers']; + } + + /** + * Sets headers + * + * @param map[string,string]|null $headers List of API HTTP headers for the given webhook-based notification. + * + * @return $this + */ + public function setHeaders($headers) + { + $this->container['headers'] = $headers; + + return $this; + } + + /** + * Gets verb + * + * @return string + */ + public function getVerb() + { + return $this->container['verb']; + } + + /** + * Sets verb + * + * @param string $verb API method for this notification. + * + * @return $this + */ + public function setVerb($verb) + { + $allowedValues = $this->getVerbAllowableValues(); + if (!in_array($verb, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'verb', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['verb'] = $verb; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url API URL for the given notification. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets payload + * + * @return string + */ + public function getPayload() + { + return $this->container['payload']; + } + + /** + * Sets payload + * + * @param string $payload API payload of this notification. + * + * @return $this + */ + public function setPayload($payload) + { + $this->container['payload'] = $payload; + + 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/NewPicklist.php b/lib/Model/NewPicklist.php index 3c86b247..aec60acb 100644 --- a/lib/Model/NewPicklist.php +++ b/lib/Model/NewPicklist.php @@ -256,7 +256,7 @@ public function getType() /** * Sets type * - * @param string $type The type of allowed values in the picklist. If type time is chosen, it must be an RFC3339 timestamp string. + * @param string $type The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string. * * @return $this */ diff --git a/lib/Model/NewRoleV2.php b/lib/Model/NewRoleV2.php index 3475b631..dbfbd985 100644 --- a/lib/Model/NewRoleV2.php +++ b/lib/Model/NewRoleV2.php @@ -314,7 +314,7 @@ public function getMembers() /** * Sets members * - * @param int[]|null $members A list of user identifiers the role is assigned to. + * @param int[]|null $members A list of user IDs the role is assigned to. * * @return $this */ diff --git a/lib/Model/NewStore.php b/lib/Model/NewStore.php index a330d308..cffd782f 100644 --- a/lib/Model/NewStore.php +++ b/lib/Model/NewStore.php @@ -340,7 +340,7 @@ public function getIntegrationId() /** * Sets integrationId * - * @param string $integrationId The integration ID of the store. You choose this ID when you create a store. + * @param string $integrationId The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. * * @return $this */ diff --git a/lib/Model/NewUser.php b/lib/Model/NewUser.php index cc58597e..29d2d110 100644 --- a/lib/Model/NewUser.php +++ b/lib/Model/NewUser.php @@ -249,7 +249,7 @@ public function getEmail() /** * Sets email * - * @param string $email The email address associated with your account. + * @param string $email The email address associated with the user profile. * * @return $this */ diff --git a/lib/Model/NotificationListItem.php b/lib/Model/NotificationListItem.php new file mode 100644 index 00000000..692242e8 --- /dev/null +++ b/lib/Model/NotificationListItem.php @@ -0,0 +1,410 @@ + 'int', + 'notificationName' => 'string', + 'entityId' => 'int', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'notificationId' => null, + 'notificationName' => null, + 'entityId' => null, + 'enabled' => 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 = [ + 'notificationId' => 'notificationId', + 'notificationName' => 'notificationName', + 'entityId' => 'entityId', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notificationId' => 'setNotificationId', + 'notificationName' => 'setNotificationName', + 'entityId' => 'setEntityId', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notificationId' => 'getNotificationId', + 'notificationName' => 'getNotificationName', + 'entityId' => 'getEntityId', + 'enabled' => 'getEnabled' + ]; + + /** + * 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['notificationId'] = isset($data['notificationId']) ? $data['notificationId'] : null; + $this->container['notificationName'] = isset($data['notificationName']) ? $data['notificationName'] : null; + $this->container['entityId'] = isset($data['entityId']) ? $data['entityId'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['notificationId'] === null) { + $invalidProperties[] = "'notificationId' can't be null"; + } + if ($this->container['notificationName'] === null) { + $invalidProperties[] = "'notificationName' can't be null"; + } + if ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['enabled'] === null) { + $invalidProperties[] = "'enabled' 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 notificationId + * + * @return int + */ + public function getNotificationId() + { + return $this->container['notificationId']; + } + + /** + * Sets notificationId + * + * @param int $notificationId The ID of the notification. + * + * @return $this + */ + public function setNotificationId($notificationId) + { + $this->container['notificationId'] = $notificationId; + + return $this; + } + + /** + * Gets notificationName + * + * @return string + */ + public function getNotificationName() + { + return $this->container['notificationName']; + } + + /** + * Sets notificationName + * + * @param string $notificationName The name of the notification. + * + * @return $this + */ + public function setNotificationName($notificationName) + { + $this->container['notificationName'] = $notificationName; + + return $this; + } + + /** + * Gets entityId + * + * @return int + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param int $entityId The ID of the entity to which this notification belongs. For example, in case of a loyalty notification, this value is the ID of the loyalty program. + * + * @return $this + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled Indicates whether the notification is activated. + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + 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/NotificationTest.php b/lib/Model/NotificationTest.php new file mode 100644 index 00000000..cfad25df --- /dev/null +++ b/lib/Model/NotificationTest.php @@ -0,0 +1,344 @@ + 'string', + 'httpStatus' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'httpResponse' => null, + 'httpStatus' => 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 = [ + 'httpResponse' => 'httpResponse', + 'httpStatus' => 'httpStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'httpResponse' => 'setHttpResponse', + 'httpStatus' => 'setHttpStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'httpResponse' => 'getHttpResponse', + 'httpStatus' => 'getHttpStatus' + ]; + + /** + * 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['httpResponse'] = isset($data['httpResponse']) ? $data['httpResponse'] : null; + $this->container['httpStatus'] = isset($data['httpStatus']) ? $data['httpStatus'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['httpResponse'] === null) { + $invalidProperties[] = "'httpResponse' can't be null"; + } + if ($this->container['httpStatus'] === null) { + $invalidProperties[] = "'httpStatus' 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 httpResponse + * + * @return string + */ + public function getHttpResponse() + { + return $this->container['httpResponse']; + } + + /** + * Sets httpResponse + * + * @param string $httpResponse The returned http response. + * + * @return $this + */ + public function setHttpResponse($httpResponse) + { + $this->container['httpResponse'] = $httpResponse; + + return $this; + } + + /** + * Gets httpStatus + * + * @return int + */ + public function getHttpStatus() + { + return $this->container['httpStatus']; + } + + /** + * Sets httpStatus + * + * @param int $httpStatus The returned http status code. + * + * @return $this + */ + public function setHttpStatus($httpStatus) + { + $this->container['httpStatus'] = $httpStatus; + + 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/PatchItemCatalogAction.php b/lib/Model/PatchItemCatalogAction.php index c833801b..39a04227 100644 --- a/lib/Model/PatchItemCatalogAction.php +++ b/lib/Model/PatchItemCatalogAction.php @@ -36,7 +36,7 @@ * PatchItemCatalogAction Class Doc Comment * * @category Class - * @description The specific properties of the \"PATCH\" catalog sync action. + * @description The specific properties of the \"PATCH\" catalog sync action. **Note:** - If you do not provide a new `price` value, the existing `price` value is retained. - If you do not provide a new `product` value, the `product` value is set to `null`. * @package TalonOne\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -61,6 +61,7 @@ class PatchItemCatalogAction implements ModelInterface, ArrayAccess 'sku' => 'string', 'price' => 'float', 'attributes' => 'object', + 'product' => '\TalonOne\Client\Model\Product', 'createIfNotExists' => 'bool' ]; @@ -73,6 +74,7 @@ class PatchItemCatalogAction implements ModelInterface, ArrayAccess 'sku' => null, 'price' => null, 'attributes' => null, + 'product' => null, 'createIfNotExists' => null ]; @@ -106,6 +108,7 @@ public static function openAPIFormats() 'sku' => 'sku', 'price' => 'price', 'attributes' => 'attributes', + 'product' => 'product', 'createIfNotExists' => 'createIfNotExists' ]; @@ -118,6 +121,7 @@ public static function openAPIFormats() 'sku' => 'setSku', 'price' => 'setPrice', 'attributes' => 'setAttributes', + 'product' => 'setProduct', 'createIfNotExists' => 'setCreateIfNotExists' ]; @@ -130,6 +134,7 @@ public static function openAPIFormats() 'sku' => 'getSku', 'price' => 'getPrice', 'attributes' => 'getAttributes', + 'product' => 'getProduct', 'createIfNotExists' => 'getCreateIfNotExists' ]; @@ -196,6 +201,7 @@ public function __construct(array $data = null) $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['product'] = isset($data['product']) ? $data['product'] : null; $this->container['createIfNotExists'] = isset($data['createIfNotExists']) ? $data['createIfNotExists'] : false; } @@ -298,6 +304,30 @@ public function setAttributes($attributes) return $this; } + /** + * Gets product + * + * @return \TalonOne\Client\Model\Product|null + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \TalonOne\Client\Model\Product|null $product product + * + * @return $this + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + /** * Gets createIfNotExists * diff --git a/lib/Model/PendingPointsNotificationPolicy.php b/lib/Model/PendingPointsNotificationPolicy.php index 926d7f85..6941bd77 100644 --- a/lib/Model/PendingPointsNotificationPolicy.php +++ b/lib/Model/PendingPointsNotificationPolicy.php @@ -57,7 +57,8 @@ class PendingPointsNotificationPolicy implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string' + 'name' => 'string', + 'batchingEnabled' => 'bool' ]; /** @@ -66,7 +67,8 @@ class PendingPointsNotificationPolicy 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/Picklist.php b/lib/Model/Picklist.php index 2ca722ad..2cc41e9b 100644 --- a/lib/Model/Picklist.php +++ b/lib/Model/Picklist.php @@ -350,7 +350,7 @@ public function getType() /** * Sets type * - * @param string $type The type of allowed values in the picklist. If type time is chosen, it must be an RFC3339 timestamp string. + * @param string $type The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string. * * @return $this */ diff --git a/lib/Model/Product.php b/lib/Model/Product.php new file mode 100644 index 00000000..809dc0d9 --- /dev/null +++ b/lib/Model/Product.php @@ -0,0 +1,320 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => 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' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : 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"; + } + if ((mb_strlen($this->container['name']) > 50)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 50."; + } + + 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 product. + * + * @return $this + */ + public function setName($name) + { + if ((mb_strlen($name) > 50)) { + throw new \InvalidArgumentException('invalid length for $name when calling Product., must be smaller than or equal to 50.'); + } + + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\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/RoleV2.php b/lib/Model/RoleV2.php index bc6cbccb..2187d7e9 100644 --- a/lib/Model/RoleV2.php +++ b/lib/Model/RoleV2.php @@ -440,7 +440,7 @@ public function getMembers() /** * Sets members * - * @param int[]|null $members A list of user identifiers the role is assigned to. + * @param int[]|null $members A list of user IDs the role is assigned to. * * @return $this */ diff --git a/lib/Model/RoleV2Base.php b/lib/Model/RoleV2Base.php index 8b1187b5..b91fa960 100644 --- a/lib/Model/RoleV2Base.php +++ b/lib/Model/RoleV2Base.php @@ -307,7 +307,7 @@ public function getMembers() /** * Sets members * - * @param int[]|null $members A list of user identifiers the role is assigned to. + * @param int[]|null $members A list of user IDs the role is assigned to. * * @return $this */ diff --git a/lib/Model/RoleV2Permissions.php b/lib/Model/RoleV2Permissions.php index e50e08f5..44fcad70 100644 --- a/lib/Model/RoleV2Permissions.php +++ b/lib/Model/RoleV2Permissions.php @@ -223,7 +223,7 @@ public function getPermissionSets() /** * Sets permissionSets * - * @param \TalonOne\Client\Model\RoleV2PermissionSet[]|null $permissionSets List of grouped logical operations to use as a reference in the roles section. Each group of logical operations has a name. + * @param \TalonOne\Client\Model\RoleV2PermissionSet[]|null $permissionSets List of grouped logical operations referenced by roles. * * @return $this */ diff --git a/lib/Model/SamlConnectionInternal.php b/lib/Model/SamlConnectionInternal.php new file mode 100644 index 00000000..e3909d1e --- /dev/null +++ b/lib/Model/SamlConnectionInternal.php @@ -0,0 +1,362 @@ + 'string', + 'metadataDocument' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'metadataDocument' => 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', + 'metadataDocument' => 'metadataDocument' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'metadataDocument' => 'setMetadataDocument' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'metadataDocument' => 'getMetadataDocument' + ]; + + /** + * 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['metadataDocument'] = isset($data['metadataDocument']) ? $data['metadataDocument'] : 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"; + } + 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['metadataDocument'] === null) { + $invalidProperties[] = "'metadataDocument' can't be null"; + } + if ((mb_strlen($this->container['metadataDocument']) < 1)) { + $invalidProperties[] = "invalid value for 'metadataDocument', 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 + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name ID of the SAML service. + * + * @return $this + */ + public function setName($name) + { + + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling SamlConnectionInternal., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets metadataDocument + * + * @return string + */ + public function getMetadataDocument() + { + return $this->container['metadataDocument']; + } + + /** + * Sets metadataDocument + * + * @param string $metadataDocument Identity Provider metadata XML document. + * + * @return $this + */ + public function setMetadataDocument($metadataDocument) + { + + if ((mb_strlen($metadataDocument) < 1)) { + throw new \InvalidArgumentException('invalid length for $metadataDocument when calling SamlConnectionInternal., must be bigger than or equal to 1.'); + } + + $this->container['metadataDocument'] = $metadataDocument; + + 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/SamlLoginEndpoint.php b/lib/Model/SamlLoginEndpoint.php index 2be56887..f15d029c 100644 --- a/lib/Model/SamlLoginEndpoint.php +++ b/lib/Model/SamlLoginEndpoint.php @@ -57,6 +57,7 @@ class SamlLoginEndpoint implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ + 'id' => 'int', 'name' => 'string', 'loginURL' => 'string' ]; @@ -67,6 +68,7 @@ class SamlLoginEndpoint implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ + 'id' => null, 'name' => null, 'loginURL' => null ]; @@ -98,6 +100,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', 'name' => 'name', 'loginURL' => 'loginURL' ]; @@ -108,6 +111,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'id' => 'setId', 'name' => 'setName', 'loginURL' => 'setLoginURL' ]; @@ -118,6 +122,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'id' => 'getId', 'name' => 'getName', 'loginURL' => 'getLoginURL' ]; @@ -182,6 +187,7 @@ public function getModelName() */ 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['loginURL'] = isset($data['loginURL']) ? $data['loginURL'] : null; } @@ -195,6 +201,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } @@ -224,6 +233,30 @@ public function valid() } + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the SAML login endpoint. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** * Gets name * @@ -266,7 +299,7 @@ public function getLoginURL() /** * Sets loginURL * - * @param string $loginURL Single Sign-On URL. + * @param string $loginURL The single sign-on URL. * * @return $this */ diff --git a/lib/Model/Store.php b/lib/Model/Store.php index 289ea244..ddab8070 100644 --- a/lib/Model/Store.php +++ b/lib/Model/Store.php @@ -430,7 +430,7 @@ public function getIntegrationId() /** * Sets integrationId * - * @param string $integrationId The integration ID of the store. You choose this ID when you create a store. + * @param string $integrationId The integration ID of the store. You choose this ID when you create a store. **Note**: You cannot edit the `integrationId` after the store has been created. * * @return $this */ diff --git a/lib/Model/TalangAttribute.php b/lib/Model/TalangAttribute.php index d4fcd50b..bd459e65 100644 --- a/lib/Model/TalangAttribute.php +++ b/lib/Model/TalangAttribute.php @@ -217,6 +217,7 @@ public function getModelName() const ENTITY_REFERRAL = 'Referral'; const ENTITY_SESSION = 'Session'; const ENTITY_STORE = 'Store'; + const ENTITY_ACHIEVEMENTS = 'Achievements'; const KIND_BUILT_IN = 'built-in'; const KIND_CUSTOM = 'custom'; @@ -248,6 +249,7 @@ public function getEntityAllowableValues() self::ENTITY_REFERRAL, self::ENTITY_SESSION, self::ENTITY_STORE, + self::ENTITY_ACHIEVEMENTS, ]; } diff --git a/lib/Model/TemplateArgDef.php b/lib/Model/TemplateArgDef.php index 6d319e0e..94259233 100644 --- a/lib/Model/TemplateArgDef.php +++ b/lib/Model/TemplateArgDef.php @@ -256,9 +256,6 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'type', 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['title'] === null) { $invalidProperties[] = "'title' can't be null"; } @@ -325,7 +322,7 @@ public function setType($type) /** * Gets description * - * @return string + * @return string|null */ public function getDescription() { @@ -335,7 +332,7 @@ public function getDescription() /** * Sets description * - * @param string $description A campaigner-friendly description of the argument, this will also be shown in the rule editor. + * @param string|null $description A campaigner-friendly description of the argument, this will also be shown in the rule editor. * * @return $this */ diff --git a/lib/Model/TierDowngradeNotificationPolicy.php b/lib/Model/TierDowngradeNotificationPolicy.php index 263d7612..4ea0bee0 100644 --- a/lib/Model/TierDowngradeNotificationPolicy.php +++ b/lib/Model/TierDowngradeNotificationPolicy.php @@ -57,7 +57,8 @@ class TierDowngradeNotificationPolicy implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string' + 'name' => 'string', + 'batchingEnabled' => 'bool' ]; /** @@ -66,7 +67,8 @@ class TierDowngradeNotificationPolicy 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/TierUpgradeNotificationPolicy.php b/lib/Model/TierUpgradeNotificationPolicy.php index ed9e9ca2..0978d1e7 100644 --- a/lib/Model/TierUpgradeNotificationPolicy.php +++ b/lib/Model/TierUpgradeNotificationPolicy.php @@ -57,7 +57,8 @@ class TierUpgradeNotificationPolicy implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string' + 'name' => 'string', + 'batchingEnabled' => 'bool' ]; /** @@ -66,7 +67,8 @@ class TierUpgradeNotificationPolicy 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/TierWillDowngradeNotificationPolicy.php b/lib/Model/TierWillDowngradeNotificationPolicy.php index 07ca63e2..5f963870 100644 --- a/lib/Model/TierWillDowngradeNotificationPolicy.php +++ b/lib/Model/TierWillDowngradeNotificationPolicy.php @@ -58,6 +58,7 @@ class TierWillDowngradeNotificationPolicy implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'name' => 'string', + 'batchingEnabled' => 'bool', 'triggers' => '\TalonOne\Client\Model\TierWillDowngradeNotificationTrigger[]' ]; @@ -68,6 +69,7 @@ class TierWillDowngradeNotificationPolicy implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'name' => null, + 'batchingEnabled' => null, 'triggers' => null ]; @@ -99,6 +101,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'name' => 'name', + 'batchingEnabled' => 'batchingEnabled', 'triggers' => 'triggers' ]; @@ -109,6 +112,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'name' => 'setName', + 'batchingEnabled' => 'setBatchingEnabled', 'triggers' => 'setTriggers' ]; @@ -119,6 +123,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'name' => 'getName', + 'batchingEnabled' => 'getBatchingEnabled', 'triggers' => 'getTriggers' ]; @@ -183,6 +188,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; $this->container['triggers'] = isset($data['triggers']) ? $data['triggers'] : null; } @@ -249,6 +255,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; + } + /** * Gets triggers * diff --git a/lib/Model/TimePoint.php b/lib/Model/TimePoint.php new file mode 100644 index 00000000..c375f9c6 --- /dev/null +++ b/lib/Model/TimePoint.php @@ -0,0 +1,516 @@ + 'int', + 'dayOfMonth' => 'int', + 'dayOfWeek' => 'int', + 'hour' => 'int', + 'minute' => 'int', + 'second' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'month' => null, + 'dayOfMonth' => null, + 'dayOfWeek' => null, + 'hour' => null, + 'minute' => null, + 'second' => 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 = [ + 'month' => 'month', + 'dayOfMonth' => 'dayOfMonth', + 'dayOfWeek' => 'dayOfWeek', + 'hour' => 'hour', + 'minute' => 'minute', + 'second' => 'second' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'month' => 'setMonth', + 'dayOfMonth' => 'setDayOfMonth', + 'dayOfWeek' => 'setDayOfWeek', + 'hour' => 'setHour', + 'minute' => 'setMinute', + 'second' => 'setSecond' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'month' => 'getMonth', + 'dayOfMonth' => 'getDayOfMonth', + 'dayOfWeek' => 'getDayOfWeek', + 'hour' => 'getHour', + 'minute' => 'getMinute', + 'second' => 'getSecond' + ]; + + /** + * 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['month'] = isset($data['month']) ? $data['month'] : null; + $this->container['dayOfMonth'] = isset($data['dayOfMonth']) ? $data['dayOfMonth'] : null; + $this->container['dayOfWeek'] = isset($data['dayOfWeek']) ? $data['dayOfWeek'] : null; + $this->container['hour'] = isset($data['hour']) ? $data['hour'] : null; + $this->container['minute'] = isset($data['minute']) ? $data['minute'] : null; + $this->container['second'] = isset($data['second']) ? $data['second'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['month']) && ($this->container['month'] > 12)) { + $invalidProperties[] = "invalid value for 'month', must be smaller than or equal to 12."; + } + + if (!is_null($this->container['month']) && ($this->container['month'] < 1)) { + $invalidProperties[] = "invalid value for 'month', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['dayOfMonth']) && ($this->container['dayOfMonth'] > 31)) { + $invalidProperties[] = "invalid value for 'dayOfMonth', must be smaller than or equal to 31."; + } + + if (!is_null($this->container['dayOfMonth']) && ($this->container['dayOfMonth'] < 1)) { + $invalidProperties[] = "invalid value for 'dayOfMonth', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['dayOfWeek']) && ($this->container['dayOfWeek'] > 7)) { + $invalidProperties[] = "invalid value for 'dayOfWeek', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['dayOfWeek']) && ($this->container['dayOfWeek'] < 1)) { + $invalidProperties[] = "invalid value for 'dayOfWeek', must be bigger than or equal to 1."; + } + + if ($this->container['hour'] === null) { + $invalidProperties[] = "'hour' can't be null"; + } + if ($this->container['minute'] === null) { + $invalidProperties[] = "'minute' can't be null"; + } + if ($this->container['second'] === null) { + $invalidProperties[] = "'second' 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 month + * + * @return int|null + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int|null $month The achievement ends and resets in this month. **Note**: Only applicable if the period is set to `Y`. + * + * @return $this + */ + public function setMonth($month) + { + + if (!is_null($month) && ($month > 12)) { + throw new \InvalidArgumentException('invalid value for $month when calling TimePoint., must be smaller than or equal to 12.'); + } + if (!is_null($month) && ($month < 1)) { + throw new \InvalidArgumentException('invalid value for $month when calling TimePoint., must be bigger than or equal to 1.'); + } + + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets dayOfMonth + * + * @return int|null + */ + public function getDayOfMonth() + { + return $this->container['dayOfMonth']; + } + + /** + * Sets dayOfMonth + * + * @param int|null $dayOfMonth The achievement ends and resets on this day of the month. **Note**: Only applicable if the period is set to `Y` or `M`. + * + * @return $this + */ + public function setDayOfMonth($dayOfMonth) + { + + if (!is_null($dayOfMonth) && ($dayOfMonth > 31)) { + throw new \InvalidArgumentException('invalid value for $dayOfMonth when calling TimePoint., must be smaller than or equal to 31.'); + } + if (!is_null($dayOfMonth) && ($dayOfMonth < 1)) { + throw new \InvalidArgumentException('invalid value for $dayOfMonth when calling TimePoint., must be bigger than or equal to 1.'); + } + + $this->container['dayOfMonth'] = $dayOfMonth; + + return $this; + } + + /** + * Gets dayOfWeek + * + * @return int|null + */ + public function getDayOfWeek() + { + return $this->container['dayOfWeek']; + } + + /** + * Sets dayOfWeek + * + * @param int|null $dayOfWeek The achievement ends and resets on this day of the week. `1` represents `Monday` and `7` represents `Sunday`. **Note**: Only applicable if the period is set to `W`. + * + * @return $this + */ + public function setDayOfWeek($dayOfWeek) + { + + if (!is_null($dayOfWeek) && ($dayOfWeek > 7)) { + throw new \InvalidArgumentException('invalid value for $dayOfWeek when calling TimePoint., must be smaller than or equal to 7.'); + } + if (!is_null($dayOfWeek) && ($dayOfWeek < 1)) { + throw new \InvalidArgumentException('invalid value for $dayOfWeek when calling TimePoint., must be bigger than or equal to 1.'); + } + + $this->container['dayOfWeek'] = $dayOfWeek; + + return $this; + } + + /** + * Gets hour + * + * @return int + */ + public function getHour() + { + return $this->container['hour']; + } + + /** + * Sets hour + * + * @param int $hour The achievement ends and resets at this hour. + * + * @return $this + */ + public function setHour($hour) + { + $this->container['hour'] = $hour; + + return $this; + } + + /** + * Gets minute + * + * @return int + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int $minute The achievement ends and resets at this minute. + * + * @return $this + */ + public function setMinute($minute) + { + $this->container['minute'] = $minute; + + return $this; + } + + /** + * Gets second + * + * @return int + */ + public function getSecond() + { + return $this->container['second']; + } + + /** + * Sets second + * + * @param int $second The achievement ends and resets at this second. + * + * @return $this + */ + public function setSecond($second) + { + $this->container['second'] = $second; + + 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/UpdateAchievement.php b/lib/Model/UpdateAchievement.php new file mode 100644 index 00000000..939d423c --- /dev/null +++ b/lib/Model/UpdateAchievement.php @@ -0,0 +1,480 @@ + 'string', + 'title' => 'string', + 'description' => 'string', + 'target' => 'float', + 'period' => 'string', + 'periodEndOverride' => '\TalonOne\Client\Model\TimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'title' => null, + 'description' => 'string', + 'target' => null, + 'period' => null, + 'periodEndOverride' => 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', + 'title' => 'title', + 'description' => 'description', + 'target' => 'target', + 'period' => 'period', + 'periodEndOverride' => 'periodEndOverride' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'title' => 'setTitle', + 'description' => 'setDescription', + 'target' => 'setTarget', + 'period' => 'setPeriod', + 'periodEndOverride' => 'setPeriodEndOverride' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'title' => 'getTitle', + 'description' => 'getDescription', + 'target' => 'getTarget', + 'period' => 'getPeriod', + 'periodEndOverride' => 'getPeriodEndOverride' + ]; + + /** + * 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['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['target'] = isset($data['target']) ? $data['target'] : null; + $this->container['period'] = isset($data['period']) ? $data['period'] : null; + $this->container['periodEndOverride'] = isset($data['periodEndOverride']) ? $data['periodEndOverride'] : 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']) > 1000)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 1000."; + } + + 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."; + } + + if (!is_null($this->container['name']) && !preg_match("/^[a-zA-Z]\\w+$/", $this->container['name'])) { + $invalidProperties[] = "invalid value for 'name', must be conform to the pattern /^[a-zA-Z]\\w+$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The internal name of the achievement used in API requests. + * + * @return $this + */ + public function setName($name) + { + if (!is_null($name) && (mb_strlen($name) > 1000)) { + throw new \InvalidArgumentException('invalid length for $name when calling UpdateAchievement., must be smaller than or equal to 1000.'); + } + if (!is_null($name) && (mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling UpdateAchievement., must be bigger than or equal to 1.'); + } + if (!is_null($name) && (!preg_match("/^[a-zA-Z]\\w+$/", $name))) { + throw new \InvalidArgumentException("invalid value for $name when calling UpdateAchievement., must conform to the pattern /^[a-zA-Z]\\w+$/."); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The display name for the achievement in the Campaign Manager. + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $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 achievement. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets target + * + * @return float|null + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param float|null $target The required number of actions or the transactional milestone to complete the achievement. + * + * @return $this + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets period + * + * @return string|null + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string|null $period The relative duration after which the achievement ends and resets for a particular customer profile. + * + * @return $this + */ + public function setPeriod($period) + { + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets periodEndOverride + * + * @return \TalonOne\Client\Model\TimePoint|null + */ + public function getPeriodEndOverride() + { + return $this->container['periodEndOverride']; + } + + /** + * Sets periodEndOverride + * + * @param \TalonOne\Client\Model\TimePoint|null $periodEndOverride periodEndOverride + * + * @return $this + */ + public function setPeriodEndOverride($periodEndOverride) + { + $this->container['periodEndOverride'] = $periodEndOverride; + + 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/UpdateApplicationAPIKey.php b/lib/Model/UpdateApplicationAPIKey.php new file mode 100644 index 00000000..f018af3a --- /dev/null +++ b/lib/Model/UpdateApplicationAPIKey.php @@ -0,0 +1,311 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'timeOffset' => 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 = [ + 'timeOffset' => 'timeOffset' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timeOffset' => 'setTimeOffset' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timeOffset' => 'getTimeOffset' + ]; + + /** + * 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['timeOffset'] = isset($data['timeOffset']) ? $data['timeOffset'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['timeOffset'] === null) { + $invalidProperties[] = "'timeOffset' 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 timeOffset + * + * @return int + */ + public function getTimeOffset() + { + return $this->container['timeOffset']; + } + + /** + * Sets timeOffset + * + * @param int $timeOffset A time offset in nanoseconds associated with the API key. When making a request using the API key, rule evaluation is based on a date that is calculated by adding the offset to the current date. + * + * @return $this + */ + public function setTimeOffset($timeOffset) + { + $this->container['timeOffset'] = $timeOffset; + + 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 e88c677c..f82e6145 100644 --- a/lib/Model/UpdateCampaign.php +++ b/lib/Model/UpdateCampaign.php @@ -241,6 +241,7 @@ public function getModelName() const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; const TYPE_CART_ITEM = 'cartItem'; const TYPE_ADVANCED = 'advanced'; @@ -273,6 +274,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, ]; } diff --git a/lib/Model/UpdateCampaignGroup.php b/lib/Model/UpdateCampaignGroup.php index 6e172ef8..543e0a81 100644 --- a/lib/Model/UpdateCampaignGroup.php +++ b/lib/Model/UpdateCampaignGroup.php @@ -243,7 +243,7 @@ public function getName() /** * Sets name * - * @param string $name The name of this campaign access group. + * @param string $name The name of the campaign access group. * * @return $this */ diff --git a/lib/Model/UpdateCampaignTemplate.php b/lib/Model/UpdateCampaignTemplate.php index 05ea3a27..60e294d6 100644 --- a/lib/Model/UpdateCampaignTemplate.php +++ b/lib/Model/UpdateCampaignTemplate.php @@ -246,6 +246,7 @@ public function getModelName() const FEATURES_LOYALTY = 'loyalty'; const FEATURES_GIVEAWAYS = 'giveaways'; const FEATURES_STRIKETHROUGH = 'strikethrough'; + const FEATURES_ACHIEVEMENTS = 'achievements'; const CAMPAIGN_TYPE_CART_ITEM = 'cartItem'; const CAMPAIGN_TYPE_ADVANCED = 'advanced'; @@ -278,6 +279,7 @@ public function getFeaturesAllowableValues() self::FEATURES_LOYALTY, self::FEATURES_GIVEAWAYS, self::FEATURES_STRIKETHROUGH, + self::FEATURES_ACHIEVEMENTS, ]; } diff --git a/lib/Model/UpdateCoupon.php b/lib/Model/UpdateCoupon.php index 0e406556..3b5d0011 100644 --- a/lib/Model/UpdateCoupon.php +++ b/lib/Model/UpdateCoupon.php @@ -231,7 +231,7 @@ public function __construct(array $data = null) $this->container['limits'] = isset($data['limits']) ? $data['limits'] : null; $this->container['recipientIntegrationId'] = isset($data['recipientIntegrationId']) ? $data['recipientIntegrationId'] : null; $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; - $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : true; + $this->container['isReservationMandatory'] = isset($data['isReservationMandatory']) ? $data['isReservationMandatory'] : false; $this->container['implicitlyReserved'] = isset($data['implicitlyReserved']) ? $data['implicitlyReserved'] : null; } diff --git a/lib/Model/UpdateLoyaltyProgram.php b/lib/Model/UpdateLoyaltyProgram.php index 604965ef..567ce454 100644 --- a/lib/Model/UpdateLoyaltyProgram.php +++ b/lib/Model/UpdateLoyaltyProgram.php @@ -66,8 +66,10 @@ class UpdateLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => 'bool', 'usersPerCardLimit' => 'int', 'sandbox' => 'bool', + 'tiersExpirationPolicy' => 'string', 'tiersExpireIn' => 'string', 'tiersDowngradePolicy' => 'string', + 'programJoinPolicy' => 'string', 'tiers' => '\TalonOne\Client\Model\NewLoyaltyTier[]' ]; @@ -85,8 +87,10 @@ class UpdateLoyaltyProgram implements ModelInterface, ArrayAccess 'allowSubledger' => null, 'usersPerCardLimit' => null, 'sandbox' => null, + 'tiersExpirationPolicy' => null, 'tiersExpireIn' => null, 'tiersDowngradePolicy' => null, + 'programJoinPolicy' => null, 'tiers' => null ]; @@ -125,8 +129,10 @@ public static function openAPIFormats() 'allowSubledger' => 'allowSubledger', 'usersPerCardLimit' => 'usersPerCardLimit', 'sandbox' => 'sandbox', + 'tiersExpirationPolicy' => 'tiersExpirationPolicy', 'tiersExpireIn' => 'tiersExpireIn', 'tiersDowngradePolicy' => 'tiersDowngradePolicy', + 'programJoinPolicy' => 'programJoinPolicy', 'tiers' => 'tiers' ]; @@ -144,8 +150,10 @@ public static function openAPIFormats() 'allowSubledger' => 'setAllowSubledger', 'usersPerCardLimit' => 'setUsersPerCardLimit', 'sandbox' => 'setSandbox', + 'tiersExpirationPolicy' => 'setTiersExpirationPolicy', 'tiersExpireIn' => 'setTiersExpireIn', 'tiersDowngradePolicy' => 'setTiersDowngradePolicy', + 'programJoinPolicy' => 'setProgramJoinPolicy', 'tiers' => 'setTiers' ]; @@ -163,8 +171,10 @@ public static function openAPIFormats() 'allowSubledger' => 'getAllowSubledger', 'usersPerCardLimit' => 'getUsersPerCardLimit', 'sandbox' => 'getSandbox', + 'tiersExpirationPolicy' => 'getTiersExpirationPolicy', 'tiersExpireIn' => 'getTiersExpireIn', 'tiersDowngradePolicy' => 'getTiersDowngradePolicy', + 'programJoinPolicy' => 'getProgramJoinPolicy', 'tiers' => 'getTiers' ]; @@ -209,11 +219,29 @@ public function getModelName() return self::$openAPIModelName; } + const TIERS_EXPIRATION_POLICY_TIER_START_DATE = 'tier_start_date'; + const TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE = 'program_join_date'; 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'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTiersExpirationPolicyAllowableValues() + { + return [ + self::TIERS_EXPIRATION_POLICY_TIER_START_DATE, + self::TIERS_EXPIRATION_POLICY_PROGRAM_JOIN_DATE, + ]; + } + /** * Gets allowable values of the enum * @@ -227,6 +255,20 @@ public function getTiersDowngradePolicyAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getProgramJoinPolicyAllowableValues() + { + return [ + self::PROGRAM_JOIN_POLICY_NOT_JOIN, + self::PROGRAM_JOIN_POLICY_POINTS_ACTIVATED, + self::PROGRAM_JOIN_POLICY_POINTS_EARNED, + ]; + } + /** * Associative array for storing property values @@ -251,8 +293,10 @@ 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['tiersExpirationPolicy'] = isset($data['tiersExpirationPolicy']) ? $data['tiersExpirationPolicy'] : 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['tiers'] = isset($data['tiers']) ? $data['tiers'] : null; } @@ -269,6 +313,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'usersPerCardLimit', must be bigger than or equal to 0."; } + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($this->container['tiersExpirationPolicy']) && !in_array($this->container['tiersExpirationPolicy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTiersDowngradePolicyAllowableValues(); if (!is_null($this->container['tiersDowngradePolicy']) && !in_array($this->container['tiersDowngradePolicy'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -277,6 +329,14 @@ 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; } @@ -489,6 +549,39 @@ public function setSandbox($sandbox) return $this; } + /** + * Gets tiersExpirationPolicy + * + * @return string|null + */ + public function getTiersExpirationPolicy() + { + return $this->container['tiersExpirationPolicy']; + } + + /** + * 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. + * + * @return $this + */ + public function setTiersExpirationPolicy($tiersExpirationPolicy) + { + $allowedValues = $this->getTiersExpirationPolicyAllowableValues(); + if (!is_null($tiersExpirationPolicy) && !in_array($tiersExpirationPolicy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'tiersExpirationPolicy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['tiersExpirationPolicy'] = $tiersExpirationPolicy; + + return $this; + } + /** * Gets tiersExpireIn * @@ -502,7 +595,7 @@ public function getTiersExpireIn() /** * Sets tiersExpireIn * - * @param string|null $tiersExpireIn The amount of time until the expiration of every tier, starting from the date when the customer joined the considered tier for the first time. 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. 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 */ @@ -546,6 +639,39 @@ public function setTiersDowngradePolicy($tiersDowngradePolicy) 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 tiers * diff --git a/lib/Model/UpdatePicklist.php b/lib/Model/UpdatePicklist.php index f4219402..7230da3d 100644 --- a/lib/Model/UpdatePicklist.php +++ b/lib/Model/UpdatePicklist.php @@ -257,7 +257,7 @@ public function getType() /** * Sets type * - * @param string $type The type of allowed values in the picklist. If type time is chosen, it must be an RFC3339 timestamp string. + * @param string $type The type of allowed values in the picklist. If the type `time` is chosen, it must be an RFC3339 timestamp string. * * @return $this */ diff --git a/lib/Model/UpdateUser.php b/lib/Model/UpdateUser.php index 9c156a52..a83200c4 100644 --- a/lib/Model/UpdateUser.php +++ b/lib/Model/UpdateUser.php @@ -58,11 +58,11 @@ class UpdateUser implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'name' => 'string', - 'policy' => 'string', 'state' => 'string', + 'isAdmin' => 'bool', + 'policy' => 'string', 'roles' => 'int[]', - 'applicationNotificationSubscriptions' => 'object', - 'isAdmin' => 'bool' + 'applicationNotificationSubscriptions' => 'object' ]; /** @@ -72,11 +72,11 @@ class UpdateUser implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'name' => null, - 'policy' => null, 'state' => null, + 'isAdmin' => null, + 'policy' => null, 'roles' => null, - 'applicationNotificationSubscriptions' => null, - 'isAdmin' => null + 'applicationNotificationSubscriptions' => null ]; /** @@ -107,11 +107,11 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'policy' => 'policy', 'state' => 'state', + 'isAdmin' => 'isAdmin', + 'policy' => 'policy', 'roles' => 'roles', - 'applicationNotificationSubscriptions' => 'applicationNotificationSubscriptions', - 'isAdmin' => 'isAdmin' + 'applicationNotificationSubscriptions' => 'applicationNotificationSubscriptions' ]; /** @@ -121,11 +121,11 @@ public static function openAPIFormats() */ protected static $setters = [ 'name' => 'setName', - 'policy' => 'setPolicy', 'state' => 'setState', + 'isAdmin' => 'setIsAdmin', + 'policy' => 'setPolicy', 'roles' => 'setRoles', - 'applicationNotificationSubscriptions' => 'setApplicationNotificationSubscriptions', - 'isAdmin' => 'setIsAdmin' + 'applicationNotificationSubscriptions' => 'setApplicationNotificationSubscriptions' ]; /** @@ -135,11 +135,11 @@ public static function openAPIFormats() */ protected static $getters = [ 'name' => 'getName', - 'policy' => 'getPolicy', 'state' => 'getState', + 'isAdmin' => 'getIsAdmin', + 'policy' => 'getPolicy', 'roles' => 'getRoles', - 'applicationNotificationSubscriptions' => 'getApplicationNotificationSubscriptions', - 'isAdmin' => 'getIsAdmin' + 'applicationNotificationSubscriptions' => 'getApplicationNotificationSubscriptions' ]; /** @@ -218,11 +218,11 @@ public function getStateAllowableValues() public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['policy'] = isset($data['policy']) ? $data['policy'] : null; $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['isAdmin'] = isset($data['isAdmin']) ? $data['isAdmin'] : null; + $this->container['policy'] = isset($data['policy']) ? $data['policy'] : null; $this->container['roles'] = isset($data['roles']) ? $data['roles'] : null; $this->container['applicationNotificationSubscriptions'] = isset($data['applicationNotificationSubscriptions']) ? $data['applicationNotificationSubscriptions'] : null; - $this->container['isAdmin'] = isset($data['isAdmin']) ? $data['isAdmin'] : null; } /** @@ -270,7 +270,7 @@ public function getName() /** * Sets name * - * @param string|null $name The user name. + * @param string|null $name Name of the user. * * @return $this */ @@ -282,130 +282,130 @@ public function setName($name) } /** - * Gets policy + * Gets state * * @return string|null */ - public function getPolicy() + public function getState() { - return $this->container['policy']; + return $this->container['state']; } /** - * Sets policy + * Sets state * - * @param string|null $policy The `Access Control List` json defining the role of the user. This represents the access control on the user level. + * @param string|null $state The state of the user. - `deactivated`: The user has been deactivated. - `active`: The user is active. **Note**: Only `admin` users can update the state of another user. * * @return $this */ - public function setPolicy($policy) + public function setState($state) { - $this->container['policy'] = $policy; + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !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 state + * Gets isAdmin * - * @return string|null + * @return bool|null */ - public function getState() + public function getIsAdmin() { - return $this->container['state']; + return $this->container['isAdmin']; } /** - * Sets state + * Sets isAdmin * - * @param string|null $state New state (\"deactivated\" or \"active\") for the user. Only usable by admins for the user. + * @param bool|null $isAdmin Indicates whether the user is an `admin`. * * @return $this */ - public function setState($state) + public function setIsAdmin($isAdmin) { - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($state) && !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['isAdmin'] = $isAdmin; return $this; } /** - * Gets roles + * Gets policy * - * @return int[]|null + * @return string|null */ - public function getRoles() + public function getPolicy() { - return $this->container['roles']; + return $this->container['policy']; } /** - * Sets roles + * Sets policy * - * @param int[]|null $roles List of roles to assign to the user. + * @param string|null $policy Indicates the access level of the user. * * @return $this */ - public function setRoles($roles) + public function setPolicy($policy) { - $this->container['roles'] = $roles; + $this->container['policy'] = $policy; return $this; } /** - * Gets applicationNotificationSubscriptions + * Gets roles * - * @return object|null + * @return int[]|null */ - public function getApplicationNotificationSubscriptions() + public function getRoles() { - return $this->container['applicationNotificationSubscriptions']; + return $this->container['roles']; } /** - * Sets applicationNotificationSubscriptions + * Sets roles * - * @param object|null $applicationNotificationSubscriptions applicationNotificationSubscriptions + * @param int[]|null $roles A list of the IDs of the roles assigned to the user. **Note**: Use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint to find the ID of a role. * * @return $this */ - public function setApplicationNotificationSubscriptions($applicationNotificationSubscriptions) + public function setRoles($roles) { - $this->container['applicationNotificationSubscriptions'] = $applicationNotificationSubscriptions; + $this->container['roles'] = $roles; return $this; } /** - * Gets isAdmin + * Gets applicationNotificationSubscriptions * - * @return bool|null + * @return object|null */ - public function getIsAdmin() + public function getApplicationNotificationSubscriptions() { - return $this->container['isAdmin']; + return $this->container['applicationNotificationSubscriptions']; } /** - * Sets isAdmin + * Sets applicationNotificationSubscriptions * - * @param bool|null $isAdmin An indication of whether the user has admin permissions. + * @param object|null $applicationNotificationSubscriptions Application notifications that the user is subscribed to. * * @return $this */ - public function setIsAdmin($isAdmin) + public function setApplicationNotificationSubscriptions($applicationNotificationSubscriptions) { - $this->container['isAdmin'] = $isAdmin; + $this->container['applicationNotificationSubscriptions'] = $applicationNotificationSubscriptions; return $this; } diff --git a/lib/Model/User.php b/lib/Model/User.php index f5f49ac1..18ffc53d 100644 --- a/lib/Model/User.php +++ b/lib/Model/User.php @@ -63,17 +63,17 @@ class User implements ModelInterface, ArrayAccess 'modified' => '\DateTime', 'email' => 'string', 'accountId' => 'int', - 'inviteToken' => 'string', - 'state' => 'string', 'name' => 'string', + 'state' => 'string', + 'inviteToken' => 'string', + 'isAdmin' => 'bool', 'policy' => 'object', - 'latestFeedTimestamp' => '\DateTime', 'roles' => 'int[]', - 'applicationNotificationSubscriptions' => 'object', 'authMethod' => 'string', - 'isAdmin' => 'bool', + 'applicationNotificationSubscriptions' => 'object', 'lastSignedIn' => '\DateTime', - 'lastAccessed' => '\DateTime' + 'lastAccessed' => '\DateTime', + 'latestFeedTimestamp' => '\DateTime' ]; /** @@ -87,17 +87,17 @@ class User implements ModelInterface, ArrayAccess 'modified' => 'date-time', 'email' => 'email', 'accountId' => null, - 'inviteToken' => null, - 'state' => null, 'name' => null, + 'state' => null, + 'inviteToken' => null, + 'isAdmin' => null, 'policy' => null, - 'latestFeedTimestamp' => 'date-time', 'roles' => null, - 'applicationNotificationSubscriptions' => null, 'authMethod' => null, - 'isAdmin' => null, + 'applicationNotificationSubscriptions' => null, 'lastSignedIn' => 'date-time', - 'lastAccessed' => 'date-time' + 'lastAccessed' => 'date-time', + 'latestFeedTimestamp' => 'date-time' ]; /** @@ -132,17 +132,17 @@ public static function openAPIFormats() 'modified' => 'modified', 'email' => 'email', 'accountId' => 'accountId', - 'inviteToken' => 'inviteToken', - 'state' => 'state', 'name' => 'name', + 'state' => 'state', + 'inviteToken' => 'inviteToken', + 'isAdmin' => 'isAdmin', 'policy' => 'policy', - 'latestFeedTimestamp' => 'latestFeedTimestamp', 'roles' => 'roles', - 'applicationNotificationSubscriptions' => 'applicationNotificationSubscriptions', 'authMethod' => 'authMethod', - 'isAdmin' => 'isAdmin', + 'applicationNotificationSubscriptions' => 'applicationNotificationSubscriptions', 'lastSignedIn' => 'lastSignedIn', - 'lastAccessed' => 'lastAccessed' + 'lastAccessed' => 'lastAccessed', + 'latestFeedTimestamp' => 'latestFeedTimestamp' ]; /** @@ -156,17 +156,17 @@ public static function openAPIFormats() 'modified' => 'setModified', 'email' => 'setEmail', 'accountId' => 'setAccountId', - 'inviteToken' => 'setInviteToken', - 'state' => 'setState', 'name' => 'setName', + 'state' => 'setState', + 'inviteToken' => 'setInviteToken', + 'isAdmin' => 'setIsAdmin', 'policy' => 'setPolicy', - 'latestFeedTimestamp' => 'setLatestFeedTimestamp', 'roles' => 'setRoles', - 'applicationNotificationSubscriptions' => 'setApplicationNotificationSubscriptions', 'authMethod' => 'setAuthMethod', - 'isAdmin' => 'setIsAdmin', + 'applicationNotificationSubscriptions' => 'setApplicationNotificationSubscriptions', 'lastSignedIn' => 'setLastSignedIn', - 'lastAccessed' => 'setLastAccessed' + 'lastAccessed' => 'setLastAccessed', + 'latestFeedTimestamp' => 'setLatestFeedTimestamp' ]; /** @@ -180,17 +180,17 @@ public static function openAPIFormats() 'modified' => 'getModified', 'email' => 'getEmail', 'accountId' => 'getAccountId', - 'inviteToken' => 'getInviteToken', - 'state' => 'getState', 'name' => 'getName', + 'state' => 'getState', + 'inviteToken' => 'getInviteToken', + 'isAdmin' => 'getIsAdmin', 'policy' => 'getPolicy', - 'latestFeedTimestamp' => 'getLatestFeedTimestamp', 'roles' => 'getRoles', - 'applicationNotificationSubscriptions' => 'getApplicationNotificationSubscriptions', 'authMethod' => 'getAuthMethod', - 'isAdmin' => 'getIsAdmin', + 'applicationNotificationSubscriptions' => 'getApplicationNotificationSubscriptions', 'lastSignedIn' => 'getLastSignedIn', - 'lastAccessed' => 'getLastAccessed' + 'lastAccessed' => 'getLastAccessed', + 'latestFeedTimestamp' => 'getLatestFeedTimestamp' ]; /** @@ -275,17 +275,17 @@ public function __construct(array $data = null) $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; $this->container['accountId'] = isset($data['accountId']) ? $data['accountId'] : null; - $this->container['inviteToken'] = isset($data['inviteToken']) ? $data['inviteToken'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['inviteToken'] = isset($data['inviteToken']) ? $data['inviteToken'] : null; + $this->container['isAdmin'] = isset($data['isAdmin']) ? $data['isAdmin'] : null; $this->container['policy'] = isset($data['policy']) ? $data['policy'] : null; - $this->container['latestFeedTimestamp'] = isset($data['latestFeedTimestamp']) ? $data['latestFeedTimestamp'] : null; $this->container['roles'] = isset($data['roles']) ? $data['roles'] : null; - $this->container['applicationNotificationSubscriptions'] = isset($data['applicationNotificationSubscriptions']) ? $data['applicationNotificationSubscriptions'] : null; $this->container['authMethod'] = isset($data['authMethod']) ? $data['authMethod'] : null; - $this->container['isAdmin'] = isset($data['isAdmin']) ? $data['isAdmin'] : null; + $this->container['applicationNotificationSubscriptions'] = isset($data['applicationNotificationSubscriptions']) ? $data['applicationNotificationSubscriptions'] : 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; } /** @@ -312,8 +312,8 @@ public function listInvalidProperties() if ($this->container['accountId'] === null) { $invalidProperties[] = "'accountId' can't be null"; } - if ($this->container['inviteToken'] === null) { - $invalidProperties[] = "'inviteToken' can't be null"; + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; } if ($this->container['state'] === null) { $invalidProperties[] = "'state' can't be null"; @@ -326,8 +326,8 @@ public function listInvalidProperties() ); } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; + if ($this->container['inviteToken'] === null) { + $invalidProperties[] = "'inviteToken' can't be null"; } if ($this->container['policy'] === null) { $invalidProperties[] = "'policy' can't be null"; @@ -432,7 +432,7 @@ public function getEmail() /** * Sets email * - * @param string $email The email address associated with your account. + * @param string $email The email address associated with the user profile. * * @return $this */ @@ -468,25 +468,25 @@ public function setAccountId($accountId) } /** - * Gets inviteToken + * Gets name * * @return string */ - public function getInviteToken() + public function getName() { - return $this->container['inviteToken']; + return $this->container['name']; } /** - * Sets inviteToken + * Sets name * - * @param string $inviteToken Invite token, empty if the user as already accepted their invite. + * @param string $name Name of the user. * * @return $this */ - public function setInviteToken($inviteToken) + public function setName($name) { - $this->container['inviteToken'] = $inviteToken; + $this->container['name'] = $name; return $this; } @@ -504,7 +504,7 @@ public function getState() /** * Sets state * - * @param string $state Current user state. + * @param string $state State of the user. * * @return $this */ @@ -525,73 +525,73 @@ public function setState($state) } /** - * Gets name + * Gets inviteToken * * @return string */ - public function getName() + public function getInviteToken() { - return $this->container['name']; + return $this->container['inviteToken']; } /** - * Sets name + * Sets inviteToken * - * @param string $name Full name + * @param string $inviteToken Invitation token of the user. **Note**: If the user has already accepted their invitation, this is `null`. * * @return $this */ - public function setName($name) + public function setInviteToken($inviteToken) { - $this->container['name'] = $name; + $this->container['inviteToken'] = $inviteToken; return $this; } /** - * Gets policy + * Gets isAdmin * - * @return object + * @return bool|null */ - public function getPolicy() + public function getIsAdmin() { - return $this->container['policy']; + return $this->container['isAdmin']; } /** - * Sets policy + * Sets isAdmin * - * @param object $policy User ACL Policy + * @param bool|null $isAdmin Indicates whether the user is an `admin`. * * @return $this */ - public function setPolicy($policy) + public function setIsAdmin($isAdmin) { - $this->container['policy'] = $policy; + $this->container['isAdmin'] = $isAdmin; return $this; } /** - * Gets latestFeedTimestamp + * Gets policy * - * @return \DateTime|null + * @return object */ - public function getLatestFeedTimestamp() + public function getPolicy() { - return $this->container['latestFeedTimestamp']; + return $this->container['policy']; } /** - * Sets latestFeedTimestamp + * Sets policy * - * @param \DateTime|null $latestFeedTimestamp Latest timestamp the user has been notified for feed. + * @param object $policy Access level of the user. * * @return $this */ - public function setLatestFeedTimestamp($latestFeedTimestamp) + public function setPolicy($policy) { - $this->container['latestFeedTimestamp'] = $latestFeedTimestamp; + $this->container['policy'] = $policy; return $this; } @@ -609,7 +609,7 @@ public function getRoles() /** * Sets roles * - * @param int[]|null $roles Contains a list of all roles the user is a member of. + * @param int[]|null $roles A list of the IDs of the roles assigned to the user. * * @return $this */ @@ -620,30 +620,6 @@ public function setRoles($roles) return $this; } - /** - * Gets applicationNotificationSubscriptions - * - * @return object|null - */ - public function getApplicationNotificationSubscriptions() - { - return $this->container['applicationNotificationSubscriptions']; - } - - /** - * Sets applicationNotificationSubscriptions - * - * @param object|null $applicationNotificationSubscriptions applicationNotificationSubscriptions - * - * @return $this - */ - public function setApplicationNotificationSubscriptions($applicationNotificationSubscriptions) - { - $this->container['applicationNotificationSubscriptions'] = $applicationNotificationSubscriptions; - - return $this; - } - /** * Gets authMethod * @@ -657,7 +633,7 @@ public function getAuthMethod() /** * Sets authMethod * - * @param string|null $authMethod The Authentication method for this user. + * @param string|null $authMethod Authentication method for this user. * * @return $this */ @@ -669,25 +645,25 @@ public function setAuthMethod($authMethod) } /** - * Gets isAdmin + * Gets applicationNotificationSubscriptions * - * @return bool|null + * @return object|null */ - public function getIsAdmin() + public function getApplicationNotificationSubscriptions() { - return $this->container['isAdmin']; + return $this->container['applicationNotificationSubscriptions']; } /** - * Sets isAdmin + * Sets applicationNotificationSubscriptions * - * @param bool|null $isAdmin An indication of whether the user has admin permissions. + * @param object|null $applicationNotificationSubscriptions Application notifications that the user is subscribed to. * * @return $this */ - public function setIsAdmin($isAdmin) + public function setApplicationNotificationSubscriptions($applicationNotificationSubscriptions) { - $this->container['isAdmin'] = $isAdmin; + $this->container['applicationNotificationSubscriptions'] = $applicationNotificationSubscriptions; return $this; } @@ -705,7 +681,7 @@ public function getLastSignedIn() /** * Sets lastSignedIn * - * @param \DateTime|null $lastSignedIn Date and time when the user last signed in to Talon.One. + * @param \DateTime|null $lastSignedIn Timestamp when the user last signed in to Talon.One. * * @return $this */ @@ -729,7 +705,7 @@ public function getLastAccessed() /** * Sets lastAccessed * - * @param \DateTime|null $lastAccessed Date and time of the user's last activity after signing in to Talon.One. + * @param \DateTime|null $lastAccessed Timestamp of the user's last activity after signing in to Talon.One. * * @return $this */ @@ -739,6 +715,30 @@ public function setLastAccessed($lastAccessed) return $this; } + + /** + * Gets latestFeedTimestamp + * + * @return \DateTime|null + */ + public function getLatestFeedTimestamp() + { + return $this->container['latestFeedTimestamp']; + } + + /** + * Sets latestFeedTimestamp + * + * @param \DateTime|null $latestFeedTimestamp Timestamp when the user was notified for feed. + * + * @return $this + */ + public function setLatestFeedTimestamp($latestFeedTimestamp) + { + $this->container['latestFeedTimestamp'] = $latestFeedTimestamp; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/test/Api/ManagementApiTest.php b/test/Api/ManagementApiTest.php index 12d339a2..4a1e9712 100644 --- a/test/Api/ManagementApiTest.php +++ b/test/Api/ManagementApiTest.php @@ -112,6 +112,16 @@ public function testCreateAccountCollection() { } + /** + * Test case for createAchievement + * + * Create achievement. + * + */ + public function testCreateAchievement() + { + } + /** * Test case for createAdditionalCost * @@ -182,6 +192,26 @@ public function testCreateCouponsForMultipleRecipients() { } + /** + * Test case for createInviteEmail + * + * Resend invitation email. + * + */ + public function testCreateInviteEmail() + { + } + + /** + * Test case for createInviteV2 + * + * Invite user. + * + */ + public function testCreateInviteV2() + { + } + /** * Test case for createPasswordRecoveryEmail * @@ -212,6 +242,16 @@ public function testCreateStore() { } + /** + * Test case for deactivateUserByEmail + * + * Deactivate user by email address. + * + */ + public function testDeactivateUserByEmail() + { + } + /** * Test case for deductLoyaltyCardPoints * @@ -232,6 +272,16 @@ public function testDeleteAccountCollection() { } + /** + * Test case for deleteAchievement + * + * Delete achievement. + * + */ + public function testDeleteAchievement() + { + } + /** * Test case for deleteCampaign * @@ -302,6 +352,26 @@ public function testDeleteStore() { } + /** + * Test case for deleteUser + * + * Delete user. + * + */ + public function testDeleteUser() + { + } + + /** + * Test case for deleteUserByEmail + * + * Delete user by email address. + * + */ + public function testDeleteUserByEmail() + { + } + /** * Test case for destroySession * @@ -322,6 +392,26 @@ public function testExportAccountCollectionItems() { } + /** + * Test case for exportAchievements + * + * Export achievement customer data. + * + */ + public function testExportAchievements() + { + } + + /** + * Test case for exportAudiencesMemberships + * + * Export audience members. + * + */ + public function testExportAudiencesMemberships() + { + } + /** * Test case for exportCollectionItems * @@ -482,6 +572,16 @@ public function testGetAccountCollection() { } + /** + * Test case for getAchievement + * + * Get achievement. + * + */ + public function testGetAchievement() + { + } + /** * Test case for getAdditionalCost * @@ -652,6 +752,16 @@ public function testGetAttributes() { } + /** + * Test case for getAudienceMemberships + * + * List audience members. + * + */ + public function testGetAudienceMemberships() + { + } + /** * Test case for getAudiences * @@ -662,6 +772,16 @@ public function testGetAudiences() { } + /** + * Test case for getAudiencesAnalytics + * + * List audience analytics. + * + */ + public function testGetAudiencesAnalytics() + { + } + /** * Test case for getCampaign * @@ -692,6 +812,26 @@ public function testGetCampaignByAttributes() { } + /** + * Test case for getCampaignGroup + * + * Get campaign access group. + * + */ + public function testGetCampaignGroup() + { + } + + /** + * Test case for getCampaignGroups + * + * List campaign access groups. + * + */ + public function testGetCampaignGroups() + { + } + /** * Test case for getCampaignTemplates * @@ -792,6 +932,16 @@ public function testGetCustomerProfile() { } + /** + * Test case for getCustomerProfileAchievementProgress + * + * List customer achievements. + * + */ + public function testGetCustomerProfileAchievementProgress() + { + } + /** * Test case for getCustomerProfiles * @@ -1042,6 +1192,16 @@ public function testImportAllowedList() { } + /** + * Test case for importAudiencesMemberships + * + * Import audience members. + * + */ + public function testImportAudiencesMemberships() + { + } + /** * Test case for importCollection * @@ -1122,6 +1282,16 @@ public function testListAccountCollections() { } + /** + * Test case for listAchievements + * + * List achievements. + * + */ + public function testListAchievements() + { + } + /** * Test case for listCatalogItems * @@ -1262,6 +1432,16 @@ public function testUpdateAccountCollection() { } + /** + * Test case for updateAchievement + * + * Update achievement. + * + */ + public function testUpdateAchievement() + { + } + /** * Test case for updateAdditionalCost * @@ -1342,6 +1522,16 @@ public function testUpdateReferral() { } + /** + * Test case for updateRoleV2 + * + * Update role. + * + */ + public function testUpdateRoleV2() + { + } + /** * Test case for updateStore * @@ -1351,4 +1541,14 @@ public function testUpdateReferral() public function testUpdateStore() { } + + /** + * Test case for updateUser + * + * Update user. + * + */ + public function testUpdateUser() + { + } } diff --git a/test/Model/AccountDashboardStatisticTest.php b/test/Model/AccountDashboardStatisticTest.php index 06c3809c..19031895 100644 --- a/test/Model/AccountDashboardStatisticTest.php +++ b/test/Model/AccountDashboardStatisticTest.php @@ -106,13 +106,6 @@ public function testPropertyReferrals() { } - /** - * Test attribute "apiCalls" - */ - public function testPropertyApiCalls() - { - } - /** * Test attribute "campaigns" */ diff --git a/test/Model/AchievementAdditionalPropertiesTest.php b/test/Model/AchievementAdditionalPropertiesTest.php new file mode 100644 index 00000000..26adb5dc --- /dev/null +++ b/test/Model/AchievementAdditionalPropertiesTest.php @@ -0,0 +1,108 @@ +