Skip to content

Commit

Permalink
v3.3.0: Customer Profile Update v2 dry runs & Loyalty Program Statist…
Browse files Browse the repository at this point in the history
…ics (#8)

## Summary

### Integration API
 - Introduce `loyalty` flag in [`getCustomerInventory`](https://developers.talon.one/Integration-API/API-Reference#getCustomerInventory) endpoint to retrieve also profile's loyalty programs subscription and stats upon querying the endpoint
 - Introduce flags to control whether a customer [profile update request v2](https://developers.talon.one/Integration-API/API-Reference#updateCustomerProfileV2) should be a "dry run" or force it to "run rule engine"

### Loyalty Programs
 - Introduce Loyalty Programs statistics [endpoint](https://developers.talon.one/Management-API/API-Reference#getLoyaltyStatistics) to get a loyalty program stats snapshot

### Account Analytics
 - [Account analytics](https://github.com/talon-one/TalonOnePHPsdk/blob/0554761fff24d7bba56b4ab31fa4ed71eee5d0ef/docs/Model/AccountAnalytics.md) now respect live/sandbox application flagging and reports new data points: `liveApplications`, `sandboxApplications` and `liveActiveCampaigns`

### Misc: OpenAPI Generator version upgrade
We have upgraded the OpenAPI Generator used to release this SDK from [v4.2.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.3) to [v4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) which includes a few subtle improvements in the generated code, for full list of changes, please consult the release logs' under the PHP section.

-----
## Commit Summary:
* Initial Commit
* Upgrade generator version
  • Loading branch information
altJake authored Oct 10, 2020
1 parent 9143515 commit 67a63e7
Show file tree
Hide file tree
Showing 484 changed files with 9,285 additions and 1,436 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.3
4.3.1
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The API is available at the same hostname as these docs. For example, if you are
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 3.2.0
- Package version: 3.3.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen

## Requirements
Expand Down Expand Up @@ -240,7 +240,9 @@ Class | Method | HTTP request | Description
*IntegrationApi* | [**getReservedCustomers**](docs/Api/IntegrationApi.md#getreservedcustomers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | Get the users that have this coupon reserved
*IntegrationApi* | [**trackEvent**](docs/Api/IntegrationApi.md#trackevent) | **POST** /v1/events | Track an Event
*IntegrationApi* | [**updateCustomerProfile**](docs/Api/IntegrationApi.md#updatecustomerprofile) | **PUT** /v1/customer_profiles/{integrationId} | Update a Customer Profile V1
*IntegrationApi* | [**updateCustomerProfileV2**](docs/Api/IntegrationApi.md#updatecustomerprofilev2) | **PUT** /v2/customer_profiles/{customerProfileId} | Update a Customer Profile
*IntegrationApi* | [**updateCustomerProfileAudiences**](docs/Api/IntegrationApi.md#updatecustomerprofileaudiences) | **POST** /v2/customer_audiences | Update a Customer Profile Audiences
*IntegrationApi* | [**updateCustomerProfileV2**](docs/Api/IntegrationApi.md#updatecustomerprofilev2) | **PUT** /v2/customer_profiles/{integrationId} | Update a Customer Profile
*IntegrationApi* | [**updateCustomerProfilesV2**](docs/Api/IntegrationApi.md#updatecustomerprofilesv2) | **PUT** /v2/customer_profiles | Update multiple Customer Profiles
*IntegrationApi* | [**updateCustomerSession**](docs/Api/IntegrationApi.md#updatecustomersession) | **PUT** /v1/customer_sessions/{customerSessionId} | Update a Customer Session V1
*IntegrationApi* | [**updateCustomerSessionV2**](docs/Api/IntegrationApi.md#updatecustomersessionv2) | **PUT** /v2/customer_sessions/{customerSessionId} | Update a Customer Session
*ManagementApi* | [**addLoyaltyPoints**](docs/Api/ManagementApi.md#addloyaltypoints) | **PUT** /v1/loyalty_programs/{programID}/profile/{integrationID}/add_points | Add points in a certain loyalty program for the specified customer
Expand Down Expand Up @@ -300,6 +302,7 @@ Class | Method | HTTP request | Description
*ManagementApi* | [**getLoyaltyPoints**](docs/Api/ManagementApi.md#getloyaltypoints) | **GET** /v1/loyalty_programs/{programID}/profile/{integrationID} | get the Loyalty Ledger for this integrationID
*ManagementApi* | [**getLoyaltyProgram**](docs/Api/ManagementApi.md#getloyaltyprogram) | **GET** /v1/loyalty_programs/{programID} | Get a loyalty program
*ManagementApi* | [**getLoyaltyPrograms**](docs/Api/ManagementApi.md#getloyaltyprograms) | **GET** /v1/loyalty_programs | List all loyalty Programs
*ManagementApi* | [**getLoyaltyStatistics**](docs/Api/ManagementApi.md#getloyaltystatistics) | **GET** /v1/loyalty_programs/{programID}/statistics | Get loyalty program statistics by loyalty program ID
*ManagementApi* | [**getReferrals**](docs/Api/ManagementApi.md#getreferrals) | **GET** /v1/applications/{applicationId}/campaigns/{campaignId}/referrals | List Referrals (with total count)
*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 information for the specified role.
Expand Down Expand Up @@ -352,6 +355,8 @@ Class | Method | HTTP request | Description
- [Attribute](docs/Model/Attribute.md)
- [AttributesMandatory](docs/Model/AttributesMandatory.md)
- [AttributesSettings](docs/Model/AttributesSettings.md)
- [Audience](docs/Model/Audience.md)
- [AudienceMembership](docs/Model/AudienceMembership.md)
- [BaseSamlConnection](docs/Model/BaseSamlConnection.md)
- [Binding](docs/Model/Binding.md)
- [Campaign](docs/Model/Campaign.md)
Expand Down Expand Up @@ -382,8 +387,10 @@ Class | Method | HTTP request | Description
- [CustomerAnalytics](docs/Model/CustomerAnalytics.md)
- [CustomerInventory](docs/Model/CustomerInventory.md)
- [CustomerProfile](docs/Model/CustomerProfile.md)
- [CustomerProfileAudienceRequest](docs/Model/CustomerProfileAudienceRequest.md)
- [CustomerProfileAudienceRequestItem](docs/Model/CustomerProfileAudienceRequestItem.md)
- [CustomerProfileIntegrationRequestV2](docs/Model/CustomerProfileIntegrationRequestV2.md)
- [CustomerProfileSearchQuery](docs/Model/CustomerProfileSearchQuery.md)
- [CustomerProfileUpdate](docs/Model/CustomerProfileUpdate.md)
- [CustomerSession](docs/Model/CustomerSession.md)
- [CustomerSessionV2](docs/Model/CustomerSessionV2.md)
- [DeductLoyaltyPointsEffectProps](docs/Model/DeductLoyaltyPointsEffectProps.md)
Expand Down Expand Up @@ -456,17 +463,22 @@ Class | Method | HTTP request | Description
- [LoyaltyProgram](docs/Model/LoyaltyProgram.md)
- [LoyaltyProgramBalance](docs/Model/LoyaltyProgramBalance.md)
- [LoyaltyProgramLedgers](docs/Model/LoyaltyProgramLedgers.md)
- [LoyaltyStatistics](docs/Model/LoyaltyStatistics.md)
- [LoyaltySubLedger](docs/Model/LoyaltySubLedger.md)
- [ManagerConfig](docs/Model/ManagerConfig.md)
- [Meta](docs/Model/Meta.md)
- [MultiApplicationEntity](docs/Model/MultiApplicationEntity.md)
- [MultipleCustomerProfileIntegrationRequest](docs/Model/MultipleCustomerProfileIntegrationRequest.md)
- [MultipleCustomerProfileIntegrationRequestItem](docs/Model/MultipleCustomerProfileIntegrationRequestItem.md)
- [MultipleCustomerProfileIntegrationResponseV2](docs/Model/MultipleCustomerProfileIntegrationResponseV2.md)
- [MutableEntity](docs/Model/MutableEntity.md)
- [NewAccount](docs/Model/NewAccount.md)
- [NewAccountSignUp](docs/Model/NewAccountSignUp.md)
- [NewAdditionalCost](docs/Model/NewAdditionalCost.md)
- [NewApplication](docs/Model/NewApplication.md)
- [NewApplicationAPIKey](docs/Model/NewApplicationAPIKey.md)
- [NewAttribute](docs/Model/NewAttribute.md)
- [NewAudience](docs/Model/NewAudience.md)
- [NewCampaign](docs/Model/NewCampaign.md)
- [NewCampaignGroup](docs/Model/NewCampaignGroup.md)
- [NewCampaignSet](docs/Model/NewCampaignSet.md)
Expand Down Expand Up @@ -519,6 +531,7 @@ Class | Method | HTTP request | Description
- [UpdateAccount](docs/Model/UpdateAccount.md)
- [UpdateApplication](docs/Model/UpdateApplication.md)
- [UpdateAttributeEffectProps](docs/Model/UpdateAttributeEffectProps.md)
- [UpdateAudience](docs/Model/UpdateAudience.md)
- [UpdateCampaign](docs/Model/UpdateCampaign.md)
- [UpdateCampaignGroup](docs/Model/UpdateCampaignGroup.md)
- [UpdateCoupon](docs/Model/UpdateCoupon.md)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "talon-one/talon-one-client",
"type": "library",
"version": "3.2.0",
"version": "3.3.0",
"description": "The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns.",
"keywords": [
"talon-one",
Expand Down
155 changes: 145 additions & 10 deletions docs/Api/IntegrationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Method | HTTP request | Description
[**getReservedCustomers**](IntegrationApi.md#getReservedCustomers) | **GET** /v1/coupon_reservations/customerprofiles/{couponValue} | Get the users that have this coupon reserved
[**trackEvent**](IntegrationApi.md#trackEvent) | **POST** /v1/events | Track an Event
[**updateCustomerProfile**](IntegrationApi.md#updateCustomerProfile) | **PUT** /v1/customer_profiles/{integrationId} | Update a Customer Profile V1
[**updateCustomerProfileV2**](IntegrationApi.md#updateCustomerProfileV2) | **PUT** /v2/customer_profiles/{customerProfileId} | Update a Customer Profile
[**updateCustomerProfileAudiences**](IntegrationApi.md#updateCustomerProfileAudiences) | **POST** /v2/customer_audiences | Update a Customer Profile Audiences
[**updateCustomerProfileV2**](IntegrationApi.md#updateCustomerProfileV2) | **PUT** /v2/customer_profiles/{integrationId} | Update a Customer Profile
[**updateCustomerProfilesV2**](IntegrationApi.md#updateCustomerProfilesV2) | **PUT** /v2/customer_profiles | Update multiple Customer Profiles
[**updateCustomerSession**](IntegrationApi.md#updateCustomerSession) | **PUT** /v1/customer_sessions/{customerSessionId} | Update a Customer Session V1
[**updateCustomerSessionV2**](IntegrationApi.md#updateCustomerSessionV2) | **PUT** /v2/customer_sessions/{customerSessionId} | Update a Customer Session

Expand Down Expand Up @@ -294,7 +296,7 @@ void (empty response body)

## getCustomerInventory

> \TalonOne\Client\Model\CustomerInventory getCustomerInventory($integrationId, $profile, $referrals, $coupons)
> \TalonOne\Client\Model\CustomerInventory getCustomerInventory($integrationId, $profile, $referrals, $coupons, $loyalty)
Get an inventory of all data associated with a specific customer profile.

Expand Down Expand Up @@ -328,9 +330,10 @@ $integrationId = 'integrationId_example'; // string | The custom identifier for
$profile = True; // bool | optional flag to decide if you would like customer profile information in the response
$referrals = True; // bool | optional flag to decide if you would like referral information in the response
$coupons = True; // bool | optional flag to decide if you would like coupon information in the response
$loyalty = True; // bool | optional flag to decide if you would like loyalty information in the response

try {
$result = $apiInstance->getCustomerInventory($integrationId, $profile, $referrals, $coupons);
$result = $apiInstance->getCustomerInventory($integrationId, $profile, $referrals, $coupons, $loyalty);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling IntegrationApi->getCustomerInventory: ', $e->getMessage(), PHP_EOL;
Expand All @@ -347,6 +350,7 @@ Name | Type | Description | Notes
**profile** | **bool**| optional flag to decide if you would like customer profile information in the response | [optional]
**referrals** | **bool**| optional flag to decide if you would like referral information in the response | [optional]
**coupons** | **bool**| optional flag to decide if you would like coupon information in the response | [optional]
**loyalty** | **bool**| optional flag to decide if you would like loyalty information in the response | [optional]

### Return type

Expand Down Expand Up @@ -576,9 +580,71 @@ Name | Type | Description | Notes
[[Back to README]](../../README.md)


## updateCustomerProfileAudiences

> updateCustomerProfileAudiences($body)
Update a Customer Profile Audiences

Update one ore multiple Customer Profiles with the specified Audiences

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key_v1
$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\IntegrationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \TalonOne\Client\Model\CustomerProfileAudienceRequest(); // \TalonOne\Client\Model\CustomerProfileAudienceRequest |

try {
$apiInstance->updateCustomerProfileAudiences($body);
} catch (Exception $e) {
echo 'Exception when calling IntegrationApi->updateCustomerProfileAudiences: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\TalonOne\Client\Model\CustomerProfileAudienceRequest**](../Model/CustomerProfileAudienceRequest.md)| |

### Return type

void (empty response body)

### Authorization

[api_key_v1](../../README.md#api_key_v1)

### 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)


## updateCustomerProfileV2

> \TalonOne\Client\Model\CustomerProfileUpdate updateCustomerProfileV2($customerProfileId, $body)
> \TalonOne\Client\Model\IntegrationStateV2 updateCustomerProfileV2($integrationId, $body, $runRuleEngine, $dry)
Update a Customer Profile

Expand All @@ -603,11 +669,13 @@ $apiInstance = new TalonOne\Client\Api\IntegrationApi(
new GuzzleHttp\Client(),
$config
);
$customerProfileId = 'customerProfileId_example'; // string | The custom identifier for this profile, must be unique within the account.
$body = new \TalonOne\Client\Model\NewCustomerProfile(); // \TalonOne\Client\Model\NewCustomerProfile |
$integrationId = 'integrationId_example'; // string | The custom identifier for this profile, must be unique within the account.
$body = new \TalonOne\Client\Model\CustomerProfileIntegrationRequestV2(); // \TalonOne\Client\Model\CustomerProfileIntegrationRequestV2 |
$runRuleEngine = True; // bool | Flag to indicate whether to run the rule engine (Defaults to false).
$dry = True; // bool | Flag to indicate whether to skip persisting the changes or not (Will not persist if set to 'true'. Only used when 'runRuleEngine' is set to 'true').

try {
$result = $apiInstance->updateCustomerProfileV2($customerProfileId, $body);
$result = $apiInstance->updateCustomerProfileV2($integrationId, $body, $runRuleEngine, $dry);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling IntegrationApi->updateCustomerProfileV2: ', $e->getMessage(), PHP_EOL;
Expand All @@ -620,12 +688,79 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**customerProfileId** | **string**| The custom identifier for this profile, must be unique within the account. |
**body** | [**\TalonOne\Client\Model\NewCustomerProfile**](../Model/NewCustomerProfile.md)| |
**integrationId** | **string**| The custom identifier for this profile, must be unique within the account. |
**body** | [**\TalonOne\Client\Model\CustomerProfileIntegrationRequestV2**](../Model/CustomerProfileIntegrationRequestV2.md)| |
**runRuleEngine** | **bool**| Flag to indicate whether to run the rule engine (Defaults to false). | [optional]
**dry** | **bool**| Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;. Only used when &#39;runRuleEngine&#39; is set to &#39;true&#39;). | [optional]

### Return type

[**\TalonOne\Client\Model\IntegrationStateV2**](../Model/IntegrationStateV2.md)

### Authorization

[api_key_v1](../../README.md#api_key_v1)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../../README.md#documentation-for-models)
[[Back to README]](../../README.md)


## updateCustomerProfilesV2

> \TalonOne\Client\Model\MultipleCustomerProfileIntegrationResponseV2 updateCustomerProfilesV2($body, $silent)
Update multiple Customer Profiles

Update (or create) up to 1000 [Customer Profiles][] in 1 request. The `integrationId` may be any identifier that will remain stable for the customer. For example, you might use a database ID, an email, or a phone number as the `integrationId`. It is vital that this ID **not** change over time, so **don't** use any identifier that the customer can update themselves. E.g. if your application allows a customer to update their e-mail address, you should instead use a database ID. [Customer Profiles]: /Getting-Started/entities#customer-profile

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key_v1
$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\IntegrationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \TalonOne\Client\Model\MultipleCustomerProfileIntegrationRequest(); // \TalonOne\Client\Model\MultipleCustomerProfileIntegrationRequest |
$silent = 'silent_example'; // string | If set to 'yes', response will be an empty 204, otherwise a list of the IntegrationStateV2 generated.

try {
$result = $apiInstance->updateCustomerProfilesV2($body, $silent);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling IntegrationApi->updateCustomerProfilesV2: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\TalonOne\Client\Model\MultipleCustomerProfileIntegrationRequest**](../Model/MultipleCustomerProfileIntegrationRequest.md)| |
**silent** | **string**| If set to &#39;yes&#39;, response will be an empty 204, otherwise a list of the IntegrationStateV2 generated. | [optional]

### Return type

[**\TalonOne\Client\Model\CustomerProfileUpdate**](../Model/CustomerProfileUpdate.md)
[**\TalonOne\Client\Model\MultipleCustomerProfileIntegrationResponseV2**](../Model/MultipleCustomerProfileIntegrationResponseV2.md)

### Authorization

Expand Down
Loading

0 comments on commit 67a63e7

Please sign in to comment.