From 8c9dfb21121f6a37cee4e6bd0d28a6f2cf0bce54 Mon Sep 17 00:00:00 2001 From: rubyjohn93 Date: Tue, 11 Jun 2024 08:07:32 +0200 Subject: [PATCH] Update sdk --- README.md | 11 +- composer.json | 2 +- docs/Api/IntegrationApi.md | 28 +- docs/Api/ManagementApi.md | 292 +- docs/Model/ActivateUserRequest.md | 11 + docs/Model/Coupon.md | 4 +- docs/Model/CustomerInventory.md | 2 +- docs/Model/InlineResponse20044.md | 2 +- docs/Model/IntegrationCoupon.md | 4 +- docs/Model/InventoryCoupon.md | 4 +- docs/Model/LoyaltyCardBalances.md | 13 + docs/Model/LoyaltyCardProfileRegistration.md | 2 +- docs/Model/MessageLogEntry.md | 3 +- docs/Model/NewCoupons.md | 2 +- docs/Model/NewExternalInvitation.md | 13 + docs/Model/UpdateCoupon.md | 2 +- docs/Model/UpdateUser.md | 2 +- lib/Api/IntegrationApi.php | 98 +- lib/Api/ManagementApi.php | 4524 ++++++++++-------- lib/Configuration.php | 4 +- lib/Model/ActivateUserRequest.php | 312 ++ lib/Model/AdditionalCampaignProperties.php | 4 + lib/Model/Campaign.php | 4 + lib/Model/Coupon.php | 4 +- lib/Model/CustomerInventory.php | 2 +- lib/Model/InlineResponse20044.php | 6 +- lib/Model/IntegrationCoupon.php | 4 +- lib/Model/InventoryCoupon.php | 4 +- lib/Model/LoyaltyCardBalances.php | 369 ++ lib/Model/LoyaltyCardProfileRegistration.php | 2 +- lib/Model/MessageLogEntry.php | 34 +- lib/Model/NewCoupons.php | 2 +- lib/Model/NewExternalInvitation.php | 372 ++ lib/Model/UpdateCoupon.php | 2 +- lib/Model/UpdateUser.php | 2 +- test/Api/ManagementApiTest.php | 44 +- test/Model/ActivateUserRequestTest.php | 87 + test/Model/LoyaltyCardBalancesTest.php | 101 + test/Model/MessageLogEntryTest.php | 7 - test/Model/NewExternalInvitationTest.php | 101 + 40 files changed, 4241 insertions(+), 2245 deletions(-) create mode 100644 docs/Model/ActivateUserRequest.md create mode 100644 docs/Model/LoyaltyCardBalances.md create mode 100644 docs/Model/NewExternalInvitation.md create mode 100644 lib/Model/ActivateUserRequest.php create mode 100644 lib/Model/LoyaltyCardBalances.php create mode 100644 lib/Model/NewExternalInvitation.php create mode 100644 test/Model/ActivateUserRequestTest.php create mode 100644 test/Model/LoyaltyCardBalancesTest.php create mode 100644 test/Model/NewExternalInvitationTest.php diff --git a/README.md b/README.md index 6dade98f..02309f2c 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: 7.0.0 +- Package version: 8.0.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen ## Requirements @@ -217,6 +217,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**updateCustomerProfileV2**](docs/Api/IntegrationApi.md#updatecustomerprofilev2) | **PUT** /v2/customer_profiles/{integrationId} | Update customer profile *IntegrationApi* | [**updateCustomerProfilesV2**](docs/Api/IntegrationApi.md#updatecustomerprofilesv2) | **PUT** /v2/customer_profiles | Update multiple customer profiles *IntegrationApi* | [**updateCustomerSessionV2**](docs/Api/IntegrationApi.md#updatecustomersessionv2) | **PUT** /v2/customer_sessions/{customerSessionId} | Update customer session +*ManagementApi* | [**activateUserByEmail**](docs/Api/ManagementApi.md#activateuserbyemail) | **POST** /v1/users/activate | Activate user by email address *ManagementApi* | [**addLoyaltyCardPoints**](docs/Api/ManagementApi.md#addloyaltycardpoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/add_points | Add points to card *ManagementApi* | [**addLoyaltyPoints**](docs/Api/ManagementApi.md#addloyaltypoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/add_points | Add points to customer profile *ManagementApi* | [**copyCampaignToApplications**](docs/Api/ManagementApi.md#copycampaigntoapplications) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/copy | Copy the campaign into the specified Application @@ -271,7 +272,6 @@ Class | Method | HTTP request | Description *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 -*ManagementApi* | [**getAllRoles**](docs/Api/ManagementApi.md#getallroles) | **GET** /v1/roles | List roles *ManagementApi* | [**getApplication**](docs/Api/ManagementApi.md#getapplication) | **GET** /v1/applications/{applicationId} | Get Application *ManagementApi* | [**getApplicationApiHealth**](docs/Api/ManagementApi.md#getapplicationapihealth) | **GET** /v1/applications/{applicationId}/health_report | Get Application health *ManagementApi* | [**getApplicationCustomer**](docs/Api/ManagementApi.md#getapplicationcustomer) | **GET** /v1/applications/{applicationId}/customers/{customerId} | Get application's customer @@ -317,7 +317,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**getLoyaltyPrograms**](docs/Api/ManagementApi.md#getloyaltyprograms) | **GET** /v1/loyalty_programs | List loyalty programs *ManagementApi* | [**getLoyaltyStatistics**](docs/Api/ManagementApi.md#getloyaltystatistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/statistics | Get loyalty program statistics *ManagementApi* | [**getReferralsWithoutTotalCount**](docs/Api/ManagementApi.md#getreferralswithouttotalcount) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total | List referrals -*ManagementApi* | [**getRole**](docs/Api/ManagementApi.md#getrole) | **GET** /v1/roles/{roleId} | Get role +*ManagementApi* | [**getRoleV2**](docs/Api/ManagementApi.md#getrolev2) | **GET** /v2/roles/{roleId} | Get role *ManagementApi* | [**getRuleset**](docs/Api/ManagementApi.md#getruleset) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Get ruleset *ManagementApi* | [**getRulesets**](docs/Api/ManagementApi.md#getrulesets) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets | List campaign rulesets *ManagementApi* | [**getStore**](docs/Api/ManagementApi.md#getstore) | **GET** /v1/applications/{applicationId}/stores/{storeId} | Get store @@ -337,8 +337,10 @@ Class | Method | HTTP request | Description *ManagementApi* | [**importLoyaltyPoints**](docs/Api/ManagementApi.md#importloyaltypoints) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_points | Import loyalty points *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* | [**inviteUserExternal**](docs/Api/ManagementApi.md#inviteuserexternal) | **POST** /v1/users/invite | Invite user from identity provider *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* | [**listAllRolesV2**](docs/Api/ManagementApi.md#listallrolesv2) | **GET** /v2/roles | List roles *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 @@ -387,6 +389,7 @@ Class | Method | HTTP request | Description - [Achievement](docs/Model/Achievement.md) - [AchievementAdditionalProperties](docs/Model/AchievementAdditionalProperties.md) - [AchievementProgress](docs/Model/AchievementProgress.md) + - [ActivateUserRequest](docs/Model/ActivateUserRequest.md) - [AddFreeItemEffectProps](docs/Model/AddFreeItemEffectProps.md) - [AddItemCatalogAction](docs/Model/AddItemCatalogAction.md) - [AddLoyaltyPoints](docs/Model/AddLoyaltyPoints.md) @@ -626,6 +629,7 @@ Class | Method | HTTP request | Description - [LoyaltyBalance](docs/Model/LoyaltyBalance.md) - [LoyaltyBalances](docs/Model/LoyaltyBalances.md) - [LoyaltyCard](docs/Model/LoyaltyCard.md) + - [LoyaltyCardBalances](docs/Model/LoyaltyCardBalances.md) - [LoyaltyCardProfileRegistration](docs/Model/LoyaltyCardProfileRegistration.md) - [LoyaltyCardRegistration](docs/Model/LoyaltyCardRegistration.md) - [LoyaltyDashboardData](docs/Model/LoyaltyDashboardData.md) @@ -685,6 +689,7 @@ Class | Method | HTTP request | Description - [NewCustomerSessionV2](docs/Model/NewCustomerSessionV2.md) - [NewEvent](docs/Model/NewEvent.md) - [NewEventType](docs/Model/NewEventType.md) + - [NewExternalInvitation](docs/Model/NewExternalInvitation.md) - [NewGiveawaysPool](docs/Model/NewGiveawaysPool.md) - [NewInternalAudience](docs/Model/NewInternalAudience.md) - [NewInvitation](docs/Model/NewInvitation.md) diff --git a/composer.json b/composer.json index 02656c75..d3f91141 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "talon-one/talon-one-client", "type": "library", - "version": "7.0.0", + "version": "8.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 99a1e220..dd4f0c00 100644 --- a/docs/Api/IntegrationApi.md +++ b/docs/Api/IntegrationApi.md @@ -104,7 +104,7 @@ Name | Type | Description | Notes Create coupon reservation -Create a coupon reservation for specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation effect](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). Reserving a coupon allows you to associate a coupon code to a given customer(s). You can then list the reserved coupons of a given customer with the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. If a coupon gets created for a specific user, it will automatically appear in their coupons. When a user redeems a coupon, a reservation is automatically created after the redemption and the used coupon will be returned in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. For example, you can use this endpoint and `List customer data` to create a _coupon wallet_ by reserving coupon codes for a customer, and then displaying their coupon wallet when they visit your store. If the **Coupon visibility** checkbox was selected when [creating a universal code](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons#generating-a-universal-code), the coupon code is implicitly reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint.

Important

This endpoint creates a **soft** reservation. _Any_ customer can use a reserved coupon code and proceed to checkout. To create a hard reservation, you can: - use the [Create coupons](https://docs.talon.one/management-api#operation/createCoupons) endpoint or, - use the [Create coupons for multiple recipients](https://docs.talon.one/management-api#operation/createCouponsForMultipleRecipients) endpoint setting the `recipientsIntegrationId` property or, - create a coupon code with the **Reservation mandatory** option then use the [Create coupon code reservation effect](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). This endpoint overrides the reservation limit set for the coupon code during coupon creation.
To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. +Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation effect](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon will be associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. ### Example @@ -681,11 +681,11 @@ Name | Type | Description | Notes ## getLoyaltyBalances -> \TalonOne\Client\Model\LoyaltyBalances getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate) +> \TalonOne\Client\Model\LoyaltyBalances getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate, $subledgerId) Get customer's loyalty points -Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date. If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. **Note:** For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) +Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) ### Example @@ -709,9 +709,10 @@ $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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. +$subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. try { - $result = $apiInstance->getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate); + $result = $apiInstance->getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate, $subledgerId); print_r($result); } catch (Exception $e) { echo 'Exception when calling IntegrationApi->getLoyaltyBalances: ', $e->getMessage(), PHP_EOL; @@ -727,6 +728,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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] + **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] ### Return type @@ -748,7 +750,7 @@ Name | Type | Description | Notes ## getLoyaltyCardBalances -> \TalonOne\Client\Model\LoyaltyBalances getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDate) +> \TalonOne\Client\Model\LoyaltyCardBalances getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDate, $subledgerId) Get card's point balances @@ -776,9 +778,10 @@ $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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. +$subledgerId = array('subledgerId_example'); // string[] | Filter results by one or more subledger IDs. Must be exact match. try { - $result = $apiInstance->getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDate); + $result = $apiInstance->getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDate, $subledgerId); print_r($result); } catch (Exception $e) { echo 'Exception when calling IntegrationApi->getLoyaltyCardBalances: ', $e->getMessage(), PHP_EOL; @@ -794,10 +797,11 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] + **subledgerId** | [**string[]**](../Model/string.md)| Filter results by one or more subledger IDs. Must be exact match. | [optional] ### Return type -[**\TalonOne\Client\Model\LoyaltyBalances**](../Model/LoyaltyBalances.md) +[**\TalonOne\Client\Model\LoyaltyCardBalances**](../Model/LoyaltyCardBalances.md) ### Authorization @@ -843,7 +847,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. $status = 'active'; // string | Filter points based on their status. -$subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. +$subledgerId = array('subledgerId_example'); // string[] | Filter results by one or more subledger IDs. Must be exact match. $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. @@ -864,7 +868,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. | **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] + **subledgerId** | [**string[]**](../Model/string.md)| Filter results by one or more subledger IDs. Must be exact match. | [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] @@ -915,7 +919,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. -$subledgerId = 'subledgerId_example'; // string | The ID of the subledger by which we filter the data. +$subledgerId = array('subledgerId_example'); // string[] | Filter results by one or more subledger IDs. Must be exact match. $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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting 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. @@ -938,7 +942,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. | - **subledgerId** | **string**| The ID of the subledger by which we filter the data. | [optional] + **subledgerId** | [**string[]**](../Model/string.md)| Filter results by one or more subledger IDs. Must be exact match. | [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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting 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] @@ -1119,7 +1123,7 @@ Name | Type | Description | Notes List customers that have this coupon reserved -Return all customers that have this coupon marked as reserved. Coupons are reserved in the following ways: - To create a soft reservation (any customer can use the coupon), use the [Create coupon reservation](#operation/createCouponReservation) endpoint. - To create a hard reservation (only the given customer can use the coupon), create a coupon in the Campaign Manager for a given `recipientIntegrationId` or use the [Create coupons](https://docs.talon.one/management-api#operation/createCoupons) or [Create coupons for multiple recipients](https://docs.talon.one/management-api#operation/createCouponsForMultipleRecipients) endpoints. +Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. ### Example diff --git a/docs/Api/ManagementApi.md b/docs/Api/ManagementApi.md index 4bfc6497..7d977b29 100644 --- a/docs/Api/ManagementApi.md +++ b/docs/Api/ManagementApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://yourbaseurl.talon.one* Method | HTTP request | Description ------------- | ------------- | ------------- +[**activateUserByEmail**](ManagementApi.md#activateUserByEmail) | **POST** /v1/users/activate | Activate user by email address [**addLoyaltyCardPoints**](ManagementApi.md#addLoyaltyCardPoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/add_points | Add points to card [**addLoyaltyPoints**](ManagementApi.md#addLoyaltyPoints) | **PUT** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/add_points | Add points to customer profile [**copyCampaignToApplications**](ManagementApi.md#copyCampaignToApplications) | **POST** /v1/applications/{applicationId}/campaigns/{campaignId}/copy | Copy the campaign into the specified Application @@ -58,7 +59,6 @@ Method | HTTP request | Description [**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 -[**getAllRoles**](ManagementApi.md#getAllRoles) | **GET** /v1/roles | List roles [**getApplication**](ManagementApi.md#getApplication) | **GET** /v1/applications/{applicationId} | Get Application [**getApplicationApiHealth**](ManagementApi.md#getApplicationApiHealth) | **GET** /v1/applications/{applicationId}/health_report | Get Application health [**getApplicationCustomer**](ManagementApi.md#getApplicationCustomer) | **GET** /v1/applications/{applicationId}/customers/{customerId} | Get application's customer @@ -104,7 +104,7 @@ Method | HTTP request | Description [**getLoyaltyPrograms**](ManagementApi.md#getLoyaltyPrograms) | **GET** /v1/loyalty_programs | List loyalty programs [**getLoyaltyStatistics**](ManagementApi.md#getLoyaltyStatistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/statistics | Get loyalty program statistics [**getReferralsWithoutTotalCount**](ManagementApi.md#getReferralsWithoutTotalCount) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total | List referrals -[**getRole**](ManagementApi.md#getRole) | **GET** /v1/roles/{roleId} | Get role +[**getRoleV2**](ManagementApi.md#getRoleV2) | **GET** /v2/roles/{roleId} | Get role [**getRuleset**](ManagementApi.md#getRuleset) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Get ruleset [**getRulesets**](ManagementApi.md#getRulesets) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets | List campaign rulesets [**getStore**](ManagementApi.md#getStore) | **GET** /v1/applications/{applicationId}/stores/{storeId} | Get store @@ -124,8 +124,10 @@ Method | HTTP request | Description [**importLoyaltyPoints**](ManagementApi.md#importLoyaltyPoints) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/import_points | Import loyalty points [**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 +[**inviteUserExternal**](ManagementApi.md#inviteUserExternal) | **POST** /v1/users/invite | Invite user from identity provider [**listAccountCollections**](ManagementApi.md#listAccountCollections) | **GET** /v1/collections | List collections in account [**listAchievements**](ManagementApi.md#listAchievements) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/achievements | List achievements +[**listAllRolesV2**](ManagementApi.md#listAllRolesV2) | **GET** /v2/roles | List roles [**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 @@ -155,6 +157,73 @@ Method | HTTP request | Description +## activateUserByEmail + +> activateUserByEmail($body) + +Activate user by email address + +Activate a deactivated 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\ActivateUserRequest(); // \TalonOne\Client\Model\ActivateUserRequest | body + +try { + $apiInstance->activateUserByEmail($body); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->activateUserByEmail: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\TalonOne\Client\Model\ActivateUserRequest**](../Model/ActivateUserRequest.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) + + ## addLoyaltyCardPoints > addLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $body) @@ -2623,7 +2692,7 @@ Name | Type | Description | Notes 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. +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 recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon can be reserved for multiple customers. - `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 @@ -4037,70 +4106,6 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getAllRoles - -> \TalonOne\Client\Model\InlineResponse20044 getAllRoles() - -List roles - -List all roles. - -### Example - -```php -setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); - -// Configure API key authorization: manager_auth -$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); - - -$apiInstance = new TalonOne\Client\Api\ManagementApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->getAllRoles(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ManagementApi->getAllRoles: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\TalonOne\Client\Model\InlineResponse20044**](../Model/InlineResponse20044.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) - - ## getApplication > \TalonOne\Client\Model\Application getApplication($applicationId) @@ -7511,13 +7516,13 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## getRole +## getRoleV2 -> \TalonOne\Client\Model\Role getRole($roleId) +> \TalonOne\Client\Model\RoleV2 getRoleV2($roleId) Get role -Get the details of a specific role. To see all the roles, use [List roles](#operation/getAllRoles). +Get the details of a specific role. To see all the roles, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. ### Example @@ -7543,13 +7548,13 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$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. +$roleId = 56; // int | The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. try { - $result = $apiInstance->getRole($roleId); + $result = $apiInstance->getRoleV2($roleId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ManagementApi->getRole: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ManagementApi->getRoleV2: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -7559,11 +7564,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **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. | + **roleId** | **int**| The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. | ### Return type -[**\TalonOne\Client\Model\Role**](../Model/Role.md) +[**\TalonOne\Client\Model\RoleV2**](../Model/RoleV2.md) ### Authorization @@ -8547,7 +8552,7 @@ Name | Type | Description | Notes Import coupons -Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `value` (required): The coupon code. - `expirydate`: The end date in RFC3339 of the code redemption period. - `startdate`: The start date in RFC3339 of the code redemption period. - `recipientintegrationid`: The integration ID of the customer who receives 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). - `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. - `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. - `attributes`: A JSON object describing _custom_ coupon 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 coupon 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. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text \"value\",\"expirydate\",\"startdate\",\"recipientintegrationid\",\"limitval\",\"attributes\",\"discountlimit\" COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\"{\"\"Category\"\": \"\"10_off\"\"}\",2.4 ``` Once imported, you can find the `batchId` in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount). +Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `value` (required): The coupon code. - `expirydate`: The end date in RFC3339 of the code redemption period. - `startdate`: The start date in RFC3339 of the code redemption period. - `recipientintegrationid`: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. - `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. - `attributes`: A JSON object describing _custom_ coupon 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 coupon 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. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text \"value\",\"expirydate\",\"startdate\",\"recipientintegrationid\",\"limitval\",\"attributes\",\"discountlimit\" COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\"{\"\"Category\"\": \"\"10_off\"\"}\",2.4 ``` Once imported, you can find the `batchId` in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount). ### Example @@ -8967,6 +8972,73 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## inviteUserExternal + +> inviteUserExternal($body) + +Invite user from identity provider + +Invite a user from an external identity provider to Talon.One by sending an invitation to 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\NewExternalInvitation(); // \TalonOne\Client\Model\NewExternalInvitation | body + +try { + $apiInstance->inviteUserExternal($body); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->inviteUserExternal: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\TalonOne\Client\Model\NewExternalInvitation**](../Model/NewExternalInvitation.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) + + ## listAccountCollections > \TalonOne\Client\Model\InlineResponse20017 listAccountCollections($pageSize, $skip, $sort, $withTotalResultSize, $name) @@ -9119,6 +9191,70 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) +## listAllRolesV2 + +> \TalonOne\Client\Model\InlineResponse20044 listAllRolesV2() + +List roles + +List all roles. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + +// Configure API key authorization: manager_auth +$config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = TalonOne\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new TalonOne\Client\Api\ManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listAllRolesV2(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ManagementApi->listAllRolesV2: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\TalonOne\Client\Model\InlineResponse20044**](../Model/InlineResponse20044.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) + + ## listCatalogItems > \TalonOne\Client\Model\InlineResponse20035 listCatalogItems($catalogId, $pageSize, $skip, $withTotalResultSize, $sku, $productNames) @@ -10873,7 +11009,7 @@ $apiInstance = new TalonOne\Client\Api\ManagementApi( new GuzzleHttp\Client(), $config ); -$roleId = 56; // int | The ID of role. +$roleId = 56; // int | The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. $body = new \TalonOne\Client\Model\RoleV2Base(); // \TalonOne\Client\Model\RoleV2Base | body try { @@ -10890,7 +11026,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **roleId** | **int**| The ID of role. | + **roleId** | **int**| The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. | **body** | **\TalonOne\Client\Model\RoleV2Base**| body | ### Return type diff --git a/docs/Model/ActivateUserRequest.md b/docs/Model/ActivateUserRequest.md new file mode 100644 index 00000000..989a824f --- /dev/null +++ b/docs/Model/ActivateUserRequest.md @@ -0,0 +1,11 @@ +# # ActivateUserRequest + +## 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/Coupon.md b/docs/Model/Coupon.md index c6f79da5..88246daf 100644 --- a/docs/Model/Coupon.md +++ b/docs/Model/Coupon.md @@ -22,9 +22,9 @@ Name | Type | Description | Notes **referralId** | **int** | The integration ID of the referring customer (if any) for whom this coupon was created as an effect. | [optional] **recipientIntegrationId** | **string** | The Integration ID of the customer that is allowed to redeem this coupon. | [optional] **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] +**reservation** | **bool** | Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. | [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 false] +**isReservationMandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [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/CustomerInventory.md b/docs/Model/CustomerInventory.md index 63f85edc..3733bfb8 100644 --- a/docs/Model/CustomerInventory.md +++ b/docs/Model/CustomerInventory.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **profile** | [**\TalonOne\Client\Model\CustomerProfile**](CustomerProfile.md) | | [optional] **loyalty** | [**\TalonOne\Client\Model\Loyalty**](Loyalty.md) | | [optional] **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] +**coupons** | [**\TalonOne\Client\Model\InventoryCoupon[]**](InventoryCoupon.md) | The coupons reserved by this profile. This array includes hard and soft reservations. | [optional] **giveaways** | [**\TalonOne\Client\Model\Giveaway[]**](Giveaway.md) | | [optional] **achievements** | [**\TalonOne\Client\Model\AchievementProgress[]**](AchievementProgress.md) | | [optional] diff --git a/docs/Model/InlineResponse20044.md b/docs/Model/InlineResponse20044.md index 3e70a804..2d03265d 100644 --- a/docs/Model/InlineResponse20044.md +++ b/docs/Model/InlineResponse20044.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **totalResultSize** | **int** | | -**data** | [**\TalonOne\Client\Model\Role[]**](Role.md) | | +**data** | [**\TalonOne\Client\Model\RoleV2[]**](RoleV2.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 14e413e1..0ffdb796 100644 --- a/docs/Model/IntegrationCoupon.md +++ b/docs/Model/IntegrationCoupon.md @@ -22,9 +22,9 @@ Name | Type | Description | Notes **referralId** | **int** | The integration ID of the referring customer (if any) for whom this coupon was created as an effect. | [optional] **recipientIntegrationId** | **string** | The Integration ID of the customer that is allowed to redeem this coupon. | [optional] **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] +**reservation** | **bool** | Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. | [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 false] +**isReservationMandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [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 47da5bbc..c69f582b 100644 --- a/docs/Model/InventoryCoupon.md +++ b/docs/Model/InventoryCoupon.md @@ -22,9 +22,9 @@ Name | Type | Description | Notes **referralId** | **int** | The integration ID of the referring customer (if any) for whom this coupon was created as an effect. | [optional] **recipientIntegrationId** | **string** | The Integration ID of the customer that is allowed to redeem this coupon. | [optional] **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] +**reservation** | **bool** | Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. | [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 false] +**isReservationMandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [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 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. | diff --git a/docs/Model/LoyaltyCardBalances.md b/docs/Model/LoyaltyCardBalances.md new file mode 100644 index 00000000..d6fa0cc0 --- /dev/null +++ b/docs/Model/LoyaltyCardBalances.md @@ -0,0 +1,13 @@ +# # LoyaltyCardBalances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance** | [**\TalonOne\Client\Model\LoyaltyBalance**](LoyaltyBalance.md) | | [optional] +**subledgerBalances** | [**map[string,\TalonOne\Client\Model\LoyaltyBalance]**](LoyaltyBalance.md) | Map of the loyalty balances of the subledgers of a ledger. | [optional] +**profiles** | [**\TalonOne\Client\Model\LoyaltyCardProfileRegistration[]**](LoyaltyCardProfileRegistration.md) | Customer profiles linked to the loyalty card. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/LoyaltyCardProfileRegistration.md b/docs/Model/LoyaltyCardProfileRegistration.md index 0d29d649..350b7988 100644 --- a/docs/Model/LoyaltyCardProfileRegistration.md +++ b/docs/Model/LoyaltyCardProfileRegistration.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **integrationId** | **string** | Integration ID of the customer profile linked to the card. | -**timestamp** | [**\DateTime**](\DateTime.md) | Timestamp of the registration to the card. | +**timestamp** | [**\DateTime**](\DateTime.md) | Timestamp the customer profile was linked to the card. | [[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 index bf3d2d94..a80e23f2 100644 --- a/docs/Model/MessageLogEntry.md +++ b/docs/Model/MessageLogEntry.md @@ -12,8 +12,7 @@ Name | Type | Description | Notes **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] +**entityType** | **string** | The entity type the notification is related to. | [optional] **applicationId** | **int** | Identifier of the Application. | [optional] **loyaltyProgramId** | **int** | Identifier of the loyalty program. | [optional] diff --git a/docs/Model/NewCoupons.md b/docs/Model/NewCoupons.md index f6d9c789..0c6b4d2c 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 false] +**isReservationMandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [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/NewExternalInvitation.md b/docs/Model/NewExternalInvitation.md new file mode 100644 index 00000000..3730d962 --- /dev/null +++ b/docs/Model/NewExternalInvitation.md @@ -0,0 +1,13 @@ +# # NewExternalInvitation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the user. | [optional] +**userGroups** | **string[]** | List of user groups in the external identity provider. If there are roles in Talon.One whose names match these user groups, those roles will be automatically assigned to the user upon invitation. | [optional] +**email** | **string** | Email address 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/UpdateCoupon.md b/docs/Model/UpdateCoupon.md index c5bc98ed..d61dd30b 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 false] +**isReservationMandatory** | **bool** | An indication of whether the code can be redeemed only if it has been reserved first. | [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/UpdateUser.md b/docs/Model/UpdateUser.md index ab9baac6..f8baa972 100644 --- a/docs/Model/UpdateUser.md +++ b/docs/Model/UpdateUser.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **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] +**roles** | **int[]** | A list of the IDs of the roles assigned to the user. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. | [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/lib/Api/IntegrationApi.php b/lib/Api/IntegrationApi.php index a98abd15..5daf3160 100644 --- a/lib/Api/IntegrationApi.php +++ b/lib/Api/IntegrationApi.php @@ -3168,14 +3168,15 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \TalonOne\Client\Model\LoyaltyBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate = null) + public function getLoyaltyBalances($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) { - list($response) = $this->getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate); + list($response) = $this->getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate, $subledgerId); return $response; } @@ -3187,14 +3188,15 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \TalonOne\Client\Model\LoyaltyBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null) + public function getLoyaltyBalancesWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) { - $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate); + $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate, $subledgerId); try { $options = $this->createHttpClientOption(); @@ -3337,13 +3339,14 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyBalancesAsync($loyaltyProgramId, $integrationId, $endDate = null) + public function getLoyaltyBalancesAsync($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) { - return $this->getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate) + return $this->getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate, $subledgerId) ->then( function ($response) { return $response[0]; @@ -3359,14 +3362,15 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null) + public function getLoyaltyBalancesAsyncWithHttpInfo($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) { $returnType = '\TalonOne\Client\Model\LoyaltyBalances'; - $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate); + $request = $this->getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate, $subledgerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3408,11 +3412,12 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string $subledgerId The ID of the subledger by which we filter the data. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate = null) + protected function getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, $endDate = null, $subledgerId = null) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { @@ -3441,6 +3446,13 @@ protected function getLoyaltyBalancesRequest($loyaltyProgramId, $integrationId, if ($endDate !== null) { $queryParams['endDate'] = $endDate; } + // query params + if (is_array($subledgerId)) { + $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); + } + if ($subledgerId !== null) { + $queryParams['subledgerId'] = $subledgerId; + } // path params @@ -3537,14 +3549,15 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\LoyaltyBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\LoyaltyCardBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDate = null) + public function getLoyaltyCardBalances($loyaltyProgramId, $loyaltyCardId, $endDate = null, $subledgerId = null) { - list($response) = $this->getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate); + list($response) = $this->getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate, $subledgerId); return $response; } @@ -3556,14 +3569,15 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\LoyaltyBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\LoyaltyCardBalances|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate = null) + public function getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate = null, $subledgerId = null) { - $request = $this->getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCardId, $endDate); + $request = $this->getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCardId, $endDate, $subledgerId); try { $options = $this->createHttpClientOption(); @@ -3596,14 +3610,14 @@ public function getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCa $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\LoyaltyBalances' === '\SplFileObject') { + if ('\TalonOne\Client\Model\LoyaltyCardBalances' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyBalances', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\LoyaltyCardBalances', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3645,7 +3659,7 @@ public function getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCa ]; } - $returnType = '\TalonOne\Client\Model\LoyaltyBalances'; + $returnType = '\TalonOne\Client\Model\LoyaltyCardBalances'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3664,7 +3678,7 @@ public function getLoyaltyCardBalancesWithHttpInfo($loyaltyProgramId, $loyaltyCa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\LoyaltyBalances', + '\TalonOne\Client\Model\LoyaltyCardBalances', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3706,13 +3720,14 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardBalancesAsync($loyaltyProgramId, $loyaltyCardId, $endDate = null) + public function getLoyaltyCardBalancesAsync($loyaltyProgramId, $loyaltyCardId, $endDate = null, $subledgerId = null) { - return $this->getLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate) + return $this->getLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate, $subledgerId) ->then( function ($response) { return $response[0]; @@ -3728,14 +3743,15 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate = null) + public function getLoyaltyCardBalancesAsyncWithHttpInfo($loyaltyProgramId, $loyaltyCardId, $endDate = null, $subledgerId = null) { - $returnType = '\TalonOne\Client\Model\LoyaltyBalances'; - $request = $this->getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCardId, $endDate); + $returnType = '\TalonOne\Client\Model\LoyaltyCardBalances'; + $request = $this->getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCardId, $endDate, $subledgerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3777,11 +3793,12 @@ 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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCardId, $endDate = null) + protected function getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCardId, $endDate = null, $subledgerId = null) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { @@ -3814,6 +3831,13 @@ protected function getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCard if ($endDate !== null) { $queryParams['endDate'] = $endDate; } + // query params + if (is_array($subledgerId)) { + $subledgerId = ObjectSerializer::serializeCollection($subledgerId, 'form', true); + } + if ($subledgerId !== null) { + $queryParams['subledgerId'] = $subledgerId; + } // path params @@ -3910,7 +3934,7 @@ protected function getLoyaltyCardBalancesRequest($loyaltyProgramId, $loyaltyCard * @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 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 string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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) * @@ -3932,7 +3956,7 @@ public function getLoyaltyCardPoints($loyaltyProgramId, $loyaltyCardId, $status * @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 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 string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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) * @@ -4085,7 +4109,7 @@ public function getLoyaltyCardPointsWithHttpInfo($loyaltyProgramId, $loyaltyCard * @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 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 string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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) * @@ -4110,7 +4134,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 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 string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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) * @@ -4162,7 +4186,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 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 string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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) * @@ -4211,7 +4235,7 @@ protected function getLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId } // query params if (is_array($subledgerId)) { - $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); + $subledgerId = ObjectSerializer::serializeCollection($subledgerId, 'form', true); } if ($subledgerId !== null) { $queryParams['subledgerId'] = $subledgerId; @@ -4325,7 +4349,7 @@ protected function getLoyaltyCardPointsRequest($loyaltyProgramId, $loyaltyCardId * * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting 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) @@ -4349,7 +4373,7 @@ public function getLoyaltyCardTransactions($loyaltyProgramId, $loyaltyCardId, $s * * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting 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) @@ -4504,7 +4528,7 @@ public function getLoyaltyCardTransactionsWithHttpInfo($loyaltyProgramId, $loyal * * @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 string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting 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) @@ -4531,7 +4555,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 string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting 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) @@ -4585,7 +4609,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 string $subledgerId The ID of the subledger by which we filter the data. (optional) + * @param string[] $subledgerId Filter results by one or more subledger IDs. Must be exact match. (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. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting 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) @@ -4630,7 +4654,7 @@ protected function getLoyaltyCardTransactionsRequest($loyaltyProgramId, $loyalty // query params if (is_array($subledgerId)) { - $subledgerId = ObjectSerializer::serializeCollection($subledgerId, '', true); + $subledgerId = ObjectSerializer::serializeCollection($subledgerId, 'form', true); } if ($subledgerId !== null) { $queryParams['subledgerId'] = $subledgerId; diff --git a/lib/Api/ManagementApi.php b/lib/Api/ManagementApi.php index 3383f5e0..cf2ccbde 100644 --- a/lib/Api/ManagementApi.php +++ b/lib/Api/ManagementApi.php @@ -115,6 +115,236 @@ public function getConfig() return $this->config; } + /** + * Operation activateUserByEmail + * + * Activate user by email address + * + * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function activateUserByEmail($body) + { + $this->activateUserByEmailWithHttpInfo($body); + } + + /** + * Operation activateUserByEmailWithHttpInfo + * + * Activate user by email address + * + * @param \TalonOne\Client\Model\ActivateUserRequest $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 activateUserByEmailWithHttpInfo($body) + { + $request = $this->activateUserByEmailRequest($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 activateUserByEmailAsync + * + * Activate user by email address + * + * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function activateUserByEmailAsync($body) + { + return $this->activateUserByEmailAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation activateUserByEmailAsyncWithHttpInfo + * + * Activate user by email address + * + * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function activateUserByEmailAsyncWithHttpInfo($body) + { + $returnType = ''; + $request = $this->activateUserByEmailRequest($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 'activateUserByEmail' + * + * @param \TalonOne\Client\Model\ActivateUserRequest $body body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function activateUserByEmailRequest($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 activateUserByEmail' + ); + } + + $resourcePath = '/v1/users/activate'; + $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 addLoyaltyCardPoints * @@ -16938,34 +17168,36 @@ protected function getAllAccessLogsRequest($rangeStart = null, $rangeEnd = null, } /** - * Operation getAllRoles + * Operation getApplication * - * List roles + * Get Application * + * @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 \TalonOne\Client\Model\InlineResponse20044 + * @return \TalonOne\Client\Model\Application */ - public function getAllRoles() + public function getApplication($applicationId) { - list($response) = $this->getAllRolesWithHttpInfo(); + list($response) = $this->getApplicationWithHttpInfo($applicationId); return $response; } /** - * Operation getAllRolesWithHttpInfo + * Operation getApplicationWithHttpInfo * - * List roles + * Get Application * + * @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 \TalonOne\Client\Model\InlineResponse20044, 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 getAllRolesWithHttpInfo() + public function getApplicationWithHttpInfo($applicationId) { - $request = $this->getAllRolesRequest(); + $request = $this->getApplicationRequest($applicationId); try { $options = $this->createHttpClientOption(); @@ -16998,20 +17230,20 @@ public function getAllRolesWithHttpInfo() $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20044' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Application' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20044', []), + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Application', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20044'; + $returnType = '\TalonOne\Client\Model\Application'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17030,7 +17262,7 @@ public function getAllRolesWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20044', + '\TalonOne\Client\Model\Application', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17041,17 +17273,18 @@ public function getAllRolesWithHttpInfo() } /** - * Operation getAllRolesAsync + * Operation getApplicationAsync * - * List roles + * Get Application * + * @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 getAllRolesAsync() + public function getApplicationAsync($applicationId) { - return $this->getAllRolesAsyncWithHttpInfo() + return $this->getApplicationAsyncWithHttpInfo($applicationId) ->then( function ($response) { return $response[0]; @@ -17060,18 +17293,19 @@ function ($response) { } /** - * Operation getAllRolesAsyncWithHttpInfo + * Operation getApplicationAsyncWithHttpInfo * - * List roles + * Get Application * + * @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 getAllRolesAsyncWithHttpInfo() + public function getApplicationAsyncWithHttpInfo($applicationId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20044'; - $request = $this->getAllRolesRequest(); + $returnType = '\TalonOne\Client\Model\Application'; + $request = $this->getApplicationRequest($applicationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17108,16 +17342,23 @@ function ($exception) { } /** - * Create request for operation 'getAllRoles' + * Create request for operation 'getApplication' * + * @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 getAllRolesRequest() + protected function getApplicationRequest($applicationId) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicationId when calling getApplication' + ); + } - $resourcePath = '/v1/roles'; + $resourcePath = '/v1/applications/{applicationId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17126,6 +17367,14 @@ protected function getAllRolesRequest() + // path params + if ($applicationId !== null) { + $resourcePath = str_replace( + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -17202,36 +17451,36 @@ protected function getAllRolesRequest() } /** - * Operation getApplication + * Operation getApplicationApiHealth * - * Get Application + * Get Application health * * @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 \TalonOne\Client\Model\Application + * @return \TalonOne\Client\Model\ApplicationApiHealth */ - public function getApplication($applicationId) + public function getApplicationApiHealth($applicationId) { - list($response) = $this->getApplicationWithHttpInfo($applicationId); + list($response) = $this->getApplicationApiHealthWithHttpInfo($applicationId); return $response; } /** - * Operation getApplicationWithHttpInfo + * Operation getApplicationApiHealthWithHttpInfo * - * Get Application + * Get Application health * * @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 \TalonOne\Client\Model\Application, 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 getApplicationWithHttpInfo($applicationId) + public function getApplicationApiHealthWithHttpInfo($applicationId) { - $request = $this->getApplicationRequest($applicationId); + $request = $this->getApplicationApiHealthRequest($applicationId); try { $options = $this->createHttpClientOption(); @@ -17264,20 +17513,20 @@ public function getApplicationWithHttpInfo($applicationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Application' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationApiHealth' === '\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\ApplicationApiHealth', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Application'; + $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17296,7 +17545,7 @@ public function getApplicationWithHttpInfo($applicationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Application', + '\TalonOne\Client\Model\ApplicationApiHealth', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17307,18 +17556,18 @@ public function getApplicationWithHttpInfo($applicationId) } /** - * Operation getApplicationAsync + * Operation getApplicationApiHealthAsync * - * Get Application + * Get Application health * * @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 getApplicationAsync($applicationId) + public function getApplicationApiHealthAsync($applicationId) { - return $this->getApplicationAsyncWithHttpInfo($applicationId) + return $this->getApplicationApiHealthAsyncWithHttpInfo($applicationId) ->then( function ($response) { return $response[0]; @@ -17327,19 +17576,19 @@ function ($response) { } /** - * Operation getApplicationAsyncWithHttpInfo + * Operation getApplicationApiHealthAsyncWithHttpInfo * - * Get Application + * Get Application health * * @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 getApplicationAsyncWithHttpInfo($applicationId) + public function getApplicationApiHealthAsyncWithHttpInfo($applicationId) { - $returnType = '\TalonOne\Client\Model\Application'; - $request = $this->getApplicationRequest($applicationId); + $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; + $request = $this->getApplicationApiHealthRequest($applicationId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17376,23 +17625,23 @@ function ($exception) { } /** - * Create request for operation 'getApplication' + * Create request for operation 'getApplicationApiHealth' * * @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 getApplicationRequest($applicationId) + 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 getApplication' + 'Missing the required parameter $applicationId when calling getApplicationApiHealth' ); } - $resourcePath = '/v1/applications/{applicationId}'; + $resourcePath = '/v1/applications/{applicationId}/health_report'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17485,36 +17734,38 @@ protected function getApplicationRequest($applicationId) } /** - * Operation getApplicationApiHealth + * Operation getApplicationCustomer * - * Get Application health + * Get application's customer * * @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) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\ApplicationApiHealth + * @return \TalonOne\Client\Model\ApplicationCustomer */ - public function getApplicationApiHealth($applicationId) + public function getApplicationCustomer($applicationId, $customerId) { - list($response) = $this->getApplicationApiHealthWithHttpInfo($applicationId); + list($response) = $this->getApplicationCustomerWithHttpInfo($applicationId, $customerId); return $response; } /** - * Operation getApplicationApiHealthWithHttpInfo + * Operation getApplicationCustomerWithHttpInfo * - * Get Application health + * Get application's customer * * @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) * * @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\ApplicationCustomer, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationApiHealthWithHttpInfo($applicationId) + public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) { - $request = $this->getApplicationApiHealthRequest($applicationId); + $request = $this->getApplicationCustomerRequest($applicationId, $customerId); try { $options = $this->createHttpClientOption(); @@ -17547,20 +17798,20 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationApiHealth' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationCustomer' === '\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\ApplicationCustomer', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; + $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17579,7 +17830,7 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationApiHealth', + '\TalonOne\Client\Model\ApplicationCustomer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17590,18 +17841,19 @@ public function getApplicationApiHealthWithHttpInfo($applicationId) } /** - * Operation getApplicationApiHealthAsync + * Operation getApplicationCustomerAsync * - * Get Application health + * Get application's customer * * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationApiHealthAsync($applicationId) + public function getApplicationCustomerAsync($applicationId, $customerId) { - return $this->getApplicationApiHealthAsyncWithHttpInfo($applicationId) + return $this->getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) ->then( function ($response) { return $response[0]; @@ -17610,19 +17862,20 @@ function ($response) { } /** - * Operation getApplicationApiHealthAsyncWithHttpInfo + * Operation getApplicationCustomerAsyncWithHttpInfo * - * Get Application health + * Get application's customer * * @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) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationApiHealthAsyncWithHttpInfo($applicationId) + public function getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) { - $returnType = '\TalonOne\Client\Model\ApplicationApiHealth'; - $request = $this->getApplicationApiHealthRequest($applicationId); + $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; + $request = $this->getApplicationCustomerRequest($applicationId, $customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17659,23 +17912,30 @@ function ($exception) { } /** - * Create request for operation 'getApplicationApiHealth' + * Create request for operation 'getApplicationCustomer' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $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 getApplicationApiHealthRequest($applicationId) + 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 getApplicationApiHealth' + 'Missing the required parameter $applicationId when calling getApplicationCustomer' + ); + } + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling getApplicationCustomer' ); } - $resourcePath = '/v1/applications/{applicationId}/health_report'; + $resourcePath = '/v1/applications/{applicationId}/customers/{customerId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17692,6 +17952,14 @@ protected function getApplicationApiHealthRequest($applicationId) $resourcePath ); } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -17768,38 +18036,46 @@ protected function getApplicationApiHealthRequest($applicationId) } /** - * Operation getApplicationCustomer + * Operation getApplicationCustomerFriends * - * Get application's customer + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param 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 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\ApplicationCustomer + * @return \TalonOne\Client\Model\InlineResponse20033 */ - public function getApplicationCustomer($applicationId, $customerId) + public function getApplicationCustomerFriends($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - list($response) = $this->getApplicationCustomerWithHttpInfo($applicationId, $customerId); + list($response) = $this->getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); return $response; } /** - * Operation getApplicationCustomerWithHttpInfo + * Operation getApplicationCustomerFriendsWithHttpInfo * - * Get application's customer + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param 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 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\ApplicationCustomer, 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 getApplicationCustomerWithHttpInfo($applicationId, $customerId) + public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $request = $this->getApplicationCustomerRequest($applicationId, $customerId); + $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -17832,20 +18108,20 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\ApplicationCustomer' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20033' === '\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\InlineResponse20033', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; + $returnType = '\TalonOne\Client\Model\InlineResponse20033'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17864,7 +18140,7 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ApplicationCustomer', + '\TalonOne\Client\Model\InlineResponse20033', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17875,19 +18151,23 @@ public function getApplicationCustomerWithHttpInfo($applicationId, $customerId) } /** - * Operation getApplicationCustomerAsync + * Operation getApplicationCustomerFriendsAsync * - * Get application's customer + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param 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 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 getApplicationCustomerAsync($applicationId, $customerId) + public function getApplicationCustomerFriendsAsync($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - return $this->getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) + return $this->getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -17896,20 +18176,24 @@ function ($response) { } /** - * Operation getApplicationCustomerAsyncWithHttpInfo + * Operation getApplicationCustomerFriendsAsyncWithHttpInfo * - * Get application's customer + * List friends referred by customer profile * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param 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 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 getApplicationCustomerAsyncWithHttpInfo($applicationId, $customerId) + public function getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\ApplicationCustomer'; - $request = $this->getApplicationCustomerRequest($applicationId, $customerId); + $returnType = '\TalonOne\Client\Model\InlineResponse20033'; + $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17946,36 +18230,75 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomer' + * Create request for operation 'getApplicationCustomerFriends' * * @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 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 getApplicationCustomerRequest($applicationId, $customerId) + protected function getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationCustomer' + 'Missing the required parameter $applicationId when calling getApplicationCustomerFriends' ); } - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'integrationId' is set + if ($integrationId === null || (is_array($integrationId) && count($integrationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling getApplicationCustomer' + '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/applications/{applicationId}/customers/{customerId}'; + + $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 @@ -17987,10 +18310,10 @@ protected function getApplicationCustomerRequest($applicationId, $customerId) ); } // path params - if ($customerId !== null) { + if ($integrationId !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'integrationId' . '}', + ObjectSerializer::toPathValue($integrationId), $resourcePath ); } @@ -18070,46 +18393,44 @@ protected function getApplicationCustomerRequest($applicationId, $customerId) } /** - * Operation getApplicationCustomerFriends + * Operation getApplicationCustomers * - * List friends referred by customer profile + * List application's customers * * @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 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 string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\InlineResponse20033 + * @return \TalonOne\Client\Model\InlineResponse20022 */ - public function getApplicationCustomerFriends($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplicationCustomers($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - list($response) = $this->getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + list($response) = $this->getApplicationCustomersWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); return $response; } /** - * Operation getApplicationCustomerFriendsWithHttpInfo + * Operation getApplicationCustomersWithHttpInfo * - * List friends referred by customer profile + * List application's customers * * @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 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 string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\InlineResponse20033, HTTP status code, HTTP response headers (array of strings) + * @return array of \TalonOne\Client\Model\InlineResponse20022, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplicationCustomersWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -18142,20 +18463,20 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20033' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20022' === '\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\InlineResponse20022', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20033'; + $returnType = '\TalonOne\Client\Model\InlineResponse20022'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18174,7 +18495,7 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20033', + '\TalonOne\Client\Model\InlineResponse20022', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18185,23 +18506,22 @@ public function getApplicationCustomerFriendsWithHttpInfo($applicationId, $integ } /** - * Operation getApplicationCustomerFriendsAsync + * Operation getApplicationCustomersAsync * - * List friends referred by customer profile + * List application's customers * * @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 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 string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerFriendsAsync($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplicationCustomersAsync($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - return $this->getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize) + return $this->getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -18210,24 +18530,23 @@ function ($response) { } /** - * Operation getApplicationCustomerFriendsAsyncWithHttpInfo + * Operation getApplicationCustomersAsyncWithHttpInfo * - * List friends referred by customer profile + * List application's customers * * @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 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 string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomerFriendsAsyncWithHttpInfo($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + public function getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20033'; - $request = $this->getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize, $skip, $sort, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse20022'; + $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18264,47 +18583,47 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomerFriends' + * Create request for operation 'getApplicationCustomers' * * @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 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 string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) * @param bool $withTotalResultSize When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomerFriendsRequest($applicationId, $integrationId, $pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null) + protected function getApplicationCustomersRequest($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling 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 $applicationId when calling getApplicationCustomers' ); } 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.getApplicationCustomers, 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.getApplicationCustomers, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/profile/{integrationId}/friends'; + $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); @@ -18320,13 +18639,6 @@ protected function getApplicationCustomerFriendsRequest($applicationId, $integra $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); } @@ -18343,14 +18655,6 @@ protected function getApplicationCustomerFriendsRequest($applicationId, $integra $resourcePath ); } - // path params - if ($integrationId !== null) { - $resourcePath = str_replace( - '{' . 'integrationId' . '}', - ObjectSerializer::toPathValue($integrationId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -18427,44 +18731,44 @@ protected function getApplicationCustomerFriendsRequest($applicationId, $integra } /** - * Operation getApplicationCustomers + * Operation getApplicationCustomersByAttributes * - * List application's customers + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param 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\InlineResponse20023 */ - public function getApplicationCustomers($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationCustomersByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - list($response) = $this->getApplicationCustomersWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + list($response) = $this->getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize); return $response; } /** - * Operation getApplicationCustomersWithHttpInfo + * Operation getApplicationCustomersByAttributesWithHttpInfo * - * List application's customers + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param 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\InlineResponse20023, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomersWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); try { $options = $this->createHttpClientOption(); @@ -18497,20 +18801,20 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20022' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20023' === '\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\InlineResponse20023', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20022'; + $returnType = '\TalonOne\Client\Model\InlineResponse20023'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18529,7 +18833,7 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20022', + '\TalonOne\Client\Model\InlineResponse20023', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18540,12 +18844,12 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration } /** - * Operation getApplicationCustomersAsync + * Operation getApplicationCustomersByAttributesAsync * - * List application's customers + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param 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) @@ -18553,9 +18857,9 @@ public function getApplicationCustomersWithHttpInfo($applicationId, $integration * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomersAsync($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationCustomersByAttributesAsync($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - return $this->getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize) + return $this->getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize) ->then( function ($response) { return $response[0]; @@ -18564,12 +18868,12 @@ function ($response) { } /** - * Operation getApplicationCustomersAsyncWithHttpInfo + * Operation getApplicationCustomersByAttributesAsyncWithHttpInfo * - * List application's customers + * List application customers matching the given attributes * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) - * @param string $integrationId Filter results performing an exact matching against the profile integration identifier. (optional) + * @param \TalonOne\Client\Model\CustomerProfileSearchQuery $body body (required) * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param 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) @@ -18577,10 +18881,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getApplicationCustomersAsyncWithHttpInfo($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20022'; - $request = $this->getApplicationCustomersRequest($applicationId, $integrationId, $pageSize, $skip, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse20023'; + $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18617,10 +18921,10 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomers' + * Create request for operation 'getApplicationCustomersByAttributes' * * @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 \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) @@ -18628,36 +18932,35 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getApplicationCustomersRequest($applicationId, $integrationId = null, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + protected function getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationCustomers' + '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.getApplicationCustomers, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomers, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customers'; + $resourcePath = '/v1/applications/{applicationId}/customer_search'; $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); @@ -18692,6 +18995,9 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -18700,7 +19006,7 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -18757,7 +19063,7 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18765,44 +19071,42 @@ protected function getApplicationCustomersRequest($applicationId, $integrationId } /** - * Operation getApplicationCustomersByAttributes + * Operation getApplicationEventTypes * - * List application customers matching the given attributes + * List Applications event types * * @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) + * @param string $sort The field by which results should be sorted. By default, results are 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\InlineResponse20029 */ - public function getApplicationCustomersByAttributes($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationEventTypes($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + list($response) = $this->getApplicationEventTypesWithHttpInfo($applicationId, $pageSize, $skip, $sort); return $response; } /** - * Operation getApplicationCustomersByAttributesWithHttpInfo + * Operation getApplicationEventTypesWithHttpInfo * - * List application customers matching the given attributes + * List Applications event types * * @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) + * @param string $sort The field by which results should be sorted. By default, results are 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\InlineResponse20029, HTTP status code, HTTP response headers (array of strings) */ - public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $body, $pageSize = 1000, $skip = null, $withTotalResultSize = null) + public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -18835,20 +19139,20 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20023' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20029' === '\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\InlineResponse20029', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20023'; + $returnType = '\TalonOne\Client\Model\InlineResponse20029'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18867,7 +19171,7 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20023', + '\TalonOne\Client\Model\InlineResponse20029', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18878,22 +19182,21 @@ public function getApplicationCustomersByAttributesWithHttpInfo($applicationId, } /** - * Operation getApplicationCustomersByAttributesAsync + * Operation getApplicationEventTypesAsync * - * List application customers matching the given attributes + * List Applications event types * * @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) + * @param string $sort The field by which results should be sorted. By default, results are 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 getApplicationEventTypesAsync($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getApplicationCustomersByAttributesAsyncWithHttpInfo($applicationId, $body, $pageSize, $skip, $withTotalResultSize) + return $this->getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -18902,23 +19205,22 @@ function ($response) { } /** - * Operation getApplicationCustomersByAttributesAsyncWithHttpInfo + * Operation getApplicationEventTypesAsyncWithHttpInfo * - * List application customers matching the given attributes + * List Applications event types * * @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) + * @param string $sort The field by which results should be sorted. By default, results are 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 getApplicationEventTypesAsyncWithHttpInfo($applicationId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20023'; - $request = $this->getApplicationCustomersByAttributesRequest($applicationId, $body, $pageSize, $skip, $withTotalResultSize); + $returnType = '\TalonOne\Client\Model\InlineResponse20029'; + $request = $this->getApplicationEventTypesRequest($applicationId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18955,40 +19257,33 @@ function ($exception) { } /** - * Create request for operation 'getApplicationCustomersByAttributes' + * Create request for operation 'getApplicationEventTypes' * * @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) + * @param string $sort The field by which results should be sorted. By default, results are 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 getApplicationEventTypesRequest($applicationId, $pageSize = 1000, $skip = null, $sort = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling getApplicationCustomersByAttributes' - ); - } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling getApplicationCustomersByAttributes' + 'Missing the required parameter $applicationId when calling getApplicationEventTypes' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventTypes, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationCustomersByAttributes, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventTypes, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/customer_search'; + $resourcePath = '/v1/applications/{applicationId}/event_types'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19010,11 +19305,11 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b $queryParams['skip'] = $skip; } // query params - if (is_array($withTotalResultSize)) { - $withTotalResultSize = ObjectSerializer::serializeCollection($withTotalResultSize, '', true); + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); } - if ($withTotalResultSize !== null) { - $queryParams['withTotalResultSize'] = $withTotalResultSize; + if ($sort !== null) { + $queryParams['sort'] = $sort; } @@ -19029,9 +19324,6 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -19040,7 +19332,7 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -19097,7 +19389,7 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19105,42 +19397,64 @@ protected function getApplicationCustomersByAttributesRequest($applicationId, $b } /** - * Operation getApplicationEventTypes + * Operation getApplicationEventsWithoutTotalCount * - * List Applications event types + * List Applications events * * @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\InlineResponse20029 + * @return \TalonOne\Client\Model\InlineResponse20028 */ - public function getApplicationEventTypes($applicationId, $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->getApplicationEventTypesWithHttpInfo($applicationId, $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 getApplicationEventTypesWithHttpInfo + * Operation getApplicationEventsWithoutTotalCountWithHttpInfo * - * List Applications event types + * List Applications events * * @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\InlineResponse20029, 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 getApplicationEventTypesWithHttpInfo($applicationId, $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->getApplicationEventTypesRequest($applicationId, $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(); @@ -19173,20 +19487,20 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20029' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20028' === '\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\InlineResponse20028', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20029'; + $returnType = '\TalonOne\Client\Model\InlineResponse20028'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19205,7 +19519,7 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20029', + '\TalonOne\Client\Model\InlineResponse20028', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19216,21 +19530,32 @@ public function getApplicationEventTypesWithHttpInfo($applicationId, $pageSize = } /** - * Operation getApplicationEventTypesAsync + * Operation getApplicationEventsWithoutTotalCountAsync * - * List Applications event types + * List Applications events * * @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 getApplicationEventTypesAsync($applicationId, $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->getApplicationEventTypesAsyncWithHttpInfo($applicationId, $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]; @@ -19239,22 +19564,33 @@ function ($response) { } /** - * Operation getApplicationEventTypesAsyncWithHttpInfo + * Operation getApplicationEventsWithoutTotalCountAsyncWithHttpInfo * - * List Applications event types + * List Applications events * * @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 getApplicationEventTypesAsyncWithHttpInfo($applicationId, $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\InlineResponse20029'; - $request = $this->getApplicationEventTypesRequest($applicationId, $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()) @@ -19291,33 +19627,52 @@ function ($exception) { } /** - * Create request for operation 'getApplicationEventTypes' + * Create request for operation 'getApplicationEventsWithoutTotalCount' * * @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 getApplicationEventTypesRequest($applicationId, $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 getApplicationEventTypes' + 'Missing the required parameter $applicationId when calling getApplicationEventsWithoutTotalCount' ); } if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getApplicationEventTypes, 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.getApplicationEventTypes, 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/applications/{applicationId}/event_types'; + 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 = []; @@ -19345,6 +19700,83 @@ protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1 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 @@ -19431,64 +19863,38 @@ protected function getApplicationEventTypesRequest($applicationId, $pageSize = 1 } /** - * Operation getApplicationEventsWithoutTotalCount + * Operation getApplicationSession * - * List Applications events + * Get Application session * * @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) + * @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\InlineResponse20028 + * @return \TalonOne\Client\Model\ApplicationSession */ - 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 getApplicationSession($applicationId, $sessionId) { - list($response) = $this->getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + list($response) = $this->getApplicationSessionWithHttpInfo($applicationId, $sessionId); return $response; } /** - * Operation getApplicationEventsWithoutTotalCountWithHttpInfo + * Operation getApplicationSessionWithHttpInfo * - * List Applications events + * Get Application session * * @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) + * @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\InlineResponse20028, 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 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 getApplicationSessionWithHttpInfo($applicationId, $sessionId) { - $request = $this->getApplicationEventsWithoutTotalCountRequest($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery); + $request = $this->getApplicationSessionRequest($applicationId, $sessionId); try { $options = $this->createHttpClientOption(); @@ -19521,20 +19927,20 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20028' === '\SplFileObject') { + if ('\TalonOne\Client\Model\ApplicationSession' === '\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\ApplicationSession', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20028'; + $returnType = '\TalonOne\Client\Model\ApplicationSession'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19553,7 +19959,7 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20028', + '\TalonOne\Client\Model\ApplicationSession', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19564,32 +19970,19 @@ public function getApplicationEventsWithoutTotalCountWithHttpInfo($applicationId } /** - * Operation getApplicationEventsWithoutTotalCountAsync + * Operation getApplicationSessionAsync * - * List Applications events + * Get Application session * * @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) + * @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 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 getApplicationSessionAsync($applicationId, $sessionId) { - return $this->getApplicationEventsWithoutTotalCountAsyncWithHttpInfo($applicationId, $pageSize, $skip, $sort, $type, $createdBefore, $createdAfter, $session, $profile, $customerName, $customerEmail, $couponCode, $referralCode, $ruleQuery, $campaignQuery) + return $this->getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) ->then( function ($response) { return $response[0]; @@ -19598,447 +19991,20 @@ function ($response) { } /** - * Operation getApplicationEventsWithoutTotalCountAsyncWithHttpInfo + * Operation getApplicationSessionAsyncWithHttpInfo * - * List Applications events + * Get Application session * * @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) + * @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 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 getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) { - $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()) - ->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 'getApplicationEventsWithoutTotalCount' - * - * @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 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.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.'); - } - - if ($customerName !== null && strlen($customerName) < 2) { - throw new \InvalidArgumentException('invalid length for "$customerName" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 2.'); - } - - if ($customerEmail !== null && strlen($customerEmail) < 2) { - throw new \InvalidArgumentException('invalid length for "$customerEmail" when calling ManagementApi.getApplicationEventsWithoutTotalCount, must be bigger than or equal to 2.'); - } - - - $resourcePath = '/v1/applications/{applicationId}/events/no_total'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } - // query params - if (is_array($type)) { - $type = ObjectSerializer::serializeCollection($type, '', true); - } - if ($type !== null) { - $queryParams['type'] = $type; - } - // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); - } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; - } - // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); - } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; - } - // query params - if (is_array($session)) { - $session = ObjectSerializer::serializeCollection($session, '', true); - } - if ($session !== null) { - $queryParams['session'] = $session; - } - // query params - if (is_array($profile)) { - $profile = ObjectSerializer::serializeCollection($profile, '', true); - } - if ($profile !== null) { - $queryParams['profile'] = $profile; - } - // query params - if (is_array($customerName)) { - $customerName = ObjectSerializer::serializeCollection($customerName, '', true); - } - if ($customerName !== null) { - $queryParams['customerName'] = $customerName; - } - // query params - if (is_array($customerEmail)) { - $customerEmail = ObjectSerializer::serializeCollection($customerEmail, '', true); - } - if ($customerEmail !== null) { - $queryParams['customerEmail'] = $customerEmail; - } - // query params - if (is_array($couponCode)) { - $couponCode = ObjectSerializer::serializeCollection($couponCode, '', true); - } - if ($couponCode !== null) { - $queryParams['couponCode'] = $couponCode; - } - // query params - if (is_array($referralCode)) { - $referralCode = ObjectSerializer::serializeCollection($referralCode, '', true); - } - if ($referralCode !== null) { - $queryParams['referralCode'] = $referralCode; - } - // query params - if (is_array($ruleQuery)) { - $ruleQuery = ObjectSerializer::serializeCollection($ruleQuery, '', true); - } - if ($ruleQuery !== null) { - $queryParams['ruleQuery'] = $ruleQuery; - } - // query params - if (is_array($campaignQuery)) { - $campaignQuery = ObjectSerializer::serializeCollection($campaignQuery, '', true); - } - if ($campaignQuery !== null) { - $queryParams['campaignQuery'] = $campaignQuery; - } - - - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - '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 getApplicationSession - * - * Get Application session - * - * @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\ApplicationSession - */ - public function getApplicationSession($applicationId, $sessionId) - { - list($response) = $this->getApplicationSessionWithHttpInfo($applicationId, $sessionId); - return $response; - } - - /** - * Operation getApplicationSessionWithHttpInfo - * - * Get Application session - * - * @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\ApplicationSession, HTTP status code, HTTP response headers (array of strings) - */ - public function getApplicationSessionWithHttpInfo($applicationId, $sessionId) - { - $request = $this->getApplicationSessionRequest($applicationId, $sessionId); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\ApplicationSession' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ApplicationSession', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\ApplicationSession'; - $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\ApplicationSession', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getApplicationSessionAsync - * - * Get Application session - * - * @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 getApplicationSessionAsync($applicationId, $sessionId) - { - return $this->getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getApplicationSessionAsyncWithHttpInfo - * - * Get Application session - * - * @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 getApplicationSessionAsyncWithHttpInfo($applicationId, $sessionId) - { - $returnType = '\TalonOne\Client\Model\ApplicationSession'; - $request = $this->getApplicationSessionRequest($applicationId, $sessionId); + $returnType = '\TalonOne\Client\Model\ApplicationSession'; + $request = $this->getApplicationSessionRequest($applicationId, $sessionId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32665,36 +32631,323 @@ protected function getReferralsWithoutTotalCountRequest($applicationId, $campaig } /** - * Operation getRole + * Operation getRoleV2 * * Get role * - * @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) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Role + * @return \TalonOne\Client\Model\RoleV2 */ - public function getRole($roleId) + public function getRoleV2($roleId) { - list($response) = $this->getRoleWithHttpInfo($roleId); + list($response) = $this->getRoleV2WithHttpInfo($roleId); return $response; } /** - * Operation getRoleWithHttpInfo + * Operation getRoleV2WithHttpInfo * * Get role * - * @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) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Role, 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 getRoleWithHttpInfo($roleId) + public function getRoleV2WithHttpInfo($roleId) { - $request = $this->getRoleRequest($roleId); + $request = $this->getRoleV2Request($roleId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\RoleV2' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\RoleV2', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\RoleV2'; + $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\RoleV2', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRoleV2Async + * + * Get role + * + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRoleV2Async($roleId) + { + return $this->getRoleV2AsyncWithHttpInfo($roleId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRoleV2AsyncWithHttpInfo + * + * Get role + * + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRoleV2AsyncWithHttpInfo($roleId) + { + $returnType = '\TalonOne\Client\Model\RoleV2'; + $request = $this->getRoleV2Request($roleId); + + 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 'getRoleV2' + * + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getRoleV2Request($roleId) + { + // 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 getRoleV2' + ); + } + + $resourcePath = '/v2/roles/{roleId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($roleId !== null) { + $resourcePath = str_replace( + '{' . 'roleId' . '}', + ObjectSerializer::toPathValue($roleId), + $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( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRuleset + * + * Get ruleset + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $rulesetId The ID of the ruleset. (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\Ruleset + */ + public function getRuleset($applicationId, $campaignId, $rulesetId) + { + list($response) = $this->getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId); + return $response; + } + + /** + * Operation getRulesetWithHttpInfo + * + * Get ruleset + * + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $rulesetId The ID of the ruleset. (required) + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\Ruleset, HTTP status code, HTTP response headers (array of strings) + */ + public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) + { + $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); try { $options = $this->createHttpClientOption(); @@ -32727,20 +32980,20 @@ public function getRoleWithHttpInfo($roleId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Role' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Ruleset' === '\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\Ruleset', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Role'; + $returnType = '\TalonOne\Client\Model\Ruleset'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -32759,7 +33012,7 @@ public function getRoleWithHttpInfo($roleId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Role', + '\TalonOne\Client\Model\Ruleset', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -32770,18 +33023,20 @@ public function getRoleWithHttpInfo($roleId) } /** - * Operation getRoleAsync + * Operation getRulesetAsync * - * Get role + * Get ruleset * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your 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 getRoleAsync($roleId) + public function getRulesetAsync($applicationId, $campaignId, $rulesetId) { - return $this->getRoleAsyncWithHttpInfo($roleId) + return $this->getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) ->then( function ($response) { return $response[0]; @@ -32790,19 +33045,21 @@ function ($response) { } /** - * Operation getRoleAsyncWithHttpInfo + * Operation getRulesetAsyncWithHttpInfo * - * Get role + * Get ruleset * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your 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 getRoleAsyncWithHttpInfo($roleId) + public function getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) { - $returnType = '\TalonOne\Client\Model\Role'; - $request = $this->getRoleRequest($roleId); + $returnType = '\TalonOne\Client\Model\Ruleset'; + $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32839,23 +33096,37 @@ function ($exception) { } /** - * Create request for operation 'getRole' + * Create request for operation 'getRuleset' * - * @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) + * @param int $applicationId The ID of the Application. It is displayed in your 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 getRoleRequest($roleId) + protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) { - // verify the required parameter 'roleId' is set - if ($roleId === null || (is_array($roleId) && count($roleId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $roleId when calling getRole' + 'Missing the required parameter $applicationId when calling getRuleset' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getRuleset' + ); + } + // verify the required parameter 'rulesetId' is set + if ($rulesetId === null || (is_array($rulesetId) && count($rulesetId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rulesetId when calling getRuleset' ); } - $resourcePath = '/v1/roles/{roleId}'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32865,10 +33136,26 @@ protected function getRoleRequest($roleId) // path params - if ($roleId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'roleId' . '}', - ObjectSerializer::toPathValue($roleId), + '{' . '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 ); } @@ -32948,40 +33235,44 @@ protected function getRoleRequest($roleId) } /** - * Operation getRuleset + * Operation getRulesets * - * Get ruleset + * 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 $rulesetId The ID of the ruleset. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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\Ruleset + * @return \TalonOne\Client\Model\InlineResponse2007 */ - public function getRuleset($applicationId, $campaignId, $rulesetId) + public function getRulesets($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId); + list($response) = $this->getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort); return $response; } /** - * Operation getRulesetWithHttpInfo + * Operation getRulesetsWithHttpInfo * - * Get ruleset + * 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 $rulesetId The ID of the ruleset. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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\Ruleset, 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 getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) + public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); + $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -33014,20 +33305,20 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Ruleset' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse2007' === '\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\InlineResponse2007', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Ruleset'; + $returnType = '\TalonOne\Client\Model\InlineResponse2007'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -33046,7 +33337,7 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Ruleset', + '\TalonOne\Client\Model\InlineResponse2007', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33057,20 +33348,22 @@ public function getRulesetWithHttpInfo($applicationId, $campaignId, $rulesetId) } /** - * Operation getRulesetAsync + * Operation getRulesetsAsync * - * Get ruleset + * 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 $rulesetId The ID of the ruleset. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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 getRulesetAsync($applicationId, $campaignId, $rulesetId) + public function getRulesetsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - return $this->getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) + return $this->getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -33079,21 +33372,23 @@ function ($response) { } /** - * Operation getRulesetAsyncWithHttpInfo + * Operation getRulesetsAsyncWithHttpInfo * - * Get ruleset + * 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 $rulesetId The ID of the ruleset. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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 getRulesetAsyncWithHttpInfo($applicationId, $campaignId, $rulesetId) + public function getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\Ruleset'; - $request = $this->getRulesetRequest($applicationId, $campaignId, $rulesetId); + $returnType = '\TalonOne\Client\Model\InlineResponse2007'; + $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33130,43 +33425,67 @@ function ($exception) { } /** - * Create request for operation 'getRuleset' + * 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 $rulesetId The ID of the ruleset. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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 getRulesetRequest($applicationId, $campaignId, $rulesetId) + 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 getRuleset' + '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 getRuleset' + 'Missing the required parameter $campaignId when calling getRulesets' ); } - // 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' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'; + + $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 @@ -33185,14 +33504,6 @@ protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) $resourcePath ); } - // path params - if ($rulesetId !== null) { - $resourcePath = str_replace( - '{' . 'rulesetId' . '}', - ObjectSerializer::toPathValue($rulesetId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -33269,44 +33580,38 @@ protected function getRulesetRequest($applicationId, $campaignId, $rulesetId) } /** - * Operation getRulesets + * Operation getStore * - * List campaign rulesets + * Get 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 int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @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\InlineResponse2007 + * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getRulesets($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getStore($applicationId, $storeId) { - list($response) = $this->getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort); + list($response) = $this->getStoreWithHttpInfo($applicationId, $storeId); return $response; } /** - * Operation getRulesetsWithHttpInfo + * Operation getStoreWithHttpInfo * - * List campaign rulesets + * Get 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 int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @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\InlineResponse2007, 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 getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getStoreWithHttpInfo($applicationId, $storeId) { - $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); + $request = $this->getStoreRequest($applicationId, $storeId); try { $options = $this->createHttpClientOption(); @@ -33339,20 +33644,32 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse2007' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Store' === '\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\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\InlineResponse2007'; + $returnType = '\TalonOne\Client\Model\Store'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -33371,7 +33688,15 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse2007', + '\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); @@ -33382,22 +33707,19 @@ public function getRulesetsWithHttpInfo($applicationId, $campaignId, $pageSize = } /** - * Operation getRulesetsAsync + * Operation getStoreAsync * - * List campaign rulesets + * Get 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 int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @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 getRulesetsAsync($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getStoreAsync($applicationId, $storeId) { - return $this->getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize, $skip, $sort) + return $this->getStoreAsyncWithHttpInfo($applicationId, $storeId) ->then( function ($response) { return $response[0]; @@ -33406,23 +33728,20 @@ function ($response) { } /** - * Operation getRulesetsAsyncWithHttpInfo + * Operation getStoreAsyncWithHttpInfo * - * List campaign rulesets + * Get 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 int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) + * @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 getRulesetsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + public function getStoreAsyncWithHttpInfo($applicationId, $storeId) { - $returnType = '\TalonOne\Client\Model\InlineResponse2007'; - $request = $this->getRulesetsRequest($applicationId, $campaignId, $pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\Store'; + $request = $this->getStoreRequest($applicationId, $storeId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33459,67 +33778,36 @@ function ($exception) { } /** - * Create request for operation 'getRulesets' + * Create request for operation 'getStore' * * @param int $applicationId The ID of the Application. It is displayed in your 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 $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 getRulesetsRequest($applicationId, $campaignId, $pageSize = 1000, $skip = null, $sort = null) + protected function getStoreRequest($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 getRulesets' + 'Missing the required parameter $applicationId when calling getStore' ); } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'storeId' is set + if ($storeId === null || (is_array($storeId) && count($storeId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getRulesets' + 'Missing the required parameter $storeId when calling getStore' ); } - if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be smaller than or equal to 1000.'); - } - if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getRulesets, must be bigger than or equal to 1.'); - } - - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets'; + $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } // path params @@ -33531,10 +33819,10 @@ protected function getRulesetsRequest($applicationId, $campaignId, $pageSize = 1 ); } // path params - if ($campaignId !== null) { + if ($storeId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'storeId' . '}', + ObjectSerializer::toPathValue($storeId), $resourcePath ); } @@ -33614,38 +33902,36 @@ protected function getRulesetsRequest($applicationId, $campaignId, $pageSize = 1 } /** - * Operation getStore + * Operation getUser * - * Get store + * Get 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 int $userId The ID of the user. (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Store|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\User */ - public function getStore($applicationId, $storeId) + public function getUser($userId) { - list($response) = $this->getStoreWithHttpInfo($applicationId, $storeId); + list($response) = $this->getUserWithHttpInfo($userId); return $response; } /** - * Operation getStoreWithHttpInfo + * Operation getUserWithHttpInfo * - * Get store + * Get 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 int $userId The ID of the user. (required) * * @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\User, HTTP status code, HTTP response headers (array of strings) */ - public function getStoreWithHttpInfo($applicationId, $storeId) + public function getUserWithHttpInfo($userId) { - $request = $this->getStoreRequest($applicationId, $storeId); + $request = $this->getUserRequest($userId); try { $options = $this->createHttpClientOption(); @@ -33678,32 +33964,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\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 @@ -33722,15 +33996,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\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -33741,19 +34007,18 @@ public function getStoreWithHttpInfo($applicationId, $storeId) } /** - * Operation getStoreAsync + * Operation getUserAsync * - * Get store + * Get 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 int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStoreAsync($applicationId, $storeId) + public function getUserAsync($userId) { - return $this->getStoreAsyncWithHttpInfo($applicationId, $storeId) + return $this->getUserAsyncWithHttpInfo($userId) ->then( function ($response) { return $response[0]; @@ -33762,20 +34027,19 @@ function ($response) { } /** - * Operation getStoreAsyncWithHttpInfo + * Operation getUserAsyncWithHttpInfo * - * Get store + * Get 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 int $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStoreAsyncWithHttpInfo($applicationId, $storeId) + public function getUserAsyncWithHttpInfo($userId) { - $returnType = '\TalonOne\Client\Model\Store'; - $request = $this->getStoreRequest($applicationId, $storeId); + $returnType = '\TalonOne\Client\Model\User'; + $request = $this->getUserRequest($userId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33812,30 +34076,23 @@ function ($exception) { } /** - * Create request for operation 'getStore' + * Create request for operation 'getUser' * - * @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 $userId The ID of the user. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getStoreRequest($applicationId, $storeId) + 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 getStore' - ); - } - // 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 getStore' + 'Missing the required parameter $userId when calling getUser' ); } - $resourcePath = '/v1/applications/{applicationId}/stores/{storeId}'; + $resourcePath = '/v1/users/{userId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -33845,18 +34102,10 @@ protected function getStoreRequest($applicationId, $storeId) // 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 ); } @@ -33936,36 +34185,40 @@ protected function getStoreRequest($applicationId, $storeId) } /** - * Operation getUser + * Operation getUsers * - * Get user + * List users in account * - * @param int $userId The ID of the user. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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\User + * @return \TalonOne\Client\Model\InlineResponse20041 */ - public function getUser($userId) + public function getUsers($pageSize = 1000, $skip = null, $sort = null) { - list($response) = $this->getUserWithHttpInfo($userId); + list($response) = $this->getUsersWithHttpInfo($pageSize, $skip, $sort); return $response; } /** - * Operation getUserWithHttpInfo + * Operation getUsersWithHttpInfo * - * Get user + * List users in account * - * @param int $userId The ID of the user. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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\User, 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 getUserWithHttpInfo($userId) + public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $request = $this->getUserRequest($userId); + $request = $this->getUsersRequest($pageSize, $skip, $sort); try { $options = $this->createHttpClientOption(); @@ -33998,20 +34251,20 @@ public function getUserWithHttpInfo($userId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\User' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20041' === '\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\InlineResponse20041', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\User'; + $returnType = '\TalonOne\Client\Model\InlineResponse20041'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34030,7 +34283,7 @@ public function getUserWithHttpInfo($userId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\User', + '\TalonOne\Client\Model\InlineResponse20041', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34041,18 +34294,20 @@ public function getUserWithHttpInfo($userId) } /** - * Operation getUserAsync + * Operation getUsersAsync * - * Get user + * List users in account * - * @param int $userId The ID of the user. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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 getUserAsync($userId) + public function getUsersAsync($pageSize = 1000, $skip = null, $sort = null) { - return $this->getUserAsyncWithHttpInfo($userId) + return $this->getUsersAsyncWithHttpInfo($pageSize, $skip, $sort) ->then( function ($response) { return $response[0]; @@ -34061,19 +34316,21 @@ function ($response) { } /** - * Operation getUserAsyncWithHttpInfo + * Operation getUsersAsyncWithHttpInfo * - * Get user + * List users in account * - * @param int $userId The ID of the user. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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 getUserAsyncWithHttpInfo($userId) + public function getUsersAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) { - $returnType = '\TalonOne\Client\Model\User'; - $request = $this->getUserRequest($userId); + $returnType = '\TalonOne\Client\Model\InlineResponse20041'; + $request = $this->getUsersRequest($pageSize, $skip, $sort); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34110,39 +34367,55 @@ function ($exception) { } /** - * Create request for operation 'getUser' + * Create request for operation 'getUsers' * - * @param int $userId The ID of the user. (required) + * @param int $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are 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 getUserRequest($userId) + protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = 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.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/users/{userId}'; + + $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 ($userId !== null) { - $resourcePath = str_replace( - '{' . 'userId' . '}', - ObjectSerializer::toPathValue($userId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -34219,40 +34492,36 @@ protected function getUserRequest($userId) } /** - * Operation getUsers + * Operation getWebhook * - * List users in account + * Get webhook * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted 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 $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\InlineResponse20041 + * @return \TalonOne\Client\Model\Webhook */ - public function getUsers($pageSize = 1000, $skip = null, $sort = null) + public function getWebhook($webhookId) { - list($response) = $this->getUsersWithHttpInfo($pageSize, $skip, $sort); + list($response) = $this->getWebhookWithHttpInfo($webhookId); return $response; } /** - * Operation getUsersWithHttpInfo + * Operation getWebhookWithHttpInfo * - * List users in account + * Get webhook * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted 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 $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\InlineResponse20041, 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 getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getWebhookWithHttpInfo($webhookId) { - $request = $this->getUsersRequest($pageSize, $skip, $sort); + $request = $this->getWebhookRequest($webhookId); try { $options = $this->createHttpClientOption(); @@ -34285,20 +34554,20 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20041' === '\SplFileObject') { + if ('\TalonOne\Client\Model\Webhook' === '\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\Webhook', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20041'; + $returnType = '\TalonOne\Client\Model\Webhook'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34317,7 +34586,7 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20041', + '\TalonOne\Client\Model\Webhook', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34328,20 +34597,18 @@ public function getUsersWithHttpInfo($pageSize = 1000, $skip = null, $sort = nul } /** - * Operation getUsersAsync + * Operation getWebhookAsync * - * List users in account + * Get webhook * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted 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 $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 getUsersAsync($pageSize = 1000, $skip = null, $sort = null) + public function getWebhookAsync($webhookId) { - return $this->getUsersAsyncWithHttpInfo($pageSize, $skip, $sort) + return $this->getWebhookAsyncWithHttpInfo($webhookId) ->then( function ($response) { return $response[0]; @@ -34350,21 +34617,19 @@ function ($response) { } /** - * Operation getUsersAsyncWithHttpInfo + * Operation getWebhookAsyncWithHttpInfo * - * List users in account + * Get webhook * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted 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 $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 getUsersAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null) + public function getWebhookAsyncWithHttpInfo($webhookId) { - $returnType = '\TalonOne\Client\Model\InlineResponse20041'; - $request = $this->getUsersRequest($pageSize, $skip, $sort); + $returnType = '\TalonOne\Client\Model\Webhook'; + $request = $this->getWebhookRequest($webhookId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34401,55 +34666,39 @@ function ($exception) { } /** - * Create request for operation 'getUsers' + * Create request for operation 'getWebhook' * - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted 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 $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 getUsersRequest($pageSize = 1000, $skip = null, $sort = null) + protected function getWebhookRequest($webhookId) { - 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 'webhookId' is set + if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $webhookId when calling getWebhook' + ); } - - $resourcePath = '/v1/users'; + $resourcePath = '/v1/webhooks/{webhookId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($pageSize)) { - $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); - } - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - // query params - if (is_array($skip)) { - $skip = ObjectSerializer::serializeCollection($skip, '', true); - } - if ($skip !== null) { - $queryParams['skip'] = $skip; - } - // query params - if (is_array($sort)) { - $sort = ObjectSerializer::serializeCollection($sort, '', true); - } - if ($sort !== null) { - $queryParams['sort'] = $sort; - } + // path params + if ($webhookId !== null) { + $resourcePath = str_replace( + '{' . 'webhookId' . '}', + ObjectSerializer::toPathValue($webhookId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -34526,36 +34775,52 @@ protected function getUsersRequest($pageSize = 1000, $skip = null, $sort = null) } /** - * Operation getWebhook + * Operation getWebhookActivationLogs * - * Get webhook + * List webhook activation log entries * - * @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 $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in 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\Webhook + * @return \TalonOne\Client\Model\InlineResponse20038 */ - public function getWebhook($webhookId) + public function getWebhookActivationLogs($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) { - list($response) = $this->getWebhookWithHttpInfo($webhookId); + list($response) = $this->getWebhookActivationLogsWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); return $response; } /** - * Operation getWebhookWithHttpInfo + * Operation getWebhookActivationLogsWithHttpInfo * - * Get webhook + * List webhook activation log entries * - * @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 $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in 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\Webhook, 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 getWebhookWithHttpInfo($webhookId) + public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) { - $request = $this->getWebhookRequest($webhookId); + $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); try { $options = $this->createHttpClientOption(); @@ -34588,20 +34853,20 @@ public function getWebhookWithHttpInfo($webhookId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\Webhook' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20038' === '\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\InlineResponse20038', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\Webhook'; + $returnType = '\TalonOne\Client\Model\InlineResponse20038'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34620,7 +34885,7 @@ public function getWebhookWithHttpInfo($webhookId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\Webhook', + '\TalonOne\Client\Model\InlineResponse20038', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34631,18 +34896,26 @@ public function getWebhookWithHttpInfo($webhookId) } /** - * Operation getWebhookAsync + * Operation getWebhookActivationLogsAsync * - * Get webhook + * List webhook activation log entries * - * @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 $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in 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 getWebhookAsync($webhookId) + public function getWebhookActivationLogsAsync($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) { - return $this->getWebhookAsyncWithHttpInfo($webhookId) + return $this->getWebhookActivationLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) ->then( function ($response) { return $response[0]; @@ -34651,19 +34924,27 @@ function ($response) { } /** - * Operation getWebhookAsyncWithHttpInfo + * Operation getWebhookActivationLogsAsyncWithHttpInfo * - * Get webhook + * List webhook activation log entries * - * @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 $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in 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 getWebhookAsyncWithHttpInfo($webhookId) + 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\Webhook'; - $request = $this->getWebhookRequest($webhookId); + $returnType = '\TalonOne\Client\Model\InlineResponse20038'; + $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34700,40 +34981,104 @@ function ($exception) { } /** - * Create request for operation 'getWebhook' + * Create request for operation 'getWebhookActivationLogs' * - * @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 $pageSize The number of items in the response. (optional, default to 1000) + * @param int $skip The number of items to skip when paging through large result sets. (optional) + * @param string $sort The field by which results should be sorted. By default, results are sorted in 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 getWebhookRequest($webhookId) + 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 'webhookId' is set - if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $webhookId when calling getWebhook' - ); + if ($pageSize !== null && $pageSize > 1000) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be smaller than or equal to 1000.'); + } + if ($pageSize !== null && $pageSize < 1) { + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/webhooks/{webhookId}'; + + $resourcePath = '/v1/webhook_activation_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($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) { - $resourcePath = str_replace( - '{' . 'webhookId' . '}', - ObjectSerializer::toPathValue($webhookId), - $resourcePath - ); + $queryParams['webhookId'] = $webhookId; + } + // query params + if (is_array($applicationId)) { + $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); + } + if ($applicationId !== null) { + $queryParams['applicationId'] = $applicationId; + } + // query params + if (is_array($campaignId)) { + $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + } + if ($campaignId !== null) { + $queryParams['campaignId'] = $campaignId; + } + // query params + if (is_array($createdBefore)) { + $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + } + if ($createdBefore !== null) { + $queryParams['createdBefore'] = $createdBefore; + } + // query params + if (is_array($createdAfter)) { + $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + } + if ($createdAfter !== null) { + $queryParams['createdAfter'] = $createdAfter; } + + // body params $_tempBody = null; @@ -34809,52 +35154,54 @@ protected function getWebhookRequest($webhookId) } /** - * Operation getWebhookActivationLogs + * Operation getWebhookLogs * - * List webhook activation log entries + * List webhook log entries * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (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 \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 $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\InlineResponse20038 + * @return \TalonOne\Client\Model\InlineResponse20039 */ - public function getWebhookActivationLogs($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + 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->getWebhookActivationLogsWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + list($response) = $this->getWebhookLogsWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); return $response; } /** - * Operation getWebhookActivationLogsWithHttpInfo + * Operation getWebhookLogsWithHttpInfo * - * List webhook activation log entries + * List webhook log entries * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (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 \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 $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\InlineResponse20038, 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 getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + 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->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); try { $options = $this->createHttpClientOption(); @@ -34887,20 +35234,20 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20038' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20039' === '\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\InlineResponse20039', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20038'; + $returnType = '\TalonOne\Client\Model\InlineResponse20039'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -34919,7 +35266,7 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20038', + '\TalonOne\Client\Model\InlineResponse20039', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -34930,26 +35277,27 @@ public function getWebhookActivationLogsWithHttpInfo($pageSize = 1000, $skip = n } /** - * Operation getWebhookActivationLogsAsync + * Operation getWebhookLogsAsync * - * List webhook activation log entries + * List webhook log entries * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (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 \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 $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 getWebhookActivationLogsAsync($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + 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->getWebhookActivationLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter) + return $this->getWebhookLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) ->then( function ($response) { return $response[0]; @@ -34958,27 +35306,28 @@ function ($response) { } /** - * Operation getWebhookActivationLogsAsyncWithHttpInfo + * Operation getWebhookLogsAsyncWithHttpInfo * - * List webhook activation log entries + * List webhook log entries * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (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 \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 $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 getWebhookActivationLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + 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\InlineResponse20038'; - $request = $this->getWebhookActivationLogsRequest($pageSize, $skip, $sort, $integrationRequestUuid, $webhookId, $applicationId, $campaignId, $createdBefore, $createdAfter); + $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()) @@ -35015,32 +35364,33 @@ function ($exception) { } /** - * Create request for operation 'getWebhookActivationLogs' + * Create request for operation 'getWebhookLogs' * * @param int $pageSize The number of items in the response. (optional, default to 1000) * @param int $skip The number of items to skip when paging through large result sets. (optional) * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $integrationRequestUuid Filter results by integration request UUID. (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 \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 $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 getWebhookActivationLogsRequest($pageSize = 1000, $skip = null, $sort = null, $integrationRequestUuid = null, $webhookId = null, $applicationId = null, $campaignId = null, $createdBefore = null, $createdAfter = null) + protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) { if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be smaller than or equal to 1000.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be smaller than or equal to 1000.'); } if ($pageSize !== null && $pageSize < 1) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookActivationLogs, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/webhook_activation_logs'; + $resourcePath = '/v1/webhook_logs'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35069,11 +35419,11 @@ protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = nul $queryParams['sort'] = $sort; } // query params - if (is_array($integrationRequestUuid)) { - $integrationRequestUuid = ObjectSerializer::serializeCollection($integrationRequestUuid, '', true); + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); } - if ($integrationRequestUuid !== null) { - $queryParams['integrationRequestUuid'] = $integrationRequestUuid; + if ($status !== null) { + $queryParams['status'] = $status; } // query params if (is_array($webhookId)) { @@ -35097,6 +35447,13 @@ protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = nul $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); } @@ -35188,54 +35545,50 @@ protected function getWebhookActivationLogsRequest($pageSize = 1000, $skip = nul } /** - * Operation getWebhookLogs + * Operation getWebhooks * - * List webhook log entries + * List webhooks * + * @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 $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param 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\InlineResponse20039 + * @return \TalonOne\Client\Model\InlineResponse20037 */ - 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 getWebhooks($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - list($response) = $this->getWebhookLogsWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + list($response) = $this->getWebhooksWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); return $response; } /** - * Operation getWebhookLogsWithHttpInfo + * Operation getWebhooksWithHttpInfo * - * List webhook log entries + * List webhooks * + * @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 $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param 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\InlineResponse20039, 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 getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); try { $options = $this->createHttpClientOption(); @@ -35268,20 +35621,20 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20039' === '\SplFileObject') { + if ('\TalonOne\Client\Model\InlineResponse20037' === '\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\InlineResponse20037', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\TalonOne\Client\Model\InlineResponse20039'; + $returnType = '\TalonOne\Client\Model\InlineResponse20037'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -35300,7 +35653,7 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20039', + '\TalonOne\Client\Model\InlineResponse20037', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -35311,27 +35664,25 @@ public function getWebhookLogsWithHttpInfo($pageSize = 1000, $skip = null, $sort } /** - * Operation getWebhookLogsAsync + * Operation getWebhooksAsync * - * List webhook log entries + * List webhooks * + * @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 $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param 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 getWebhookLogsAsync($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function getWebhooksAsync($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - return $this->getWebhookLogsAsyncWithHttpInfo($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter) + return $this->getWebhooksAsyncWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) ->then( function ($response) { return $response[0]; @@ -35340,28 +35691,26 @@ function ($response) { } /** - * Operation getWebhookLogsAsyncWithHttpInfo + * Operation getWebhooksAsyncWithHttpInfo * - * List webhook log entries + * List webhooks * + * @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 $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param 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 getWebhookLogsAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + public function getWebhooksAsyncWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20039'; - $request = $this->getWebhookLogsRequest($pageSize, $skip, $sort, $status, $webhookId, $applicationId, $campaignId, $requestUuid, $createdBefore, $createdAfter); + $returnType = '\TalonOne\Client\Model\InlineResponse20037'; + $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35398,33 +35747,31 @@ function ($exception) { } /** - * Create request for operation 'getWebhookLogs' + * Create request for operation 'getWebhooks' * + * @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 $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param string $status Filter results by HTTP status codes. (optional) - * @param float $webhookId Filter results by Webhook. (optional) - * @param float $applicationId Filter results by Application ID. (optional) - * @param float $campaignId Filter results by campaign. (optional) - * @param string $requestUuid Filter results by request UUID. (optional) - * @param \DateTime $createdBefore Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) - * @param \DateTime $createdAfter Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. You can use any time zone setting. Talon.One will convert to UTC internally. (optional) + * @param 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 getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = null, $status = null, $webhookId = null, $applicationId = null, $campaignId = null, $requestUuid = null, $createdBefore = null, $createdAfter = null) + protected function getWebhooksRequest($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) { if ($pageSize !== null && $pageSize > 1000) { - throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhookLogs, must be smaller than or equal to 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.getWebhookLogs, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$pageSize" when calling ManagementApi.getWebhooks, must be bigger than or equal to 1.'); } - $resourcePath = '/v1/webhook_logs'; + $resourcePath = '/v1/webhooks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35432,18 +35779,11 @@ protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = $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($applicationIds)) { + $applicationIds = ObjectSerializer::serializeCollection($applicationIds, '', true); } - if ($skip !== null) { - $queryParams['skip'] = $skip; + if ($applicationIds !== null) { + $queryParams['applicationIds'] = $applicationIds; } // query params if (is_array($sort)) { @@ -35453,53 +35793,46 @@ protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = $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 (is_array($pageSize)) { + $pageSize = ObjectSerializer::serializeCollection($pageSize, '', true); } - if ($webhookId !== null) { - $queryParams['webhookId'] = $webhookId; + if ($pageSize !== null) { + $queryParams['pageSize'] = $pageSize; } // query params - if (is_array($applicationId)) { - $applicationId = ObjectSerializer::serializeCollection($applicationId, '', true); + if (is_array($skip)) { + $skip = ObjectSerializer::serializeCollection($skip, '', true); } - if ($applicationId !== null) { - $queryParams['applicationId'] = $applicationId; + if ($skip !== null) { + $queryParams['skip'] = $skip; } // query params - if (is_array($campaignId)) { - $campaignId = ObjectSerializer::serializeCollection($campaignId, '', true); + if (is_array($creationType)) { + $creationType = ObjectSerializer::serializeCollection($creationType, '', true); } - if ($campaignId !== null) { - $queryParams['campaignId'] = $campaignId; + if ($creationType !== null) { + $queryParams['creationType'] = $creationType; } // query params - if (is_array($requestUuid)) { - $requestUuid = ObjectSerializer::serializeCollection($requestUuid, '', true); + if (is_array($visibility)) { + $visibility = ObjectSerializer::serializeCollection($visibility, '', true); } - if ($requestUuid !== null) { - $queryParams['requestUuid'] = $requestUuid; + if ($visibility !== null) { + $queryParams['visibility'] = $visibility; } // query params - if (is_array($createdBefore)) { - $createdBefore = ObjectSerializer::serializeCollection($createdBefore, '', true); + if (is_array($outgoingIntegrationsTypeId)) { + $outgoingIntegrationsTypeId = ObjectSerializer::serializeCollection($outgoingIntegrationsTypeId, '', true); } - if ($createdBefore !== null) { - $queryParams['createdBefore'] = $createdBefore; + if ($outgoingIntegrationsTypeId !== null) { + $queryParams['outgoingIntegrationsTypeId'] = $outgoingIntegrationsTypeId; } // query params - if (is_array($createdAfter)) { - $createdAfter = ObjectSerializer::serializeCollection($createdAfter, '', true); + if (is_array($title)) { + $title = ObjectSerializer::serializeCollection($title, '', true); } - if ($createdAfter !== null) { - $queryParams['createdAfter'] = $createdAfter; + if ($title !== null) { + $queryParams['title'] = $title; } @@ -35579,50 +35912,38 @@ protected function getWebhookLogsRequest($pageSize = 1000, $skip = null, $sort = } /** - * Operation getWebhooks + * Operation importAccountCollection * - * List webhooks + * Import data into existing account-level collection * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param 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\InlineResponse20037 + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function getWebhooks($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function importAccountCollection($collectionId, $upFile = null) { - list($response) = $this->getWebhooksWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + list($response) = $this->importAccountCollectionWithHttpInfo($collectionId, $upFile); return $response; } /** - * Operation getWebhooksWithHttpInfo + * Operation importAccountCollectionWithHttpInfo * - * List webhooks + * Import data into existing account-level collection * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param 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\InlineResponse20037, 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 getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function importAccountCollectionWithHttpInfo($collectionId, $upFile = null) { - $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + $request = $this->importAccountCollectionRequest($collectionId, $upFile); try { $options = $this->createHttpClientOption(); @@ -35655,20 +35976,44 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\TalonOne\Client\Model\InlineResponse20037' === '\SplFileObject') { + if ('\TalonOne\Client\Model\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 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\InlineResponse20037'; + $returnType = '\TalonOne\Client\Model\Import'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -35687,7 +36032,23 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\InlineResponse20037', + '\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); @@ -35698,25 +36059,19 @@ public function getWebhooksWithHttpInfo($applicationIds = null, $sort = null, $p } /** - * Operation getWebhooksAsync + * Operation importAccountCollectionAsync * - * List webhooks + * Import data into existing account-level collection * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param 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 getWebhooksAsync($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function importAccountCollectionAsync($collectionId, $upFile = null) { - return $this->getWebhooksAsyncWithHttpInfo($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title) + return $this->importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile) ->then( function ($response) { return $response[0]; @@ -35725,26 +36080,20 @@ function ($response) { } /** - * Operation getWebhooksAsyncWithHttpInfo + * Operation importAccountCollectionAsyncWithHttpInfo * - * List webhooks + * Import data into existing account-level collection * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param 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 getWebhooksAsyncWithHttpInfo($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + public function importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile = null) { - $returnType = '\TalonOne\Client\Model\InlineResponse20037'; - $request = $this->getWebhooksRequest($applicationIds, $sort, $pageSize, $skip, $creationType, $visibility, $outgoingIntegrationsTypeId, $title); + $returnType = '\TalonOne\Client\Model\Import'; + $request = $this->importAccountCollectionRequest($collectionId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35781,96 +36130,45 @@ function ($exception) { } /** - * Create request for operation 'getWebhooks' + * Create request for operation 'importAccountCollection' * - * @param string $applicationIds Filter by one or more Application IDs, separated by a comma. (optional) - * @param string $sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields. (optional) - * @param int $pageSize The number of items in the response. (optional, default to 1000) - * @param int $skip The number of items to skip when paging through large result sets. (optional) - * @param string $creationType Filter results by creation type. (optional) - * @param string $visibility Filter results by visibility. (optional) - * @param int $outgoingIntegrationsTypeId Filter results by outgoing integration type ID. (optional) - * @param string $title Filter results performing case-insensitive matching against the webhook title. (optional) + * @param 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 getWebhooksRequest($applicationIds = null, $sort = null, $pageSize = 1000, $skip = null, $creationType = null, $visibility = null, $outgoingIntegrationsTypeId = null, $title = null) + protected function importAccountCollectionRequest($collectionId, $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.'); - } - 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 '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/webhooks'; + $resourcePath = '/v1/collections/{collectionId}/import'; $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 ($collectionId !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collectionId), + $resourcePath + ); + } + // form params + if ($upFile !== null) { + $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); + } // body params $_tempBody = null; @@ -35881,7 +36179,7 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['multipart/form-data'] ); } @@ -35938,7 +36236,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 @@ -35946,38 +36244,38 @@ protected function getWebhooksRequest($applicationIds = null, $sort = null, $pag } /** - * Operation importAccountCollection + * Operation importAllowedList * - * Import data into existing account-level collection + * Import allowed values for attribute * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (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\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importAccountCollection($collectionId, $upFile = null) + public function importAllowedList($attributeId, $upFile = null) { - list($response) = $this->importAccountCollectionWithHttpInfo($collectionId, $upFile); + list($response) = $this->importAllowedListWithHttpInfo($attributeId, $upFile); return $response; } /** - * Operation importAccountCollectionWithHttpInfo + * Operation importAllowedListWithHttpInfo * - * Import data into existing account-level collection + * Import allowed values for attribute * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (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\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|\TalonOne\Client\Model\ErrorResponse|\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 importAllowedListWithHttpInfo($attributeId, $upFile = null) { - $request = $this->importAccountCollectionRequest($collectionId, $upFile); + $request = $this->importAllowedListRequest($attributeId, $upFile); try { $options = $this->createHttpClientOption(); @@ -36022,6 +36320,18 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul $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 { @@ -36033,7 +36343,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 { @@ -36074,7 +36384,7 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', + '\TalonOne\Client\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -36087,25 +36397,33 @@ public function importAccountCollectionWithHttpInfo($collectionId, $upFile = nul ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\ErrorResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation importAccountCollectionAsync + * Operation importAllowedListAsync * - * Import data into existing account-level collection + * Import allowed values for attribute * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (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 importAccountCollectionAsync($collectionId, $upFile = null) + public function importAllowedListAsync($attributeId, $upFile = null) { - return $this->importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile) + return $this->importAllowedListAsyncWithHttpInfo($attributeId, $upFile) ->then( function ($response) { return $response[0]; @@ -36114,20 +36432,20 @@ function ($response) { } /** - * Operation importAccountCollectionAsyncWithHttpInfo + * Operation importAllowedListAsyncWithHttpInfo * - * Import data into existing account-level collection + * Import allowed values for attribute * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (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 importAccountCollectionAsyncWithHttpInfo($collectionId, $upFile = null) + public function importAllowedListAsyncWithHttpInfo($attributeId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAccountCollectionRequest($collectionId, $upFile); + $request = $this->importAllowedListRequest($attributeId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36164,24 +36482,24 @@ function ($exception) { } /** - * Create request for operation 'importAccountCollection' + * Create request for operation 'importAllowedList' * - * @param int $collectionId The ID of the collection. You can get it with the [List collections in account](#operation/listAccountCollections) endpoint. (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 importAccountCollectionRequest($collectionId, $upFile = null) + protected function importAllowedListRequest($attributeId, $upFile = null) { - // 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 importAccountCollection' + 'Missing the required parameter $attributeId when calling importAllowedList' ); } - $resourcePath = '/v1/collections/{collectionId}/import'; + $resourcePath = '/v1/attributes/{attributeId}/allowed_list/import'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36191,10 +36509,10 @@ protected function importAccountCollectionRequest($collectionId, $upFile = null) // path params - if ($collectionId !== null) { + if ($attributeId !== null) { $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), + '{' . 'attributeId' . '}', + ObjectSerializer::toPathValue($attributeId), $resourcePath ); } @@ -36278,38 +36596,38 @@ protected function importAccountCollectionRequest($collectionId, $upFile = null) } /** - * Operation importAllowedList + * Operation importAudiencesMemberships * - * Import allowed values for attribute + * Import audience members * - * @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 $audienceId The ID of the audience. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importAllowedList($attributeId, $upFile = null) + public function importAudiencesMemberships($audienceId, $upFile = null) { - list($response) = $this->importAllowedListWithHttpInfo($attributeId, $upFile); + list($response) = $this->importAudiencesMembershipsWithHttpInfo($audienceId, $upFile); return $response; } /** - * Operation importAllowedListWithHttpInfo + * Operation importAudiencesMembershipsWithHttpInfo * - * Import allowed values for attribute + * Import audience members * - * @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 $audienceId The ID of the audience. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, HTTP status code, HTTP response headers (array of strings) */ - public function importAllowedListWithHttpInfo($attributeId, $upFile = null) + public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = null) { - $request = $this->importAllowedListRequest($attributeId, $upFile); + $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); try { $options = $this->createHttpClientOption(); @@ -36445,19 +36763,19 @@ public function importAllowedListWithHttpInfo($attributeId, $upFile = null) } /** - * Operation importAllowedListAsync + * Operation importAudiencesMembershipsAsync * - * Import allowed values for attribute + * Import audience members * - * @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 $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 importAllowedListAsync($attributeId, $upFile = null) + public function importAudiencesMembershipsAsync($audienceId, $upFile = null) { - return $this->importAllowedListAsyncWithHttpInfo($attributeId, $upFile) + return $this->importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile) ->then( function ($response) { return $response[0]; @@ -36466,20 +36784,20 @@ function ($response) { } /** - * Operation importAllowedListAsyncWithHttpInfo + * Operation importAudiencesMembershipsAsyncWithHttpInfo * - * Import allowed values for attribute + * Import audience members * - * @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 $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 importAllowedListAsyncWithHttpInfo($attributeId, $upFile = null) + public function importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAllowedListRequest($attributeId, $upFile); + $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36516,24 +36834,24 @@ function ($exception) { } /** - * Create request for operation 'importAllowedList' + * Create request for operation 'importAudiencesMemberships' * - * @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 $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 importAllowedListRequest($attributeId, $upFile = null) + protected function importAudiencesMembershipsRequest($audienceId, $upFile = null) { - // verify the required parameter 'attributeId' is set - if ($attributeId === null || (is_array($attributeId) && count($attributeId) === 0)) { + // verify the required parameter 'audienceId' is set + if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $attributeId when calling importAllowedList' + 'Missing the required parameter $audienceId when calling importAudiencesMemberships' ); } - $resourcePath = '/v1/attributes/{attributeId}/allowed_list/import'; + $resourcePath = '/v1/audiences/{audienceId}/memberships/import'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36543,10 +36861,10 @@ protected function importAllowedListRequest($attributeId, $upFile = null) // path params - if ($attributeId !== null) { + if ($audienceId !== null) { $resourcePath = str_replace( - '{' . 'attributeId' . '}', - ObjectSerializer::toPathValue($attributeId), + '{' . 'audienceId' . '}', + ObjectSerializer::toPathValue($audienceId), $resourcePath ); } @@ -36630,38 +36948,42 @@ protected function importAllowedListRequest($attributeId, $upFile = null) } /** - * Operation importAudiencesMemberships + * Operation importCollection * - * Import audience members + * Import data into existing campaign-level collection * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponse|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importAudiencesMemberships($audienceId, $upFile = null) + public function importCollection($applicationId, $campaignId, $collectionId, $upFile = null) { - list($response) = $this->importAudiencesMembershipsWithHttpInfo($audienceId, $upFile); + list($response) = $this->importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile); return $response; } /** - * Operation importAudiencesMembershipsWithHttpInfo + * Operation importCollectionWithHttpInfo * - * Import audience members + * Import data into existing campaign-level collection * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) + * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\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, HTTP status code, HTTP response headers (array of strings) */ - public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = null) + public function importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) { - $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); + $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); try { $options = $this->createHttpClientOption(); @@ -36705,18 +37027,6 @@ public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = nu $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 @@ -36724,18 +37034,6 @@ public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = nu $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(), @@ -36767,14 +37065,6 @@ public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = nu ); $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(), @@ -36783,33 +37073,27 @@ public function importAudiencesMembershipsWithHttpInfo($audienceId, $upFile = nu ); $e->setResponseObject($data); break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation importAudiencesMembershipsAsync + * Operation importCollectionAsync * - * Import audience members + * Import data into existing campaign-level collection * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $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 importAudiencesMembershipsAsync($audienceId, $upFile = null) + public function importCollectionAsync($applicationId, $campaignId, $collectionId, $upFile = null) { - return $this->importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile) + return $this->importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile) ->then( function ($response) { return $response[0]; @@ -36818,20 +37102,22 @@ function ($response) { } /** - * Operation importAudiencesMembershipsAsyncWithHttpInfo + * Operation importCollectionAsyncWithHttpInfo * - * Import audience members + * Import data into existing campaign-level collection * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $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 importAudiencesMembershipsAsyncWithHttpInfo($audienceId, $upFile = null) + public function importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importAudiencesMembershipsRequest($audienceId, $upFile); + $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36868,24 +37154,38 @@ function ($exception) { } /** - * Create request for operation 'importAudiencesMemberships' + * Create request for operation 'importCollection' * - * @param int $audienceId The ID of the audience. (required) + * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) + * @param int $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 importAudiencesMembershipsRequest($audienceId, $upFile = null) + protected function importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile = null) { - // verify the required parameter 'audienceId' is set - if ($audienceId === null || (is_array($audienceId) && count($audienceId) === 0)) { + // verify the required parameter 'applicationId' is set + if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $audienceId when calling importAudiencesMemberships' + 'Missing the required parameter $applicationId when calling importCollection' + ); + } + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling importCollection' + ); + } + // verify the required parameter 'collectionId' is set + if ($collectionId === null || (is_array($collectionId) && count($collectionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collectionId when calling importCollection' ); } - $resourcePath = '/v1/audiences/{audienceId}/memberships/import'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36895,10 +37195,26 @@ protected function importAudiencesMembershipsRequest($audienceId, $upFile = null // path params - if ($audienceId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'audienceId' . '}', - ObjectSerializer::toPathValue($audienceId), + '{' . '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 ); } @@ -36982,42 +37298,42 @@ protected function importAudiencesMembershipsRequest($audienceId, $upFile = null } /** - * Operation importCollection + * Operation importCoupons * - * Import data into existing campaign-level collection + * Import coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Import */ - public function importCollection($applicationId, $campaignId, $collectionId, $upFile = null) + public function importCoupons($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { - list($response) = $this->importCollectionWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile); + list($response) = $this->importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile); return $response; } /** - * Operation importCollectionWithHttpInfo + * Operation importCouponsWithHttpInfo * - * Import data into existing campaign-level collection + * Import coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (required) + * @param bool $skipDuplicates An indicator of whether to skip duplicate coupon values instead of causing an error. Duplicate values are ignored when `skipDuplicates=true`. (optional) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\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 importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { - $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); try { $options = $this->createHttpClientOption(); @@ -37061,18 +37377,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'; @@ -37099,35 +37403,27 @@ 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 importCouponsAsync * - * Import data into existing campaign-level collection + * Import coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (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 importCollectionAsync($applicationId, $campaignId, $collectionId, $upFile = null) + public function importCouponsAsync($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { - return $this->importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile) + return $this->importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile) ->then( function ($response) { return $response[0]; @@ -37136,22 +37432,22 @@ function ($response) { } /** - * Operation importCollectionAsyncWithHttpInfo + * Operation importCouponsAsyncWithHttpInfo * - * Import data into existing campaign-level collection + * Import coupons * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (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 importCollectionAsyncWithHttpInfo($applicationId, $campaignId, $collectionId, $upFile = null) + public function importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile); + $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37188,44 +37484,45 @@ function ($exception) { } /** - * Create request for operation 'importCollection' + * Create request for operation 'importCoupons' * * @param int $applicationId The ID of the Application. It is displayed in your Talon.One deployment URL. (required) * @param int $campaignId The ID of the campaign. It is displayed in your Talon.One deployment URL. (required) - * @param int $collectionId The ID of the collection. You can get it with the [List collections in Application](#operation/listCollectionsInApplication) endpoint. (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 importCollectionRequest($applicationId, $campaignId, $collectionId, $upFile = null) + protected function importCouponsRequest($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) { // verify the required parameter 'applicationId' is set if ($applicationId === null || (is_array($applicationId) && count($applicationId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicationId when calling importCollection' + 'Missing the required parameter $applicationId when calling importCoupons' ); } // verify the required parameter 'campaignId' is set if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling 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' + 'Missing the required parameter $campaignId when calling importCoupons' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if (is_array($skipDuplicates)) { + $skipDuplicates = ObjectSerializer::serializeCollection($skipDuplicates, '', true); + } + if ($skipDuplicates !== null) { + $queryParams['skipDuplicates'] = $skipDuplicates; + } // path params @@ -37244,14 +37541,6 @@ protected function importCollectionRequest($applicationId, $campaignId, $collect $resourcePath ); } - // path params - if ($collectionId !== null) { - $resourcePath = str_replace( - '{' . 'collectionId' . '}', - ObjectSerializer::toPathValue($collectionId), - $resourcePath - ); - } // form params if ($upFile !== null) { @@ -37332,42 +37621,38 @@ protected function importCollectionRequest($applicationId, $campaignId, $collect } /** - * Operation importCoupons + * Operation importLoyaltyCards * - * Import coupons + * Import loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your 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 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 + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importCoupons($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function importLoyaltyCards($loyaltyProgramId, $upFile = null) { - list($response) = $this->importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile); + list($response) = $this->importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile); return $response; } /** - * Operation importCouponsWithHttpInfo + * Operation importLoyaltyCardsWithHttpInfo * - * Import coupons + * Import loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your 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 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, 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 importCouponsWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null) { - $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); + $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); try { $options = $this->createHttpClientOption(); @@ -37411,6 +37696,30 @@ public function importCouponsWithHttpInfo($applicationId, $campaignId, $skipDupl $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'; @@ -37437,27 +37746,41 @@ public function importCouponsWithHttpInfo($applicationId, $campaignId, $skipDupl ); $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 importCouponsAsync + * Operation importLoyaltyCardsAsync * - * Import coupons + * Import loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your 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 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 importCouponsAsync($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function importLoyaltyCardsAsync($loyaltyProgramId, $upFile = null) { - return $this->importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates, $upFile) + return $this->importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile) ->then( function ($response) { return $response[0]; @@ -37466,22 +37789,20 @@ function ($response) { } /** - * Operation importCouponsAsyncWithHttpInfo + * Operation importLoyaltyCardsAsyncWithHttpInfo * - * Import coupons + * Import loyalty cards * - * @param int $applicationId The ID of the Application. It is displayed in your 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 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 importCouponsAsyncWithHttpInfo($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + public function importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importCouponsRequest($applicationId, $campaignId, $skipDuplicates, $upFile); + $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37518,60 +37839,37 @@ function ($exception) { } /** - * Create request for operation 'importCoupons' + * Create request for operation 'importLoyaltyCards' * - * @param int $applicationId The ID of the Application. It is displayed in your 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 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 importCouponsRequest($applicationId, $campaignId, $skipDuplicates = null, $upFile = null) + protected function importLoyaltyCardsRequest($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 importCoupons' - ); - } - // verify the required parameter 'campaignId' is set - if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + // verify the required parameter 'loyaltyProgramId' is set + if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling importCoupons' + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCards' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_cards'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($skipDuplicates)) { - $skipDuplicates = ObjectSerializer::serializeCollection($skipDuplicates, '', true); - } - if ($skipDuplicates !== null) { - $queryParams['skipDuplicates'] = $skipDuplicates; - } // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { + if ($loyaltyProgramId !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), + '{' . 'loyaltyProgramId' . '}', + ObjectSerializer::toPathValue($loyaltyProgramId), $resourcePath ); } @@ -37655,38 +37953,38 @@ protected function importCouponsRequest($applicationId, $campaignId, $skipDuplic } /** - * Operation importLoyaltyCards + * Operation importLoyaltyCustomersTiers * - * Import loyalty cards + * Import customers into loyalty tiers * - * @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 $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus */ - public function importLoyaltyCards($loyaltyProgramId, $upFile = null) + public function importLoyaltyCustomersTiers($loyaltyProgramId, $upFile = null) { - list($response) = $this->importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile); return $response; } /** - * Operation importLoyaltyCardsWithHttpInfo + * Operation importLoyaltyCustomersTiersWithHttpInfo * - * Import loyalty cards + * Import customers into loyalty tiers * - * @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 $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus, 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 importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile = null) { - $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); try { $options = $this->createHttpClientOption(); @@ -37730,6 +38028,18 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null $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 @@ -37780,6 +38090,14 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null ); $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(), @@ -37802,19 +38120,19 @@ public function importLoyaltyCardsWithHttpInfo($loyaltyProgramId, $upFile = null } /** - * Operation importLoyaltyCardsAsync + * Operation importLoyaltyCustomersTiersAsync * - * Import loyalty cards + * Import customers into loyalty tiers * - * @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 $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 importLoyaltyCardsAsync($loyaltyProgramId, $upFile = null) + public function importLoyaltyCustomersTiersAsync($loyaltyProgramId, $upFile = null) { - return $this->importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile) ->then( function ($response) { return $response[0]; @@ -37823,20 +38141,20 @@ function ($response) { } /** - * Operation importLoyaltyCardsAsyncWithHttpInfo + * Operation importLoyaltyCustomersTiersAsyncWithHttpInfo * - * Import loyalty cards + * Import customers into loyalty tiers * - * @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 $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 importLoyaltyCardsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyCardsRequest($loyaltyProgramId, $upFile); + $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37873,24 +38191,24 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyCards' + * Create request for operation 'importLoyaltyCustomersTiers' * - * @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 $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 importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) + protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile = null) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCards' + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCustomersTiers' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_cards'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -37987,38 +38305,38 @@ protected function importLoyaltyCardsRequest($loyaltyProgramId, $upFile = null) } /** - * Operation importLoyaltyCustomersTiers + * Operation importLoyaltyPoints * - * Import customers into loyalty tiers + * Import loyalty points * * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus|\TalonOne\Client\Model\ErrorResponseWithStatus + * @return \TalonOne\Client\Model\Import */ - public function importLoyaltyCustomersTiers($loyaltyProgramId, $upFile = null) + public function importLoyaltyPoints($loyaltyProgramId, $upFile = null) { - list($response) = $this->importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile); return $response; } /** - * Operation importLoyaltyCustomersTiersWithHttpInfo + * Operation importLoyaltyPointsWithHttpInfo * - * Import customers into loyalty tiers + * Import loyalty points * * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import|\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\Import, HTTP status code, HTTP response headers (array of strings) */ - public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = null) { - $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); + $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); try { $options = $this->createHttpClientOption(); @@ -38062,42 +38380,6 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\TalonOne\Client\Model\ErrorResponseWithStatus' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\ErrorResponseWithStatus', []), - $response->getStatusCode(), - $response->getHeaders() - ]; } $returnType = '\TalonOne\Client\Model\Import'; @@ -38124,39 +38406,15 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi ); $e->setResponseObject($data); break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\ErrorResponseWithStatus', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation importLoyaltyCustomersTiersAsync + * Operation importLoyaltyPointsAsync * - * Import customers into loyalty tiers + * Import loyalty points * * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) @@ -38164,9 +38422,9 @@ public function importLoyaltyCustomersTiersWithHttpInfo($loyaltyProgramId, $upFi * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCustomersTiersAsync($loyaltyProgramId, $upFile = null) + public function importLoyaltyPointsAsync($loyaltyProgramId, $upFile = null) { - return $this->importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile) ->then( function ($response) { return $response[0]; @@ -38175,9 +38433,9 @@ function ($response) { } /** - * Operation importLoyaltyCustomersTiersAsyncWithHttpInfo + * Operation importLoyaltyPointsAsyncWithHttpInfo * - * Import customers into loyalty tiers + * Import loyalty points * * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) @@ -38185,10 +38443,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importLoyaltyCustomersTiersAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile); + $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38225,7 +38483,7 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyCustomersTiers' + * Create request for operation 'importLoyaltyPoints' * * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) * @param string $upFile The file containing the data that is being imported. (optional) @@ -38233,16 +38491,16 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile = null) + protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) { // verify the required parameter 'loyaltyProgramId' is set if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyCustomersTiers' + 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyPoints' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_customers_tiers'; + $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_points'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38339,38 +38597,38 @@ protected function importLoyaltyCustomersTiersRequest($loyaltyProgramId, $upFile } /** - * Operation importLoyaltyPoints + * Operation importPoolGiveaways * - * Import loyalty points + * Import giveaway codes into a giveaway pool * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $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 importLoyaltyPoints($loyaltyProgramId, $upFile = null) + public function importPoolGiveaways($poolId, $upFile = null) { - list($response) = $this->importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile); + list($response) = $this->importPoolGiveawaysWithHttpInfo($poolId, $upFile); return $response; } /** - * Operation importLoyaltyPointsWithHttpInfo + * Operation importPoolGiveawaysWithHttpInfo * - * Import loyalty points + * Import giveaway codes into a giveaway pool * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $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 importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) { - $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + $request = $this->importPoolGiveawaysRequest($poolId, $upFile); try { $options = $this->createHttpClientOption(); @@ -38446,19 +38704,19 @@ public function importLoyaltyPointsWithHttpInfo($loyaltyProgramId, $upFile = nul } /** - * Operation importLoyaltyPointsAsync + * Operation importPoolGiveawaysAsync * - * Import loyalty points + * Import giveaway codes into a giveaway pool * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $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 importLoyaltyPointsAsync($loyaltyProgramId, $upFile = null) + public function importPoolGiveawaysAsync($poolId, $upFile = null) { - return $this->importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile) + return $this->importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile) ->then( function ($response) { return $response[0]; @@ -38467,20 +38725,20 @@ function ($response) { } /** - * Operation importLoyaltyPointsAsyncWithHttpInfo + * Operation importPoolGiveawaysAsyncWithHttpInfo * - * Import loyalty points + * Import giveaway codes into a giveaway pool * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $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 importLoyaltyPointsAsyncWithHttpInfo($loyaltyProgramId, $upFile = null) + public function importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importLoyaltyPointsRequest($loyaltyProgramId, $upFile); + $request = $this->importPoolGiveawaysRequest($poolId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38517,24 +38775,24 @@ function ($exception) { } /** - * Create request for operation 'importLoyaltyPoints' + * Create request for operation 'importPoolGiveaways' * - * @param int $loyaltyProgramId Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + * @param int $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 importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) + protected function importPoolGiveawaysRequest($poolId, $upFile = null) { - // verify the required parameter 'loyaltyProgramId' is set - if ($loyaltyProgramId === null || (is_array($loyaltyProgramId) && count($loyaltyProgramId) === 0)) { + // verify the required parameter 'poolId' is set + if ($poolId === null || (is_array($poolId) && count($poolId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loyaltyProgramId when calling importLoyaltyPoints' + 'Missing the required parameter $poolId when calling importPoolGiveaways' ); } - $resourcePath = '/v1/loyalty_programs/{loyaltyProgramId}/import_points'; + $resourcePath = '/v1/giveaways/pools/{poolId}/import'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38544,10 +38802,10 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) // path params - if ($loyaltyProgramId !== null) { + if ($poolId !== null) { $resourcePath = str_replace( - '{' . 'loyaltyProgramId' . '}', - ObjectSerializer::toPathValue($loyaltyProgramId), + '{' . 'poolId' . '}', + ObjectSerializer::toPathValue($poolId), $resourcePath ); } @@ -38631,38 +38889,40 @@ protected function importLoyaltyPointsRequest($loyaltyProgramId, $upFile = null) } /** - * Operation importPoolGiveaways + * Operation importReferrals * - * Import giveaway codes into a giveaway pool + * Import referrals * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \TalonOne\Client\Model\Import */ - public function importPoolGiveaways($poolId, $upFile = null) + public function importReferrals($applicationId, $campaignId, $upFile = null) { - list($response) = $this->importPoolGiveawaysWithHttpInfo($poolId, $upFile); + list($response) = $this->importReferralsWithHttpInfo($applicationId, $campaignId, $upFile); return $response; } /** - * Operation importPoolGiveawaysWithHttpInfo + * Operation importReferralsWithHttpInfo * - * Import giveaway codes into a giveaway pool + * Import referrals * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) */ - public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) + public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile = null) { - $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); try { $options = $this->createHttpClientOption(); @@ -38738,19 +38998,20 @@ public function importPoolGiveawaysWithHttpInfo($poolId, $upFile = null) } /** - * Operation importPoolGiveawaysAsync + * Operation importReferralsAsync * - * Import giveaway codes into a giveaway pool + * Import referrals * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importPoolGiveawaysAsync($poolId, $upFile = null) + public function importReferralsAsync($applicationId, $campaignId, $upFile = null) { - return $this->importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile) + return $this->importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile) ->then( function ($response) { return $response[0]; @@ -38759,20 +39020,21 @@ function ($response) { } /** - * Operation importPoolGiveawaysAsyncWithHttpInfo + * Operation importReferralsAsyncWithHttpInfo * - * Import giveaway codes into a giveaway pool + * Import referrals * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importPoolGiveawaysAsyncWithHttpInfo($poolId, $upFile = null) + public function importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) { $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importPoolGiveawaysRequest($poolId, $upFile); + $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38809,24 +39071,31 @@ function ($exception) { } /** - * Create request for operation 'importPoolGiveaways' + * Create request for operation 'importReferrals' * - * @param int $poolId The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section. (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 $upFile The file containing the data that is being imported. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importPoolGiveawaysRequest($poolId, $upFile = null) + protected function importReferralsRequest($applicationId, $campaignId, $upFile = null) { - // 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 importPoolGiveaways' + '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/giveaways/pools/{poolId}/import'; + $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38836,10 +39105,18 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) // path params - if ($poolId !== null) { + if ($applicationId !== null) { $resourcePath = str_replace( - '{' . 'poolId' . '}', - ObjectSerializer::toPathValue($poolId), + '{' . 'applicationId' . '}', + ObjectSerializer::toPathValue($applicationId), + $resourcePath + ); + } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), $resourcePath ); } @@ -38923,40 +39200,35 @@ protected function importPoolGiveawaysRequest($poolId, $upFile = null) } /** - * Operation importReferrals + * Operation inviteUserExternal * - * Import referrals + * Invite user from identity provider * - * @param int $applicationId The ID of the Application. It is displayed in your 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) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \TalonOne\Client\Model\Import + * @return void */ - public function importReferrals($applicationId, $campaignId, $upFile = null) + public function inviteUserExternal($body) { - list($response) = $this->importReferralsWithHttpInfo($applicationId, $campaignId, $upFile); - return $response; + $this->inviteUserExternalWithHttpInfo($body); } /** - * Operation importReferralsWithHttpInfo + * Operation inviteUserExternalWithHttpInfo * - * Import referrals + * Invite user from identity provider * - * @param int $applicationId The ID of the Application. It is displayed in your 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) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \TalonOne\Client\Model\Import, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function inviteUserExternalWithHttpInfo($body) { - $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + $request = $this->inviteUserExternalRequest($body); try { $options = $this->createHttpClientOption(); @@ -38986,66 +39258,28 @@ public function importReferralsWithHttpInfo($applicationId, $campaignId, $upFile ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\TalonOne\Client\Model\Import' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\Import', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\TalonOne\Client\Model\Import'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\TalonOne\Client\Model\Import', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation importReferralsAsync + * Operation inviteUserExternalAsync * - * Import referrals + * Invite user from identity provider * - * @param int $applicationId The ID of the Application. It is displayed in your 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) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importReferralsAsync($applicationId, $campaignId, $upFile = null) + public function inviteUserExternalAsync($body) { - return $this->importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile) + return $this->inviteUserExternalAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -39054,38 +39288,25 @@ function ($response) { } /** - * Operation importReferralsAsyncWithHttpInfo + * Operation inviteUserExternalAsyncWithHttpInfo * - * Import referrals + * Invite user from identity provider * - * @param int $applicationId The ID of the Application. It is displayed in your 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) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importReferralsAsyncWithHttpInfo($applicationId, $campaignId, $upFile = null) + public function inviteUserExternalAsyncWithHttpInfo($body) { - $returnType = '\TalonOne\Client\Model\Import'; - $request = $this->importReferralsRequest($applicationId, $campaignId, $upFile); + $returnType = ''; + $request = $this->inviteUserExternalRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -39105,31 +39326,23 @@ function ($exception) { } /** - * Create request for operation 'importReferrals' + * Create request for operation 'inviteUserExternal' * - * @param int $applicationId The ID of the Application. It is displayed in your 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) + * @param \TalonOne\Client\Model\NewExternalInvitation $body body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function importReferralsRequest($applicationId, $campaignId, $upFile = null) + protected function inviteUserExternalRequest($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 importReferrals' - ); - } - // 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 importReferrals' + 'Missing the required parameter $body when calling inviteUserExternal' ); } - $resourcePath = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals'; + $resourcePath = '/v1/users/invite'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39138,38 +39351,21 @@ protected function importReferralsRequest($applicationId, $campaignId, $upFile = - // path params - if ($applicationId !== null) { - $resourcePath = str_replace( - '{' . 'applicationId' . '}', - ObjectSerializer::toPathValue($applicationId), - $resourcePath - ); - } - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); - } - // form params - if ($upFile !== null) { - $formParams['upFile'] = ObjectSerializer::toFormValue($upFile); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] + [], + ['application/json'] ); } @@ -39895,6 +40091,270 @@ protected function listAchievementsRequest($applicationId, $campaignId, $pageSiz ); } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listAllRolesV2 + * + * List roles + * + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \TalonOne\Client\Model\InlineResponse20044 + */ + public function listAllRolesV2() + { + list($response) = $this->listAllRolesV2WithHttpInfo(); + return $response; + } + + /** + * Operation listAllRolesV2WithHttpInfo + * + * List roles + * + * + * @throws \TalonOne\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \TalonOne\Client\Model\InlineResponse20044, HTTP status code, HTTP response headers (array of strings) + */ + public function listAllRolesV2WithHttpInfo() + { + $request = $this->listAllRolesV2Request(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\TalonOne\Client\Model\InlineResponse20044' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\InlineResponse20044', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\TalonOne\Client\Model\InlineResponse20044'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\TalonOne\Client\Model\InlineResponse20044', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listAllRolesV2Async + * + * List roles + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listAllRolesV2Async() + { + return $this->listAllRolesV2AsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listAllRolesV2AsyncWithHttpInfo + * + * List roles + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listAllRolesV2AsyncWithHttpInfo() + { + $returnType = '\TalonOne\Client\Model\InlineResponse20044'; + $request = $this->listAllRolesV2Request(); + + 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 'listAllRolesV2' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listAllRolesV2Request() + { + + $resourcePath = '/v2/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params $_tempBody = null; @@ -47917,7 +48377,7 @@ protected function updateReferralRequest($applicationId, $campaignId, $referralI * * Update role * - * @param int $roleId The ID of role. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -47935,7 +48395,7 @@ public function updateRoleV2($roleId, $body) * * Update role * - * @param int $roleId The ID of role. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \TalonOne\Client\ApiException on non-2xx response @@ -48024,7 +48484,7 @@ public function updateRoleV2WithHttpInfo($roleId, $body) * * Update role * - * @param int $roleId The ID of role. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \InvalidArgumentException @@ -48045,7 +48505,7 @@ function ($response) { * * Update role * - * @param int $roleId The ID of role. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \InvalidArgumentException @@ -48093,7 +48553,7 @@ function ($exception) { /** * Create request for operation 'updateRoleV2' * - * @param int $roleId The ID of role. (required) + * @param int $roleId The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. (required) * @param \TalonOne\Client\Model\RoleV2Base $body body (required) * * @throws \InvalidArgumentException diff --git a/lib/Configuration.php b/lib/Configuration.php index 9c8e2f16..d28b50d3 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/7.0.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/8.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: 7.0.0' . PHP_EOL; + $report .= ' SDK Package Version: 8.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/ActivateUserRequest.php b/lib/Model/ActivateUserRequest.php new file mode 100644 index 00000000..3d193086 --- /dev/null +++ b/lib/Model/ActivateUserRequest.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/AdditionalCampaignProperties.php b/lib/Model/AdditionalCampaignProperties.php index 57557385..bd2c5576 100644 --- a/lib/Model/AdditionalCampaignProperties.php +++ b/lib/Model/AdditionalCampaignProperties.php @@ -267,6 +267,8 @@ public function getModelName() const FRONTEND_STATE_SCHEDULED = 'scheduled'; const FRONTEND_STATE_RUNNING = 'running'; const FRONTEND_STATE_DRAFT = 'draft'; + const FRONTEND_STATE_DISABLED = 'disabled'; + const FRONTEND_STATE_ARCHIVED = 'archived'; @@ -282,6 +284,8 @@ public function getFrontendStateAllowableValues() self::FRONTEND_STATE_SCHEDULED, self::FRONTEND_STATE_RUNNING, self::FRONTEND_STATE_DRAFT, + self::FRONTEND_STATE_DISABLED, + self::FRONTEND_STATE_ARCHIVED, ]; } diff --git a/lib/Model/Campaign.php b/lib/Model/Campaign.php index d9d6c16e..262582c7 100644 --- a/lib/Model/Campaign.php +++ b/lib/Model/Campaign.php @@ -374,6 +374,8 @@ public function getModelName() const FRONTEND_STATE_SCHEDULED = 'scheduled'; const FRONTEND_STATE_RUNNING = 'running'; const FRONTEND_STATE_DRAFT = 'draft'; + const FRONTEND_STATE_DISABLED = 'disabled'; + const FRONTEND_STATE_ARCHIVED = 'archived'; @@ -433,6 +435,8 @@ public function getFrontendStateAllowableValues() self::FRONTEND_STATE_SCHEDULED, self::FRONTEND_STATE_RUNNING, self::FRONTEND_STATE_DRAFT, + self::FRONTEND_STATE_DISABLED, + self::FRONTEND_STATE_ARCHIVED, ]; } diff --git a/lib/Model/Coupon.php b/lib/Model/Coupon.php index d0bc5d88..f3ba9855 100644 --- a/lib/Model/Coupon.php +++ b/lib/Model/Coupon.php @@ -859,7 +859,7 @@ public function getReservation() /** * Sets reservation * - * @param bool|null $reservation 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. + * @param bool|null $reservation Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. * * @return $this */ @@ -907,7 +907,7 @@ public function getIsReservationMandatory() /** * Sets isReservationMandatory * - * @param bool|null $isReservationMandatory Whether the reservation effect actually created a new reservation. + * @param bool|null $isReservationMandatory An indication of whether the code can be redeemed only if it has been reserved first. * * @return $this */ diff --git a/lib/Model/CustomerInventory.php b/lib/Model/CustomerInventory.php index 6eb9a375..00c3a185 100644 --- a/lib/Model/CustomerInventory.php +++ b/lib/Model/CustomerInventory.php @@ -319,7 +319,7 @@ public function getCoupons() /** * Sets coupons * - * @param \TalonOne\Client\Model\InventoryCoupon[]|null $coupons The coupons reserved by this profile. This array includes hard and soft reservations. See each coupon's `reservation` property. + * @param \TalonOne\Client\Model\InventoryCoupon[]|null $coupons The coupons reserved by this profile. This array includes hard and soft reservations. * * @return $this */ diff --git a/lib/Model/InlineResponse20044.php b/lib/Model/InlineResponse20044.php index db2979d4..18b51a43 100644 --- a/lib/Model/InlineResponse20044.php +++ b/lib/Model/InlineResponse20044.php @@ -58,7 +58,7 @@ class InlineResponse20044 implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'totalResultSize' => 'int', - 'data' => '\TalonOne\Client\Model\Role[]' + 'data' => '\TalonOne\Client\Model\RoleV2[]' ]; /** @@ -243,7 +243,7 @@ public function setTotalResultSize($totalResultSize) /** * Gets data * - * @return \TalonOne\Client\Model\Role[] + * @return \TalonOne\Client\Model\RoleV2[] */ public function getData() { @@ -253,7 +253,7 @@ public function getData() /** * Sets data * - * @param \TalonOne\Client\Model\Role[] $data data + * @param \TalonOne\Client\Model\RoleV2[] $data data * * @return $this */ diff --git a/lib/Model/IntegrationCoupon.php b/lib/Model/IntegrationCoupon.php index 4ecdad15..391cd255 100644 --- a/lib/Model/IntegrationCoupon.php +++ b/lib/Model/IntegrationCoupon.php @@ -868,7 +868,7 @@ public function getReservation() /** * Sets reservation * - * @param bool|null $reservation 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. + * @param bool|null $reservation Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. * * @return $this */ @@ -916,7 +916,7 @@ public function getIsReservationMandatory() /** * Sets isReservationMandatory * - * @param bool|null $isReservationMandatory Whether the reservation effect actually created a new reservation. + * @param bool|null $isReservationMandatory An indication of whether the code can be redeemed only if it has been reserved first. * * @return $this */ diff --git a/lib/Model/InventoryCoupon.php b/lib/Model/InventoryCoupon.php index e4b4ec37..dd02ca9b 100644 --- a/lib/Model/InventoryCoupon.php +++ b/lib/Model/InventoryCoupon.php @@ -877,7 +877,7 @@ public function getReservation() /** * Sets reservation * - * @param bool|null $reservation 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. + * @param bool|null $reservation Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code. * * @return $this */ @@ -925,7 +925,7 @@ public function getIsReservationMandatory() /** * Sets isReservationMandatory * - * @param bool|null $isReservationMandatory Whether the reservation effect actually created a new reservation. + * @param bool|null $isReservationMandatory An indication of whether the code can be redeemed only if it has been reserved first. * * @return $this */ diff --git a/lib/Model/LoyaltyCardBalances.php b/lib/Model/LoyaltyCardBalances.php new file mode 100644 index 00000000..9609f75c --- /dev/null +++ b/lib/Model/LoyaltyCardBalances.php @@ -0,0 +1,369 @@ + '\TalonOne\Client\Model\LoyaltyBalance', + 'subledgerBalances' => 'map[string,\TalonOne\Client\Model\LoyaltyBalance]', + 'profiles' => '\TalonOne\Client\Model\LoyaltyCardProfileRegistration[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'balance' => null, + 'subledgerBalances' => null, + 'profiles' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance' => 'balance', + 'subledgerBalances' => 'subledgerBalances', + 'profiles' => 'profiles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance' => 'setBalance', + 'subledgerBalances' => 'setSubledgerBalances', + 'profiles' => 'setProfiles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance' => 'getBalance', + 'subledgerBalances' => 'getSubledgerBalances', + 'profiles' => 'getProfiles' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['balance'] = isset($data['balance']) ? $data['balance'] : null; + $this->container['subledgerBalances'] = isset($data['subledgerBalances']) ? $data['subledgerBalances'] : null; + $this->container['profiles'] = isset($data['profiles']) ? $data['profiles'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance + * + * @return \TalonOne\Client\Model\LoyaltyBalance|null + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param \TalonOne\Client\Model\LoyaltyBalance|null $balance balance + * + * @return $this + */ + public function setBalance($balance) + { + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets subledgerBalances + * + * @return map[string,\TalonOne\Client\Model\LoyaltyBalance]|null + */ + public function getSubledgerBalances() + { + return $this->container['subledgerBalances']; + } + + /** + * Sets subledgerBalances + * + * @param map[string,\TalonOne\Client\Model\LoyaltyBalance]|null $subledgerBalances Map of the loyalty balances of the subledgers of a ledger. + * + * @return $this + */ + public function setSubledgerBalances($subledgerBalances) + { + $this->container['subledgerBalances'] = $subledgerBalances; + + return $this; + } + + /** + * Gets profiles + * + * @return \TalonOne\Client\Model\LoyaltyCardProfileRegistration[]|null + */ + public function getProfiles() + { + return $this->container['profiles']; + } + + /** + * Sets profiles + * + * @param \TalonOne\Client\Model\LoyaltyCardProfileRegistration[]|null $profiles Customer profiles linked to the loyalty card. + * + * @return $this + */ + public function setProfiles($profiles) + { + $this->container['profiles'] = $profiles; + + 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/LoyaltyCardProfileRegistration.php b/lib/Model/LoyaltyCardProfileRegistration.php index e0a087d3..263fc0f6 100644 --- a/lib/Model/LoyaltyCardProfileRegistration.php +++ b/lib/Model/LoyaltyCardProfileRegistration.php @@ -261,7 +261,7 @@ public function getTimestamp() /** * Sets timestamp * - * @param \DateTime $timestamp Timestamp of the registration to the card. + * @param \DateTime $timestamp Timestamp the customer profile was linked to the card. * * @return $this */ diff --git a/lib/Model/MessageLogEntry.php b/lib/Model/MessageLogEntry.php index 2350249b..ad17d0e1 100644 --- a/lib/Model/MessageLogEntry.php +++ b/lib/Model/MessageLogEntry.php @@ -67,7 +67,6 @@ class MessageLogEntry implements ModelInterface, ArrayAccess 'response' => '\TalonOne\Client\Model\MessageLogResponse', 'createdAt' => '\DateTime', 'entityType' => 'string', - 'url' => 'string', 'applicationId' => 'int', 'loyaltyProgramId' => 'int' ]; @@ -87,7 +86,6 @@ class MessageLogEntry implements ModelInterface, ArrayAccess 'response' => null, 'createdAt' => 'date-time', 'entityType' => null, - 'url' => null, 'applicationId' => null, 'loyaltyProgramId' => null ]; @@ -128,7 +126,6 @@ public static function openAPIFormats() 'response' => 'response', 'createdAt' => 'createdAt', 'entityType' => 'entityType', - 'url' => 'url', 'applicationId' => 'applicationId', 'loyaltyProgramId' => 'loyaltyProgramId' ]; @@ -148,7 +145,6 @@ public static function openAPIFormats() 'response' => 'setResponse', 'createdAt' => 'setCreatedAt', 'entityType' => 'setEntityType', - 'url' => 'setUrl', 'applicationId' => 'setApplicationId', 'loyaltyProgramId' => 'setLoyaltyProgramId' ]; @@ -168,7 +164,6 @@ public static function openAPIFormats() 'response' => 'getResponse', 'createdAt' => 'getCreatedAt', 'entityType' => 'getEntityType', - 'url' => 'getUrl', 'applicationId' => 'getApplicationId', 'loyaltyProgramId' => 'getLoyaltyProgramId' ]; @@ -216,7 +211,6 @@ public function getModelName() const ENTITY_TYPE_APPLICATION = 'application'; const ENTITY_TYPE_LOYALTY_PROGRAM = 'loyalty_program'; - const ENTITY_TYPE_WEBHOOK = 'webhook'; @@ -230,7 +224,6 @@ public function getEntityTypeAllowableValues() return [ self::ENTITY_TYPE_APPLICATION, self::ENTITY_TYPE_LOYALTY_PROGRAM, - self::ENTITY_TYPE_WEBHOOK, ]; } @@ -259,7 +252,6 @@ public function __construct(array $data = 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; } @@ -518,7 +510,7 @@ public function getEntityType() /** * Sets entityType * - * @param string|null $entityType The entity type the log is related to. + * @param string|null $entityType The entity type the notification is related to. * * @return $this */ @@ -538,30 +530,6 @@ public function setEntityType($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 * diff --git a/lib/Model/NewCoupons.php b/lib/Model/NewCoupons.php index e381052b..c472280b 100644 --- a/lib/Model/NewCoupons.php +++ b/lib/Model/NewCoupons.php @@ -661,7 +661,7 @@ public function getIsReservationMandatory() /** * Sets isReservationMandatory * - * @param bool|null $isReservationMandatory Whether the reservation effect actually created a new reservation. + * @param bool|null $isReservationMandatory An indication of whether the code can be redeemed only if it has been reserved first. * * @return $this */ diff --git a/lib/Model/NewExternalInvitation.php b/lib/Model/NewExternalInvitation.php new file mode 100644 index 00000000..369644f8 --- /dev/null +++ b/lib/Model/NewExternalInvitation.php @@ -0,0 +1,372 @@ + 'string', + 'userGroups' => 'string[]', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'userGroups' => null, + '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 = [ + 'name' => 'name', + 'userGroups' => 'userGroups', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'userGroups' => 'setUserGroups', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'userGroups' => 'getUserGroups', + '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['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['userGroups'] = isset($data['userGroups']) ? $data['userGroups'] : 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the user. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets userGroups + * + * @return string[]|null + */ + public function getUserGroups() + { + return $this->container['userGroups']; + } + + /** + * Sets userGroups + * + * @param string[]|null $userGroups List of user groups in the external identity provider. If there are roles in Talon.One whose names match these user groups, those roles will be automatically assigned to the user upon invitation. + * + * @return $this + */ + public function setUserGroups($userGroups) + { + $this->container['userGroups'] = $userGroups; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the user. + * + * @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/UpdateCoupon.php b/lib/Model/UpdateCoupon.php index 3b5d0011..1d27603a 100644 --- a/lib/Model/UpdateCoupon.php +++ b/lib/Model/UpdateCoupon.php @@ -520,7 +520,7 @@ public function getIsReservationMandatory() /** * Sets isReservationMandatory * - * @param bool|null $isReservationMandatory Whether the reservation effect actually created a new reservation. + * @param bool|null $isReservationMandatory An indication of whether the code can be redeemed only if it has been reserved first. * * @return $this */ diff --git a/lib/Model/UpdateUser.php b/lib/Model/UpdateUser.php index a83200c4..d95424dd 100644 --- a/lib/Model/UpdateUser.php +++ b/lib/Model/UpdateUser.php @@ -375,7 +375,7 @@ public function getRoles() /** * Sets roles * - * @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. + * @param int[]|null $roles A list of the IDs of the roles assigned to the user. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint. * * @return $this */ diff --git a/test/Api/ManagementApiTest.php b/test/Api/ManagementApiTest.php index 4a1e9712..4e8d214a 100644 --- a/test/Api/ManagementApiTest.php +++ b/test/Api/ManagementApiTest.php @@ -72,6 +72,16 @@ public static function tearDownAfterClass() { } + /** + * Test case for activateUserByEmail + * + * Activate user by email address. + * + */ + public function testActivateUserByEmail() + { + } + /** * Test case for addLoyaltyCardPoints * @@ -612,16 +622,6 @@ public function testGetAllAccessLogs() { } - /** - * Test case for getAllRoles - * - * List roles. - * - */ - public function testGetAllRoles() - { - } - /** * Test case for getApplication * @@ -1073,12 +1073,12 @@ public function testGetReferralsWithoutTotalCount() } /** - * Test case for getRole + * Test case for getRoleV2 * * Get role. * */ - public function testGetRole() + public function testGetRoleV2() { } @@ -1272,6 +1272,16 @@ public function testImportReferrals() { } + /** + * Test case for inviteUserExternal + * + * Invite user from identity provider. + * + */ + public function testInviteUserExternal() + { + } + /** * Test case for listAccountCollections * @@ -1292,6 +1302,16 @@ public function testListAchievements() { } + /** + * Test case for listAllRolesV2 + * + * List roles. + * + */ + public function testListAllRolesV2() + { + } + /** * Test case for listCatalogItems * diff --git a/test/Model/ActivateUserRequestTest.php b/test/Model/ActivateUserRequestTest.php new file mode 100644 index 00000000..6b8a1e0a --- /dev/null +++ b/test/Model/ActivateUserRequestTest.php @@ -0,0 +1,87 @@ +