Skip to content

Commit

Permalink
v5.0.0: Reopen session endpoint, loyalty data integration endpoints a…
Browse files Browse the repository at this point in the history
…nd loyalty card management endpoints (#26)

## Summary

### Integration API
- [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)
- [Get customer's loyalty points](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyBalances)
- [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions)
- [Get card's point balances](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardBalances)
- [List card's transactions](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactions)
- [Link customer profile to card](https://docs.talon.one/integration-api#tag/Loyalty-cards/operation/linkLoyaltyCardToProfile)

### Management API
- [Add points to card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/addLoyaltyCardPoints)
- [Deduct points from card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/deductLoyaltyCardPoints)
- [Delete loyalty card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/deleteLoyaltyCard)
- [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards)
- [Get loyalty card](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCard)
- [Import loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/importLoyaltyCards)
- [Transfer card data](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/transferLoyaltyCard)
- [Update loyalty card status](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/updateLoyaltyCard)
- [List card's transactions](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCardTransactionLogs)
- [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions)

- [Export customer loyalty balances](https://docs.talon.one/management-api#tag/Loyalty/operation/exportLoyaltyBalances) -- please note deprecation notice blow
- [Export all card transaction logs](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/exportLoyaltyCardBalances)
- [Export card's ledger log](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/exportLoyaltyCardLedger)


## Dependencies Upgrades
 - **`Newtonsoft.Json`**: `12.0.1` -> `13.0.2`; closes #25 
 - **`RestSharp`**: `106.10.1` -> `106.15.0`; closes #16 
 
## Fix import endpoints bug with due to RestSharp's older version 🎉 
Import endpoints are now functional.
**Please note** that the `upFile` argument that each endpoint expects is expected to hold the _contents_ to be imported. It's the consumer's responsibility to read the csv file to be imported, or create a csv-string and send it as the `upFile` argument. Below is an example for importing loyalty points, provided a csv file holding the contents named `loyalty-import.csv`:

```C#
// initiate management api instance
// ...

string upFile = File.ReadAllText("/path/to/file/loyalty-import.csv");
int programID = 42;

var response = mgmtAPI.ImportLoyaltyPoints(programID, upFile);
```

## ⚠️ Deprecation Notice: Export customer loyalty balance to CSV endpoint
Please note that the [Export customer loyalty balance to CSV](https://docs.talon.one/management-api#tag/Loyalty/operation/exportLoyaltyBalance) endpoint is getting deprecated, please update your code to point at the new [Export customer loyalty balances](https://docs.talon.one/management-api#tag/Loyalty/operation/exportLoyaltyBalances)


## Commit Summary
* Initial Commit
* Makefile small improvements
* Upgrade underlying dependencies
* Fixes double authentication for mgmt endpoints
* Migrate RestSharp AddHandler functions to support 106.15.0
* Apply "emitdefaultvalue" fix to models
  • Loading branch information
altJake authored May 9, 2023
1 parent 07c63af commit 0c2afbd
Show file tree
Hide file tree
Showing 1,129 changed files with 58,725 additions and 13,698 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
BUILD_DIR=src/TalonOne
VERSION=$(shell grep -om1 -E '^\[assembly: AssemblyVersion\("[0-9\.]+"\)\]$$' $(PWD)/$(BUILD_DIR)/Properties/AssemblyInfo.cs | sed 's/\[assembly: AssemblyVersion("\(.*\)")\]/\1/')
BUILD_DIR:=src/TalonOne
VERSION:=$(shell grep -om1 -E '^\[assembly: AssemblyVersion\("[0-9\.]+"\)\]$$' $(PWD)/$(BUILD_DIR)/Properties/AssemblyInfo.cs | sed 's/\[assembly: AssemblyVersion("\(.*\)")\]/\1/')
DOCKER_TAG_ARCH:=$(shell [[ $(shell uname -m) == "arm64" ]] && echo "3.1-focal-arm64v8" || echo "sdk:3.1-focal")

default: testenv

clean:
rm -rf $(PWD)/$(BUILD_DIR)/TalonOne.$(VERSION)*.nupkg && \
Expand All @@ -14,7 +17,7 @@ endif
--rm \
-v $(PWD):/tmp/talon-client \
-w "/tmp/talon-client/$(BUILD_DIR)" \
mcr.microsoft.com/dotnet/sdk:3.1-focal \
mcr.microsoft.com/dotnet/sdk:$(DOCKER_TAG_ARCH) \
dotnet pack TalonOne.csproj \
-p:PackageVersion=$(VERSION) \
--output . \
Expand All @@ -34,15 +37,16 @@ endif
--rm \
-v $(PWD):/tmp/talon-client \
-w "/tmp/talon-client/$(BUILD_DIR)" \
mcr.microsoft.com/dotnet/sdk:3.1-focal \
mcr.microsoft.com/dotnet/sdk:$(DOCKER_TAG_ARCH) \
dotnet nuget push TalonOne.$(VERSION).nupkg \
--api-key $(apiKey) \
--source https://api.nuget.org/v3/index.json

.PHONY: testenv
testenv:
docker run \
--rm -it \
-v $(PWD):/tmp/talon-client \
-w /tmp/talon-client \
mcr.microsoft.com/dotnet/sdk:3.1-focal \
mcr.microsoft.com/dotnet/sdk:$(DOCKER_TAG_ARCH) \
/bin/bash
241 changes: 186 additions & 55 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/AcceptCouponEffectProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The properties specific to the \"acceptCoupon\" effect. This gets triggered when

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Value** | **string** | The coupon code that was accepted |
**Value** | **string** | The coupon code that was accepted. |

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

2 changes: 1 addition & 1 deletion docs/AcceptReferralEffectProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The properties specific to the \"acceptReferral\" effect. TThis gets triggered w

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Value** | **string** | The referral code that was accepted |
**Value** | **string** | The referral code that was accepted. |

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

8 changes: 4 additions & 4 deletions docs/AccessLogEntry.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# TalonOne.Model.AccessLogEntry
Log of application accesses
Log of application accesses.
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Uuid** | **string** | UUID reference of request |
**Status** | **int** | HTTP status code of response |
**Method** | **string** | HTTP method of request |
**Uuid** | **string** | UUID reference of request. |
**Status** | **int** | HTTP status code of response. |
**Method** | **string** | HTTP method of request. |
**RequestUri** | **string** | target URI of request |
**Time** | **DateTime** | timestamp of request |
**RequestPayload** | **string** | payload of request |
Expand Down
12 changes: 6 additions & 6 deletions docs/Account.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **int** | Unique ID for this entity. |
**Created** | **DateTime** | The exact moment this entity was created. |
**Modified** | **DateTime** | The exact moment this entity was last modified. |
**Id** | **int** | Internal ID of this entity. |
**Created** | **DateTime** | The time this entity was created. |
**Modified** | **DateTime** | The time this entity was last modified. |
**CompanyName** | **string** | |
**DomainName** | **string** | Subdomain Name for yourcompany.talon.one |
**State** | **string** | State of the account (active, deactivated) |
**DomainName** | **string** | Subdomain Name for yourcompany.talon.one. |
**State** | **string** | State of the account (active, deactivated). |
**BillingEmail** | **string** | The billing email address associated with your company account. |
**PlanName** | **string** | The name of your booked plan. | [optional]
**PlanExpires** | **DateTime** | The point in time at which your current plan expires. | [optional]
Expand All @@ -20,7 +20,7 @@ Name | Type | Description | Notes
**UserCount** | **int** | The current number of Campaign Manager Users in your account. |
**CampaignsActiveCount** | **int** | The current number of active Campaigns in your account. |
**CampaignsInactiveCount** | **int** | The current number of inactive Campaigns in your account. |
**Attributes** | [**Object**](.md) | Arbitrary properties associated with this campaign | [optional]
**Attributes** | [**Object**](.md) | Arbitrary properties associated with this campaign. | [optional]

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

9 changes: 5 additions & 4 deletions docs/AccountAdditionalCost.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **int** | Unique ID for this entity. |
**Created** | **DateTime** | The exact moment this entity was created. |
**Id** | **int** | Internal ID of this entity. |
**Created** | **DateTime** | The time this entity was created. |
**AccountId** | **int** | The ID of the account that owns this entity. |
**Name** | **string** | The additional cost name that will be used in API requests and Talang. E.g. if `name == \"shipping\"` then you would set the shipping additional cost by including an `additionalCosts.shipping` property in your request payload. |
**Name** | **string** | The internal name used in API requests. |
**Title** | **string** | The human-readable name for the additional cost that will be shown in the Campaign Manager. Like `name`, the combination of entity and title must also be unique. |
**Description** | **string** | A description of this additional cost. |
**SubscribedApplicationsIds** | **List<int>** | A list of the IDs of the applications that are subscribed to this additional cost | [optional]
**SubscribedApplicationsIds** | **List<int>** | A list of the IDs of the applications that are subscribed to this additional cost. | [optional]
**Type** | **string** | The type of additional cost. Possible value: - `session`: Additional cost will be added per session. - `item`: Additional cost will be added per item. - `both`: Additional cost will be added per item and session. | [optional] [default to TypeEnum.Session]

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

38 changes: 19 additions & 19 deletions docs/AccountAnalytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Applications** | **int** | Total number of applications in the account |
**LiveApplications** | **int** | Total number of live applications in the account |
**SandboxApplications** | **int** | Total number of sandbox applications in the account |
**Campaigns** | **int** | Total number of campaigns in the account |
**ActiveCampaigns** | **int** | Total number of active campaigns in the account |
**LiveActiveCampaigns** | **int** | Total number of active campaigns in live applications in the account |
**Coupons** | **int** | Total number of coupons in the account |
**ActiveCoupons** | **int** | Total number of active coupons in the account |
**ExpiredCoupons** | **int** | Total number of expired coupons in the account |
**ReferralCodes** | **int** | Total number of referral codes in the account |
**ActiveReferralCodes** | **int** | Total number of active referral codes in the account |
**ExpiredReferralCodes** | **int** | Total number of expired referral codes in the account |
**ActiveRules** | **int** | Total number of active rules in the account |
**Users** | **int** | Total number of users in the account |
**Roles** | **int** | Total number of roles in the account |
**CustomAttributes** | **int** | Total number of custom attributes in the account |
**Webhooks** | **int** | Total number of webhooks in the account |
**LoyaltyPrograms** | **int** | Total number of all loyalty programs in the account |
**LiveLoyaltyPrograms** | **int** | Total number of live loyalty programs in the account |
**Applications** | **int** | Total number of applications in the account. |
**LiveApplications** | **int** | Total number of live applications in the account. |
**SandboxApplications** | **int** | Total number of sandbox applications in the account. |
**Campaigns** | **int** | Total number of campaigns in the account. |
**ActiveCampaigns** | **int** | Total number of active campaigns in the account. |
**LiveActiveCampaigns** | **int** | Total number of active campaigns in live applications in the account. |
**Coupons** | **int** | Total number of coupons in the account. |
**ActiveCoupons** | **int** | Total number of active coupons in the account. |
**ExpiredCoupons** | **int** | Total number of expired coupons in the account. |
**ReferralCodes** | **int** | Total number of referral codes in the account. |
**ActiveReferralCodes** | **int** | Total number of active referral codes in the account. |
**ExpiredReferralCodes** | **int** | Total number of expired referral codes in the account. |
**ActiveRules** | **int** | Total number of active rules in the account. |
**Users** | **int** | Total number of users in the account. |
**Roles** | **int** | Total number of roles in the account. |
**CustomAttributes** | **int** | Total number of custom attributes in the account. |
**Webhooks** | **int** | Total number of webhooks in the account. |
**LoyaltyPrograms** | **int** | Total number of all loyalty programs in the account. |
**LiveLoyaltyPrograms** | **int** | Total number of live loyalty programs in the account. |

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

14 changes: 14 additions & 0 deletions docs/AccountDashboardStatistic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# TalonOne.Model.AccountDashboardStatistic
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Revenue** | [**List<AccountDashboardStatisticRevenue>**](AccountDashboardStatisticRevenue.md) | Aggregated statistic for account revenue. | [optional]
**Discounts** | [**List<AccountDashboardStatisticDiscount>**](AccountDashboardStatisticDiscount.md) | Aggregated statistic for account discount. | [optional]
**LoyaltyPoints** | [**List<AccountDashboardStatisticLoyaltyPoints>**](AccountDashboardStatisticLoyaltyPoints.md) | Aggregated statistic for account loyalty points. | [optional]
**Referrals** | [**List<AccountDashboardStatisticReferrals>**](AccountDashboardStatisticReferrals.md) | Aggregated statistic for account referrals. | [optional]
**ApiCalls** | [**List<AccountDashboardStatisticApiCalls>**](AccountDashboardStatisticApiCalls.md) | Aggregated statistic for the number of account API calls. | [optional]
**Campaigns** | [**AccountDashboardStatisticCampaigns**](AccountDashboardStatisticCampaigns.md) | |

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

10 changes: 10 additions & 0 deletions docs/AccountDashboardStatisticApiCalls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TalonOne.Model.AccountDashboardStatisticApiCalls
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Total** | **decimal** | Total number of API calls received. |
**Datetime** | **DateTime** | Values aggregated for the specified date. |

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

10 changes: 10 additions & 0 deletions docs/AccountDashboardStatisticCampaigns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TalonOne.Model.AccountDashboardStatisticCampaigns
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Live** | **int** | Number of campaigns that are active and live (across all Applications). |
**EndingSoon** | **int** | Campaigns with a schedule ending in 7 days or with only 10% of budget left. |

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

11 changes: 11 additions & 0 deletions docs/AccountDashboardStatisticDiscount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TalonOne.Model.AccountDashboardStatisticDiscount
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Total** | **decimal** | Total discount value redeemed by users. |
**Average** | **decimal** | Average discount percentage. |
**Datetime** | **DateTime** | Values aggregated for the specified date. |

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

10 changes: 10 additions & 0 deletions docs/AccountDashboardStatisticLoyaltyPoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TalonOne.Model.AccountDashboardStatisticLoyaltyPoints
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Total** | **decimal** | Total loyalty points earned by users. |
**Datetime** | **DateTime** | Values aggregated for the specified date. |

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

10 changes: 10 additions & 0 deletions docs/AccountDashboardStatisticReferrals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TalonOne.Model.AccountDashboardStatisticReferrals
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Total** | **decimal** | Total number of referrals initiated by users. |
**Datetime** | **DateTime** | Values aggregated for the specified date. |

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

11 changes: 11 additions & 0 deletions docs/AccountDashboardStatisticRevenue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TalonOne.Model.AccountDashboardStatisticRevenue
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Total** | **decimal** | All revenue that went through the client's shop (including purchases that didn’t trigger an effect). |
**Influenced** | **decimal** | The revenue that was created by a purchase that triggered an effect (excluding web hooks, notifications). |
**Datetime** | **DateTime** | Values aggregated for the specified date. |

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

24 changes: 12 additions & 12 deletions docs/AccountLimits.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**LiveApplications** | **int** | Total number of allowed live applications in the account |
**SandboxApplications** | **int** | Total number of allowed sandbox applications in the account |
**ActiveCampaigns** | **int** | Total number of allowed active campaigns in live applications in the account |
**Coupons** | **int** | Total number of allowed coupons in the account |
**ReferralCodes** | **int** | Total number of allowed referral codes in the account |
**ActiveRules** | **int** | Total number of allowed active rulesets in the account |
**LiveLoyaltyPrograms** | **int** | Total number of allowed live loyalty programs in the account |
**SandboxLoyaltyPrograms** | **int** | Total number of allowed sandbox loyalty programs in the account |
**Webhooks** | **int** | Total number of allowed webhooks in the account |
**Users** | **int** | Total number of allowed users in the account |
**ApiVolume** | **int** | Allowed volume of API requests to the account |
**PromotionTypes** | **List<string>** | Array of promotion types that are employed in the account |
**LiveApplications** | **int** | Total number of allowed live applications in the account. |
**SandboxApplications** | **int** | Total number of allowed sandbox applications in the account. |
**ActiveCampaigns** | **int** | Total number of allowed active campaigns in live applications in the account. |
**Coupons** | **int** | Total number of allowed coupons in the account. |
**ReferralCodes** | **int** | Total number of allowed referral codes in the account. |
**ActiveRules** | **int** | Total number of allowed active rulesets in the account. |
**LiveLoyaltyPrograms** | **int** | Total number of allowed live loyalty programs in the account. |
**SandboxLoyaltyPrograms** | **int** | Total number of allowed sandbox loyalty programs in the account. |
**Webhooks** | **int** | Total number of allowed webhooks in the account. |
**Users** | **int** | Total number of allowed users in the account. |
**ApiVolume** | **int** | Allowed volume of API requests to the account. |
**PromotionTypes** | **List<string>** | Array of promotion types that are employed in the account. |

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

4 changes: 2 additions & 2 deletions docs/AddFreeItemEffectProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ The properties specific to the \"addFreeItem\" effect. This gets triggered whene

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Sku** | **string** | SKU of the item that needs to be added |
**Name** | **string** | The name/description of the effect |
**Sku** | **string** | SKU of the item that needs to be added. |
**Name** | **string** | The name / description of the effect |

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

13 changes: 13 additions & 0 deletions docs/AddItemCatalogAction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TalonOne.Model.AddItemCatalogAction
The specific properties of the \"ADD\" catalog sync action.
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Sku** | **string** | The unique SKU of the item to add. |
**Price** | **decimal** | Price of the item. | [optional]
**Attributes** | [**Object**](.md) | The attributes of the item to add. | [optional]
**ReplaceIfExists** | **bool** | Indicates whether to replace the attributes of the item if the same SKU exists. | [optional] [default to false]

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

Loading

0 comments on commit 0c2afbd

Please sign in to comment.