Skip to content

Commit 98318a9

Browse files
committed
Added coupon_reservations to the integration api. Added missing coupon rejections
1 parent 6ddcd1f commit 98318a9

File tree

77 files changed

+2045
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2045
-1043
lines changed

README.md

Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -71,59 +71,37 @@ Please follow the [installation](#installation) instruction and execute the foll
7171

7272
```java
7373

74-
package com.example.consumer;
75-
76-
import one.talon.ApiClient;
77-
import one.talon.api.IntegrationApi;
78-
import one.talon.api.ManagementApi;
74+
import one.talon.*;
75+
import one.talon.auth.*;
7976
import one.talon.model.*;
77+
import one.talon.api.IntegrationApi;
8078

81-
public class TalonApiTest {
82-
public static void main(String[] args) {
83-
84-
// Management API
85-
ApiClient mApiClient = new ApiClient("manager_auth");
86-
ManagementApi mApi = new ManagementApi(mApiClient);
87-
mApi.getApiClient().setBasePath("http://localhost");
88-
mApi.getApiClient().setApiKeyPrefix("Bearer");
89-
LoginParams lp = new LoginParams();
90-
lp.setEmail("demo@talon.one");
91-
lp.setPassword("yourpassword");
92-
93-
try {
94-
Session s = mApi.createSession(lp);
95-
mApi.getApiClient().setApiKey(s.getToken());
96-
Account acc = mApi.getAccount(1);
97-
System.out.println(acc.toString());
98-
99-
System.out.println(mApi.getRuleset(1, 1, 1));
100-
} catch (Exception e) {
101-
System.out.println(e);
102-
}
79+
import java.io.File;
80+
import java.util.*;
10381

104-
// Integration API
105-
ApiClient iApiClient = new ApiClient("integration_auth");
106-
IntegrationApi iApi = new IntegrationApi(iApiClient );
107-
// setup: applicationId, applicationKey, basePath, apiKeyPrefix and apiKey
108-
iApi.getApiClient().setApplicationId("1");
109-
iApi.getApiClient().setApplicationKey("6e17358a222eae88");
110-
iApi.getApiClient().setBasePath("http://localhost:8080");
111-
iApi.getApiClient().setApiKeyPrefix("ApiKey-v1");
112-
iApi.getApiClient().setApiKey("38c6e3405e4c4e37da32c99fd6bdd8d71bbd1afd769bdeba6f0a8e0fb8e06ddb");
113-
// regarding 'Content-Signature' signing the request body is in process of deprecation
114-
// therefore enforced to do in the client side
82+
public class IntegrationApiExample {
11583

84+
public static void main(String[] args) {
85+
ApiClient defaultClient = Configuration.getDefaultApiClient();
86+
87+
// Configure API key authorization: integration_auth
88+
ApiKeyAuth integration_auth = (ApiKeyAuth) defaultClient.getAuthentication("integration_auth");
89+
integration_auth.setApiKey("YOUR API KEY");
90+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
91+
//integration_auth.setApiKeyPrefix("Token");
92+
93+
IntegrationApi apiInstance = new IntegrationApi();
94+
NewReferral newReferral = new NewReferral(); // NewReferral |
11695
try {
117-
NewCustomerProfile body = new NewCustomerProfile();
118-
IntegrationState ie = iApi.updateCustomerProfile("testCustomerProfile", body);
119-
System.out.println(ie.toString());
120-
} catch (Exception e) {
121-
System.out.println(e);
96+
Referral result = apiInstance.createReferral(newReferral);
97+
System.out.println(result);
98+
} catch (ApiException e) {
99+
System.err.println("Exception when calling IntegrationApi#createReferral");
100+
e.printStackTrace();
122101
}
123102
}
124103
}
125104

126-
127105
```
128106

129107
## Documentation for API Endpoints

docs/Application.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
1515
**currency** | **String** | A string describing a default currency for new customer sessions. |
1616
**caseSensitivity** | [**CaseSensitivityEnum**](#CaseSensitivityEnum) | A string indicating how should campaigns in this application deal with case sensitivity on coupon codes. | [optional]
1717
**attributes** | [**Object**](.md) | Arbitrary properties associated with this campaign | [optional]
18+
**limits** | [**List<LimitConfig>**](LimitConfig.md) | Default limits for campaigns created in this application | [optional]
1819
**loyaltyPrograms** | [**List<LoyaltyProgram>**](LoyaltyProgram.md) | An array containing all the loyalty programs to which this application is subscribed |
1920

2021

docs/CouponRejectionReason.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Name | Value
1616
COUPONNOTFOUND | "CouponNotFound"
1717
COUPONPARTOFNOTRUNNINGCAMPAIGN | "CouponPartOfNotRunningCampaign"
1818
COUPONLIMITREACHED | "CouponLimitReached"
19+
CAMPAIGNLIMITREACHED | "CampaignLimitReached"
20+
PROFILELIMITREACHED | "ProfileLimitReached"
1921
COUPONRECIPIENTDOESNOTMATCH | "CouponRecipientDoesNotMatch"
2022
COUPONEXPIRED | "CouponExpired"
2123
COUPONSTARTDATEINFUTURE | "CouponStartDateInFuture"

docs/CustomerSession.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
1212
**referral** | **String** | Any referral code entered. |
1313
**state** | [**StateEnum**](#StateEnum) | Indicates the current state of the session. All sessions must start in the \"open\" state, after which valid transitions are... 1. open -> closed 2. open -> cancelled 3. closed -> cancelled |
1414
**cartItems** | [**List<CartItem>**](CartItem.md) | Serialized JSON representation. |
15+
**identifiers** | **List<String>** | Identifiers for the customer, this can be used for limits on values such as device ID. | [optional]
1516
**total** | [**BigDecimal**](BigDecimal.md) | The total sum of the cart in one session. |
1617
**attributes** | [**Object**](.md) | A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings. |
1718
**firstSession** | **Boolean** | Indicates whether this is the first session for the customer's profile. Will always be true for anonymous sessions. |

docs/InlineResponse200.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**data** | [**List<Application>**](Application.md) | |
7+
**data** | [**List<CustomerProfile>**](CustomerProfile.md) | |
88
**totalResultSize** | **Integer** | |
99

1010

docs/InlineResponse2001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**data** | [**List<Campaign>**](Campaign.md) | |
7+
**data** | [**List<Coupon>**](Coupon.md) | |
88
**totalResultSize** | **Integer** | |
99

1010

docs/InlineResponse20010.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**data** | [**List<CampaignAnalytics>**](CampaignAnalytics.md) | |
8-
**totalResultSize** | **Integer** | |
7+
**data** | [**List<AccessLogEntry>**](AccessLogEntry.md) | |
8+
**hasMore** | **Boolean** | |
99

1010

1111

docs/InlineResponse20011.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**data** | [**List<ApplicationCustomer>**](ApplicationCustomer.md) | |
7+
**data** | [**List<CampaignAnalytics>**](CampaignAnalytics.md) | |
88
**totalResultSize** | **Integer** | |
99

1010

docs/InlineResponse20012.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**data** | [**List<ApplicationCustomer>**](ApplicationCustomer.md) | |
8-
**hasMore** | **Boolean** | |
8+
**totalResultSize** | **Integer** | |
99

1010

1111

docs/InlineResponse20013.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**data** | [**List<CustomerActivityReport>**](CustomerActivityReport.md) | |
8-
**totalResultSize** | **Integer** | |
7+
**data** | [**List<ApplicationCustomer>**](ApplicationCustomer.md) | |
8+
**hasMore** | **Boolean** | |
99

1010

1111

0 commit comments

Comments
 (0)