diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 5e4b8dc2..d04de314 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -121,6 +121,7 @@ docs/CampaignDeletedNotificationItem.md
docs/CampaignDetail.md
docs/CampaignEditedNotification.md
docs/CampaignEditedNotificationItem.md
+docs/CampaignEligibility.md
docs/CampaignEntity.md
docs/CampaignEvaluationGroup.md
docs/CampaignEvaluationPosition.md
@@ -849,6 +850,7 @@ src/main/java/one/talon/model/CampaignDeletedNotificationItem.java
src/main/java/one/talon/model/CampaignDetail.java
src/main/java/one/talon/model/CampaignEditedNotification.java
src/main/java/one/talon/model/CampaignEditedNotificationItem.java
+src/main/java/one/talon/model/CampaignEligibility.java
src/main/java/one/talon/model/CampaignEntity.java
src/main/java/one/talon/model/CampaignEvaluationGroup.java
src/main/java/one/talon/model/CampaignEvaluationPosition.java
@@ -1547,6 +1549,7 @@ src/test/java/one/talon/model/CampaignDeletedNotificationTest.java
src/test/java/one/talon/model/CampaignDetailTest.java
src/test/java/one/talon/model/CampaignEditedNotificationItemTest.java
src/test/java/one/talon/model/CampaignEditedNotificationTest.java
+src/test/java/one/talon/model/CampaignEligibilityTest.java
src/test/java/one/talon/model/CampaignEntityTest.java
src/test/java/one/talon/model/CampaignEvaluationGroupTest.java
src/test/java/one/talon/model/CampaignEvaluationPositionTest.java
diff --git a/README.md b/README.md
index 52ab7b13..832293d0 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@ Add this dependency to your project's POM:
one.talon
talon-one-client
- 26.08.0
+ 26.08.01
compile
```
@@ -52,7 +52,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:
```groovy
-compile "one.talon:talon-one-client:26.08.0"
+compile "one.talon:talon-one-client:26.08.01"
```
### Others
@@ -541,6 +541,7 @@ Class | Method | HTTP request | Description
- [CampaignDetail](docs/CampaignDetail.md)
- [CampaignEditedNotification](docs/CampaignEditedNotification.md)
- [CampaignEditedNotificationItem](docs/CampaignEditedNotificationItem.md)
+- [CampaignEligibility](docs/CampaignEligibility.md)
- [CampaignEntity](docs/CampaignEntity.md)
- [CampaignEvaluationGroup](docs/CampaignEvaluationGroup.md)
- [CampaignEvaluationPosition](docs/CampaignEvaluationPosition.md)
diff --git a/api/openapi.yaml b/api/openapi.yaml
index 9e68f5ea..0a0c841f 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -5986,6 +5986,28 @@ paths:
format: date-time
type: string
style: form
+ - description: |
+ Filters which balance fields are included in the CSV export. `currentBalance`
+ is always returned.
+
+ By default, all balance fields are included. When this parameter is provided, only the
+ listed fields contain values and the rest are returned empty.
+
+ Accepted values:
+ - `currentBalance`
+ - `pendingBalance`
+ - `expiredBalance`
+ - `spentBalance`
+ - `negativeBalance`
+
+ Multiple values must be provided as a comma-separated list.
+ explode: true
+ in: query
+ name: balances
+ required: false
+ schema:
+ type: string
+ style: form
responses:
"200":
content:
@@ -6055,6 +6077,28 @@ paths:
format: date-time
type: string
style: form
+ - description: |
+ Filters which balance fields are included in the CSV export. `currentBalance`
+ is always returned.
+
+ By default, all balance fields are included. When this parameter is provided, only the
+ listed fields contain values and the rest are returned empty.
+
+ Accepted values:
+ - `currentBalance`
+ - `pendingBalance`
+ - `expiredBalance`
+ - `spentBalance`
+ - `negativeBalance`
+
+ Multiple values must be provided as a comma-separated list.
+ explode: true
+ in: query
+ name: balances
+ required: false
+ schema:
+ type: string
+ style: form
responses:
"200":
content:
@@ -6430,6 +6474,30 @@ paths:
format: date-time
type: string
style: form
+ - description: |
+ Filters which balance fields are included in the CSV export. By default,
+ all balance fields are included. When this parameter is provided, only the
+ listed fields contain values and the rest are returned empty.
+
+ Accepted values:
+ - `currentBalance`
+ - `pendingBalance`
+ - `expiredBalance`
+ - `spentBalance`
+ - `negativeBalance`
+
+ Multiple values must be provided as a comma-separated list.
+
+ **Note:**
+ - The `negativeBalance` value is not supported for card balance exports.
+ - Providing an unsupported or invalid value returns a `400 Bad Request` error.
+ explode: true
+ in: query
+ name: balances
+ required: false
+ schema:
+ type: string
+ style: form
responses:
"200":
content:
@@ -16250,6 +16318,7 @@ components:
- awardedGiveaways
- ruleFailureReasons
- previousReturns
+ - campaignEligibility
type: string
type: array
required:
@@ -17540,6 +17609,155 @@ components:
lastActivity: 2022-11-10T23:00:00Z
endTime: 2021-09-22T22:00:00Z
referralRedemptionCount: 3
+ RuleMetadata:
+ example:
+ displayDescription: Get a 20% discount on all shoes during Thanksgiving! Offer
+ valid till Dec 5 only.
+ displayName: 20% off all shoes!
+ eligibility:
+ - ""
+ - ""
+ relatedData: https://example.com/discounts/20-off-shoes.png
+ title: Give discount via coupon
+ properties:
+ title:
+ description: A short description of the rule.
+ example: Give discount via coupon
+ type: string
+ displayName:
+ description: A customer-facing name for the rule.
+ example: 20% off all shoes!
+ type: string
+ displayDescription:
+ description: "A customer-facing description that explains the details of\
+ \ the rule. \n\nFor example, this property can contain details about eligibility\
+ \ requirements, reward timelines, or terms and conditions.\n"
+ example: Get a 20% discount on all shoes during Thanksgiving! Offer valid
+ till Dec 5 only.
+ type: string
+ relatedData:
+ description: |
+ Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID.
+ example: https://example.com/discounts/20-off-shoes.png
+ type: string
+ eligibility:
+ items: {}
+ type: array
+ required:
+ - title
+ IntegrationCampaign:
+ allOf:
+ - properties:
+ id:
+ description: Unique ID of Campaign.
+ example: 4
+ format: int64
+ type: integer
+ required:
+ - id
+ - $ref: "#/components/schemas/ApplicationEntity"
+ - properties:
+ name:
+ description: The name of the campaign.
+ example: Summer promotions
+ minLength: 1
+ title: Campaign Name
+ type: string
+ description:
+ description: A detailed description of the campaign.
+ example: Campaign for all summer 2021 promotions
+ title: Campaign Description
+ type: string
+ startTime:
+ description: Timestamp when the campaign will become active.
+ example: 2021-07-20T22:00:00Z
+ format: date-time
+ type: string
+ endTime:
+ description: Timestamp when the campaign will become inactive.
+ example: 2021-09-22T22:00:00Z
+ format: date-time
+ type: string
+ attributes:
+ $ref: "#/components/schemas/IntegrationCampaign_allOf_attributes"
+ state:
+ default: enabled
+ description: |
+ The state of the campaign.
+ enum:
+ - enabled
+ example: enabled
+ type: string
+ tags:
+ description: A list of tags for the campaign.
+ example:
+ - summer
+ items:
+ maxLength: 50
+ minLength: 1
+ type: string
+ maxItems: 50
+ type: array
+ features:
+ description: The features enabled in this campaign.
+ example:
+ - coupons
+ - referrals
+ items:
+ enum:
+ - coupons
+ - referrals
+ - loyalty
+ - giveaways
+ - strikethrough
+ - achievements
+ type: string
+ type: array
+ rules:
+ description: A list of rules containing customer-facing details of the
+ rewards defined in the campaign.
+ items:
+ $ref: "#/components/schemas/RuleMetadata"
+ type: array
+ required:
+ - features
+ - name
+ - state
+ - tags
+ example:
+ features:
+ - coupons
+ - referrals
+ name: Summer promotions
+ description: Campaign for all summer 2021 promotions
+ startTime: 2021-07-20T22:00:00Z
+ attributes: null
+ rules:
+ - displayDescription: Get a 20% discount on all shoes during Thanksgiving!
+ Offer valid till Dec 5 only.
+ displayName: 20% off all shoes!
+ eligibility:
+ - ""
+ - ""
+ relatedData: https://example.com/discounts/20-off-shoes.png
+ title: Give discount via coupon
+ - displayDescription: Get a 20% discount on all shoes during Thanksgiving!
+ Offer valid till Dec 5 only.
+ displayName: 20% off all shoes!
+ eligibility:
+ - ""
+ - ""
+ relatedData: https://example.com/discounts/20-off-shoes.png
+ title: Give discount via coupon
+ id: 4
+ endTime: 2021-09-22T22:00:00Z
+ state: enabled
+ applicationId: 322
+ tags:
+ - summer
+ CampaignEligibility:
+ allOf:
+ - $ref: "#/components/schemas/IntegrationCampaign"
RuleFailureReason:
description: Details about why a rule failed.
example:
@@ -19246,6 +19464,7 @@ components:
- event
- awardedGiveaways
- ruleFailureReasons
+ - campaignEligibility
type: string
type: array
ProfileAudiencesChanges:
@@ -20117,6 +20336,17 @@ components:
description: A description of the audience.
example: Travel audience 18-27
type: string
+ subscribedApplicationsIds:
+ description: A list of the IDs of the Applications that are connected to
+ this audience.
+ example:
+ - 3
+ - 13
+ items:
+ format: int64
+ type: integer
+ type: array
+ uniqueItems: true
required:
- name
NewAudience:
@@ -20154,6 +20384,9 @@ components:
lastUpdate: 2022-04-26T11:02:38Z
name: Travel audience
sandbox: true
+ subscribedApplicationsIds:
+ - 3
+ - 13
integration: mparticle
description: Travel audience 18-27
integrationId: 382370BKDB946
@@ -20169,6 +20402,9 @@ components:
lastUpdate: 2022-04-26T11:02:38Z
name: Travel audience
sandbox: true
+ subscribedApplicationsIds:
+ - 3
+ - 13
integration: mparticle
description: Travel audience 18-27
integrationId: 382370BKDB946
@@ -20177,12 +20413,26 @@ components:
UpdateAudience:
example:
name: Travel audience
+ subscribedApplicationsIds:
+ - 3
+ - 13
properties:
name:
description: The human-friendly display name for this audience.
example: Travel audience
minLength: 1
type: string
+ subscribedApplicationsIds:
+ description: A list of the IDs of the Applications that are connected to
+ this audience.
+ example:
+ - 3
+ - 13
+ items:
+ format: int64
+ type: integer
+ type: array
+ uniqueItems: true
required:
- name
CustomerProfileAudienceRequestItem:
@@ -20286,117 +20536,6 @@ components:
items:
$ref: "#/components/schemas/IntegrationCustomerProfileAudienceRequestItem"
type: array
- RuleMetadata:
- properties:
- title:
- description: A short description of the rule.
- example: Give discount via coupon
- type: string
- displayName:
- description: A customer-facing name for the rule.
- example: 20% off all shoes!
- type: string
- displayDescription:
- description: "A customer-facing description that explains the details of\
- \ the rule. \n\nFor example, this property can contain details about eligibility\
- \ requirements, reward timelines, or terms and conditions.\n"
- example: Get a 20% discount on all shoes during Thanksgiving! Offer valid
- till Dec 5 only.
- type: string
- relatedData:
- description: |
- Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID.
- example: https://example.com/discounts/20-off-shoes.png
- type: string
- required:
- - title
- IntegrationCampaign:
- allOf:
- - properties:
- id:
- description: Unique ID of Campaign.
- example: 4
- format: int64
- type: integer
- required:
- - id
- - $ref: "#/components/schemas/ApplicationEntity"
- - properties:
- name:
- description: A user-facing name for this campaign.
- example: Summer promotions
- minLength: 1
- title: Campaign Name
- type: string
- description:
- description: A detailed description of the campaign.
- example: Campaign for all summer 2021 promotions
- title: Campaign Description
- type: string
- startTime:
- description: Timestamp when the campaign will become active.
- example: 2021-07-20T22:00:00Z
- format: date-time
- type: string
- endTime:
- description: Timestamp when the campaign will become inactive.
- example: 2021-09-22T22:00:00Z
- format: date-time
- type: string
- attributes:
- $ref: "#/components/schemas/IntegrationCampaign_allOf_attributes"
- state:
- default: enabled
- description: |
- The state of the campaign.
- enum:
- - enabled
- example: enabled
- type: string
- tags:
- description: A list of tags for the campaign.
- example:
- - summer
- items:
- maxLength: 50
- minLength: 1
- type: string
- maxItems: 50
- type: array
- features:
- description: The features enabled in this campaign.
- example:
- - coupons
- - referrals
- items:
- enum:
- - coupons
- - referrals
- - loyalty
- - giveaways
- - strikethrough
- - achievements
- type: string
- type: array
- required:
- - features
- - name
- - state
- - tags
- example:
- features:
- - coupons
- - referrals
- name: Summer promotions
- description: Campaign for all summer 2021 promotions
- startTime: 2021-07-20T22:00:00Z
- attributes: null
- id: 4
- endTime: 2021-09-22T22:00:00Z
- state: enabled
- applicationId: 322
- tags:
- - summer
NewAttribute:
allOf:
- properties:
@@ -36433,6 +36572,21 @@ components:
example: true
title: Sandbox
type: boolean
+ rule:
+ description: Rule to apply.
+ items:
+ $ref: "#/components/schemas/Rule"
+ type: array
+ bindings:
+ description: A list of named variables created before the reward's rules
+ are evaluated. Each binding pairs a name with a talang expression. The
+ expression is evaluated once and its result is available by name in any
+ rule condition or effect. Bindings must be defined outside of individual
+ rules.
+ example: []
+ items:
+ $ref: "#/components/schemas/Binding"
+ type: array
required:
- apiName
- applicationIds
@@ -38162,6 +38316,23 @@ components:
description: Campaign for all summer 2021 promotions
startTime: 2021-07-20T22:00:00Z
attributes: null
+ rules:
+ - displayDescription: Get a 20% discount on all shoes during Thanksgiving!
+ Offer valid till Dec 5 only.
+ displayName: 20% off all shoes!
+ eligibility:
+ - ""
+ - ""
+ relatedData: https://example.com/discounts/20-off-shoes.png
+ title: Give discount via coupon
+ - displayDescription: Get a 20% discount on all shoes during Thanksgiving!
+ Offer valid till Dec 5 only.
+ displayName: 20% off all shoes!
+ eligibility:
+ - ""
+ - ""
+ relatedData: https://example.com/discounts/20-off-shoes.png
+ title: Give discount via coupon
id: 4
endTime: 2021-09-22T22:00:00Z
state: enabled
@@ -38175,6 +38346,23 @@ components:
description: Campaign for all summer 2021 promotions
startTime: 2021-07-20T22:00:00Z
attributes: null
+ rules:
+ - displayDescription: Get a 20% discount on all shoes during Thanksgiving!
+ Offer valid till Dec 5 only.
+ displayName: 20% off all shoes!
+ eligibility:
+ - ""
+ - ""
+ relatedData: https://example.com/discounts/20-off-shoes.png
+ title: Give discount via coupon
+ - displayDescription: Get a 20% discount on all shoes during Thanksgiving!
+ Offer valid till Dec 5 only.
+ displayName: 20% off all shoes!
+ eligibility:
+ - ""
+ - ""
+ relatedData: https://example.com/discounts/20-off-shoes.png
+ title: Give discount via coupon
id: 4
endTime: 2021-09-22T22:00:00Z
state: enabled
@@ -42445,6 +42633,9 @@ components:
lastUpdate: 2022-04-26T11:02:38Z
name: Travel audience
sandbox: true
+ subscribedApplicationsIds:
+ - 3
+ - 13
integration: mparticle
description: Travel audience 18-27
integrationId: 382370BKDB946
@@ -42455,6 +42646,9 @@ components:
lastUpdate: 2022-04-26T11:02:38Z
name: Travel audience
sandbox: true
+ subscribedApplicationsIds:
+ - 3
+ - 13
integration: mparticle
description: Travel audience 18-27
integrationId: 382370BKDB946
@@ -43247,6 +43441,9 @@ components:
items: {}
minItems: 1
type: array
+ IntegrationCampaign_allOf_attributes:
+ description: Arbitrary properties associated with this campaign.
+ type: object
Attributes_of_coupon:
description: Custom attributes associated with this coupon.
title: Attributes of coupon
@@ -43268,9 +43465,6 @@ components:
\ property. See [creating custom attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#creating-a-custom-attribute)."
example: "{myAttribute=myValue}"
type: object
- IntegrationCampaign_allOf_attributes:
- description: Arbitrary properties associated with this campaign.
- type: object
NewCustomerSession_allOf_attributes:
description: |
A key-value map of the sessions attributes. The potentially valid attributes are configured in your accounts developer settings.
diff --git a/build.gradle b/build.gradle
index bdfd28bd..87f61b5f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'
group = 'one.talon'
-version = '26.08.0'
+version = '26.08.01'
buildscript {
repositories {
diff --git a/build.sbt b/build.sbt
index 292b2533..4a2e7b94 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "one.talon",
name := "talon-one-client",
- version := "26.08.0",
+ version := "26.08.01",
scalaVersion := "2.11.12",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
diff --git a/docs/Audience.md b/docs/Audience.md
index a114726c..809bd838 100644
--- a/docs/Audience.md
+++ b/docs/Audience.md
@@ -13,6 +13,7 @@
|**name** | **String** | The human-friendly display name for this audience. | |
|**sandbox** | **Boolean** | Indicates if this is a live or sandbox Application. | [optional] |
|**description** | **String** | A description of the audience. | [optional] |
+|**subscribedApplicationsIds** | **Set<Long>** | A list of the IDs of the Applications that are connected to this audience. | [optional] |
|**integration** | **String** | The Talon.One-supported [3rd-party platform](https://docs.talon.one/docs/dev/technology-partners/overview) that this audience was created in. For example, `mParticle`, `Segment`, `Shopify`, `Braze`, or `Iterable`. **Note:** If you do not integrate with any of these platforms, do not use this property. | [optional] |
|**integrationId** | **String** | The ID of this audience in the third-party integration. **Note:** To create an audience that doesn't come from a 3rd party platform, do not use this property. | [optional] |
|**createdIn3rdParty** | **Boolean** | Determines if this audience is a 3rd party audience or not. | [optional] |
diff --git a/docs/CampaignEligibility.md b/docs/CampaignEligibility.md
new file mode 100644
index 00000000..8bc1f83d
--- /dev/null
+++ b/docs/CampaignEligibility.md
@@ -0,0 +1,44 @@
+
+
+# CampaignEligibility
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **Long** | Unique ID of Campaign. | |
+|**applicationId** | **Long** | The ID of the Application that owns this entity. | |
+|**name** | **String** | The name of the campaign. | |
+|**description** | **String** | A detailed description of the campaign. | [optional] |
+|**startTime** | **OffsetDateTime** | Timestamp when the campaign will become active. | [optional] |
+|**endTime** | **OffsetDateTime** | Timestamp when the campaign will become inactive. | [optional] |
+|**attributes** | **Object** | Arbitrary properties associated with this campaign. | [optional] |
+|**state** | [**StateEnum**](#StateEnum) | The state of the campaign. | |
+|**tags** | **List<String>** | A list of tags for the campaign. | |
+|**features** | [**List<FeaturesEnum>**](#List<FeaturesEnum>) | The features enabled in this campaign. | |
+|**rules** | [**List<RuleMetadata>**](RuleMetadata.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | [optional] |
+
+
+
+## Enum: StateEnum
+
+| Name | Value |
+|---- | -----|
+| ENABLED | "enabled" |
+
+
+
+## Enum: List<FeaturesEnum>
+
+| Name | Value |
+|---- | -----|
+| COUPONS | "coupons" |
+| REFERRALS | "referrals" |
+| LOYALTY | "loyalty" |
+| GIVEAWAYS | "giveaways" |
+| STRIKETHROUGH | "strikethrough" |
+| ACHIEVEMENTS | "achievements" |
+
+
+
diff --git a/docs/CustomerProfileIntegrationRequestV2.md b/docs/CustomerProfileIntegrationRequestV2.md
index 4b2d5137..b2246870 100644
--- a/docs/CustomerProfileIntegrationRequestV2.md
+++ b/docs/CustomerProfileIntegrationRequestV2.md
@@ -24,6 +24,7 @@
| EVENT | "event" |
| AWARDED_GIVEAWAYS | "awardedGiveaways" |
| RULE_FAILURE_REASONS | "ruleFailureReasons" |
+| CAMPAIGN_ELIGIBILITY | "campaignEligibility" |
diff --git a/docs/IntegrationCampaign.md b/docs/IntegrationCampaign.md
index 4e656497..6a97a226 100644
--- a/docs/IntegrationCampaign.md
+++ b/docs/IntegrationCampaign.md
@@ -9,7 +9,7 @@
|------------ | ------------- | ------------- | -------------|
|**applicationId** | **Long** | The ID of the Application that owns this entity. | |
|**id** | **Long** | Unique ID of Campaign. | |
-|**name** | **String** | A user-facing name for this campaign. | |
+|**name** | **String** | The name of the campaign. | |
|**description** | **String** | A detailed description of the campaign. | [optional] |
|**startTime** | **OffsetDateTime** | Timestamp when the campaign will become active. | [optional] |
|**endTime** | **OffsetDateTime** | Timestamp when the campaign will become inactive. | [optional] |
@@ -17,6 +17,7 @@
|**state** | [**StateEnum**](#StateEnum) | The state of the campaign. | |
|**tags** | **List<String>** | A list of tags for the campaign. | |
|**features** | [**List<FeaturesEnum>**](#List<FeaturesEnum>) | The features enabled in this campaign. | |
+|**rules** | [**List<RuleMetadata>**](RuleMetadata.md) | A list of rules containing customer-facing details of the rewards defined in the campaign. | [optional] |
diff --git a/docs/IntegrationEventV2Request.md b/docs/IntegrationEventV2Request.md
index e84c0a98..05cff6e9 100644
--- a/docs/IntegrationEventV2Request.md
+++ b/docs/IntegrationEventV2Request.md
@@ -27,6 +27,7 @@
| EVENT | "event" |
| AWARDED_GIVEAWAYS | "awardedGiveaways" |
| RULE_FAILURE_REASONS | "ruleFailureReasons" |
+| CAMPAIGN_ELIGIBILITY | "campaignEligibility" |
diff --git a/docs/IntegrationRequest.md b/docs/IntegrationRequest.md
index 56cd52f4..902ccf75 100644
--- a/docs/IntegrationRequest.md
+++ b/docs/IntegrationRequest.md
@@ -27,6 +27,7 @@ The body of a V2 integration API request (customer session update). Next to the
| AWARDED_GIVEAWAYS | "awardedGiveaways" |
| RULE_FAILURE_REASONS | "ruleFailureReasons" |
| PREVIOUS_RETURNS | "previousReturns" |
+| CAMPAIGN_ELIGIBILITY | "campaignEligibility" |
diff --git a/docs/ManagementApi.md b/docs/ManagementApi.md
index f819aa3f..81ad0e12 100644
--- a/docs/ManagementApi.md
+++ b/docs/ManagementApi.md
@@ -3791,7 +3791,7 @@ public class Example {
# **exportLoyaltyBalance**
-> String exportLoyaltyBalance(loyaltyProgramId, endDate)
+> String exportLoyaltyBalance(loyaltyProgramId, endDate, balances)
Export customer loyalty balance to CSV
@@ -3821,8 +3821,9 @@ public class Example {
ManagementApi apiInstance = new ManagementApi(defaultClient);
String loyaltyProgramId = "loyaltyProgramId_example"; // String | The identifier for the loyalty program.
OffsetDateTime endDate = OffsetDateTime.now(); // OffsetDateTime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered.
+ String balances = "balances_example"; // String | Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list.
try {
- String result = apiInstance.exportLoyaltyBalance(loyaltyProgramId, endDate);
+ String result = apiInstance.exportLoyaltyBalance(loyaltyProgramId, endDate, balances);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ManagementApi#exportLoyaltyBalance");
@@ -3841,6 +3842,7 @@ public class Example {
|------------- | ------------- | ------------- | -------------|
| **loyaltyProgramId** | **String**| The identifier for the loyalty program. | |
| **endDate** | **OffsetDateTime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] |
+| **balances** | **String**| Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. | [optional] |
### Return type
@@ -3864,7 +3866,7 @@ public class Example {
# **exportLoyaltyBalances**
-> String exportLoyaltyBalances(loyaltyProgramId, endDate)
+> String exportLoyaltyBalances(loyaltyProgramId, endDate, balances)
Export customer loyalty balances
@@ -3894,8 +3896,9 @@ public class Example {
ManagementApi apiInstance = new ManagementApi(defaultClient);
String loyaltyProgramId = "loyaltyProgramId_example"; // String | The identifier for the loyalty program.
OffsetDateTime endDate = OffsetDateTime.now(); // OffsetDateTime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. > - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export.
+ String balances = "balances_example"; // String | Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list.
try {
- String result = apiInstance.exportLoyaltyBalances(loyaltyProgramId, endDate);
+ String result = apiInstance.exportLoyaltyBalances(loyaltyProgramId, endDate, balances);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ManagementApi#exportLoyaltyBalances");
@@ -3914,6 +3917,7 @@ public class Example {
|------------- | ------------- | ------------- | -------------|
| **loyaltyProgramId** | **String**| The identifier for the loyalty program. | |
| **endDate** | **OffsetDateTime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. > - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. | [optional] |
+| **balances** | **String**| Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. | [optional] |
### Return type
@@ -3937,7 +3941,7 @@ public class Example {
# **exportLoyaltyCardBalances**
-> String exportLoyaltyCardBalances(loyaltyProgramId, endDate)
+> String exportLoyaltyCardBalances(loyaltyProgramId, endDate, balances)
Export all card transaction logs
@@ -3967,8 +3971,9 @@ public class Example {
ManagementApi apiInstance = new ManagementApi(defaultClient);
Long loyaltyProgramId = 56L; // Long | 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.
OffsetDateTime endDate = OffsetDateTime.now(); // OffsetDateTime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered.
+ String balances = "balances_example"; // String | Filters which balance fields are included in the CSV export. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. **Note:** - The `negativeBalance` value is not supported for card balance exports. - Providing an unsupported or invalid value returns a `400 Bad Request` error.
try {
- String result = apiInstance.exportLoyaltyCardBalances(loyaltyProgramId, endDate);
+ String result = apiInstance.exportLoyaltyCardBalances(loyaltyProgramId, endDate, balances);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ManagementApi#exportLoyaltyCardBalances");
@@ -3987,6 +3992,7 @@ public class Example {
|------------- | ------------- | ------------- | -------------|
| **loyaltyProgramId** | **Long**| Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | |
| **endDate** | **OffsetDateTime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] |
+| **balances** | **String**| Filters which balance fields are included in the CSV export. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. **Note:** - The `negativeBalance` value is not supported for card balance exports. - Providing an unsupported or invalid value returns a `400 Bad Request` error. | [optional] |
### Return type
diff --git a/docs/MultipleAudiencesItem.md b/docs/MultipleAudiencesItem.md
index a983fd37..f27fbad8 100644
--- a/docs/MultipleAudiencesItem.md
+++ b/docs/MultipleAudiencesItem.md
@@ -10,6 +10,7 @@
|**id** | **Long** | The internal ID of this entity. | |
|**created** | **OffsetDateTime** | The time this entity was created. | |
|**name** | **String** | The human-friendly display name for this audience. | |
+|**subscribedApplicationsIds** | **Set<Long>** | A list of the IDs of the Applications that are connected to this audience. | [optional] |
|**integrationId** | **String** | The ID of this audience in the third-party integration. | [optional] |
|**status** | [**StatusEnum**](#StatusEnum) | Indicates whether the audience is new, updated or unmodified by the request. | |
diff --git a/docs/NewAudience.md b/docs/NewAudience.md
index 6a560b25..73e5960e 100644
--- a/docs/NewAudience.md
+++ b/docs/NewAudience.md
@@ -10,6 +10,7 @@
|**name** | **String** | The human-friendly display name for this audience. | |
|**sandbox** | **Boolean** | Indicates if this is a live or sandbox Application. | [optional] |
|**description** | **String** | A description of the audience. | [optional] |
+|**subscribedApplicationsIds** | **Set<Long>** | A list of the IDs of the Applications that are connected to this audience. | [optional] |
|**integration** | **String** | The Talon.One-supported [3rd-party platform](https://docs.talon.one/docs/dev/technology-partners/overview) that this audience was created in. For example, `mParticle`, `Segment`, `Shopify`, `Braze`, or `Iterable`. **Note:** If you do not integrate with any of these platforms, do not use this property. | [optional] |
|**integrationId** | **String** | The ID of this audience in the third-party integration. **Note:** To create an audience that doesn't come from a 3rd party platform, do not use this property. | [optional] |
|**createdIn3rdParty** | **Boolean** | Determines if this audience is a 3rd party audience or not. | [optional] |
diff --git a/docs/NewInternalAudience.md b/docs/NewInternalAudience.md
index 0bc64445..bb4137c1 100644
--- a/docs/NewInternalAudience.md
+++ b/docs/NewInternalAudience.md
@@ -10,6 +10,7 @@
|**name** | **String** | The human-friendly display name for this audience. | |
|**sandbox** | **Boolean** | Indicates if this is a live or sandbox Application. | [optional] |
|**description** | **String** | A description of the audience. | [optional] |
+|**subscribedApplicationsIds** | **Set<Long>** | A list of the IDs of the Applications that are connected to this audience. | [optional] |
diff --git a/docs/NewMultipleAudiencesItem.md b/docs/NewMultipleAudiencesItem.md
index febc75d2..52d5f5ae 100644
--- a/docs/NewMultipleAudiencesItem.md
+++ b/docs/NewMultipleAudiencesItem.md
@@ -8,6 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | The human-friendly display name for this audience. | |
+|**subscribedApplicationsIds** | **Set<Long>** | A list of the IDs of the Applications that are connected to this audience. | [optional] |
|**integrationId** | **String** | The ID of this audience in the third-party integration. | [optional] |
diff --git a/docs/NewReward.md b/docs/NewReward.md
index a2e8d10d..5b6aa303 100644
--- a/docs/NewReward.md
+++ b/docs/NewReward.md
@@ -12,6 +12,8 @@
|**description** | **String** | A description of the reward. | [optional] |
|**applicationIds** | **List<Long>** | The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. | |
|**sandbox** | **Boolean** | Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type. | |
+|**rule** | [**List<Rule>**](Rule.md) | Rule to apply. | [optional] |
+|**bindings** | [**List<Binding>**](Binding.md) | A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules. | [optional] |
diff --git a/docs/ResponseContentObject.md b/docs/ResponseContentObject.md
index ac16c2d1..7573fb9c 100644
--- a/docs/ResponseContentObject.md
+++ b/docs/ResponseContentObject.md
@@ -21,6 +21,7 @@
| EVENT | "event" |
| AWARDED_GIVEAWAYS | "awardedGiveaways" |
| RULE_FAILURE_REASONS | "ruleFailureReasons" |
+| CAMPAIGN_ELIGIBILITY | "campaignEligibility" |
diff --git a/docs/Reward.md b/docs/Reward.md
index 446c51e6..3c357c2a 100644
--- a/docs/Reward.md
+++ b/docs/Reward.md
@@ -15,6 +15,8 @@
|**description** | **String** | A description of the reward. | [optional] |
|**applicationIds** | **List<Long>** | The IDs of the Applications this reward is connected to. **Note**: Currently, a reward can only be connected to one Application. | |
|**sandbox** | **Boolean** | Indicates if this is a live or sandbox reward. Rewards of a given type can only be connected to Applications of the same type. | |
+|**rule** | [**List<Rule>**](Rule.md) | Rule to apply. | [optional] |
+|**bindings** | [**List<Binding>**](Binding.md) | A list of named variables created before the reward's rules are evaluated. Each binding pairs a name with a talang expression. The expression is evaluated once and its result is available by name in any rule condition or effect. Bindings must be defined outside of individual rules. | [optional] |
|**status** | [**StatusEnum**](#StatusEnum) | The status of the reward. | |
diff --git a/docs/RuleMetadata.md b/docs/RuleMetadata.md
index 69096ca6..e9376f45 100644
--- a/docs/RuleMetadata.md
+++ b/docs/RuleMetadata.md
@@ -11,6 +11,7 @@
|**displayName** | **String** | A customer-facing name for the rule. | [optional] |
|**displayDescription** | **String** | A customer-facing description that explains the details of the rule. For example, this property can contain details about eligibility requirements, reward timelines, or terms and conditions. | [optional] |
|**relatedData** | **String** | Any additional data associated with the rule, such as an image URL, vendor name, or a content management system (CMS) ID. | [optional] |
+|**eligibility** | **List<Object>** | | [optional] |
diff --git a/docs/UpdateAudience.md b/docs/UpdateAudience.md
index c995dc3a..8d74b165 100644
--- a/docs/UpdateAudience.md
+++ b/docs/UpdateAudience.md
@@ -8,6 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | The human-friendly display name for this audience. | |
+|**subscribedApplicationsIds** | **Set<Long>** | A list of the IDs of the Applications that are connected to this audience. | [optional] |
diff --git a/pom.xml b/pom.xml
index 27478ff4..5badf494 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
talon-one-client
jar
talon-one-client
- 26.08.0
+ 26.08.01
https://github.com/talon-one/talon-one-maven-artifacts
Talon.One unified JAVA SDK. It allows for programmatic access to the integration and management API with their respective authentication strategies
diff --git a/src/main/java/one/talon/ApiClient.java b/src/main/java/one/talon/ApiClient.java
index 9ce06d1b..8f141275 100644
--- a/src/main/java/one/talon/ApiClient.java
+++ b/src/main/java/one/talon/ApiClient.java
@@ -142,7 +142,7 @@ protected void init() {
json = new JSON();
// Set default User-Agent.
- setUserAgent("OpenAPI-Generator/26.08.0/java");
+ setUserAgent("OpenAPI-Generator/26.08.01/java");
authentications = new HashMap();
}
diff --git a/src/main/java/one/talon/Configuration.java b/src/main/java/one/talon/Configuration.java
index 8ac9a302..8b47c89c 100644
--- a/src/main/java/one/talon/Configuration.java
+++ b/src/main/java/one/talon/Configuration.java
@@ -19,7 +19,7 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
public class Configuration {
- public static final String VERSION = "26.08.0";
+ public static final String VERSION = "26.08.01";
private static final AtomicReference defaultApiClient = new AtomicReference<>();
private static volatile Supplier apiClientFactory = ApiClient::new;
diff --git a/src/main/java/one/talon/JSON.java b/src/main/java/one/talon/JSON.java
index 531da1ea..b97c779f 100644
--- a/src/main/java/one/talon/JSON.java
+++ b/src/main/java/one/talon/JSON.java
@@ -207,6 +207,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CampaignDetail.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CampaignEditedNotification.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CampaignEditedNotificationItem.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CampaignEligibility.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CampaignEntity.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CampaignEvaluationGroup.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new one.talon.model.CampaignEvaluationPosition.CustomTypeAdapterFactory());
diff --git a/src/main/java/one/talon/api/ManagementApi.java b/src/main/java/one/talon/api/ManagementApi.java
index 928904c7..da36dbb3 100644
--- a/src/main/java/one/talon/api/ManagementApi.java
+++ b/src/main/java/one/talon/api/ManagementApi.java
@@ -7409,6 +7409,7 @@ public okhttp3.Call exportEffectsAsync(@javax.annotation.Nonnull Long applicatio
* Build call for exportLoyaltyBalance
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
@@ -7423,7 +7424,7 @@ public okhttp3.Call exportEffectsAsync(@javax.annotation.Nonnull Long applicatio
* @deprecated
*/
@Deprecated
- public okhttp3.Call exportLoyaltyBalanceCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ public okhttp3.Call exportLoyaltyBalanceCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
@@ -7453,6 +7454,10 @@ public okhttp3.Call exportLoyaltyBalanceCall(@javax.annotation.Nonnull String lo
localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate));
}
+ if (balances != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("balances", balances));
+ }
+
final String[] localVarAccepts = {
"application/csv"
};
@@ -7474,13 +7479,13 @@ public okhttp3.Call exportLoyaltyBalanceCall(@javax.annotation.Nonnull String lo
@Deprecated
@SuppressWarnings("rawtypes")
- private okhttp3.Call exportLoyaltyBalanceValidateBeforeCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ private okhttp3.Call exportLoyaltyBalanceValidateBeforeCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'loyaltyProgramId' is set
if (loyaltyProgramId == null) {
throw new ApiException("Missing the required parameter 'loyaltyProgramId' when calling exportLoyaltyBalance(Async)");
}
- return exportLoyaltyBalanceCall(loyaltyProgramId, endDate, _callback);
+ return exportLoyaltyBalanceCall(loyaltyProgramId, endDate, balances, _callback);
}
@@ -7489,6 +7494,7 @@ private okhttp3.Call exportLoyaltyBalanceValidateBeforeCall(@javax.annotation.No
* To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files).
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
@@ -7502,8 +7508,8 @@ private okhttp3.Call exportLoyaltyBalanceValidateBeforeCall(@javax.annotation.No
* @deprecated
*/
@Deprecated
- public String exportLoyaltyBalance(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate) throws ApiException {
- ApiResponse localVarResp = exportLoyaltyBalanceWithHttpInfo(loyaltyProgramId, endDate);
+ public String exportLoyaltyBalance(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances) throws ApiException {
+ ApiResponse localVarResp = exportLoyaltyBalanceWithHttpInfo(loyaltyProgramId, endDate, balances);
return localVarResp.getData();
}
@@ -7512,6 +7518,7 @@ public String exportLoyaltyBalance(@javax.annotation.Nonnull String loyaltyProgr
* To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files).
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
@@ -7525,8 +7532,8 @@ public String exportLoyaltyBalance(@javax.annotation.Nonnull String loyaltyProgr
* @deprecated
*/
@Deprecated
- public ApiResponse exportLoyaltyBalanceWithHttpInfo(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate) throws ApiException {
- okhttp3.Call localVarCall = exportLoyaltyBalanceValidateBeforeCall(loyaltyProgramId, endDate, null);
+ public ApiResponse exportLoyaltyBalanceWithHttpInfo(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances) throws ApiException {
+ okhttp3.Call localVarCall = exportLoyaltyBalanceValidateBeforeCall(loyaltyProgramId, endDate, balances, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
@@ -7536,6 +7543,7 @@ public ApiResponse exportLoyaltyBalanceWithHttpInfo(@javax.annotation.No
* To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files).
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -7550,9 +7558,9 @@ public ApiResponse exportLoyaltyBalanceWithHttpInfo(@javax.annotation.No
* @deprecated
*/
@Deprecated
- public okhttp3.Call exportLoyaltyBalanceAsync(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ public okhttp3.Call exportLoyaltyBalanceAsync(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
- okhttp3.Call localVarCall = exportLoyaltyBalanceValidateBeforeCall(loyaltyProgramId, endDate, _callback);
+ okhttp3.Call localVarCall = exportLoyaltyBalanceValidateBeforeCall(loyaltyProgramId, endDate, balances, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
@@ -7561,6 +7569,7 @@ public okhttp3.Call exportLoyaltyBalanceAsync(@javax.annotation.Nonnull String l
* Build call for exportLoyaltyBalances
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. > - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
@@ -7573,7 +7582,7 @@ public okhttp3.Call exportLoyaltyBalanceAsync(@javax.annotation.Nonnull String l
| 401 | Unauthorized | - |
*/
- public okhttp3.Call exportLoyaltyBalancesCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ public okhttp3.Call exportLoyaltyBalancesCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
@@ -7603,6 +7612,10 @@ public okhttp3.Call exportLoyaltyBalancesCall(@javax.annotation.Nonnull String l
localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate));
}
+ if (balances != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("balances", balances));
+ }
+
final String[] localVarAccepts = {
"application/csv"
};
@@ -7623,13 +7636,13 @@ public okhttp3.Call exportLoyaltyBalancesCall(@javax.annotation.Nonnull String l
}
@SuppressWarnings("rawtypes")
- private okhttp3.Call exportLoyaltyBalancesValidateBeforeCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ private okhttp3.Call exportLoyaltyBalancesValidateBeforeCall(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'loyaltyProgramId' is set
if (loyaltyProgramId == null) {
throw new ApiException("Missing the required parameter 'loyaltyProgramId' when calling exportLoyaltyBalances(Async)");
}
- return exportLoyaltyBalancesCall(loyaltyProgramId, endDate, _callback);
+ return exportLoyaltyBalancesCall(loyaltyProgramId, endDate, balances, _callback);
}
@@ -7638,6 +7651,7 @@ private okhttp3.Call exportLoyaltyBalancesValidateBeforeCall(@javax.annotation.N
* Download a CSV file containing the balance of each customer in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subledger, when applicable. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export.
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. > - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
@@ -7649,8 +7663,8 @@ private okhttp3.Call exportLoyaltyBalancesValidateBeforeCall(@javax.annotation.N
| 401 | Unauthorized | - |
*/
- public String exportLoyaltyBalances(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate) throws ApiException {
- ApiResponse localVarResp = exportLoyaltyBalancesWithHttpInfo(loyaltyProgramId, endDate);
+ public String exportLoyaltyBalances(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances) throws ApiException {
+ ApiResponse localVarResp = exportLoyaltyBalancesWithHttpInfo(loyaltyProgramId, endDate, balances);
return localVarResp.getData();
}
@@ -7659,6 +7673,7 @@ public String exportLoyaltyBalances(@javax.annotation.Nonnull String loyaltyProg
* Download a CSV file containing the balance of each customer in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subledger, when applicable. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export.
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. > - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
@@ -7670,8 +7685,8 @@ public String exportLoyaltyBalances(@javax.annotation.Nonnull String loyaltyProg
| 401 | Unauthorized | - |
*/
- public ApiResponse exportLoyaltyBalancesWithHttpInfo(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate) throws ApiException {
- okhttp3.Call localVarCall = exportLoyaltyBalancesValidateBeforeCall(loyaltyProgramId, endDate, null);
+ public ApiResponse exportLoyaltyBalancesWithHttpInfo(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances) throws ApiException {
+ okhttp3.Call localVarCall = exportLoyaltyBalancesValidateBeforeCall(loyaltyProgramId, endDate, balances, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
@@ -7681,6 +7696,7 @@ public ApiResponse exportLoyaltyBalancesWithHttpInfo(@javax.annotation.N
* Download a CSV file containing the balance of each customer in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subledger, when applicable. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export.
* @param loyaltyProgramId The identifier for the loyalty program. (required)
* @param endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. > - This parameter does not affect the `currentTier` field in the CSV file, which shows the customer's tier at the time of export. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. `currentBalance` is always returned. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -7693,9 +7709,9 @@ public ApiResponse exportLoyaltyBalancesWithHttpInfo(@javax.annotation.N
| 401 | Unauthorized | - |
*/
- public okhttp3.Call exportLoyaltyBalancesAsync(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ public okhttp3.Call exportLoyaltyBalancesAsync(@javax.annotation.Nonnull String loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
- okhttp3.Call localVarCall = exportLoyaltyBalancesValidateBeforeCall(loyaltyProgramId, endDate, _callback);
+ okhttp3.Call localVarCall = exportLoyaltyBalancesValidateBeforeCall(loyaltyProgramId, endDate, balances, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
@@ -7704,6 +7720,7 @@ public okhttp3.Call exportLoyaltyBalancesAsync(@javax.annotation.Nonnull String
* Build call for exportLoyaltyCardBalances
* @param 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 endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. **Note:** - The `negativeBalance` value is not supported for card balance exports. - Providing an unsupported or invalid value returns a `400 Bad Request` error. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
@@ -7716,7 +7733,7 @@ public okhttp3.Call exportLoyaltyBalancesAsync(@javax.annotation.Nonnull String
| 401 | Unauthorized | - |
*/
- public okhttp3.Call exportLoyaltyCardBalancesCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ public okhttp3.Call exportLoyaltyCardBalancesCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
@@ -7746,6 +7763,10 @@ public okhttp3.Call exportLoyaltyCardBalancesCall(@javax.annotation.Nonnull Long
localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate));
}
+ if (balances != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("balances", balances));
+ }
+
final String[] localVarAccepts = {
"application/csv"
};
@@ -7766,13 +7787,13 @@ public okhttp3.Call exportLoyaltyCardBalancesCall(@javax.annotation.Nonnull Long
}
@SuppressWarnings("rawtypes")
- private okhttp3.Call exportLoyaltyCardBalancesValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ private okhttp3.Call exportLoyaltyCardBalancesValidateBeforeCall(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'loyaltyProgramId' is set
if (loyaltyProgramId == null) {
throw new ApiException("Missing the required parameter 'loyaltyProgramId' when calling exportLoyaltyCardBalances(Async)");
}
- return exportLoyaltyCardBalancesCall(loyaltyProgramId, endDate, _callback);
+ return exportLoyaltyCardBalancesCall(loyaltyProgramId, endDate, balances, _callback);
}
@@ -7781,6 +7802,7 @@ private okhttp3.Call exportLoyaltyCardBalancesValidateBeforeCall(@javax.annotati
* Download a CSV file containing the balances of all cards in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points.
* @param 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 endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. **Note:** - The `negativeBalance` value is not supported for card balance exports. - Providing an unsupported or invalid value returns a `400 Bad Request` error. (optional)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
@@ -7792,8 +7814,8 @@ private okhttp3.Call exportLoyaltyCardBalancesValidateBeforeCall(@javax.annotati
| 401 | Unauthorized | - |
*/
- public String exportLoyaltyCardBalances(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate) throws ApiException {
- ApiResponse localVarResp = exportLoyaltyCardBalancesWithHttpInfo(loyaltyProgramId, endDate);
+ public String exportLoyaltyCardBalances(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances) throws ApiException {
+ ApiResponse localVarResp = exportLoyaltyCardBalancesWithHttpInfo(loyaltyProgramId, endDate, balances);
return localVarResp.getData();
}
@@ -7802,6 +7824,7 @@ public String exportLoyaltyCardBalances(@javax.annotation.Nonnull Long loyaltyPr
* Download a CSV file containing the balances of all cards in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points.
* @param 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 endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. **Note:** - The `negativeBalance` value is not supported for card balance exports. - Providing an unsupported or invalid value returns a `400 Bad Request` error. (optional)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
@@ -7813,8 +7836,8 @@ public String exportLoyaltyCardBalances(@javax.annotation.Nonnull Long loyaltyPr
| 401 | Unauthorized | - |
*/
- public ApiResponse exportLoyaltyCardBalancesWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate) throws ApiException {
- okhttp3.Call localVarCall = exportLoyaltyCardBalancesValidateBeforeCall(loyaltyProgramId, endDate, null);
+ public ApiResponse exportLoyaltyCardBalancesWithHttpInfo(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances) throws ApiException {
+ okhttp3.Call localVarCall = exportLoyaltyCardBalancesValidateBeforeCall(loyaltyProgramId, endDate, balances, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
@@ -7824,6 +7847,7 @@ public ApiResponse exportLoyaltyCardBalancesWithHttpInfo(@javax.annotati
* Download a CSV file containing the balances of all cards in the loyalty program. > [!tip] If the exported CSV file is too large to view, you can > [split it into multiple files](https://www.google.com/search?q=split+CSV+into+multiple+files). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The identifier of the loyalty card, which must match the regular expression `^[A-Za-z0-9._%+@-]+$`. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points.
* @param 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 endDate Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. > [!note] **Note** > - This must be an RFC3339 timestamp string. > - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting > considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional)
+ * @param balances Filters which balance fields are included in the CSV export. By default, all balance fields are included. When this parameter is provided, only the listed fields contain values and the rest are returned empty. Accepted values: - `currentBalance` - `pendingBalance` - `expiredBalance` - `spentBalance` - `negativeBalance` Multiple values must be provided as a comma-separated list. **Note:** - The `negativeBalance` value is not supported for card balance exports. - Providing an unsupported or invalid value returns a `400 Bad Request` error. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -7836,9 +7860,9 @@ public ApiResponse exportLoyaltyCardBalancesWithHttpInfo(@javax.annotati
| 401 | Unauthorized | - |
*/
- public okhttp3.Call exportLoyaltyCardBalancesAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, final ApiCallback _callback) throws ApiException {
+ public okhttp3.Call exportLoyaltyCardBalancesAsync(@javax.annotation.Nonnull Long loyaltyProgramId, @javax.annotation.Nullable OffsetDateTime endDate, @javax.annotation.Nullable String balances, final ApiCallback _callback) throws ApiException {
- okhttp3.Call localVarCall = exportLoyaltyCardBalancesValidateBeforeCall(loyaltyProgramId, endDate, _callback);
+ okhttp3.Call localVarCall = exportLoyaltyCardBalancesValidateBeforeCall(loyaltyProgramId, endDate, balances, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
diff --git a/src/main/java/one/talon/model/APIError.java b/src/main/java/one/talon/model/APIError.java
index c19286c6..4c8e5c85 100644
--- a/src/main/java/one/talon/model/APIError.java
+++ b/src/main/java/one/talon/model/APIError.java
@@ -126,6 +126,50 @@ public void setSource(@javax.annotation.Nonnull ErrorSource source) {
this.source = source;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the APIError instance itself
+ */
+ public APIError putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -139,12 +183,13 @@ public boolean equals(Object o) {
APIError apIError = (APIError) o;
return Objects.equals(this.title, apIError.title) &&
Objects.equals(this.details, apIError.details) &&
- Objects.equals(this.source, apIError.source);
+ Objects.equals(this.source, apIError.source)&&
+ Objects.equals(this.additionalProperties, apIError.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(title, details, source);
+ return Objects.hash(title, details, source, additionalProperties);
}
@Override
@@ -154,6 +199,7 @@ public String toString() {
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" details: ").append(toIndentedString(details)).append("\n");
sb.append(" source: ").append(toIndentedString(source)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -194,14 +240,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!APIError.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `APIError` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : APIError.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -234,6 +272,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, APIError value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -241,7 +301,28 @@ public void write(JsonWriter out, APIError value) throws IOException {
public APIError read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ APIError instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AcceptCouponEffectProps.java b/src/main/java/one/talon/model/AcceptCouponEffectProps.java
index 4c1776bd..d6197b7f 100644
--- a/src/main/java/one/talon/model/AcceptCouponEffectProps.java
+++ b/src/main/java/one/talon/model/AcceptCouponEffectProps.java
@@ -77,6 +77,50 @@ public void setValue(@javax.annotation.Nonnull String value) {
this.value = value;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AcceptCouponEffectProps instance itself
+ */
+ public AcceptCouponEffectProps putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -88,12 +132,13 @@ public boolean equals(Object o) {
return false;
}
AcceptCouponEffectProps acceptCouponEffectProps = (AcceptCouponEffectProps) o;
- return Objects.equals(this.value, acceptCouponEffectProps.value);
+ return Objects.equals(this.value, acceptCouponEffectProps.value)&&
+ Objects.equals(this.additionalProperties, acceptCouponEffectProps.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(value);
+ return Objects.hash(value, additionalProperties);
}
@Override
@@ -101,6 +146,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AcceptCouponEffectProps {\n");
sb.append(" value: ").append(toIndentedString(value)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -141,14 +187,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AcceptCouponEffectProps.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AcceptCouponEffectProps` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AcceptCouponEffectProps.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -176,6 +214,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AcceptCouponEffectProps value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -183,7 +243,28 @@ public void write(JsonWriter out, AcceptCouponEffectProps value) throws IOExcept
public AcceptCouponEffectProps read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AcceptCouponEffectProps instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AcceptReferralEffectProps.java b/src/main/java/one/talon/model/AcceptReferralEffectProps.java
index 54aecc38..5ed9c928 100644
--- a/src/main/java/one/talon/model/AcceptReferralEffectProps.java
+++ b/src/main/java/one/talon/model/AcceptReferralEffectProps.java
@@ -77,6 +77,50 @@ public void setValue(@javax.annotation.Nonnull String value) {
this.value = value;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AcceptReferralEffectProps instance itself
+ */
+ public AcceptReferralEffectProps putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -88,12 +132,13 @@ public boolean equals(Object o) {
return false;
}
AcceptReferralEffectProps acceptReferralEffectProps = (AcceptReferralEffectProps) o;
- return Objects.equals(this.value, acceptReferralEffectProps.value);
+ return Objects.equals(this.value, acceptReferralEffectProps.value)&&
+ Objects.equals(this.additionalProperties, acceptReferralEffectProps.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(value);
+ return Objects.hash(value, additionalProperties);
}
@Override
@@ -101,6 +146,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AcceptReferralEffectProps {\n");
sb.append(" value: ").append(toIndentedString(value)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -141,14 +187,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AcceptReferralEffectProps.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AcceptReferralEffectProps` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AcceptReferralEffectProps.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -176,6 +214,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AcceptReferralEffectProps value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -183,7 +243,28 @@ public void write(JsonWriter out, AcceptReferralEffectProps value) throws IOExce
public AcceptReferralEffectProps read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AcceptReferralEffectProps instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccessLogEntry.java b/src/main/java/one/talon/model/AccessLogEntry.java
index c2d6710e..95a01d86 100644
--- a/src/main/java/one/talon/model/AccessLogEntry.java
+++ b/src/main/java/one/talon/model/AccessLogEntry.java
@@ -222,6 +222,50 @@ public void setResponsePayload(@javax.annotation.Nonnull String responsePayload)
this.responsePayload = responsePayload;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccessLogEntry instance itself
+ */
+ public AccessLogEntry putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -239,12 +283,13 @@ public boolean equals(Object o) {
Objects.equals(this.requestUri, accessLogEntry.requestUri) &&
Objects.equals(this.time, accessLogEntry.time) &&
Objects.equals(this.requestPayload, accessLogEntry.requestPayload) &&
- Objects.equals(this.responsePayload, accessLogEntry.responsePayload);
+ Objects.equals(this.responsePayload, accessLogEntry.responsePayload)&&
+ Objects.equals(this.additionalProperties, accessLogEntry.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(uuid, status, method, requestUri, time, requestPayload, responsePayload);
+ return Objects.hash(uuid, status, method, requestUri, time, requestPayload, responsePayload, additionalProperties);
}
@Override
@@ -258,6 +303,7 @@ public String toString() {
sb.append(" time: ").append(toIndentedString(time)).append("\n");
sb.append(" requestPayload: ").append(toIndentedString(requestPayload)).append("\n");
sb.append(" responsePayload: ").append(toIndentedString(responsePayload)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -298,14 +344,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccessLogEntry.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccessLogEntry` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccessLogEntry.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -345,6 +383,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccessLogEntry value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -352,7 +412,28 @@ public void write(JsonWriter out, AccessLogEntry value) throws IOException {
public AccessLogEntry read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccessLogEntry instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/Account.java b/src/main/java/one/talon/model/Account.java
index ffb01b23..93a8832d 100644
--- a/src/main/java/one/talon/model/Account.java
+++ b/src/main/java/one/talon/model/Account.java
@@ -538,6 +538,50 @@ public void setAttributes(@javax.annotation.Nullable Object attributes) {
this.attributes = attributes;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the Account instance itself
+ */
+ public Account putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -566,12 +610,13 @@ public boolean equals(Object o) {
Objects.equals(this.userCount, account.userCount) &&
Objects.equals(this.campaignsActiveCount, account.campaignsActiveCount) &&
Objects.equals(this.campaignsInactiveCount, account.campaignsInactiveCount) &&
- Objects.equals(this.attributes, account.attributes);
+ Objects.equals(this.attributes, account.attributes)&&
+ Objects.equals(this.additionalProperties, account.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(id, created, modified, companyName, domainName, state, billingEmail, planName, planExpires, applicationLimit, userLimit, campaignLimit, apiLimit, applicationCount, userCount, campaignsActiveCount, campaignsInactiveCount, attributes);
+ return Objects.hash(id, created, modified, companyName, domainName, state, billingEmail, planName, planExpires, applicationLimit, userLimit, campaignLimit, apiLimit, applicationCount, userCount, campaignsActiveCount, campaignsInactiveCount, attributes, additionalProperties);
}
@Override
@@ -596,6 +641,7 @@ public String toString() {
sb.append(" campaignsActiveCount: ").append(toIndentedString(campaignsActiveCount)).append("\n");
sb.append(" campaignsInactiveCount: ").append(toIndentedString(campaignsInactiveCount)).append("\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -636,14 +682,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!Account.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Account` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Account.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -685,6 +723,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, Account value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -692,7 +752,28 @@ public void write(JsonWriter out, Account value) throws IOException {
public Account read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ Account instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountAdditionalCost.java b/src/main/java/one/talon/model/AccountAdditionalCost.java
index ad1fe5df..5dcb082d 100644
--- a/src/main/java/one/talon/model/AccountAdditionalCost.java
+++ b/src/main/java/one/talon/model/AccountAdditionalCost.java
@@ -310,6 +310,50 @@ public void setType(@javax.annotation.Nullable TypeEnum type) {
this.type = type;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountAdditionalCost instance itself
+ */
+ public AccountAdditionalCost putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -328,12 +372,13 @@ public boolean equals(Object o) {
Objects.equals(this.title, accountAdditionalCost.title) &&
Objects.equals(this.description, accountAdditionalCost.description) &&
Objects.equals(this.subscribedApplicationsIds, accountAdditionalCost.subscribedApplicationsIds) &&
- Objects.equals(this.type, accountAdditionalCost.type);
+ Objects.equals(this.type, accountAdditionalCost.type)&&
+ Objects.equals(this.additionalProperties, accountAdditionalCost.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(id, created, accountId, name, title, description, subscribedApplicationsIds, type);
+ return Objects.hash(id, created, accountId, name, title, description, subscribedApplicationsIds, type, additionalProperties);
}
@Override
@@ -348,6 +393,7 @@ public String toString() {
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" subscribedApplicationsIds: ").append(toIndentedString(subscribedApplicationsIds)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -388,14 +434,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountAdditionalCost.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountAdditionalCost` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountAdditionalCost.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -440,6 +478,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountAdditionalCost value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -447,7 +507,28 @@ public void write(JsonWriter out, AccountAdditionalCost value) throws IOExceptio
public AccountAdditionalCost read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountAdditionalCost instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountAnalytics.java b/src/main/java/one/talon/model/AccountAnalytics.java
index 1e233513..280d83f4 100644
--- a/src/main/java/one/talon/model/AccountAnalytics.java
+++ b/src/main/java/one/talon/model/AccountAnalytics.java
@@ -534,6 +534,50 @@ public void setLastUpdatedAt(@javax.annotation.Nonnull OffsetDateTime lastUpdate
this.lastUpdatedAt = lastUpdatedAt;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountAnalytics instance itself
+ */
+ public AccountAnalytics putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -564,12 +608,13 @@ public boolean equals(Object o) {
Objects.equals(this.webhooks, accountAnalytics.webhooks) &&
Objects.equals(this.loyaltyPrograms, accountAnalytics.loyaltyPrograms) &&
Objects.equals(this.liveLoyaltyPrograms, accountAnalytics.liveLoyaltyPrograms) &&
- Objects.equals(this.lastUpdatedAt, accountAnalytics.lastUpdatedAt);
+ Objects.equals(this.lastUpdatedAt, accountAnalytics.lastUpdatedAt)&&
+ Objects.equals(this.additionalProperties, accountAnalytics.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(applications, liveApplications, sandboxApplications, campaigns, activeCampaigns, liveActiveCampaigns, coupons, activeCoupons, expiredCoupons, referralCodes, activeReferralCodes, expiredReferralCodes, activeRules, users, roles, customAttributes, webhooks, loyaltyPrograms, liveLoyaltyPrograms, lastUpdatedAt);
+ return Objects.hash(applications, liveApplications, sandboxApplications, campaigns, activeCampaigns, liveActiveCampaigns, coupons, activeCoupons, expiredCoupons, referralCodes, activeReferralCodes, expiredReferralCodes, activeRules, users, roles, customAttributes, webhooks, loyaltyPrograms, liveLoyaltyPrograms, lastUpdatedAt, additionalProperties);
}
@Override
@@ -596,6 +641,7 @@ public String toString() {
sb.append(" loyaltyPrograms: ").append(toIndentedString(loyaltyPrograms)).append("\n");
sb.append(" liveLoyaltyPrograms: ").append(toIndentedString(liveLoyaltyPrograms)).append("\n");
sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -636,14 +682,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountAnalytics.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountAnalytics` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountAnalytics.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -668,6 +706,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountAnalytics value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -675,7 +735,28 @@ public void write(JsonWriter out, AccountAnalytics value) throws IOException {
public AccountAnalytics read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountAnalytics instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountDashboardStatistic.java b/src/main/java/one/talon/model/AccountDashboardStatistic.java
index 3efe2f71..c11e274f 100644
--- a/src/main/java/one/talon/model/AccountDashboardStatistic.java
+++ b/src/main/java/one/talon/model/AccountDashboardStatistic.java
@@ -212,6 +212,50 @@ public void setCampaigns(@javax.annotation.Nonnull AccountDashboardStatisticCamp
this.campaigns = campaigns;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountDashboardStatistic instance itself
+ */
+ public AccountDashboardStatistic putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -227,12 +271,13 @@ public boolean equals(Object o) {
Objects.equals(this.discounts, accountDashboardStatistic.discounts) &&
Objects.equals(this.loyaltyPoints, accountDashboardStatistic.loyaltyPoints) &&
Objects.equals(this.referrals, accountDashboardStatistic.referrals) &&
- Objects.equals(this.campaigns, accountDashboardStatistic.campaigns);
+ Objects.equals(this.campaigns, accountDashboardStatistic.campaigns)&&
+ Objects.equals(this.additionalProperties, accountDashboardStatistic.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(revenue, discounts, loyaltyPoints, referrals, campaigns);
+ return Objects.hash(revenue, discounts, loyaltyPoints, referrals, campaigns, additionalProperties);
}
@Override
@@ -244,6 +289,7 @@ public String toString() {
sb.append(" loyaltyPoints: ").append(toIndentedString(loyaltyPoints)).append("\n");
sb.append(" referrals: ").append(toIndentedString(referrals)).append("\n");
sb.append(" campaigns: ").append(toIndentedString(campaigns)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -284,14 +330,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountDashboardStatistic.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountDashboardStatistic` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountDashboardStatistic.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -374,6 +412,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountDashboardStatistic value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -381,7 +441,28 @@ public void write(JsonWriter out, AccountDashboardStatistic value) throws IOExce
public AccountDashboardStatistic read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountDashboardStatistic instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java b/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java
index e099a33c..9489df94 100644
--- a/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java
+++ b/src/main/java/one/talon/model/AccountDashboardStatisticCampaigns.java
@@ -125,6 +125,50 @@ public void setLowOnBudget(@javax.annotation.Nonnull Long lowOnBudget) {
this.lowOnBudget = lowOnBudget;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountDashboardStatisticCampaigns instance itself
+ */
+ public AccountDashboardStatisticCampaigns putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -138,12 +182,13 @@ public boolean equals(Object o) {
AccountDashboardStatisticCampaigns accountDashboardStatisticCampaigns = (AccountDashboardStatisticCampaigns) o;
return Objects.equals(this.live, accountDashboardStatisticCampaigns.live) &&
Objects.equals(this.endingSoon, accountDashboardStatisticCampaigns.endingSoon) &&
- Objects.equals(this.lowOnBudget, accountDashboardStatisticCampaigns.lowOnBudget);
+ Objects.equals(this.lowOnBudget, accountDashboardStatisticCampaigns.lowOnBudget)&&
+ Objects.equals(this.additionalProperties, accountDashboardStatisticCampaigns.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(live, endingSoon, lowOnBudget);
+ return Objects.hash(live, endingSoon, lowOnBudget, additionalProperties);
}
@Override
@@ -153,6 +198,7 @@ public String toString() {
sb.append(" live: ").append(toIndentedString(live)).append("\n");
sb.append(" endingSoon: ").append(toIndentedString(endingSoon)).append("\n");
sb.append(" lowOnBudget: ").append(toIndentedString(lowOnBudget)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -193,14 +239,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountDashboardStatisticCampaigns.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountDashboardStatisticCampaigns` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountDashboardStatisticCampaigns.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -225,6 +263,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountDashboardStatisticCampaigns value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -232,7 +292,28 @@ public void write(JsonWriter out, AccountDashboardStatisticCampaigns value) thro
public AccountDashboardStatisticCampaigns read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountDashboardStatisticCampaigns instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java b/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java
index 333511a2..28df5dcc 100644
--- a/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java
+++ b/src/main/java/one/talon/model/AccountDashboardStatisticDiscount.java
@@ -127,6 +127,50 @@ public void setDatetime(@javax.annotation.Nonnull OffsetDateTime datetime) {
this.datetime = datetime;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountDashboardStatisticDiscount instance itself
+ */
+ public AccountDashboardStatisticDiscount putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -140,12 +184,13 @@ public boolean equals(Object o) {
AccountDashboardStatisticDiscount accountDashboardStatisticDiscount = (AccountDashboardStatisticDiscount) o;
return Objects.equals(this.total, accountDashboardStatisticDiscount.total) &&
Objects.equals(this.average, accountDashboardStatisticDiscount.average) &&
- Objects.equals(this.datetime, accountDashboardStatisticDiscount.datetime);
+ Objects.equals(this.datetime, accountDashboardStatisticDiscount.datetime)&&
+ Objects.equals(this.additionalProperties, accountDashboardStatisticDiscount.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(total, average, datetime);
+ return Objects.hash(total, average, datetime, additionalProperties);
}
@Override
@@ -155,6 +200,7 @@ public String toString() {
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" average: ").append(toIndentedString(average)).append("\n");
sb.append(" datetime: ").append(toIndentedString(datetime)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -195,14 +241,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountDashboardStatisticDiscount.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountDashboardStatisticDiscount` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountDashboardStatisticDiscount.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -227,6 +265,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountDashboardStatisticDiscount value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -234,7 +294,28 @@ public void write(JsonWriter out, AccountDashboardStatisticDiscount value) throw
public AccountDashboardStatisticDiscount read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountDashboardStatisticDiscount instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java b/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java
index 18c491c0..629a8781 100644
--- a/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java
+++ b/src/main/java/one/talon/model/AccountDashboardStatisticLoyaltyPoints.java
@@ -103,6 +103,50 @@ public void setDatetime(@javax.annotation.Nonnull OffsetDateTime datetime) {
this.datetime = datetime;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountDashboardStatisticLoyaltyPoints instance itself
+ */
+ public AccountDashboardStatisticLoyaltyPoints putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -115,12 +159,13 @@ public boolean equals(Object o) {
}
AccountDashboardStatisticLoyaltyPoints accountDashboardStatisticLoyaltyPoints = (AccountDashboardStatisticLoyaltyPoints) o;
return Objects.equals(this.total, accountDashboardStatisticLoyaltyPoints.total) &&
- Objects.equals(this.datetime, accountDashboardStatisticLoyaltyPoints.datetime);
+ Objects.equals(this.datetime, accountDashboardStatisticLoyaltyPoints.datetime)&&
+ Objects.equals(this.additionalProperties, accountDashboardStatisticLoyaltyPoints.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(total, datetime);
+ return Objects.hash(total, datetime, additionalProperties);
}
@Override
@@ -129,6 +174,7 @@ public String toString() {
sb.append("class AccountDashboardStatisticLoyaltyPoints {\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" datetime: ").append(toIndentedString(datetime)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -169,14 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountDashboardStatisticLoyaltyPoints.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountDashboardStatisticLoyaltyPoints` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountDashboardStatisticLoyaltyPoints.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -201,6 +239,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountDashboardStatisticLoyaltyPoints value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -208,7 +268,28 @@ public void write(JsonWriter out, AccountDashboardStatisticLoyaltyPoints value)
public AccountDashboardStatisticLoyaltyPoints read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountDashboardStatisticLoyaltyPoints instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java b/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java
index bf6ce9da..dd2f5ad1 100644
--- a/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java
+++ b/src/main/java/one/talon/model/AccountDashboardStatisticReferrals.java
@@ -103,6 +103,50 @@ public void setDatetime(@javax.annotation.Nonnull OffsetDateTime datetime) {
this.datetime = datetime;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountDashboardStatisticReferrals instance itself
+ */
+ public AccountDashboardStatisticReferrals putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -115,12 +159,13 @@ public boolean equals(Object o) {
}
AccountDashboardStatisticReferrals accountDashboardStatisticReferrals = (AccountDashboardStatisticReferrals) o;
return Objects.equals(this.total, accountDashboardStatisticReferrals.total) &&
- Objects.equals(this.datetime, accountDashboardStatisticReferrals.datetime);
+ Objects.equals(this.datetime, accountDashboardStatisticReferrals.datetime)&&
+ Objects.equals(this.additionalProperties, accountDashboardStatisticReferrals.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(total, datetime);
+ return Objects.hash(total, datetime, additionalProperties);
}
@Override
@@ -129,6 +174,7 @@ public String toString() {
sb.append("class AccountDashboardStatisticReferrals {\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" datetime: ").append(toIndentedString(datetime)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -169,14 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountDashboardStatisticReferrals.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountDashboardStatisticReferrals` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountDashboardStatisticReferrals.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -201,6 +239,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountDashboardStatisticReferrals value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -208,7 +268,28 @@ public void write(JsonWriter out, AccountDashboardStatisticReferrals value) thro
public AccountDashboardStatisticReferrals read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountDashboardStatisticReferrals instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java b/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java
index 4b1fcee2..eff85d20 100644
--- a/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java
+++ b/src/main/java/one/talon/model/AccountDashboardStatisticRevenue.java
@@ -127,6 +127,50 @@ public void setDatetime(@javax.annotation.Nonnull OffsetDateTime datetime) {
this.datetime = datetime;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountDashboardStatisticRevenue instance itself
+ */
+ public AccountDashboardStatisticRevenue putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -140,12 +184,13 @@ public boolean equals(Object o) {
AccountDashboardStatisticRevenue accountDashboardStatisticRevenue = (AccountDashboardStatisticRevenue) o;
return Objects.equals(this.total, accountDashboardStatisticRevenue.total) &&
Objects.equals(this.influenced, accountDashboardStatisticRevenue.influenced) &&
- Objects.equals(this.datetime, accountDashboardStatisticRevenue.datetime);
+ Objects.equals(this.datetime, accountDashboardStatisticRevenue.datetime)&&
+ Objects.equals(this.additionalProperties, accountDashboardStatisticRevenue.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(total, influenced, datetime);
+ return Objects.hash(total, influenced, datetime, additionalProperties);
}
@Override
@@ -155,6 +200,7 @@ public String toString() {
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" influenced: ").append(toIndentedString(influenced)).append("\n");
sb.append(" datetime: ").append(toIndentedString(datetime)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -195,14 +241,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountDashboardStatisticRevenue.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountDashboardStatisticRevenue` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountDashboardStatisticRevenue.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -227,6 +265,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountDashboardStatisticRevenue value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -234,7 +294,28 @@ public void write(JsonWriter out, AccountDashboardStatisticRevenue value) throws
public AccountDashboardStatisticRevenue read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountDashboardStatisticRevenue instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountEntity.java b/src/main/java/one/talon/model/AccountEntity.java
index 6025e010..ef306c59 100644
--- a/src/main/java/one/talon/model/AccountEntity.java
+++ b/src/main/java/one/talon/model/AccountEntity.java
@@ -77,6 +77,50 @@ public void setAccountId(@javax.annotation.Nonnull Long accountId) {
this.accountId = accountId;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountEntity instance itself
+ */
+ public AccountEntity putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -88,12 +132,13 @@ public boolean equals(Object o) {
return false;
}
AccountEntity accountEntity = (AccountEntity) o;
- return Objects.equals(this.accountId, accountEntity.accountId);
+ return Objects.equals(this.accountId, accountEntity.accountId)&&
+ Objects.equals(this.additionalProperties, accountEntity.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(accountId);
+ return Objects.hash(accountId, additionalProperties);
}
@Override
@@ -101,6 +146,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AccountEntity {\n");
sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -141,14 +187,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountEntity.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountEntity` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountEntity.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -173,6 +211,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountEntity value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -180,7 +240,28 @@ public void write(JsonWriter out, AccountEntity value) throws IOException {
public AccountEntity read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountEntity instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AccountLimits.java b/src/main/java/one/talon/model/AccountLimits.java
index 43a3feae..bbb53d7f 100644
--- a/src/main/java/one/talon/model/AccountLimits.java
+++ b/src/main/java/one/talon/model/AccountLimits.java
@@ -399,6 +399,50 @@ public void setCurrencyCode(@javax.annotation.Nonnull String currencyCode) {
this.currencyCode = currencyCode;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AccountLimits instance itself
+ */
+ public AccountLimits putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -423,12 +467,13 @@ public boolean equals(Object o) {
Objects.equals(this.apiVolume, accountLimits.apiVolume) &&
Objects.equals(this.promotionTypes, accountLimits.promotionTypes) &&
Objects.equals(this.secondaryDeploymentPrice, accountLimits.secondaryDeploymentPrice) &&
- Objects.equals(this.currencyCode, accountLimits.currencyCode);
+ Objects.equals(this.currencyCode, accountLimits.currencyCode)&&
+ Objects.equals(this.additionalProperties, accountLimits.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(liveApplications, sandboxApplications, activeCampaigns, coupons, referralCodes, activeRules, liveLoyaltyPrograms, sandboxLoyaltyPrograms, webhooks, users, apiVolume, promotionTypes, secondaryDeploymentPrice, currencyCode);
+ return Objects.hash(liveApplications, sandboxApplications, activeCampaigns, coupons, referralCodes, activeRules, liveLoyaltyPrograms, sandboxLoyaltyPrograms, webhooks, users, apiVolume, promotionTypes, secondaryDeploymentPrice, currencyCode, additionalProperties);
}
@Override
@@ -449,6 +494,7 @@ public String toString() {
sb.append(" promotionTypes: ").append(toIndentedString(promotionTypes)).append("\n");
sb.append(" secondaryDeploymentPrice: ").append(toIndentedString(secondaryDeploymentPrice)).append("\n");
sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -489,14 +535,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AccountLimits.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AccountLimits` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountLimits.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -530,6 +568,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountLimits value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -537,7 +597,28 @@ public void write(JsonWriter out, AccountLimits value) throws IOException {
public AccountLimits read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AccountLimits instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/Achievement.java b/src/main/java/one/talon/model/Achievement.java
index 268b7d3b..8efd59d4 100644
--- a/src/main/java/one/talon/model/Achievement.java
+++ b/src/main/java/one/talon/model/Achievement.java
@@ -655,6 +655,50 @@ public void setStatus(@javax.annotation.Nullable StatusEnum status) {
this.status = status;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the Achievement instance itself
+ */
+ public Achievement putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -683,12 +727,13 @@ public boolean equals(Object o) {
Objects.equals(this.userId, achievement.userId) &&
Objects.equals(this.createdBy, achievement.createdBy) &&
Objects.equals(this.hasProgress, achievement.hasProgress) &&
- Objects.equals(this.status, achievement.status);
+ Objects.equals(this.status, achievement.status)&&
+ Objects.equals(this.additionalProperties, achievement.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(id, created, name, title, description, target, period, periodEndOverride, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, campaignId, userId, createdBy, hasProgress, status);
+ return Objects.hash(id, created, name, title, description, target, period, periodEndOverride, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, campaignId, userId, createdBy, hasProgress, status, additionalProperties);
}
@Override
@@ -713,6 +758,7 @@ public String toString() {
sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
sb.append(" hasProgress: ").append(toIndentedString(hasProgress)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -753,14 +799,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!Achievement.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Achievement` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Achievement.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -825,6 +863,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, Achievement value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -832,7 +892,28 @@ public void write(JsonWriter out, Achievement value) throws IOException {
public Achievement read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ Achievement instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AchievementAdditionalProperties.java b/src/main/java/one/talon/model/AchievementAdditionalProperties.java
index bafddce9..d34697dd 100644
--- a/src/main/java/one/talon/model/AchievementAdditionalProperties.java
+++ b/src/main/java/one/talon/model/AchievementAdditionalProperties.java
@@ -229,6 +229,50 @@ public void setStatus(@javax.annotation.Nullable StatusEnum status) {
this.status = status;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AchievementAdditionalProperties instance itself
+ */
+ public AchievementAdditionalProperties putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -244,12 +288,13 @@ public boolean equals(Object o) {
Objects.equals(this.userId, achievementAdditionalProperties.userId) &&
Objects.equals(this.createdBy, achievementAdditionalProperties.createdBy) &&
Objects.equals(this.hasProgress, achievementAdditionalProperties.hasProgress) &&
- Objects.equals(this.status, achievementAdditionalProperties.status);
+ Objects.equals(this.status, achievementAdditionalProperties.status)&&
+ Objects.equals(this.additionalProperties, achievementAdditionalProperties.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(campaignId, userId, createdBy, hasProgress, status);
+ return Objects.hash(campaignId, userId, createdBy, hasProgress, status, additionalProperties);
}
@Override
@@ -261,6 +306,7 @@ public String toString() {
sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
sb.append(" hasProgress: ").append(toIndentedString(hasProgress)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -301,14 +347,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AchievementAdditionalProperties.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AchievementAdditionalProperties` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AchievementAdditionalProperties.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -343,6 +381,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AchievementAdditionalProperties value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -350,7 +410,28 @@ public void write(JsonWriter out, AchievementAdditionalProperties value) throws
public AchievementAdditionalProperties read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AchievementAdditionalProperties instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java b/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java
index d736ea4e..86eaed93 100644
--- a/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java
+++ b/src/main/java/one/talon/model/AchievementAdditionalPropertiesV2.java
@@ -205,6 +205,50 @@ public void setStatus(@javax.annotation.Nullable StatusEnum status) {
this.status = status;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AchievementAdditionalPropertiesV2 instance itself
+ */
+ public AchievementAdditionalPropertiesV2 putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -219,12 +263,13 @@ public boolean equals(Object o) {
return Objects.equals(this.userId, achievementAdditionalPropertiesV2.userId) &&
Objects.equals(this.createdBy, achievementAdditionalPropertiesV2.createdBy) &&
Objects.equals(this.hasProgress, achievementAdditionalPropertiesV2.hasProgress) &&
- Objects.equals(this.status, achievementAdditionalPropertiesV2.status);
+ Objects.equals(this.status, achievementAdditionalPropertiesV2.status)&&
+ Objects.equals(this.additionalProperties, achievementAdditionalPropertiesV2.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(userId, createdBy, hasProgress, status);
+ return Objects.hash(userId, createdBy, hasProgress, status, additionalProperties);
}
@Override
@@ -235,6 +280,7 @@ public String toString() {
sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
sb.append(" hasProgress: ").append(toIndentedString(hasProgress)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -275,14 +321,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AchievementAdditionalPropertiesV2.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AchievementAdditionalPropertiesV2` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AchievementAdditionalPropertiesV2.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -317,6 +355,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AchievementAdditionalPropertiesV2 value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -324,7 +384,28 @@ public void write(JsonWriter out, AchievementAdditionalPropertiesV2 value) throw
public AchievementAdditionalPropertiesV2 read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AchievementAdditionalPropertiesV2 instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AchievementBase.java b/src/main/java/one/talon/model/AchievementBase.java
index a03e8088..c3861c6a 100644
--- a/src/main/java/one/talon/model/AchievementBase.java
+++ b/src/main/java/one/talon/model/AchievementBase.java
@@ -431,6 +431,50 @@ public void setAllowRollbackAfterCompletion(@javax.annotation.Nullable Boolean a
this.allowRollbackAfterCompletion = allowRollbackAfterCompletion;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AchievementBase instance itself
+ */
+ public AchievementBase putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -452,12 +496,13 @@ public boolean equals(Object o) {
Objects.equals(this.activationPolicy, achievementBase.activationPolicy) &&
Objects.equals(this.fixedStartDate, achievementBase.fixedStartDate) &&
Objects.equals(this.endDate, achievementBase.endDate) &&
- Objects.equals(this.allowRollbackAfterCompletion, achievementBase.allowRollbackAfterCompletion);
+ Objects.equals(this.allowRollbackAfterCompletion, achievementBase.allowRollbackAfterCompletion)&&
+ Objects.equals(this.additionalProperties, achievementBase.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(name, title, description, target, period, periodEndOverride, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion);
+ return Objects.hash(name, title, description, target, period, periodEndOverride, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, additionalProperties);
}
@Override
@@ -475,6 +520,7 @@ public String toString() {
sb.append(" fixedStartDate: ").append(toIndentedString(fixedStartDate)).append("\n");
sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n");
sb.append(" allowRollbackAfterCompletion: ").append(toIndentedString(allowRollbackAfterCompletion)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -514,14 +560,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AchievementBase is not found in the empty JSON string", AchievementBase.openapiRequiredFields.toString()));
}
}
-
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AchievementBase.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AchievementBase` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@@ -570,6 +608,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AchievementBase value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -577,7 +637,28 @@ public void write(JsonWriter out, AchievementBase value) throws IOException {
public AchievementBase read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AchievementBase instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AchievementBaseV2.java b/src/main/java/one/talon/model/AchievementBaseV2.java
index 12b308af..9d722b20 100644
--- a/src/main/java/one/talon/model/AchievementBaseV2.java
+++ b/src/main/java/one/talon/model/AchievementBaseV2.java
@@ -483,6 +483,50 @@ public void setTimezone(@javax.annotation.Nullable String timezone) {
this.timezone = timezone;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AchievementBaseV2 instance itself
+ */
+ public AchievementBaseV2 putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -506,12 +550,13 @@ public boolean equals(Object o) {
Objects.equals(this.allowRollbackAfterCompletion, achievementBaseV2.allowRollbackAfterCompletion) &&
Objects.equals(this.sandbox, achievementBaseV2.sandbox) &&
Objects.equals(this.subscribedApplications, achievementBaseV2.subscribedApplications) &&
- Objects.equals(this.timezone, achievementBaseV2.timezone);
+ Objects.equals(this.timezone, achievementBaseV2.timezone)&&
+ Objects.equals(this.additionalProperties, achievementBaseV2.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, sandbox, subscribedApplications, timezone);
+ return Objects.hash(name, title, description, target, period, recurrencePolicy, activationPolicy, fixedStartDate, endDate, allowRollbackAfterCompletion, sandbox, subscribedApplications, timezone, additionalProperties);
}
@Override
@@ -531,6 +576,7 @@ public String toString() {
sb.append(" sandbox: ").append(toIndentedString(sandbox)).append("\n");
sb.append(" subscribedApplications: ").append(toIndentedString(subscribedApplications)).append("\n");
sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -570,14 +616,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in AchievementBaseV2 is not found in the empty JSON string", AchievementBaseV2.openapiRequiredFields.toString()));
}
}
-
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AchievementBaseV2.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AchievementBaseV2` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@@ -629,6 +667,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AchievementBaseV2 value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -636,7 +696,28 @@ public void write(JsonWriter out, AchievementBaseV2 value) throws IOException {
public AchievementBaseV2 read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AchievementBaseV2 instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AchievementProgress.java b/src/main/java/one/talon/model/AchievementProgress.java
index 4e676513..2328e488 100644
--- a/src/main/java/one/talon/model/AchievementProgress.java
+++ b/src/main/java/one/talon/model/AchievementProgress.java
@@ -231,6 +231,50 @@ public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) {
this.endDate = endDate;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AchievementProgress instance itself
+ */
+ public AchievementProgress putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -246,12 +290,13 @@ public boolean equals(Object o) {
Objects.equals(this.progress, achievementProgress.progress) &&
Objects.equals(this.startDate, achievementProgress.startDate) &&
Objects.equals(this.completionDate, achievementProgress.completionDate) &&
- Objects.equals(this.endDate, achievementProgress.endDate);
+ Objects.equals(this.endDate, achievementProgress.endDate)&&
+ Objects.equals(this.additionalProperties, achievementProgress.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(status, progress, startDate, completionDate, endDate);
+ return Objects.hash(status, progress, startDate, completionDate, endDate, additionalProperties);
}
@Override
@@ -263,6 +308,7 @@ public String toString() {
sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n");
sb.append(" completionDate: ").append(toIndentedString(completionDate)).append("\n");
sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -303,14 +349,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AchievementProgress.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AchievementProgress` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AchievementProgress.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -340,6 +378,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AchievementProgress value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -347,7 +407,28 @@ public void write(JsonWriter out, AchievementProgress value) throws IOException
public AchievementProgress read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AchievementProgress instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AchievementProgressWithDefinition.java b/src/main/java/one/talon/model/AchievementProgressWithDefinition.java
index 0f5c95c6..29ffe842 100644
--- a/src/main/java/one/talon/model/AchievementProgressWithDefinition.java
+++ b/src/main/java/one/talon/model/AchievementProgressWithDefinition.java
@@ -601,6 +601,50 @@ public void setAchievementAllowRollbackAfterCompletion(@javax.annotation.Nullabl
this.achievementAllowRollbackAfterCompletion = achievementAllowRollbackAfterCompletion;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ *
+ * @param key name of the property
+ * @param value value of the property
+ * @return the AchievementProgressWithDefinition instance itself
+ */
+ public AchievementProgressWithDefinition putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return a map of objects
+ */
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key name of the property
+ * @return an object
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
@Override
@@ -627,12 +671,13 @@ public boolean equals(Object o) {
Objects.equals(this.achievementActivationPolicy, achievementProgressWithDefinition.achievementActivationPolicy) &&
Objects.equals(this.achievementFixedStartDate, achievementProgressWithDefinition.achievementFixedStartDate) &&
Objects.equals(this.achievementEndDate, achievementProgressWithDefinition.achievementEndDate) &&
- Objects.equals(this.achievementAllowRollbackAfterCompletion, achievementProgressWithDefinition.achievementAllowRollbackAfterCompletion);
+ Objects.equals(this.achievementAllowRollbackAfterCompletion, achievementProgressWithDefinition.achievementAllowRollbackAfterCompletion)&&
+ Objects.equals(this.additionalProperties, achievementProgressWithDefinition.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(status, progress, startDate, completionDate, endDate, achievementId, name, title, description, campaignId, target, achievementRecurrencePolicy, achievementActivationPolicy, achievementFixedStartDate, achievementEndDate, achievementAllowRollbackAfterCompletion);
+ return Objects.hash(status, progress, startDate, completionDate, endDate, achievementId, name, title, description, campaignId, target, achievementRecurrencePolicy, achievementActivationPolicy, achievementFixedStartDate, achievementEndDate, achievementAllowRollbackAfterCompletion, additionalProperties);
}
@Override
@@ -655,6 +700,7 @@ public String toString() {
sb.append(" achievementFixedStartDate: ").append(toIndentedString(achievementFixedStartDate)).append("\n");
sb.append(" achievementEndDate: ").append(toIndentedString(achievementEndDate)).append("\n");
sb.append(" achievementAllowRollbackAfterCompletion: ").append(toIndentedString(achievementAllowRollbackAfterCompletion)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -695,14 +741,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
- Set> entries = jsonElement.getAsJsonObject().entrySet();
- // check to see if the JSON string contains additional fields
- for (Map.Entry entry : entries) {
- if (!AchievementProgressWithDefinition.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AchievementProgressWithDefinition` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AchievementProgressWithDefinition.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -751,6 +789,28 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AchievementProgressWithDefinition value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
+ obj.remove("additionalProperties");
+ // serialize additional properties
+ if (value.getAdditionalProperties() != null) {
+ for (Map.Entry entry : value.getAdditionalProperties().entrySet()) {
+ if (entry.getValue() instanceof String)
+ obj.addProperty(entry.getKey(), (String) entry.getValue());
+ else if (entry.getValue() instanceof Number)
+ obj.addProperty(entry.getKey(), (Number) entry.getValue());
+ else if (entry.getValue() instanceof Boolean)
+ obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
+ else if (entry.getValue() instanceof Character)
+ obj.addProperty(entry.getKey(), (Character) entry.getValue());
+ else {
+ JsonElement jsonElement = gson.toJsonTree(entry.getValue());
+ if (jsonElement.isJsonArray()) {
+ obj.add(entry.getKey(), jsonElement.getAsJsonArray());
+ } else {
+ obj.add(entry.getKey(), jsonElement.getAsJsonObject());
+ }
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -758,7 +818,28 @@ public void write(JsonWriter out, AchievementProgressWithDefinition value) throw
public AchievementProgressWithDefinition read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
- return thisAdapter.fromJsonTree(jsonElement);
+ JsonObject jsonObj = jsonElement.getAsJsonObject();
+ // store additional fields in the deserialized instance
+ AchievementProgressWithDefinition instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/one/talon/model/AchievementReference.java b/src/main/java/one/talon/model/AchievementReference.java
index 17cf4118..f1979a96 100644
--- a/src/main/java/one/talon/model/AchievementReference.java
+++ b/src/main/java/one/talon/model/AchievementReference.java
@@ -149,6 +149,50 @@ public void setCampaignId(@javax.annotation.Nonnull Long campaignId) {
this.campaignId = campaignId;
}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map