Skip to content

Commit 1aec9ed

Browse files
authored
add subdomain support and JSON payload support (#87)
1 parent 1c78dd9 commit 1aec9ed

19 files changed

Lines changed: 383 additions & 20 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### v4.2.0 (2026-02-16)
2+
* * *
3+
4+
### New Features:
5+
* Added subdomain routing support for API requests.
6+
* Added JSON request body support for applicable APIs.
7+
18
### v4.1.1 (2026-02-10)
29
* * *
310
### Bug Fixes:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.1
1+
4.2.0

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "com.chargebee"
10-
version = "4.1.1"
10+
version = "4.2.0"
1111
description = "Java client library for ChargeBee"
1212

1313
// Project metadata

src/main/java/com/chargebee/v4/client/ChargebeeClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public String getBaseUrl() {
103103
}
104104
return String.format("%s://%s.%s/api/v2", protocol, siteName, domainSuffix);
105105
}
106-
106+
107107
/**
108108
* Send a GET request to the specified path.
109109
*
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* This file is auto-generated by Chargebee.
3+
* Copyright 2026 Chargebee Inc.
4+
*/
5+
6+
package com.chargebee.v4.internal;
7+
8+
/** Subdomain identifiers for routing API operations to the correct service endpoint. */
9+
public enum SubDomain {
10+
INGEST("ingest"),
11+
12+
FILE_INGEST("file-ingest"),
13+
14+
GROW("grow");
15+
16+
private final String value;
17+
18+
SubDomain(String value) {
19+
this.value = value;
20+
}
21+
22+
/**
23+
* Get the string value of this subdomain.
24+
*
25+
* @return the subdomain string value
26+
*/
27+
public String getValue() {
28+
return value;
29+
}
30+
}

src/main/java/com/chargebee/v4/models/offerEvent/params/OfferEventsParams.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package com.chargebee.v4.models.offerEvent.params;
88

99
import com.chargebee.v4.internal.Recommended;
10+
import com.chargebee.v4.internal.JsonUtil;
1011

1112
import java.util.LinkedHashMap;
1213
import java.util.Map;
@@ -49,6 +50,11 @@ public Map<String, Object> toFormData() {
4950
return formData;
5051
}
5152

53+
/** Get the JSON string representation for this request. */
54+
public String toJsonString() {
55+
return JsonUtil.toJson(toFormData());
56+
}
57+
5258
/** Create a new builder for OfferEventsParams. */
5359
@Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
5460
public static OfferEventsBuilder builder() {

src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsParams.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package com.chargebee.v4.models.offerFulfillment.params;
88

99
import com.chargebee.v4.internal.Recommended;
10+
import com.chargebee.v4.internal.JsonUtil;
1011

1112
import java.util.LinkedHashMap;
1213
import java.util.Map;
@@ -49,6 +50,11 @@ public Map<String, Object> toFormData() {
4950
return formData;
5051
}
5152

53+
/** Get the JSON string representation for this request. */
54+
public String toJsonString() {
55+
return JsonUtil.toJson(toFormData());
56+
}
57+
5258
/** Create a new builder for OfferFulfillmentsParams. */
5359
@Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
5460
public static OfferFulfillmentsBuilder builder() {

src/main/java/com/chargebee/v4/models/offerFulfillment/params/OfferFulfillmentsUpdateParams.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package com.chargebee.v4.models.offerFulfillment.params;
88

99
import com.chargebee.v4.internal.Recommended;
10+
import com.chargebee.v4.internal.JsonUtil;
1011

1112
import java.util.LinkedHashMap;
1213
import java.util.Map;
@@ -62,6 +63,11 @@ public Map<String, Object> toFormData() {
6263
return formData;
6364
}
6465

66+
/** Get the JSON string representation for this request. */
67+
public String toJsonString() {
68+
return JsonUtil.toJson(toFormData());
69+
}
70+
6571
/** Create a new builder for OfferFulfillmentsUpdateParams. */
6672
@Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
6773
public static OfferFulfillmentsUpdateBuilder builder() {

src/main/java/com/chargebee/v4/models/personalizedOffer/params/PersonalizedOffersParams.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ public Map<String, Object> toFormData() {
147147
return formData;
148148
}
149149

150+
/** Get the JSON string representation for this request. */
151+
public String toJsonString() {
152+
return JsonUtil.toJson(toFormData());
153+
}
154+
150155
/** Create a new builder for PersonalizedOffersParams. */
151156
@Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
152157
public static PersonalizedOffersBuilder builder() {
@@ -302,6 +307,11 @@ public Map<String, Object> toFormData() {
302307
return formData;
303308
}
304309

310+
/** Get the JSON string representation for this request. */
311+
public String toJsonString() {
312+
return JsonUtil.toJson(toFormData());
313+
}
314+
305315
/** Create a new builder for RequestContextParams. */
306316
@Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
307317
public static RequestContextBuilder builder() {

src/main/java/com/chargebee/v4/models/usageEvent/params/UsageEventBatchIngestParams.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public Map<String, Object> toFormData() {
4949
return formData;
5050
}
5151

52+
/** Get the JSON string representation for this request. */
53+
public String toJsonString() {
54+
return JsonUtil.toJson(toFormData());
55+
}
56+
5257
/** Create a new builder for UsageEventBatchIngestParams. */
5358
@Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
5459
public static UsageEventBatchIngestBuilder builder() {
@@ -135,6 +140,11 @@ public Map<String, Object> toFormData() {
135140
return formData;
136141
}
137142

143+
/** Get the JSON string representation for this request. */
144+
public String toJsonString() {
145+
return JsonUtil.toJson(toFormData());
146+
}
147+
138148
/** Create a new builder for EventsParams. */
139149
@Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
140150
public static EventsBuilder builder() {

0 commit comments

Comments
 (0)