diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 86c7ead3..0ea288c3 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- jdk: ['8', '11', '17']
+ jdk: ['11', '17']
steps:
- uses: actions/checkout@v4
diff --git a/README.md b/README.md
index 59c95b31..4bebb2d3 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ The v4 SDK provides a modern, immutable client with enhanced type safety and imp
#### Gradle (Kotlin DSL)
```kotlin
dependencies {
- implementation("com.chargebee:chargebee-java:4.0.0")
+ implementation("com.chargebee:chargebee-java:4.0.0-beta.3")
}
```
@@ -56,7 +56,7 @@ dependencies {
com.chargebee
chargebee-java
- 4.0.0
+ 4.0.0-beta.3
```
@@ -221,23 +221,29 @@ The library provides a comprehensive exception hierarchy with **strongly-typed e
#### Exception Hierarchy
-All Chargebee exceptions extend from `TransportException`, which is a checked exception:
+All Chargebee exceptions extend from `ChargebeeException`, which is an unchecked exception:
```
-TransportException (checked)
- └── HttpException (HTTP status code errors: 4xx, 5xx)
- ├── ClientErrorException (4xx errors)
- ├── ServerErrorException (5xx errors)
- └── APIException (Chargebee API errors)
- ├── InvalidRequestException (validation errors)
- ├── PaymentException (payment-related errors)
- ├── OperationFailedException (business logic errors)
- ├── BatchAPIException (batch operation errors)
- └── UbbBatchIngestionInvalidRequestException (batch ingestion errors)
+ChargebeeException (unchecked - extends RuntimeException)
+├── ConfigurationException (setup/config errors)
+└── TransportException (runtime API errors)
+ ├── NetworkException (DNS failures, connection refused)
+ ├── TimeoutException (connect/read timeouts)
+ └── HttpException (HTTP status code errors: 4xx, 5xx)
+ ├── ClientErrorException (4xx errors)
+ ├── ServerErrorException (5xx errors)
+ └── APIException (Chargebee API errors)
+ ├── InvalidRequestException (validation errors)
+ ├── PaymentException (payment-related errors)
+ ├── OperationFailedException (business logic errors)
+ ├── BatchAPIException (batch operation errors)
+ └── UbbBatchIngestionInvalidRequestException (batch ingestion errors)
```
#### Exception Types
+- **`ChargebeeException`**: Base exception for all SDK errors - catch-all for any Chargebee SDK error
+- **`ConfigurationException`**: Thrown when SDK configuration is invalid (missing API key, invalid URL, etc.)
- **`TransportException`**: Base exception for all transport-layer failures (network issues, timeouts, etc.)
- **`HttpException`**: Thrown for HTTP error status codes (4xx, 5xx) - contains status code and response
- **`ClientErrorException`**: HTTP 4xx client errors (bad request, unauthorized, not found, etc.)
diff --git a/build.gradle.kts b/build.gradle.kts
index 70f6085a..320f4f89 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -6,7 +6,7 @@ plugins {
}
group = "com.chargebee"
-version = "4.0.0"
+version = "4.0.0-beta.3"
description = "Next-gen Java client library for ChargeBee API"
// Project metadata
@@ -30,8 +30,8 @@ extra["projectLicenseUrl"] = projectLicenseUrl
extra["teamMembers"] = teamMembers
java {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}
diff --git a/dist/chargebee-java-4.0.0-beta.3-javadoc.jar b/dist/chargebee-java-4.0.0-beta.3-javadoc.jar
new file mode 100644
index 00000000..5c05ee79
Binary files /dev/null and b/dist/chargebee-java-4.0.0-beta.3-javadoc.jar differ
diff --git a/dist/chargebee-java-4.0.0-beta.3-sources.jar b/dist/chargebee-java-4.0.0-beta.3-sources.jar
new file mode 100644
index 00000000..eb31cdb9
Binary files /dev/null and b/dist/chargebee-java-4.0.0-beta.3-sources.jar differ
diff --git a/dist/chargebee-java-4.0.0-beta.3.jar b/dist/chargebee-java-4.0.0-beta.3.jar
new file mode 100644
index 00000000..3fcd16e7
Binary files /dev/null and b/dist/chargebee-java-4.0.0-beta.3.jar differ
diff --git a/dist/chargebee-java-4.0.0-javadoc.jar b/dist/chargebee-java-4.0.0-javadoc.jar
deleted file mode 100644
index 59936db5..00000000
Binary files a/dist/chargebee-java-4.0.0-javadoc.jar and /dev/null differ
diff --git a/dist/chargebee-java-4.0.0-sources.jar b/dist/chargebee-java-4.0.0-sources.jar
deleted file mode 100644
index 30293d52..00000000
Binary files a/dist/chargebee-java-4.0.0-sources.jar and /dev/null differ
diff --git a/dist/chargebee-java-4.0.0.jar b/dist/chargebee-java-4.0.0.jar
deleted file mode 100644
index fbe07643..00000000
Binary files a/dist/chargebee-java-4.0.0.jar and /dev/null differ
diff --git a/docs/MIGRATION_GUIDE.md b/docs/MIGRATION_GUIDE.md
index eb2d03d8..d3fc11e5 100644
--- a/docs/MIGRATION_GUIDE.md
+++ b/docs/MIGRATION_GUIDE.md
@@ -34,7 +34,7 @@ The v4 SDK provides a modern, immutable client with enhanced type safety and imp
com.chargebee
chargebee-java
- 4.0.0
+ 4.0.0-beta.3
```
diff --git a/src/main/java/com/chargebee/v4/client/ChargebeeClient.java b/src/main/java/com/chargebee/v4/client/ChargebeeClient.java
index 0de6c4ab..a5ec524e 100644
--- a/src/main/java/com/chargebee/v4/client/ChargebeeClient.java
+++ b/src/main/java/com/chargebee/v4/client/ChargebeeClient.java
@@ -3,6 +3,7 @@
import com.chargebee.v4.client.request.RequestContext;
import com.chargebee.v4.client.request.RequestInterceptor;
import com.chargebee.v4.client.request.RequestWrap;
+import com.chargebee.v4.exceptions.ChargebeeException;
import com.chargebee.v4.exceptions.ConfigurationException;
import com.chargebee.v4.exceptions.NetworkException;
import com.chargebee.v4.exceptions.TimeoutException;
@@ -109,9 +110,9 @@ public String getBaseUrl() {
* @param path the API path (e.g., "/customers")
* @param queryParams optional query parameters
* @return the HTTP response
- * @throws Exception for network, timeout, configuration failures, or interceptor errors
+ * @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
- public Response get(String path, Map> queryParams) throws Exception {
+ public Response get(String path, Map> queryParams) throws ChargebeeException {
Map objectParams = new HashMap<>(queryParams);
String fullUrl = UrlBuilder.buildUrl(getBaseUrl(), path, objectParams);
Request.Builder builder = Request.builder()
@@ -130,9 +131,9 @@ public Response get(String path, Map> queryParams) throws E
*
* @param path the API path (e.g., "/customers")
* @return the HTTP response
- * @throws Exception for network, timeout, configuration failures, or interceptor errors
+ * @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
- public Response get(String path) throws Exception {
+ public Response get(String path) throws ChargebeeException {
return get(path, Collections.emptyMap());
}
@@ -173,9 +174,9 @@ public CompletableFuture getAsync(String path) {
* @param path the API path (e.g., "/customers")
* @param formData the form data to send
* @return the HTTP response
- * @throws Exception for network, timeout, configuration failures, or interceptor errors
+ * @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
- public Response post(String path, Map formData) throws Exception {
+ public Response post(String path, Map formData) throws ChargebeeException {
String fullUrl = UrlBuilder.buildUrl(getBaseUrl(), path, null);
Request.Builder builder = Request.builder()
.method("POST")
@@ -195,9 +196,9 @@ public Response post(String path, Map formData) throws Exception
* @param path the API path (e.g., "/customers")
* @param jsonData the JSON data to send
* @return the HTTP response
- * @throws Exception for network, timeout, configuration failures, or interceptor errors
+ * @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
- public Response postJson(String path, String jsonData) throws Exception {
+ public Response postJson(String path, String jsonData) throws ChargebeeException {
String fullUrl = UrlBuilder.buildUrl(getBaseUrl(), path, null);
Request.Builder builder = Request.builder()
.method("POST")
@@ -256,7 +257,7 @@ public CompletableFuture postJsonAsync(String path, String jsonData) {
/**
* Execute a request with optional interceptor.
*/
- public Response executeWithInterceptor(Request request) throws Exception {
+ public Response executeWithInterceptor(Request request) throws ChargebeeException {
if (requestInterceptor != null) {
RequestWrap requestWrap = new RequestWrap(this, request);
return requestInterceptor.handleRequest(requestWrap);
@@ -280,7 +281,7 @@ public CompletableFuture executeWithInterceptorAsync(Request request)
/**
* Send a request with retry logic based on the configured RetryConfig.
*/
- public Response sendWithRetry(Request request) throws TransportException {
+ public Response sendWithRetry(Request request) {
Request enrichedRequest = addDefaultHeaders(request);
Integer overrideRetries = enrichedRequest.getMaxNetworkRetriesOverride();
diff --git a/src/main/java/com/chargebee/v4/client/request/RequestInterceptor.java b/src/main/java/com/chargebee/v4/client/request/RequestInterceptor.java
index 6db6dfb3..67f2e451 100644
--- a/src/main/java/com/chargebee/v4/client/request/RequestInterceptor.java
+++ b/src/main/java/com/chargebee/v4/client/request/RequestInterceptor.java
@@ -1,5 +1,6 @@
package com.chargebee.v4.client.request;
+import com.chargebee.v4.exceptions.ChargebeeException;
import com.chargebee.v4.transport.Request;
import com.chargebee.v4.transport.Response;
import java.util.concurrent.CompletableFuture;
@@ -51,9 +52,9 @@ public interface RequestInterceptor {
*
* @param requestWrap wrapper containing the transport request and execution context
* @return the transport response, either from proceeding or custom implementation
- * @throws Exception if request processing fails
+ * @throws ChargebeeException if request processing fails
*/
- Response handleRequest(RequestWrap requestWrap) throws Exception;
+ Response handleRequest(RequestWrap requestWrap) throws ChargebeeException;
/**
* Handle the intercepted request asynchronously.
diff --git a/src/main/java/com/chargebee/v4/client/request/RequestWrap.java b/src/main/java/com/chargebee/v4/client/request/RequestWrap.java
index be0b75e5..183da7e6 100644
--- a/src/main/java/com/chargebee/v4/client/request/RequestWrap.java
+++ b/src/main/java/com/chargebee/v4/client/request/RequestWrap.java
@@ -1,6 +1,7 @@
package com.chargebee.v4.client.request;
import com.chargebee.v4.client.ChargebeeClient;
+import com.chargebee.v4.exceptions.ChargebeeException;
import com.chargebee.v4.transport.Request;
import com.chargebee.v4.transport.Response;
import java.util.concurrent.Callable;
@@ -95,9 +96,9 @@ public ChargebeeClient getClient() {
* standard request processing after any modifications.
*
* @return the transport response from normal execution
- * @throws Exception if request execution fails
+ * @throws ChargebeeException if request execution fails
*/
- public Response proceed() throws Exception {
+ public Response proceed() throws ChargebeeException {
return call();
}
@@ -120,10 +121,10 @@ public CompletableFuture proceedAsync() {
* and transport layer.
*
* @return the transport response
- * @throws Exception if request execution fails
+ * @throws ChargebeeException if request execution fails
*/
@Override
- public Response call() throws Exception {
+ public Response call() throws ChargebeeException {
return client.sendWithRetry(request);
}
}
\ No newline at end of file
diff --git a/src/main/java/com/chargebee/v4/exceptions/APIException.java b/src/main/java/com/chargebee/v4/exceptions/APIException.java
index ab17870c..7793ef97 100644
--- a/src/main/java/com/chargebee/v4/exceptions/APIException.java
+++ b/src/main/java/com/chargebee/v4/exceptions/APIException.java
@@ -252,11 +252,12 @@ private String extractErrorCauseId(String jsonResponse) {
/**
* API errors are generally not retryable as they indicate business logic issues.
- *
+ *
* Exceptions that may warrant retry:
+ *
*
- * 429 Too Many Requests - Rate limiting
- * 5xx Server errors - Temporary server issues
+ * 429 Too Many Requests - Rate limiting
+ * 5xx Server errors - Temporary server issues
*
*
* @return true only for 429 or 5xx status codes
diff --git a/src/main/java/com/chargebee/v4/exceptions/ChargebeeException.java b/src/main/java/com/chargebee/v4/exceptions/ChargebeeException.java
new file mode 100644
index 00000000..00ba4acb
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/exceptions/ChargebeeException.java
@@ -0,0 +1,95 @@
+package com.chargebee.v4.exceptions;
+
+/**
+ * The root exception class for all errors originating from the Chargebee SDK.
+ *
+ * {@code ChargebeeException} serves as the unified base for the SDK's exception hierarchy,
+ * enabling developers to catch all Chargebee-related errors with a single exception type
+ * while still allowing fine-grained handling of specific error categories.
+ *
+ * Exception Hierarchy
+ *
+ * ChargebeeException
+ * ├── {@link ConfigurationException} — Invalid SDK configuration (missing API key, malformed URL)
+ * └── {@link TransportException} — Runtime communication errors
+ * ├── {@link NetworkException} — Connection failures, DNS resolution errors
+ * ├── {@link TimeoutException} — Connect or read timeout exceeded
+ * └── {@link HttpException} — HTTP-level errors (4xx, 5xx responses)
+ * ├── {@link ClientErrorException} — Client errors (400-499)
+ * ├── {@link ServerErrorException} — Server errors (500-599)
+ * └── {@link APIException} — Chargebee API errors with structured details
+ *
+ *
+ * Usage Patterns
+ *
+ * Catch-all handling
+ * {@code
+ * try {
+ * client.subscriptions().create(params);
+ * } catch (ChargebeeException e) {
+ * log.error("Chargebee operation failed: {}", e.getMessage());
+ * if (e.isRetryable()) {
+ * // Schedule retry
+ * }
+ * }
+ * }
+ *
+ * Granular error handling
+ * {@code
+ * try {
+ * client.subscriptions().create(params);
+ * } catch (InvalidRequestException e) {
+ * // Handle validation errors - check e.getParams() for invalid fields
+ * } catch (PaymentException e) {
+ * // Handle payment failures - check e.getErrorCauseId() for gateway details
+ * } catch (NetworkException | TimeoutException e) {
+ * // Handle transient failures - safe to retry
+ * } catch (ChargebeeException e) {
+ * // Fallback for unexpected SDK errors
+ * }
+ * }
+ *
+ * @see TransportException
+ * @see ConfigurationException
+ * @see APIException
+ */
+public class ChargebeeException extends RuntimeException {
+
+ /**
+ * Constructs a new exception with the specified detail message.
+ *
+ * @param message the detail message describing the error condition
+ */
+ public ChargebeeException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause.
+ *
+ * @param message the detail message describing the error condition
+ * @param cause the underlying exception that triggered this error
+ */
+ public ChargebeeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Indicates whether retrying the failed operation might succeed.
+ *
+ * Subclasses override this method to provide accurate retry guidance:
+ *
+ * {@link NetworkException} — returns {@code true} (transient connectivity issues)
+ * {@link TimeoutException} — returns {@code true} (temporary overload)
+ * {@link ServerErrorException} — returns {@code true} for 5xx except 501
+ * {@link ClientErrorException} — returns {@code true} only for 429 (rate limited)
+ * {@link ConfigurationException} — returns {@code false} (requires code fix)
+ *
+ *
+ * @return {@code true} if the operation may succeed on retry; {@code false} otherwise
+ */
+ public boolean isRetryable() {
+ return false;
+ }
+}
+
diff --git a/src/main/java/com/chargebee/v4/exceptions/ConfigurationException.java b/src/main/java/com/chargebee/v4/exceptions/ConfigurationException.java
index 0356b59a..4a75e378 100644
--- a/src/main/java/com/chargebee/v4/exceptions/ConfigurationException.java
+++ b/src/main/java/com/chargebee/v4/exceptions/ConfigurationException.java
@@ -3,7 +3,7 @@
/**
* Exception thrown when there's an issue with SDK configuration.
*
- * This is a runtime exception (unchecked) to allow fluent builder usage
+ *
This extends {@link ChargebeeException} to allow fluent builder usage
* without requiring try-catch blocks during client setup.
*
*
Common causes:
@@ -28,7 +28,7 @@
*
Note: This exception is NOT retryable as it indicates a programming error
* that must be fixed in the code.
*/
-public class ConfigurationException extends RuntimeException {
+public class ConfigurationException extends ChargebeeException {
/**
* Creates a ConfigurationException with a message.
diff --git a/src/main/java/com/chargebee/v4/exceptions/TransportException.java b/src/main/java/com/chargebee/v4/exceptions/TransportException.java
index 5273e539..644e05be 100644
--- a/src/main/java/com/chargebee/v4/exceptions/TransportException.java
+++ b/src/main/java/com/chargebee/v4/exceptions/TransportException.java
@@ -19,16 +19,17 @@
*
*
Exception hierarchy:
*
- * TransportException
- * ├── NetworkException (DNS failures, connection refused, I/O errors)
- * ├── TimeoutException (connect/read timeouts)
- * └── HttpException (HTTP status code errors: 4xx, 5xx)
- * ├── ClientErrorException (4xx)
- * ├── ServerErrorException (5xx)
- * └── APIException (Chargebee API errors with structured response)
+ * ChargebeeException
+ * └── TransportException
+ * ├── NetworkException (DNS failures, connection refused, I/O errors)
+ * ├── TimeoutException (connect/read timeouts)
+ * └── HttpException (HTTP status code errors: 4xx, 5xx)
+ * ├── ClientErrorException (4xx)
+ * ├── ServerErrorException (5xx)
+ * └── APIException (Chargebee API errors with structured response)
*
*/
-public class TransportException extends Exception {
+public class TransportException extends ChargebeeException {
private final Request request;
diff --git a/src/main/java/com/chargebee/v4/internal/JsonUtil.java b/src/main/java/com/chargebee/v4/internal/JsonUtil.java
index f8b46a98..45db5ada 100644
--- a/src/main/java/com/chargebee/v4/internal/JsonUtil.java
+++ b/src/main/java/com/chargebee/v4/internal/JsonUtil.java
@@ -120,26 +120,114 @@ public static String getObject(String json, String key) {
if (json == null || key == null) {
return null;
}
- Pattern pattern = Pattern.compile("\"" + Pattern.quote(key) + "\"\\s*:\\s*(\\{[^}]*\\})");
+ // Find the key position
+ String keyPattern = "\"" + Pattern.quote(key) + "\"\\s*:";
+ Pattern pattern = Pattern.compile(keyPattern);
Matcher matcher = pattern.matcher(json);
- if (matcher.find()) {
- return matcher.group(1);
+ if (!matcher.find()) {
+ return null;
+ }
+
+ // Find the start of the object value (skip whitespace after colon)
+ int start = matcher.end();
+ while (start < json.length() && Character.isWhitespace(json.charAt(start))) {
+ start++;
+ }
+
+ if (start >= json.length() || json.charAt(start) != '{') {
+ return null;
+ }
+
+ // Extract the object by tracking brace depth
+ int depth = 0;
+ boolean inString = false;
+ boolean escaped = false;
+ int objectStart = start;
+
+ for (int i = start; i < json.length(); i++) {
+ char c = json.charAt(i);
+
+ if (escaped) {
+ escaped = false;
+ continue;
+ }
+
+ if (c == '\\' && inString) {
+ escaped = true;
+ continue;
+ }
+
+ if (c == '"' && !escaped) {
+ inString = !inString;
+ continue;
+ }
+
+ if (!inString) {
+ if (c == '{') {
+ depth++;
+ } else if (c == '}') {
+ depth--;
+ if (depth == 0) {
+ return json.substring(objectStart, i + 1);
+ }
+ }
+ }
}
+
return null;
}
/**
* Extract array as JSON string for a given key.
+ * Handles nested arrays and objects by tracking bracket depth.
*/
public static String getArray(String json, String key) {
if (json == null || key == null) {
return null;
}
- String pattern = "\"" + Pattern.quote(key) + "\"\\s*:\\s*(\\[.*?\\])";
- Pattern p = Pattern.compile(pattern, Pattern.DOTALL);
+
+ // Find the key position
+ String keyPattern = "\"" + Pattern.quote(key) + "\"\\s*:\\s*\\[";
+ Pattern p = Pattern.compile(keyPattern);
Matcher matcher = p.matcher(json);
- if (matcher.find()) {
- return matcher.group(1);
+ if (!matcher.find()) {
+ return null;
+ }
+
+ // Start from the opening bracket
+ int start = matcher.end() - 1; // Position of '['
+ int depth = 0;
+ boolean inString = false;
+ boolean escaped = false;
+
+ for (int i = start; i < json.length(); i++) {
+ char c = json.charAt(i);
+
+ if (escaped) {
+ escaped = false;
+ continue;
+ }
+
+ if (c == '\\' && inString) {
+ escaped = true;
+ continue;
+ }
+
+ if (c == '"' && !escaped) {
+ inString = !inString;
+ continue;
+ }
+
+ if (!inString) {
+ if (c == '[') {
+ depth++;
+ } else if (c == ']') {
+ depth--;
+ if (depth == 0) {
+ return json.substring(start, i + 1);
+ }
+ }
+ }
}
return null;
}
@@ -200,8 +288,17 @@ public static List parseObjectArray(String arrayJson) {
* Check if a key exists and has non-null value.
*/
public static boolean hasValue(String json, String key) {
- Pattern pattern = Pattern.compile("\"" + Pattern.quote(key) + "\"\\s*:\\s*(?!null\\b)");
- return pattern.matcher(json).find();
+ if (json == null || key == null) {
+ return false;
+ }
+ // First check if the key exists with null value
+ Pattern nullPattern = Pattern.compile("\"" + Pattern.quote(key) + "\"\\s*:\\s*null\\b");
+ if (nullPattern.matcher(json).find()) {
+ return false;
+ }
+ // Then check if the key exists at all
+ Pattern keyPattern = Pattern.compile("\"" + Pattern.quote(key) + "\"\\s*:");
+ return keyPattern.matcher(json).find();
}
/**
@@ -329,19 +426,15 @@ public static List parseArrayOfBigDecimal(String arrayJson
}
/**
- * Parse timestamp from JSON string.
+ * Parse timestamp from JSON (Unix epoch seconds).
*/
public static Timestamp getTimestamp(String json, String key) {
- Pattern pattern = Pattern.compile("\"" + Pattern.quote(key) + "\"\\s*:\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z)");
- Matcher matcher = pattern.matcher(json);
- if (matcher.find()) {
- return Timestamp.valueOf(matcher.group(1));
- }
- return null;
+ Long epochSeconds = getLong(json, key);
+ return epochSeconds != null ? new Timestamp(epochSeconds * 1000) : null;
}
/**
- * Parse a JSON object into a Map.
+ * Parse a JSON object into a Map<String, Object>.
* Values are kept as their raw types (String, Long, Double, Boolean, or nested JSON strings).
*/
public static java.util.Map parseJsonObjectToMap(String json) {
@@ -539,18 +632,26 @@ else if (c == ']') {
/**
* Unescape JSON string.
+ * Processes escape sequences correctly by handling \\\\ last to avoid
+ * incorrectly interpreting sequences like \\t as tab.
*/
private static String unescapeJsonString(String escaped) {
if (escaped == null) return null;
+
+ // Use a placeholder for \\ to avoid interference with other escapes
+ // e.g., \\t should become \t (backslash + t), not a tab character
+ String placeholder = "\u0000BACKSLASH\u0000";
+
return escaped
+ .replace("\\\\", placeholder) // Temporarily replace \\ with placeholder
.replace("\\\"", "\"")
- .replace("\\\\", "\\")
.replace("\\/", "/")
.replace("\\b", "\b")
.replace("\\f", "\f")
.replace("\\n", "\n")
.replace("\\r", "\r")
- .replace("\\t", "\t");
+ .replace("\\t", "\t")
+ .replace(placeholder, "\\"); // Replace placeholder with actual backslash
}
/**
diff --git a/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqExecuteParams.java b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqExecuteParams.java
deleted file mode 100644
index 8ed1d1d0..00000000
--- a/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqExecuteParams.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.additionalBillingLogiq.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class AdditionalBillingLogiqExecuteParams {
-
- private final Map queryParams;
-
- private AdditionalBillingLogiqExecuteParams(AdditionalBillingLogiqExecuteBuilder builder) {
- this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
- }
-
- /** Get the query parameters for this request. */
- public Map toQueryParams() {
- return queryParams;
- }
-
- public AdditionalBillingLogiqExecuteBuilder toBuilder() {
- AdditionalBillingLogiqExecuteBuilder builder = new AdditionalBillingLogiqExecuteBuilder();
- builder.queryParams.putAll(queryParams);
- return builder;
- }
-
- /** Create a new builder for AdditionalBillingLogiqExecuteParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static AdditionalBillingLogiqExecuteBuilder builder() {
- return new AdditionalBillingLogiqExecuteBuilder();
- }
-
- public static final class AdditionalBillingLogiqExecuteBuilder {
- private final Map queryParams = new LinkedHashMap<>();
-
- private AdditionalBillingLogiqExecuteBuilder() {}
-
- public AdditionalBillingLogiqExecuteParams build() {
- return new AdditionalBillingLogiqExecuteParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java
new file mode 100644
index 00000000..5c268182
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/params/AdditionalBillingLogiqRetrieveParams.java
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+
+package com.chargebee.v4.models.additionalBillingLogiq.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AdditionalBillingLogiqRetrieveParams {
+
+ private final Map queryParams;
+
+ private AdditionalBillingLogiqRetrieveParams(AdditionalBillingLogiqRetrieveBuilder builder) {
+ this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
+ }
+
+ /** Get the query parameters for this request. */
+ public Map toQueryParams() {
+ return queryParams;
+ }
+
+ public AdditionalBillingLogiqRetrieveBuilder toBuilder() {
+ AdditionalBillingLogiqRetrieveBuilder builder = new AdditionalBillingLogiqRetrieveBuilder();
+ builder.queryParams.putAll(queryParams);
+ return builder;
+ }
+
+ /** Create a new builder for AdditionalBillingLogiqRetrieveParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AdditionalBillingLogiqRetrieveBuilder builder() {
+ return new AdditionalBillingLogiqRetrieveBuilder();
+ }
+
+ public static final class AdditionalBillingLogiqRetrieveBuilder {
+ private final Map queryParams = new LinkedHashMap<>();
+
+ private AdditionalBillingLogiqRetrieveBuilder() {}
+
+ public AdditionalBillingLogiqRetrieveParams build() {
+ return new AdditionalBillingLogiqRetrieveParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/responses/AdditionalBillingLogiqExecuteResponse.java b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/responses/AdditionalBillingLogiqExecuteResponse.java
deleted file mode 100644
index 777d462f..00000000
--- a/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/responses/AdditionalBillingLogiqExecuteResponse.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.chargebee.v4.models.additionalBillingLogiq.responses;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for AdditionalBillingLogiqExecute operation. Contains the response data
- * from a single resource get operation.
- */
-public final class AdditionalBillingLogiqExecuteResponse extends BaseResponse {
- private final Object additionalBillingLogiq;
-
- private AdditionalBillingLogiqExecuteResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.additionalBillingLogiq = builder.additionalBillingLogiq;
- }
-
- /** Parse JSON response into AdditionalBillingLogiqExecuteResponse object. */
- public static AdditionalBillingLogiqExecuteResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into AdditionalBillingLogiqExecuteResponse object with HTTP response. */
- public static AdditionalBillingLogiqExecuteResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- builder.additionalBillingLogiq(JsonUtil.getObject(json, "additional_billing_logiq"));
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException(
- "Failed to parse AdditionalBillingLogiqExecuteResponse from JSON", e);
- }
- }
-
- /** Create a new builder for AdditionalBillingLogiqExecuteResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for AdditionalBillingLogiqExecuteResponse. */
- public static class Builder {
-
- private Object additionalBillingLogiq;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder additionalBillingLogiq(Object additionalBillingLogiq) {
- this.additionalBillingLogiq = additionalBillingLogiq;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public AdditionalBillingLogiqExecuteResponse build() {
- return new AdditionalBillingLogiqExecuteResponse(this);
- }
- }
-
- /** Get the additionalBillingLogiq from the response. */
- public Object getAdditionalBillingLogiq() {
- return additionalBillingLogiq;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/responses/AdditionalBillingLogiqRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/responses/AdditionalBillingLogiqRetrieveResponse.java
new file mode 100644
index 00000000..960b1ffa
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/additionalBillingLogiq/responses/AdditionalBillingLogiqRetrieveResponse.java
@@ -0,0 +1,74 @@
+package com.chargebee.v4.models.additionalBillingLogiq.responses;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for AdditionalBillingLogiqRetrieve operation. Contains the response
+ * data from a single resource get operation.
+ */
+public final class AdditionalBillingLogiqRetrieveResponse extends BaseResponse {
+ private final Object additionalBillingLogiq;
+
+ private AdditionalBillingLogiqRetrieveResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.additionalBillingLogiq = builder.additionalBillingLogiq;
+ }
+
+ /** Parse JSON response into AdditionalBillingLogiqRetrieveResponse object. */
+ public static AdditionalBillingLogiqRetrieveResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into AdditionalBillingLogiqRetrieveResponse object with HTTP response. */
+ public static AdditionalBillingLogiqRetrieveResponse fromJson(
+ String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ builder.additionalBillingLogiq(JsonUtil.getObject(json, "additional_billing_logiq"));
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException(
+ "Failed to parse AdditionalBillingLogiqRetrieveResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for AdditionalBillingLogiqRetrieveResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for AdditionalBillingLogiqRetrieveResponse. */
+ public static class Builder {
+
+ private Object additionalBillingLogiq;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder additionalBillingLogiq(Object additionalBillingLogiq) {
+ this.additionalBillingLogiq = additionalBillingLogiq;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public AdditionalBillingLogiqRetrieveResponse build() {
+ return new AdditionalBillingLogiqRetrieveResponse(this);
+ }
+ }
+
+ /** Get the additionalBillingLogiq from the response. */
+ public Object getAdditionalBillingLogiq() {
+ return additionalBillingLogiq;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/addon/params/AddonDeleteParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonDeleteParams.java
new file mode 100644
index 00000000..f22b1f5b
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonDeleteParams.java
@@ -0,0 +1,39 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.addon.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AddonDeleteParams {
+
+ private AddonDeleteParams(AddonDeleteBuilder builder) {}
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ return formData;
+ }
+
+ /** Create a new builder for AddonDeleteParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AddonDeleteBuilder builder() {
+ return new AddonDeleteBuilder();
+ }
+
+ public static final class AddonDeleteBuilder {
+
+ private AddonDeleteBuilder() {}
+
+ public AddonDeleteParams build() {
+ return new AddonDeleteParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/addon/params/AddonUnarchiveParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonUnarchiveParams.java
new file mode 100644
index 00000000..a402d94b
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonUnarchiveParams.java
@@ -0,0 +1,39 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.addon.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AddonUnarchiveParams {
+
+ private AddonUnarchiveParams(AddonUnarchiveBuilder builder) {}
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ return formData;
+ }
+
+ /** Create a new builder for AddonUnarchiveParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AddonUnarchiveBuilder builder() {
+ return new AddonUnarchiveBuilder();
+ }
+
+ public static final class AddonUnarchiveBuilder {
+
+ private AddonUnarchiveBuilder() {}
+
+ public AddonUnarchiveParams build() {
+ return new AddonUnarchiveParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/addon/params/DeleteAddonParams.java b/src/main/java/com/chargebee/v4/models/addon/params/DeleteAddonParams.java
deleted file mode 100644
index 289c5e9e..00000000
--- a/src/main/java/com/chargebee/v4/models/addon/params/DeleteAddonParams.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.addon.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class DeleteAddonParams {
-
- private DeleteAddonParams(DeleteAddonBuilder builder) {}
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- return formData;
- }
-
- /** Create a new builder for DeleteAddonParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static DeleteAddonBuilder builder() {
- return new DeleteAddonBuilder();
- }
-
- public static final class DeleteAddonBuilder {
-
- private DeleteAddonBuilder() {}
-
- public DeleteAddonParams build() {
- return new DeleteAddonParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/addon/params/UnarchiveForAddonParams.java b/src/main/java/com/chargebee/v4/models/addon/params/UnarchiveForAddonParams.java
deleted file mode 100644
index 2ae97a2a..00000000
--- a/src/main/java/com/chargebee/v4/models/addon/params/UnarchiveForAddonParams.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.addon.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class UnarchiveForAddonParams {
-
- private UnarchiveForAddonParams(UnarchiveForAddonBuilder builder) {}
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- return formData;
- }
-
- /** Create a new builder for UnarchiveForAddonParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static UnarchiveForAddonBuilder builder() {
- return new UnarchiveForAddonBuilder();
- }
-
- public static final class UnarchiveForAddonBuilder {
-
- private UnarchiveForAddonBuilder() {}
-
- public UnarchiveForAddonParams build() {
- return new UnarchiveForAddonParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/addon/responses/AddonDeleteResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonDeleteResponse.java
new file mode 100644
index 00000000..9cfb740a
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonDeleteResponse.java
@@ -0,0 +1,74 @@
+package com.chargebee.v4.models.addon.responses;
+
+import com.chargebee.v4.models.addon.Addon;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/** Immutable response object for AddonDelete operation. Contains the response data from the API. */
+public final class AddonDeleteResponse extends BaseResponse {
+ private final Addon addon;
+
+ private AddonDeleteResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.addon = builder.addon;
+ }
+
+ /** Parse JSON response into AddonDeleteResponse object. */
+ public static AddonDeleteResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into AddonDeleteResponse object with HTTP response. */
+ public static AddonDeleteResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __addonJson = JsonUtil.getObject(json, "addon");
+ if (__addonJson != null) {
+ builder.addon(Addon.fromJson(__addonJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AddonDeleteResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for AddonDeleteResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for AddonDeleteResponse. */
+ public static class Builder {
+
+ private Addon addon;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder addon(Addon addon) {
+ this.addon = addon;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public AddonDeleteResponse build() {
+ return new AddonDeleteResponse(this);
+ }
+ }
+
+ /** Get the addon from the response. */
+ public Addon getAddon() {
+ return addon;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/addon/responses/AddonListResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonListResponse.java
index 2fe17599..8274e03d 100644
--- a/src/main/java/com/chargebee/v4/models/addon/responses/AddonListResponse.java
+++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonListResponse.java
@@ -4,6 +4,7 @@
import com.chargebee.v4.models.addon.Addon;
+import com.chargebee.v4.exceptions.ChargebeeException;
import com.chargebee.v4.internal.JsonUtil;
import com.chargebee.v4.transport.Response;
import com.chargebee.v4.services.AddonService;
@@ -95,9 +96,9 @@ public boolean hasNextPage() {
/**
* Get the next page of results.
*
- * @throws Exception if unable to fetch next page
+ * @throws ChargebeeException if unable to fetch next page
*/
- public AddonListResponse nextPage() throws Exception {
+ public AddonListResponse nextPage() throws ChargebeeException {
if (!hasNextPage()) {
throw new IllegalStateException("No more pages available");
}
diff --git a/src/main/java/com/chargebee/v4/models/addon/responses/AddonUnarchiveResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/AddonUnarchiveResponse.java
new file mode 100644
index 00000000..9437a21f
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/addon/responses/AddonUnarchiveResponse.java
@@ -0,0 +1,76 @@
+package com.chargebee.v4.models.addon.responses;
+
+import com.chargebee.v4.models.addon.Addon;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for AddonUnarchive operation. Contains the response data from the API.
+ */
+public final class AddonUnarchiveResponse extends BaseResponse {
+ private final Addon addon;
+
+ private AddonUnarchiveResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.addon = builder.addon;
+ }
+
+ /** Parse JSON response into AddonUnarchiveResponse object. */
+ public static AddonUnarchiveResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into AddonUnarchiveResponse object with HTTP response. */
+ public static AddonUnarchiveResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __addonJson = JsonUtil.getObject(json, "addon");
+ if (__addonJson != null) {
+ builder.addon(Addon.fromJson(__addonJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AddonUnarchiveResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for AddonUnarchiveResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for AddonUnarchiveResponse. */
+ public static class Builder {
+
+ private Addon addon;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder addon(Addon addon) {
+ this.addon = addon;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public AddonUnarchiveResponse build() {
+ return new AddonUnarchiveResponse(this);
+ }
+ }
+
+ /** Get the addon from the response. */
+ public Addon getAddon() {
+ return addon;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/addon/responses/DeleteAddonResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/DeleteAddonResponse.java
deleted file mode 100644
index 7db533d5..00000000
--- a/src/main/java/com/chargebee/v4/models/addon/responses/DeleteAddonResponse.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.chargebee.v4.models.addon.responses;
-
-import com.chargebee.v4.models.addon.Addon;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/** Immutable response object for DeleteAddon operation. Contains the response data from the API. */
-public final class DeleteAddonResponse extends BaseResponse {
- private final Addon addon;
-
- private DeleteAddonResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.addon = builder.addon;
- }
-
- /** Parse JSON response into DeleteAddonResponse object. */
- public static DeleteAddonResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into DeleteAddonResponse object with HTTP response. */
- public static DeleteAddonResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __addonJson = JsonUtil.getObject(json, "addon");
- if (__addonJson != null) {
- builder.addon(Addon.fromJson(__addonJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse DeleteAddonResponse from JSON", e);
- }
- }
-
- /** Create a new builder for DeleteAddonResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for DeleteAddonResponse. */
- public static class Builder {
-
- private Addon addon;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder addon(Addon addon) {
- this.addon = addon;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public DeleteAddonResponse build() {
- return new DeleteAddonResponse(this);
- }
- }
-
- /** Get the addon from the response. */
- public Addon getAddon() {
- return addon;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/addon/responses/UnarchiveForAddonResponse.java b/src/main/java/com/chargebee/v4/models/addon/responses/UnarchiveForAddonResponse.java
deleted file mode 100644
index 0e99256d..00000000
--- a/src/main/java/com/chargebee/v4/models/addon/responses/UnarchiveForAddonResponse.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.chargebee.v4.models.addon.responses;
-
-import com.chargebee.v4.models.addon.Addon;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for UnarchiveForAddon operation. Contains the response data from the
- * API.
- */
-public final class UnarchiveForAddonResponse extends BaseResponse {
- private final Addon addon;
-
- private UnarchiveForAddonResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.addon = builder.addon;
- }
-
- /** Parse JSON response into UnarchiveForAddonResponse object. */
- public static UnarchiveForAddonResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into UnarchiveForAddonResponse object with HTTP response. */
- public static UnarchiveForAddonResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __addonJson = JsonUtil.getObject(json, "addon");
- if (__addonJson != null) {
- builder.addon(Addon.fromJson(__addonJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse UnarchiveForAddonResponse from JSON", e);
- }
- }
-
- /** Create a new builder for UnarchiveForAddonResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for UnarchiveForAddonResponse. */
- public static class Builder {
-
- private Addon addon;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder addon(Addon addon) {
- this.addon = addon;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public UnarchiveForAddonResponse build() {
- return new UnarchiveForAddonResponse(this);
- }
- }
-
- /** Get the addon from the response. */
- public Addon getAddon() {
- return addon;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/address/params/AddressCreateParams.java b/src/main/java/com/chargebee/v4/models/address/params/AddressCreateParams.java
deleted file mode 100644
index d87c316b..00000000
--- a/src/main/java/com/chargebee/v4/models/address/params/AddressCreateParams.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.address.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class AddressCreateParams {
-
- private final String subscriptionId;
-
- private final String label;
-
- private final String firstName;
-
- private final String lastName;
-
- private final String email;
-
- private final String company;
-
- private final String phone;
-
- private final String addr;
-
- private final String extendedAddr;
-
- private final String extendedAddr2;
-
- private final String city;
-
- private final String stateCode;
-
- private final String state;
-
- private final String zip;
-
- private final String country;
-
- private final ValidationStatus validationStatus;
-
- private AddressCreateParams(AddressCreateBuilder builder) {
-
- this.subscriptionId = builder.subscriptionId;
-
- this.label = builder.label;
-
- this.firstName = builder.firstName;
-
- this.lastName = builder.lastName;
-
- this.email = builder.email;
-
- this.company = builder.company;
-
- this.phone = builder.phone;
-
- this.addr = builder.addr;
-
- this.extendedAddr = builder.extendedAddr;
-
- this.extendedAddr2 = builder.extendedAddr2;
-
- this.city = builder.city;
-
- this.stateCode = builder.stateCode;
-
- this.state = builder.state;
-
- this.zip = builder.zip;
-
- this.country = builder.country;
-
- this.validationStatus = builder.validationStatus;
- }
-
- public String getSubscriptionId() {
- return subscriptionId;
- }
-
- public String getLabel() {
- return label;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public String getEmail() {
- return email;
- }
-
- public String getCompany() {
- return company;
- }
-
- public String getPhone() {
- return phone;
- }
-
- public String getAddr() {
- return addr;
- }
-
- public String getExtendedAddr() {
- return extendedAddr;
- }
-
- public String getExtendedAddr2() {
- return extendedAddr2;
- }
-
- public String getCity() {
- return city;
- }
-
- public String getStateCode() {
- return stateCode;
- }
-
- public String getState() {
- return state;
- }
-
- public String getZip() {
- return zip;
- }
-
- public String getCountry() {
- return country;
- }
-
- public ValidationStatus getValidationStatus() {
- return validationStatus;
- }
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- if (this.subscriptionId != null) {
-
- formData.put("subscription_id", this.subscriptionId);
- }
-
- if (this.label != null) {
-
- formData.put("label", this.label);
- }
-
- if (this.firstName != null) {
-
- formData.put("first_name", this.firstName);
- }
-
- if (this.lastName != null) {
-
- formData.put("last_name", this.lastName);
- }
-
- if (this.email != null) {
-
- formData.put("email", this.email);
- }
-
- if (this.company != null) {
-
- formData.put("company", this.company);
- }
-
- if (this.phone != null) {
-
- formData.put("phone", this.phone);
- }
-
- if (this.addr != null) {
-
- formData.put("addr", this.addr);
- }
-
- if (this.extendedAddr != null) {
-
- formData.put("extended_addr", this.extendedAddr);
- }
-
- if (this.extendedAddr2 != null) {
-
- formData.put("extended_addr2", this.extendedAddr2);
- }
-
- if (this.city != null) {
-
- formData.put("city", this.city);
- }
-
- if (this.stateCode != null) {
-
- formData.put("state_code", this.stateCode);
- }
-
- if (this.state != null) {
-
- formData.put("state", this.state);
- }
-
- if (this.zip != null) {
-
- formData.put("zip", this.zip);
- }
-
- if (this.country != null) {
-
- formData.put("country", this.country);
- }
-
- if (this.validationStatus != null) {
-
- formData.put("validation_status", this.validationStatus);
- }
-
- return formData;
- }
-
- /** Create a new builder for AddressCreateParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static AddressCreateBuilder builder() {
- return new AddressCreateBuilder();
- }
-
- public static final class AddressCreateBuilder {
-
- private String subscriptionId;
-
- private String label;
-
- private String firstName;
-
- private String lastName;
-
- private String email;
-
- private String company;
-
- private String phone;
-
- private String addr;
-
- private String extendedAddr;
-
- private String extendedAddr2;
-
- private String city;
-
- private String stateCode;
-
- private String state;
-
- private String zip;
-
- private String country;
-
- private ValidationStatus validationStatus;
-
- private AddressCreateBuilder() {}
-
- public AddressCreateBuilder subscriptionId(String value) {
- this.subscriptionId = value;
- return this;
- }
-
- public AddressCreateBuilder label(String value) {
- this.label = value;
- return this;
- }
-
- public AddressCreateBuilder firstName(String value) {
- this.firstName = value;
- return this;
- }
-
- public AddressCreateBuilder lastName(String value) {
- this.lastName = value;
- return this;
- }
-
- public AddressCreateBuilder email(String value) {
- this.email = value;
- return this;
- }
-
- public AddressCreateBuilder company(String value) {
- this.company = value;
- return this;
- }
-
- public AddressCreateBuilder phone(String value) {
- this.phone = value;
- return this;
- }
-
- public AddressCreateBuilder addr(String value) {
- this.addr = value;
- return this;
- }
-
- public AddressCreateBuilder extendedAddr(String value) {
- this.extendedAddr = value;
- return this;
- }
-
- public AddressCreateBuilder extendedAddr2(String value) {
- this.extendedAddr2 = value;
- return this;
- }
-
- public AddressCreateBuilder city(String value) {
- this.city = value;
- return this;
- }
-
- public AddressCreateBuilder stateCode(String value) {
- this.stateCode = value;
- return this;
- }
-
- public AddressCreateBuilder state(String value) {
- this.state = value;
- return this;
- }
-
- public AddressCreateBuilder zip(String value) {
- this.zip = value;
- return this;
- }
-
- public AddressCreateBuilder country(String value) {
- this.country = value;
- return this;
- }
-
- public AddressCreateBuilder validationStatus(ValidationStatus value) {
- this.validationStatus = value;
- return this;
- }
-
- public AddressCreateParams build() {
- return new AddressCreateParams(this);
- }
- }
-
- public enum ValidationStatus {
- NOT_VALIDATED("not_validated"),
-
- VALID("valid"),
-
- PARTIALLY_VALID("partially_valid"),
-
- INVALID("invalid"),
-
- /** An enum member indicating that ValidationStatus was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ValidationStatus(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ValidationStatus fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ValidationStatus enumValue : ValidationStatus.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/address/params/AddressExecuteParams.java b/src/main/java/com/chargebee/v4/models/address/params/AddressExecuteParams.java
deleted file mode 100644
index efea228c..00000000
--- a/src/main/java/com/chargebee/v4/models/address/params/AddressExecuteParams.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.address.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class AddressExecuteParams {
-
- private final Map queryParams;
-
- private AddressExecuteParams(AddressExecuteBuilder builder) {
- this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
- }
-
- /** Get the query parameters for this request. */
- public Map toQueryParams() {
- return queryParams;
- }
-
- public AddressExecuteBuilder toBuilder() {
- AddressExecuteBuilder builder = new AddressExecuteBuilder();
- builder.queryParams.putAll(queryParams);
- return builder;
- }
-
- /** Create a new builder for AddressExecuteParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static AddressExecuteBuilder builder() {
- return new AddressExecuteBuilder();
- }
-
- public static final class AddressExecuteBuilder {
- private final Map queryParams = new LinkedHashMap<>();
-
- private AddressExecuteBuilder() {}
-
- public AddressExecuteBuilder subscriptionId(String value) {
- queryParams.put("subscription_id", value);
- return this;
- }
-
- public AddressExecuteBuilder label(String value) {
- queryParams.put("label", value);
- return this;
- }
-
- public AddressExecuteParams build() {
- return new AddressExecuteParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/address/params/AddressRetrieveParams.java b/src/main/java/com/chargebee/v4/models/address/params/AddressRetrieveParams.java
new file mode 100644
index 00000000..f4bd43bf
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/address/params/AddressRetrieveParams.java
@@ -0,0 +1,60 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+
+package com.chargebee.v4.models.address.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AddressRetrieveParams {
+
+ private final Map queryParams;
+
+ private AddressRetrieveParams(AddressRetrieveBuilder builder) {
+ this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
+ }
+
+ /** Get the query parameters for this request. */
+ public Map toQueryParams() {
+ return queryParams;
+ }
+
+ public AddressRetrieveBuilder toBuilder() {
+ AddressRetrieveBuilder builder = new AddressRetrieveBuilder();
+ builder.queryParams.putAll(queryParams);
+ return builder;
+ }
+
+ /** Create a new builder for AddressRetrieveParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AddressRetrieveBuilder builder() {
+ return new AddressRetrieveBuilder();
+ }
+
+ public static final class AddressRetrieveBuilder {
+ private final Map queryParams = new LinkedHashMap<>();
+
+ private AddressRetrieveBuilder() {}
+
+ public AddressRetrieveBuilder subscriptionId(String value) {
+ queryParams.put("subscription_id", value);
+ return this;
+ }
+
+ public AddressRetrieveBuilder label(String value) {
+ queryParams.put("label", value);
+ return this;
+ }
+
+ public AddressRetrieveParams build() {
+ return new AddressRetrieveParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/address/params/AddressUpdateParams.java b/src/main/java/com/chargebee/v4/models/address/params/AddressUpdateParams.java
new file mode 100644
index 00000000..0401d0b7
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/address/params/AddressUpdateParams.java
@@ -0,0 +1,392 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.address.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AddressUpdateParams {
+
+ private final String subscriptionId;
+
+ private final String label;
+
+ private final String firstName;
+
+ private final String lastName;
+
+ private final String email;
+
+ private final String company;
+
+ private final String phone;
+
+ private final String addr;
+
+ private final String extendedAddr;
+
+ private final String extendedAddr2;
+
+ private final String city;
+
+ private final String stateCode;
+
+ private final String state;
+
+ private final String zip;
+
+ private final String country;
+
+ private final ValidationStatus validationStatus;
+
+ private AddressUpdateParams(AddressUpdateBuilder builder) {
+
+ this.subscriptionId = builder.subscriptionId;
+
+ this.label = builder.label;
+
+ this.firstName = builder.firstName;
+
+ this.lastName = builder.lastName;
+
+ this.email = builder.email;
+
+ this.company = builder.company;
+
+ this.phone = builder.phone;
+
+ this.addr = builder.addr;
+
+ this.extendedAddr = builder.extendedAddr;
+
+ this.extendedAddr2 = builder.extendedAddr2;
+
+ this.city = builder.city;
+
+ this.stateCode = builder.stateCode;
+
+ this.state = builder.state;
+
+ this.zip = builder.zip;
+
+ this.country = builder.country;
+
+ this.validationStatus = builder.validationStatus;
+ }
+
+ public String getSubscriptionId() {
+ return subscriptionId;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public String getCompany() {
+ return company;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public String getAddr() {
+ return addr;
+ }
+
+ public String getExtendedAddr() {
+ return extendedAddr;
+ }
+
+ public String getExtendedAddr2() {
+ return extendedAddr2;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public String getStateCode() {
+ return stateCode;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public ValidationStatus getValidationStatus() {
+ return validationStatus;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.subscriptionId != null) {
+
+ formData.put("subscription_id", this.subscriptionId);
+ }
+
+ if (this.label != null) {
+
+ formData.put("label", this.label);
+ }
+
+ if (this.firstName != null) {
+
+ formData.put("first_name", this.firstName);
+ }
+
+ if (this.lastName != null) {
+
+ formData.put("last_name", this.lastName);
+ }
+
+ if (this.email != null) {
+
+ formData.put("email", this.email);
+ }
+
+ if (this.company != null) {
+
+ formData.put("company", this.company);
+ }
+
+ if (this.phone != null) {
+
+ formData.put("phone", this.phone);
+ }
+
+ if (this.addr != null) {
+
+ formData.put("addr", this.addr);
+ }
+
+ if (this.extendedAddr != null) {
+
+ formData.put("extended_addr", this.extendedAddr);
+ }
+
+ if (this.extendedAddr2 != null) {
+
+ formData.put("extended_addr2", this.extendedAddr2);
+ }
+
+ if (this.city != null) {
+
+ formData.put("city", this.city);
+ }
+
+ if (this.stateCode != null) {
+
+ formData.put("state_code", this.stateCode);
+ }
+
+ if (this.state != null) {
+
+ formData.put("state", this.state);
+ }
+
+ if (this.zip != null) {
+
+ formData.put("zip", this.zip);
+ }
+
+ if (this.country != null) {
+
+ formData.put("country", this.country);
+ }
+
+ if (this.validationStatus != null) {
+
+ formData.put("validation_status", this.validationStatus);
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for AddressUpdateParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AddressUpdateBuilder builder() {
+ return new AddressUpdateBuilder();
+ }
+
+ public static final class AddressUpdateBuilder {
+
+ private String subscriptionId;
+
+ private String label;
+
+ private String firstName;
+
+ private String lastName;
+
+ private String email;
+
+ private String company;
+
+ private String phone;
+
+ private String addr;
+
+ private String extendedAddr;
+
+ private String extendedAddr2;
+
+ private String city;
+
+ private String stateCode;
+
+ private String state;
+
+ private String zip;
+
+ private String country;
+
+ private ValidationStatus validationStatus;
+
+ private AddressUpdateBuilder() {}
+
+ public AddressUpdateBuilder subscriptionId(String value) {
+ this.subscriptionId = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder label(String value) {
+ this.label = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder firstName(String value) {
+ this.firstName = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder lastName(String value) {
+ this.lastName = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder email(String value) {
+ this.email = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder company(String value) {
+ this.company = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder phone(String value) {
+ this.phone = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder addr(String value) {
+ this.addr = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder extendedAddr(String value) {
+ this.extendedAddr = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder extendedAddr2(String value) {
+ this.extendedAddr2 = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder city(String value) {
+ this.city = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder stateCode(String value) {
+ this.stateCode = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder state(String value) {
+ this.state = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder zip(String value) {
+ this.zip = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder country(String value) {
+ this.country = value;
+ return this;
+ }
+
+ public AddressUpdateBuilder validationStatus(ValidationStatus value) {
+ this.validationStatus = value;
+ return this;
+ }
+
+ public AddressUpdateParams build() {
+ return new AddressUpdateParams(this);
+ }
+ }
+
+ public enum ValidationStatus {
+ NOT_VALIDATED("not_validated"),
+
+ VALID("valid"),
+
+ PARTIALLY_VALID("partially_valid"),
+
+ INVALID("invalid"),
+
+ /** An enum member indicating that ValidationStatus was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ValidationStatus(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ValidationStatus fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ValidationStatus enumValue : ValidationStatus.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/address/responses/AddressCreateResponse.java b/src/main/java/com/chargebee/v4/models/address/responses/AddressCreateResponse.java
deleted file mode 100644
index 1a653bb0..00000000
--- a/src/main/java/com/chargebee/v4/models/address/responses/AddressCreateResponse.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.chargebee.v4.models.address.responses;
-
-import com.chargebee.v4.models.address.Address;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for AddressCreate operation. Contains the response data from the API.
- */
-public final class AddressCreateResponse extends BaseResponse {
- private final Address address;
-
- private AddressCreateResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.address = builder.address;
- }
-
- /** Parse JSON response into AddressCreateResponse object. */
- public static AddressCreateResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into AddressCreateResponse object with HTTP response. */
- public static AddressCreateResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __addressJson = JsonUtil.getObject(json, "address");
- if (__addressJson != null) {
- builder.address(Address.fromJson(__addressJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse AddressCreateResponse from JSON", e);
- }
- }
-
- /** Create a new builder for AddressCreateResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for AddressCreateResponse. */
- public static class Builder {
-
- private Address address;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder address(Address address) {
- this.address = address;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public AddressCreateResponse build() {
- return new AddressCreateResponse(this);
- }
- }
-
- /** Get the address from the response. */
- public Address getAddress() {
- return address;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/address/responses/AddressExecuteResponse.java b/src/main/java/com/chargebee/v4/models/address/responses/AddressExecuteResponse.java
deleted file mode 100644
index 55cafcf7..00000000
--- a/src/main/java/com/chargebee/v4/models/address/responses/AddressExecuteResponse.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.chargebee.v4.models.address.responses;
-
-import com.chargebee.v4.models.address.Address;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for AddressExecute operation. Contains the response data from a single
- * resource get operation.
- */
-public final class AddressExecuteResponse extends BaseResponse {
- private final Address address;
-
- private AddressExecuteResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.address = builder.address;
- }
-
- /** Parse JSON response into AddressExecuteResponse object. */
- public static AddressExecuteResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into AddressExecuteResponse object with HTTP response. */
- public static AddressExecuteResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __addressJson = JsonUtil.getObject(json, "address");
- if (__addressJson != null) {
- builder.address(Address.fromJson(__addressJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse AddressExecuteResponse from JSON", e);
- }
- }
-
- /** Create a new builder for AddressExecuteResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for AddressExecuteResponse. */
- public static class Builder {
-
- private Address address;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder address(Address address) {
- this.address = address;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public AddressExecuteResponse build() {
- return new AddressExecuteResponse(this);
- }
- }
-
- /** Get the address from the response. */
- public Address getAddress() {
- return address;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/address/responses/AddressRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/address/responses/AddressRetrieveResponse.java
new file mode 100644
index 00000000..e945c6a9
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/address/responses/AddressRetrieveResponse.java
@@ -0,0 +1,77 @@
+package com.chargebee.v4.models.address.responses;
+
+import com.chargebee.v4.models.address.Address;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for AddressRetrieve operation. Contains the response data from a single
+ * resource get operation.
+ */
+public final class AddressRetrieveResponse extends BaseResponse {
+ private final Address address;
+
+ private AddressRetrieveResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.address = builder.address;
+ }
+
+ /** Parse JSON response into AddressRetrieveResponse object. */
+ public static AddressRetrieveResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into AddressRetrieveResponse object with HTTP response. */
+ public static AddressRetrieveResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __addressJson = JsonUtil.getObject(json, "address");
+ if (__addressJson != null) {
+ builder.address(Address.fromJson(__addressJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AddressRetrieveResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for AddressRetrieveResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for AddressRetrieveResponse. */
+ public static class Builder {
+
+ private Address address;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder address(Address address) {
+ this.address = address;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public AddressRetrieveResponse build() {
+ return new AddressRetrieveResponse(this);
+ }
+ }
+
+ /** Get the address from the response. */
+ public Address getAddress() {
+ return address;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/address/responses/AddressUpdateResponse.java b/src/main/java/com/chargebee/v4/models/address/responses/AddressUpdateResponse.java
new file mode 100644
index 00000000..e4dc4635
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/address/responses/AddressUpdateResponse.java
@@ -0,0 +1,76 @@
+package com.chargebee.v4.models.address.responses;
+
+import com.chargebee.v4.models.address.Address;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for AddressUpdate operation. Contains the response data from the API.
+ */
+public final class AddressUpdateResponse extends BaseResponse {
+ private final Address address;
+
+ private AddressUpdateResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.address = builder.address;
+ }
+
+ /** Parse JSON response into AddressUpdateResponse object. */
+ public static AddressUpdateResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into AddressUpdateResponse object with HTTP response. */
+ public static AddressUpdateResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __addressJson = JsonUtil.getObject(json, "address");
+ if (__addressJson != null) {
+ builder.address(Address.fromJson(__addressJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AddressUpdateResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for AddressUpdateResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for AddressUpdateResponse. */
+ public static class Builder {
+
+ private Address address;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder address(Address address) {
+ this.address = address;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public AddressUpdateResponse build() {
+ return new AddressUpdateResponse(this);
+ }
+ }
+
+ /** Get the address from the response. */
+ public Address getAddress() {
+ return address;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/AddAttachedItemForItemParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AddAttachedItemForItemParams.java
deleted file mode 100644
index 46ae0dc7..00000000
--- a/src/main/java/com/chargebee/v4/models/attachedItem/params/AddAttachedItemForItemParams.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.attachedItem.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class AddAttachedItemForItemParams {
-
- private final String itemId;
-
- private final Type type;
-
- private final Integer billingCycles;
-
- private final Integer quantity;
-
- private final String quantityInDecimal;
-
- private final ChargeOnEvent chargeOnEvent;
-
- private final Boolean chargeOnce;
-
- private final String businessEntityId;
-
- private AddAttachedItemForItemParams(AddAttachedItemForItemBuilder builder) {
-
- this.itemId = builder.itemId;
-
- this.type = builder.type;
-
- this.billingCycles = builder.billingCycles;
-
- this.quantity = builder.quantity;
-
- this.quantityInDecimal = builder.quantityInDecimal;
-
- this.chargeOnEvent = builder.chargeOnEvent;
-
- this.chargeOnce = builder.chargeOnce;
-
- this.businessEntityId = builder.businessEntityId;
- }
-
- public String getItemId() {
- return itemId;
- }
-
- public Type getType() {
- return type;
- }
-
- public Integer getBillingCycles() {
- return billingCycles;
- }
-
- public Integer getQuantity() {
- return quantity;
- }
-
- public String getQuantityInDecimal() {
- return quantityInDecimal;
- }
-
- public ChargeOnEvent getChargeOnEvent() {
- return chargeOnEvent;
- }
-
- public Boolean getChargeOnce() {
- return chargeOnce;
- }
-
- public String getBusinessEntityId() {
- return businessEntityId;
- }
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- if (this.itemId != null) {
-
- formData.put("item_id", this.itemId);
- }
-
- if (this.type != null) {
-
- formData.put("type", this.type);
- }
-
- if (this.billingCycles != null) {
-
- formData.put("billing_cycles", this.billingCycles);
- }
-
- if (this.quantity != null) {
-
- formData.put("quantity", this.quantity);
- }
-
- if (this.quantityInDecimal != null) {
-
- formData.put("quantity_in_decimal", this.quantityInDecimal);
- }
-
- if (this.chargeOnEvent != null) {
-
- formData.put("charge_on_event", this.chargeOnEvent);
- }
-
- if (this.chargeOnce != null) {
-
- formData.put("charge_once", this.chargeOnce);
- }
-
- if (this.businessEntityId != null) {
-
- formData.put("business_entity_id", this.businessEntityId);
- }
-
- return formData;
- }
-
- /** Create a new builder for AddAttachedItemForItemParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static AddAttachedItemForItemBuilder builder() {
- return new AddAttachedItemForItemBuilder();
- }
-
- public static final class AddAttachedItemForItemBuilder {
-
- private String itemId;
-
- private Type type;
-
- private Integer billingCycles;
-
- private Integer quantity;
-
- private String quantityInDecimal;
-
- private ChargeOnEvent chargeOnEvent;
-
- private Boolean chargeOnce;
-
- private String businessEntityId;
-
- private AddAttachedItemForItemBuilder() {}
-
- public AddAttachedItemForItemBuilder itemId(String value) {
- this.itemId = value;
- return this;
- }
-
- public AddAttachedItemForItemBuilder type(Type value) {
- this.type = value;
- return this;
- }
-
- public AddAttachedItemForItemBuilder billingCycles(Integer value) {
- this.billingCycles = value;
- return this;
- }
-
- public AddAttachedItemForItemBuilder quantity(Integer value) {
- this.quantity = value;
- return this;
- }
-
- public AddAttachedItemForItemBuilder quantityInDecimal(String value) {
- this.quantityInDecimal = value;
- return this;
- }
-
- public AddAttachedItemForItemBuilder chargeOnEvent(ChargeOnEvent value) {
- this.chargeOnEvent = value;
- return this;
- }
-
- public AddAttachedItemForItemBuilder chargeOnce(Boolean value) {
- this.chargeOnce = value;
- return this;
- }
-
- public AddAttachedItemForItemBuilder businessEntityId(String value) {
- this.businessEntityId = value;
- return this;
- }
-
- public AddAttachedItemForItemParams build() {
- return new AddAttachedItemForItemParams(this);
- }
- }
-
- public enum Type {
- RECOMMENDED("recommended"),
-
- MANDATORY("mandatory"),
-
- OPTIONAL("optional"),
-
- /** An enum member indicating that Type was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- Type(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static Type fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (Type enumValue : Type.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum ChargeOnEvent {
- SUBSCRIPTION_CREATION("subscription_creation"),
-
- SUBSCRIPTION_TRIAL_START("subscription_trial_start"),
-
- PLAN_ACTIVATION("plan_activation"),
-
- SUBSCRIPTION_ACTIVATION("subscription_activation"),
-
- CONTRACT_TERMINATION("contract_termination"),
-
- ON_DEMAND("on_demand"),
-
- /** An enum member indicating that ChargeOnEvent was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ChargeOnEvent(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ChargeOnEvent fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ChargeOnEvent enumValue : ChargeOnEvent.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemCreateParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemCreateParams.java
new file mode 100644
index 00000000..4ac02431
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemCreateParams.java
@@ -0,0 +1,266 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.attachedItem.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AttachedItemCreateParams {
+
+ private final String itemId;
+
+ private final Type type;
+
+ private final Integer billingCycles;
+
+ private final Integer quantity;
+
+ private final String quantityInDecimal;
+
+ private final ChargeOnEvent chargeOnEvent;
+
+ private final Boolean chargeOnce;
+
+ private final String businessEntityId;
+
+ private AttachedItemCreateParams(AttachedItemCreateBuilder builder) {
+
+ this.itemId = builder.itemId;
+
+ this.type = builder.type;
+
+ this.billingCycles = builder.billingCycles;
+
+ this.quantity = builder.quantity;
+
+ this.quantityInDecimal = builder.quantityInDecimal;
+
+ this.chargeOnEvent = builder.chargeOnEvent;
+
+ this.chargeOnce = builder.chargeOnce;
+
+ this.businessEntityId = builder.businessEntityId;
+ }
+
+ public String getItemId() {
+ return itemId;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public Integer getBillingCycles() {
+ return billingCycles;
+ }
+
+ public Integer getQuantity() {
+ return quantity;
+ }
+
+ public String getQuantityInDecimal() {
+ return quantityInDecimal;
+ }
+
+ public ChargeOnEvent getChargeOnEvent() {
+ return chargeOnEvent;
+ }
+
+ public Boolean getChargeOnce() {
+ return chargeOnce;
+ }
+
+ public String getBusinessEntityId() {
+ return businessEntityId;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.itemId != null) {
+
+ formData.put("item_id", this.itemId);
+ }
+
+ if (this.type != null) {
+
+ formData.put("type", this.type);
+ }
+
+ if (this.billingCycles != null) {
+
+ formData.put("billing_cycles", this.billingCycles);
+ }
+
+ if (this.quantity != null) {
+
+ formData.put("quantity", this.quantity);
+ }
+
+ if (this.quantityInDecimal != null) {
+
+ formData.put("quantity_in_decimal", this.quantityInDecimal);
+ }
+
+ if (this.chargeOnEvent != null) {
+
+ formData.put("charge_on_event", this.chargeOnEvent);
+ }
+
+ if (this.chargeOnce != null) {
+
+ formData.put("charge_once", this.chargeOnce);
+ }
+
+ if (this.businessEntityId != null) {
+
+ formData.put("business_entity_id", this.businessEntityId);
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for AttachedItemCreateParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AttachedItemCreateBuilder builder() {
+ return new AttachedItemCreateBuilder();
+ }
+
+ public static final class AttachedItemCreateBuilder {
+
+ private String itemId;
+
+ private Type type;
+
+ private Integer billingCycles;
+
+ private Integer quantity;
+
+ private String quantityInDecimal;
+
+ private ChargeOnEvent chargeOnEvent;
+
+ private Boolean chargeOnce;
+
+ private String businessEntityId;
+
+ private AttachedItemCreateBuilder() {}
+
+ public AttachedItemCreateBuilder itemId(String value) {
+ this.itemId = value;
+ return this;
+ }
+
+ public AttachedItemCreateBuilder type(Type value) {
+ this.type = value;
+ return this;
+ }
+
+ public AttachedItemCreateBuilder billingCycles(Integer value) {
+ this.billingCycles = value;
+ return this;
+ }
+
+ public AttachedItemCreateBuilder quantity(Integer value) {
+ this.quantity = value;
+ return this;
+ }
+
+ public AttachedItemCreateBuilder quantityInDecimal(String value) {
+ this.quantityInDecimal = value;
+ return this;
+ }
+
+ public AttachedItemCreateBuilder chargeOnEvent(ChargeOnEvent value) {
+ this.chargeOnEvent = value;
+ return this;
+ }
+
+ public AttachedItemCreateBuilder chargeOnce(Boolean value) {
+ this.chargeOnce = value;
+ return this;
+ }
+
+ public AttachedItemCreateBuilder businessEntityId(String value) {
+ this.businessEntityId = value;
+ return this;
+ }
+
+ public AttachedItemCreateParams build() {
+ return new AttachedItemCreateParams(this);
+ }
+ }
+
+ public enum Type {
+ RECOMMENDED("recommended"),
+
+ MANDATORY("mandatory"),
+
+ OPTIONAL("optional"),
+
+ /** An enum member indicating that Type was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ Type(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static Type fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (Type enumValue : Type.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum ChargeOnEvent {
+ SUBSCRIPTION_CREATION("subscription_creation"),
+
+ SUBSCRIPTION_TRIAL_START("subscription_trial_start"),
+
+ PLAN_ACTIVATION("plan_activation"),
+
+ SUBSCRIPTION_ACTIVATION("subscription_activation"),
+
+ CONTRACT_TERMINATION("contract_termination"),
+
+ ON_DEMAND("on_demand"),
+
+ /** An enum member indicating that ChargeOnEvent was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ChargeOnEvent(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ChargeOnEvent fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ChargeOnEvent enumValue : ChargeOnEvent.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemDeleteParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemDeleteParams.java
new file mode 100644
index 00000000..95906225
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemDeleteParams.java
@@ -0,0 +1,60 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.attachedItem.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AttachedItemDeleteParams {
+
+ private final String parentItemId;
+
+ private AttachedItemDeleteParams(AttachedItemDeleteBuilder builder) {
+
+ this.parentItemId = builder.parentItemId;
+ }
+
+ public String getParentItemId() {
+ return parentItemId;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.parentItemId != null) {
+
+ formData.put("parent_item_id", this.parentItemId);
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for AttachedItemDeleteParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AttachedItemDeleteBuilder builder() {
+ return new AttachedItemDeleteBuilder();
+ }
+
+ public static final class AttachedItemDeleteBuilder {
+
+ private String parentItemId;
+
+ private AttachedItemDeleteBuilder() {}
+
+ public AttachedItemDeleteBuilder parentItemId(String value) {
+ this.parentItemId = value;
+ return this;
+ }
+
+ public AttachedItemDeleteParams build() {
+ return new AttachedItemDeleteParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java
new file mode 100644
index 00000000..e2cbd5b2
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java
@@ -0,0 +1,469 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+
+package com.chargebee.v4.models.attachedItem.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.sql.Timestamp;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class AttachedItemListParams {
+
+ private final Map queryParams;
+
+ private AttachedItemListParams(AttachedItemListBuilder builder) {
+ this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
+ }
+
+ /** Get the query parameters for this request. */
+ public Map toQueryParams() {
+ return queryParams;
+ }
+
+ public AttachedItemListBuilder toBuilder() {
+ AttachedItemListBuilder builder = new AttachedItemListBuilder();
+ builder.queryParams.putAll(queryParams);
+ return builder;
+ }
+
+ /** Create a new builder for AttachedItemListParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static AttachedItemListBuilder builder() {
+ return new AttachedItemListBuilder();
+ }
+
+ public static final class AttachedItemListBuilder {
+ private final Map queryParams = new LinkedHashMap<>();
+
+ private AttachedItemListBuilder() {}
+
+ public AttachedItemListBuilder limit(Integer value) {
+ queryParams.put("limit", value);
+ return this;
+ }
+
+ public AttachedItemListBuilder offset(String value) {
+ queryParams.put("offset", value);
+ return this;
+ }
+
+ public IdFilter id() {
+ return new IdFilter("id", this);
+ }
+
+ public ItemIdFilter itemId() {
+ return new ItemIdFilter("item_id", this);
+ }
+
+ public TypeFilter type() {
+ return new TypeFilter("type", this);
+ }
+
+ public ItemTypeFilter itemType() {
+ return new ItemTypeFilter("item_type", this);
+ }
+
+ public ChargeOnEventFilter chargeOnEvent() {
+ return new ChargeOnEventFilter("charge_on_event", this);
+ }
+
+ public UpdatedAtFilter updatedAt() {
+ return new UpdatedAtFilter("updated_at", this);
+ }
+
+ public AttachedItemListParams build() {
+ return new AttachedItemListParams(this);
+ }
+
+ public static final class IdFilter {
+ private final String fieldName;
+ private final AttachedItemListBuilder builder;
+
+ IdFilter(String fieldName, AttachedItemListBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public AttachedItemListBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder isNot(String value) {
+ builder.queryParams.put(fieldName + "[is_not]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder startsWith(String value) {
+ builder.queryParams.put(fieldName + "[starts_with]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder in(String... values) {
+ builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+
+ public AttachedItemListBuilder notIn(String... values) {
+ builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+ }
+
+ public static final class ItemIdFilter {
+ private final String fieldName;
+ private final AttachedItemListBuilder builder;
+
+ ItemIdFilter(String fieldName, AttachedItemListBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public AttachedItemListBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder isNot(String value) {
+ builder.queryParams.put(fieldName + "[is_not]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder startsWith(String value) {
+ builder.queryParams.put(fieldName + "[starts_with]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder in(String... values) {
+ builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+
+ public AttachedItemListBuilder notIn(String... values) {
+ builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+ }
+
+ public static final class TypeFilter {
+ private final String fieldName;
+ private final AttachedItemListBuilder builder;
+
+ TypeFilter(String fieldName, AttachedItemListBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public AttachedItemListBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder isNot(String value) {
+ builder.queryParams.put(fieldName + "[is_not]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder in(String... values) {
+ builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+
+ public AttachedItemListBuilder notIn(String... values) {
+ builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+ }
+
+ public static final class ItemTypeFilter {
+ private final String fieldName;
+ private final AttachedItemListBuilder builder;
+
+ ItemTypeFilter(String fieldName, AttachedItemListBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public AttachedItemListBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder isNot(String value) {
+ builder.queryParams.put(fieldName + "[is_not]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder in(String... values) {
+ builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+
+ public AttachedItemListBuilder notIn(String... values) {
+ builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+ }
+
+ public static final class ChargeOnEventFilter {
+ private final String fieldName;
+ private final AttachedItemListBuilder builder;
+
+ ChargeOnEventFilter(String fieldName, AttachedItemListBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public AttachedItemListBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder isNot(String value) {
+ builder.queryParams.put(fieldName + "[is_not]", value);
+ return builder;
+ }
+
+ public AttachedItemListBuilder in(String... values) {
+ builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+
+ public AttachedItemListBuilder notIn(String... values) {
+ builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
+ return builder;
+ }
+ }
+
+ public static final class UpdatedAtFilter {
+ private final String fieldName;
+ private final AttachedItemListBuilder builder;
+
+ UpdatedAtFilter(String fieldName, AttachedItemListBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public AttachedItemListBuilder after(Timestamp timestamp) {
+ builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000);
+ return builder;
+ }
+
+ public AttachedItemListBuilder before(Timestamp timestamp) {
+ builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000);
+ return builder;
+ }
+
+ public AttachedItemListBuilder on(Timestamp timestamp) {
+ builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000);
+ return builder;
+ }
+
+ public AttachedItemListBuilder between(Timestamp start, Timestamp end) {
+ builder.queryParams.put(
+ fieldName + "[between]",
+ "[" + (start.getTime() / 1000) + "," + (end.getTime() / 1000) + "]");
+ return builder;
+ }
+ }
+ }
+
+ public enum TypeIs {
+ RECOMMENDED("recommended"),
+
+ MANDATORY("mandatory"),
+
+ OPTIONAL("optional"),
+
+ /** An enum member indicating that TypeIs was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ TypeIs(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static TypeIs fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (TypeIs enumValue : TypeIs.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum TypeIsNot {
+ RECOMMENDED("recommended"),
+
+ MANDATORY("mandatory"),
+
+ OPTIONAL("optional"),
+
+ /** An enum member indicating that TypeIsNot was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ TypeIsNot(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static TypeIsNot fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (TypeIsNot enumValue : TypeIsNot.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum ItemTypeIs {
+ PLAN("plan"),
+
+ ADDON("addon"),
+
+ CHARGE("charge"),
+
+ /** An enum member indicating that ItemTypeIs was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ItemTypeIs(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ItemTypeIs fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ItemTypeIs enumValue : ItemTypeIs.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum ItemTypeIsNot {
+ PLAN("plan"),
+
+ ADDON("addon"),
+
+ CHARGE("charge"),
+
+ /** An enum member indicating that ItemTypeIsNot was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ItemTypeIsNot(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ItemTypeIsNot fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ItemTypeIsNot enumValue : ItemTypeIsNot.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum ChargeOnEventIs {
+ SUBSCRIPTION_CREATION("subscription_creation"),
+
+ SUBSCRIPTION_TRIAL_START("subscription_trial_start"),
+
+ PLAN_ACTIVATION("plan_activation"),
+
+ SUBSCRIPTION_ACTIVATION("subscription_activation"),
+
+ CONTRACT_TERMINATION("contract_termination"),
+
+ ON_DEMAND("on_demand"),
+
+ /** An enum member indicating that ChargeOnEventIs was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ChargeOnEventIs(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ChargeOnEventIs fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ChargeOnEventIs enumValue : ChargeOnEventIs.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum ChargeOnEventIsNot {
+ SUBSCRIPTION_CREATION("subscription_creation"),
+
+ SUBSCRIPTION_TRIAL_START("subscription_trial_start"),
+
+ PLAN_ACTIVATION("plan_activation"),
+
+ SUBSCRIPTION_ACTIVATION("subscription_activation"),
+
+ CONTRACT_TERMINATION("contract_termination"),
+
+ ON_DEMAND("on_demand"),
+
+ /** An enum member indicating that ChargeOnEventIsNot was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ChargeOnEventIsNot(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ChargeOnEventIsNot fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ChargeOnEventIsNot enumValue : ChargeOnEventIsNot.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemsForItemParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemsForItemParams.java
deleted file mode 100644
index 8b57564e..00000000
--- a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemsForItemParams.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.attachedItem.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.sql.Timestamp;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class AttachedItemsForItemParams {
-
- private final Map queryParams;
-
- private AttachedItemsForItemParams(AttachedItemsForItemBuilder builder) {
- this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
- }
-
- /** Get the query parameters for this request. */
- public Map toQueryParams() {
- return queryParams;
- }
-
- public AttachedItemsForItemBuilder toBuilder() {
- AttachedItemsForItemBuilder builder = new AttachedItemsForItemBuilder();
- builder.queryParams.putAll(queryParams);
- return builder;
- }
-
- /** Create a new builder for AttachedItemsForItemParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static AttachedItemsForItemBuilder builder() {
- return new AttachedItemsForItemBuilder();
- }
-
- public static final class AttachedItemsForItemBuilder {
- private final Map queryParams = new LinkedHashMap<>();
-
- private AttachedItemsForItemBuilder() {}
-
- public AttachedItemsForItemBuilder limit(Integer value) {
- queryParams.put("limit", value);
- return this;
- }
-
- public AttachedItemsForItemBuilder offset(String value) {
- queryParams.put("offset", value);
- return this;
- }
-
- public IdFilter id() {
- return new IdFilter("id", this);
- }
-
- public ItemIdFilter itemId() {
- return new ItemIdFilter("item_id", this);
- }
-
- public TypeFilter type() {
- return new TypeFilter("type", this);
- }
-
- public ItemTypeFilter itemType() {
- return new ItemTypeFilter("item_type", this);
- }
-
- public ChargeOnEventFilter chargeOnEvent() {
- return new ChargeOnEventFilter("charge_on_event", this);
- }
-
- public UpdatedAtFilter updatedAt() {
- return new UpdatedAtFilter("updated_at", this);
- }
-
- public AttachedItemsForItemParams build() {
- return new AttachedItemsForItemParams(this);
- }
-
- public static final class IdFilter {
- private final String fieldName;
- private final AttachedItemsForItemBuilder builder;
-
- IdFilter(String fieldName, AttachedItemsForItemBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public AttachedItemsForItemBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder isNot(String value) {
- builder.queryParams.put(fieldName + "[is_not]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder startsWith(String value) {
- builder.queryParams.put(fieldName + "[starts_with]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder in(String... values) {
- builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
- return builder;
- }
-
- public AttachedItemsForItemBuilder notIn(String... values) {
- builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
- return builder;
- }
- }
-
- public static final class ItemIdFilter {
- private final String fieldName;
- private final AttachedItemsForItemBuilder builder;
-
- ItemIdFilter(String fieldName, AttachedItemsForItemBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public AttachedItemsForItemBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder isNot(String value) {
- builder.queryParams.put(fieldName + "[is_not]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder startsWith(String value) {
- builder.queryParams.put(fieldName + "[starts_with]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder in(String... values) {
- builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
- return builder;
- }
-
- public AttachedItemsForItemBuilder notIn(String... values) {
- builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
- return builder;
- }
- }
-
- public static final class TypeFilter {
- private final String fieldName;
- private final AttachedItemsForItemBuilder builder;
-
- TypeFilter(String fieldName, AttachedItemsForItemBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public AttachedItemsForItemBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder isNot(String value) {
- builder.queryParams.put(fieldName + "[is_not]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder in(String... values) {
- builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
- return builder;
- }
-
- public AttachedItemsForItemBuilder notIn(String... values) {
- builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
- return builder;
- }
- }
-
- public static final class ItemTypeFilter {
- private final String fieldName;
- private final AttachedItemsForItemBuilder builder;
-
- ItemTypeFilter(String fieldName, AttachedItemsForItemBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public AttachedItemsForItemBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder isNot(String value) {
- builder.queryParams.put(fieldName + "[is_not]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder in(String... values) {
- builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
- return builder;
- }
-
- public AttachedItemsForItemBuilder notIn(String... values) {
- builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
- return builder;
- }
- }
-
- public static final class ChargeOnEventFilter {
- private final String fieldName;
- private final AttachedItemsForItemBuilder builder;
-
- ChargeOnEventFilter(String fieldName, AttachedItemsForItemBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public AttachedItemsForItemBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder isNot(String value) {
- builder.queryParams.put(fieldName + "[is_not]", value);
- return builder;
- }
-
- public AttachedItemsForItemBuilder in(String... values) {
- builder.queryParams.put(fieldName + "[in]", "[" + String.join(",", values) + "]");
- return builder;
- }
-
- public AttachedItemsForItemBuilder notIn(String... values) {
- builder.queryParams.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]");
- return builder;
- }
- }
-
- public static final class UpdatedAtFilter {
- private final String fieldName;
- private final AttachedItemsForItemBuilder builder;
-
- UpdatedAtFilter(String fieldName, AttachedItemsForItemBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public AttachedItemsForItemBuilder after(Timestamp timestamp) {
- builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000);
- return builder;
- }
-
- public AttachedItemsForItemBuilder before(Timestamp timestamp) {
- builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000);
- return builder;
- }
-
- public AttachedItemsForItemBuilder on(Timestamp timestamp) {
- builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000);
- return builder;
- }
-
- public AttachedItemsForItemBuilder between(Timestamp start, Timestamp end) {
- builder.queryParams.put(
- fieldName + "[between]",
- "[" + (start.getTime() / 1000) + "," + (end.getTime() / 1000) + "]");
- return builder;
- }
- }
- }
-
- public enum TypeIs {
- RECOMMENDED("recommended"),
-
- MANDATORY("mandatory"),
-
- OPTIONAL("optional"),
-
- /** An enum member indicating that TypeIs was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- TypeIs(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static TypeIs fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (TypeIs enumValue : TypeIs.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum TypeIsNot {
- RECOMMENDED("recommended"),
-
- MANDATORY("mandatory"),
-
- OPTIONAL("optional"),
-
- /** An enum member indicating that TypeIsNot was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- TypeIsNot(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static TypeIsNot fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (TypeIsNot enumValue : TypeIsNot.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum ItemTypeIs {
- PLAN("plan"),
-
- ADDON("addon"),
-
- CHARGE("charge"),
-
- /** An enum member indicating that ItemTypeIs was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ItemTypeIs(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ItemTypeIs fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ItemTypeIs enumValue : ItemTypeIs.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum ItemTypeIsNot {
- PLAN("plan"),
-
- ADDON("addon"),
-
- CHARGE("charge"),
-
- /** An enum member indicating that ItemTypeIsNot was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ItemTypeIsNot(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ItemTypeIsNot fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ItemTypeIsNot enumValue : ItemTypeIsNot.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum ChargeOnEventIs {
- SUBSCRIPTION_CREATION("subscription_creation"),
-
- SUBSCRIPTION_TRIAL_START("subscription_trial_start"),
-
- PLAN_ACTIVATION("plan_activation"),
-
- SUBSCRIPTION_ACTIVATION("subscription_activation"),
-
- CONTRACT_TERMINATION("contract_termination"),
-
- ON_DEMAND("on_demand"),
-
- /** An enum member indicating that ChargeOnEventIs was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ChargeOnEventIs(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ChargeOnEventIs fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ChargeOnEventIs enumValue : ChargeOnEventIs.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum ChargeOnEventIsNot {
- SUBSCRIPTION_CREATION("subscription_creation"),
-
- SUBSCRIPTION_TRIAL_START("subscription_trial_start"),
-
- PLAN_ACTIVATION("plan_activation"),
-
- SUBSCRIPTION_ACTIVATION("subscription_activation"),
-
- CONTRACT_TERMINATION("contract_termination"),
-
- ON_DEMAND("on_demand"),
-
- /** An enum member indicating that ChargeOnEventIsNot was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ChargeOnEventIsNot(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ChargeOnEventIsNot fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ChargeOnEventIsNot enumValue : ChargeOnEventIsNot.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/DeleteAttachedItemParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/DeleteAttachedItemParams.java
deleted file mode 100644
index fdf6eaab..00000000
--- a/src/main/java/com/chargebee/v4/models/attachedItem/params/DeleteAttachedItemParams.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.attachedItem.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class DeleteAttachedItemParams {
-
- private final String parentItemId;
-
- private DeleteAttachedItemParams(DeleteAttachedItemBuilder builder) {
-
- this.parentItemId = builder.parentItemId;
- }
-
- public String getParentItemId() {
- return parentItemId;
- }
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- if (this.parentItemId != null) {
-
- formData.put("parent_item_id", this.parentItemId);
- }
-
- return formData;
- }
-
- /** Create a new builder for DeleteAttachedItemParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static DeleteAttachedItemBuilder builder() {
- return new DeleteAttachedItemBuilder();
- }
-
- public static final class DeleteAttachedItemBuilder {
-
- private String parentItemId;
-
- private DeleteAttachedItemBuilder() {}
-
- public DeleteAttachedItemBuilder parentItemId(String value) {
- this.parentItemId = value;
- return this;
- }
-
- public DeleteAttachedItemParams build() {
- return new DeleteAttachedItemParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AddAttachedItemForItemResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AddAttachedItemForItemResponse.java
deleted file mode 100644
index d062d11c..00000000
--- a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AddAttachedItemForItemResponse.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.chargebee.v4.models.attachedItem.responses;
-
-import com.chargebee.v4.models.attachedItem.AttachedItem;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for AddAttachedItemForItem operation. Contains the response data from
- * the API.
- */
-public final class AddAttachedItemForItemResponse extends BaseResponse {
- private final AttachedItem attachedItem;
-
- private AddAttachedItemForItemResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.attachedItem = builder.attachedItem;
- }
-
- /** Parse JSON response into AddAttachedItemForItemResponse object. */
- public static AddAttachedItemForItemResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into AddAttachedItemForItemResponse object with HTTP response. */
- public static AddAttachedItemForItemResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __attachedItemJson = JsonUtil.getObject(json, "attached_item");
- if (__attachedItemJson != null) {
- builder.attachedItem(AttachedItem.fromJson(__attachedItemJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse AddAttachedItemForItemResponse from JSON", e);
- }
- }
-
- /** Create a new builder for AddAttachedItemForItemResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for AddAttachedItemForItemResponse. */
- public static class Builder {
-
- private AttachedItem attachedItem;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder attachedItem(AttachedItem attachedItem) {
- this.attachedItem = attachedItem;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public AddAttachedItemForItemResponse build() {
- return new AddAttachedItemForItemResponse(this);
- }
- }
-
- /** Get the attachedItem from the response. */
- public AttachedItem getAttachedItem() {
- return attachedItem;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemCreateResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemCreateResponse.java
new file mode 100644
index 00000000..917e8274
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemCreateResponse.java
@@ -0,0 +1,77 @@
+package com.chargebee.v4.models.attachedItem.responses;
+
+import com.chargebee.v4.models.attachedItem.AttachedItem;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for AttachedItemCreate operation. Contains the response data from the
+ * API.
+ */
+public final class AttachedItemCreateResponse extends BaseResponse {
+ private final AttachedItem attachedItem;
+
+ private AttachedItemCreateResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.attachedItem = builder.attachedItem;
+ }
+
+ /** Parse JSON response into AttachedItemCreateResponse object. */
+ public static AttachedItemCreateResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into AttachedItemCreateResponse object with HTTP response. */
+ public static AttachedItemCreateResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __attachedItemJson = JsonUtil.getObject(json, "attached_item");
+ if (__attachedItemJson != null) {
+ builder.attachedItem(AttachedItem.fromJson(__attachedItemJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AttachedItemCreateResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for AttachedItemCreateResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for AttachedItemCreateResponse. */
+ public static class Builder {
+
+ private AttachedItem attachedItem;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder attachedItem(AttachedItem attachedItem) {
+ this.attachedItem = attachedItem;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public AttachedItemCreateResponse build() {
+ return new AttachedItemCreateResponse(this);
+ }
+ }
+
+ /** Get the attachedItem from the response. */
+ public AttachedItem getAttachedItem() {
+ return attachedItem;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemDeleteResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemDeleteResponse.java
new file mode 100644
index 00000000..7b3c9e64
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemDeleteResponse.java
@@ -0,0 +1,77 @@
+package com.chargebee.v4.models.attachedItem.responses;
+
+import com.chargebee.v4.models.attachedItem.AttachedItem;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for AttachedItemDelete operation. Contains the response data from the
+ * API.
+ */
+public final class AttachedItemDeleteResponse extends BaseResponse {
+ private final AttachedItem attachedItem;
+
+ private AttachedItemDeleteResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.attachedItem = builder.attachedItem;
+ }
+
+ /** Parse JSON response into AttachedItemDeleteResponse object. */
+ public static AttachedItemDeleteResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into AttachedItemDeleteResponse object with HTTP response. */
+ public static AttachedItemDeleteResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __attachedItemJson = JsonUtil.getObject(json, "attached_item");
+ if (__attachedItemJson != null) {
+ builder.attachedItem(AttachedItem.fromJson(__attachedItemJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AttachedItemDeleteResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for AttachedItemDeleteResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for AttachedItemDeleteResponse. */
+ public static class Builder {
+
+ private AttachedItem attachedItem;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder attachedItem(AttachedItem attachedItem) {
+ this.attachedItem = attachedItem;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public AttachedItemDeleteResponse build() {
+ return new AttachedItemDeleteResponse(this);
+ }
+ }
+
+ /** Get the attachedItem from the response. */
+ public AttachedItem getAttachedItem() {
+ return attachedItem;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemListResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemListResponse.java
new file mode 100644
index 00000000..fd34422a
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemListResponse.java
@@ -0,0 +1,172 @@
+package com.chargebee.v4.models.attachedItem.responses;
+
+import java.util.List;
+
+import com.chargebee.v4.models.attachedItem.AttachedItem;
+
+import com.chargebee.v4.exceptions.ChargebeeException;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+import com.chargebee.v4.services.AttachedItemService;
+import com.chargebee.v4.models.attachedItem.params.AttachedItemListParams;
+
+/** Immutable response object for AttachedItemList operation. Contains paginated list data. */
+public final class AttachedItemListResponse {
+
+ private final List list;
+
+ private final String nextOffset;
+
+ private final String itemId;
+
+ private final AttachedItemService service;
+ private final AttachedItemListParams originalParams;
+ private final Response httpResponse;
+
+ private AttachedItemListResponse(
+ List list,
+ String nextOffset,
+ String itemId,
+ AttachedItemService service,
+ AttachedItemListParams originalParams,
+ Response httpResponse) {
+
+ this.list = list;
+
+ this.nextOffset = nextOffset;
+
+ this.itemId = itemId;
+
+ this.service = service;
+ this.originalParams = originalParams;
+ this.httpResponse = httpResponse;
+ }
+
+ /**
+ * Parse JSON response into AttachedItemListResponse object (no service context). Use this when
+ * you only need to read a single page (no nextPage()).
+ */
+ public static AttachedItemListResponse fromJson(String json) {
+ try {
+
+ List list =
+ JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
+ .map(AttachedItemListItem::fromJson)
+ .collect(java.util.stream.Collectors.toList());
+
+ String nextOffset = JsonUtil.getString(json, "next_offset");
+
+ return new AttachedItemListResponse(list, nextOffset, null, null, null, null);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AttachedItemListResponse from JSON", e);
+ }
+ }
+
+ /**
+ * Parse JSON response into AttachedItemListResponse object with service context for pagination
+ * (enables nextPage()).
+ */
+ public static AttachedItemListResponse fromJson(
+ String json,
+ AttachedItemService service,
+ AttachedItemListParams originalParams,
+ String itemId,
+ Response httpResponse) {
+ try {
+
+ List list =
+ JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
+ .map(AttachedItemListItem::fromJson)
+ .collect(java.util.stream.Collectors.toList());
+
+ String nextOffset = JsonUtil.getString(json, "next_offset");
+
+ return new AttachedItemListResponse(
+ list, nextOffset, itemId, service, originalParams, httpResponse);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse AttachedItemListResponse from JSON", e);
+ }
+ }
+
+ /** Get the list from the response. */
+ public List getList() {
+ return list;
+ }
+
+ /** Get the nextOffset from the response. */
+ public String getNextOffset() {
+ return nextOffset;
+ }
+
+ /** Check if there are more pages available. */
+ public boolean hasNextPage() {
+ return nextOffset != null && !nextOffset.isEmpty();
+ }
+
+ /**
+ * Get the next page of results.
+ *
+ * @throws ChargebeeException if unable to fetch next page
+ */
+ public AttachedItemListResponse nextPage() throws ChargebeeException {
+ if (!hasNextPage()) {
+ throw new IllegalStateException("No more pages available");
+ }
+ if (service == null) {
+ throw new UnsupportedOperationException(
+ "nextPage() requires service context. Use fromJson(json, service, originalParams, httpResponse).");
+ }
+
+ AttachedItemListParams nextParams =
+ (originalParams != null ? originalParams.toBuilder() : AttachedItemListParams.builder())
+ .offset(nextOffset)
+ .build();
+
+ return service.list(itemId, nextParams);
+ }
+
+ /** Get the raw response payload as JSON string. */
+ public String responsePayload() {
+ return httpResponse != null ? httpResponse.getBodyAsString() : null;
+ }
+
+ /** Get the HTTP status code. */
+ public int httpStatus() {
+ return httpResponse != null ? httpResponse.getStatusCode() : 0;
+ }
+
+ /** Get response headers. */
+ public java.util.Map> headers() {
+ return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap();
+ }
+
+ /** Get a specific header value. */
+ public java.util.List header(String name) {
+ if (httpResponse == null) return null;
+ return httpResponse.getHeaders().entrySet().stream()
+ .filter(e -> e.getKey().equalsIgnoreCase(name))
+ .map(java.util.Map.Entry::getValue)
+ .findFirst()
+ .orElse(null);
+ }
+
+ public static class AttachedItemListItem {
+
+ private AttachedItem attachedItem;
+
+ public AttachedItem getAttachedItem() {
+ return attachedItem;
+ }
+
+ public static AttachedItemListItem fromJson(String json) {
+ AttachedItemListItem item = new AttachedItemListItem();
+
+ String __attachedItemJson = JsonUtil.getObject(json, "attached_item");
+ if (__attachedItemJson != null) {
+ item.attachedItem = AttachedItem.fromJson(__attachedItemJson);
+ }
+
+ return item;
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemsForItemResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemsForItemResponse.java
deleted file mode 100644
index f46b0bfc..00000000
--- a/src/main/java/com/chargebee/v4/models/attachedItem/responses/AttachedItemsForItemResponse.java
+++ /dev/null
@@ -1,171 +0,0 @@
-package com.chargebee.v4.models.attachedItem.responses;
-
-import java.util.List;
-
-import com.chargebee.v4.models.attachedItem.AttachedItem;
-
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-import com.chargebee.v4.services.AttachedItemService;
-import com.chargebee.v4.models.attachedItem.params.AttachedItemsForItemParams;
-
-/** Immutable response object for AttachedItemsForItem operation. Contains paginated list data. */
-public final class AttachedItemsForItemResponse {
-
- private final List list;
-
- private final String nextOffset;
-
- private final String itemId;
-
- private final AttachedItemService service;
- private final AttachedItemsForItemParams originalParams;
- private final Response httpResponse;
-
- private AttachedItemsForItemResponse(
- List list,
- String nextOffset,
- String itemId,
- AttachedItemService service,
- AttachedItemsForItemParams originalParams,
- Response httpResponse) {
-
- this.list = list;
-
- this.nextOffset = nextOffset;
-
- this.itemId = itemId;
-
- this.service = service;
- this.originalParams = originalParams;
- this.httpResponse = httpResponse;
- }
-
- /**
- * Parse JSON response into AttachedItemsForItemResponse object (no service context). Use this
- * when you only need to read a single page (no nextPage()).
- */
- public static AttachedItemsForItemResponse fromJson(String json) {
- try {
-
- List list =
- JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
- .map(AttachedItemAttachedItemsForItemItem::fromJson)
- .collect(java.util.stream.Collectors.toList());
-
- String nextOffset = JsonUtil.getString(json, "next_offset");
-
- return new AttachedItemsForItemResponse(list, nextOffset, null, null, null, null);
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse AttachedItemsForItemResponse from JSON", e);
- }
- }
-
- /**
- * Parse JSON response into AttachedItemsForItemResponse object with service context for
- * pagination (enables nextPage()).
- */
- public static AttachedItemsForItemResponse fromJson(
- String json,
- AttachedItemService service,
- AttachedItemsForItemParams originalParams,
- String itemId,
- Response httpResponse) {
- try {
-
- List list =
- JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
- .map(AttachedItemAttachedItemsForItemItem::fromJson)
- .collect(java.util.stream.Collectors.toList());
-
- String nextOffset = JsonUtil.getString(json, "next_offset");
-
- return new AttachedItemsForItemResponse(
- list, nextOffset, itemId, service, originalParams, httpResponse);
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse AttachedItemsForItemResponse from JSON", e);
- }
- }
-
- /** Get the list from the response. */
- public List getList() {
- return list;
- }
-
- /** Get the nextOffset from the response. */
- public String getNextOffset() {
- return nextOffset;
- }
-
- /** Check if there are more pages available. */
- public boolean hasNextPage() {
- return nextOffset != null && !nextOffset.isEmpty();
- }
-
- /**
- * Get the next page of results.
- *
- * @throws Exception if unable to fetch next page
- */
- public AttachedItemsForItemResponse nextPage() throws Exception {
- if (!hasNextPage()) {
- throw new IllegalStateException("No more pages available");
- }
- if (service == null) {
- throw new UnsupportedOperationException(
- "nextPage() requires service context. Use fromJson(json, service, originalParams, httpResponse).");
- }
-
- AttachedItemsForItemParams nextParams =
- (originalParams != null ? originalParams.toBuilder() : AttachedItemsForItemParams.builder())
- .offset(nextOffset)
- .build();
-
- return service.attachedItemsForItem(itemId, nextParams);
- }
-
- /** Get the raw response payload as JSON string. */
- public String responsePayload() {
- return httpResponse != null ? httpResponse.getBodyAsString() : null;
- }
-
- /** Get the HTTP status code. */
- public int httpStatus() {
- return httpResponse != null ? httpResponse.getStatusCode() : 0;
- }
-
- /** Get response headers. */
- public java.util.Map> headers() {
- return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap();
- }
-
- /** Get a specific header value. */
- public java.util.List header(String name) {
- if (httpResponse == null) return null;
- return httpResponse.getHeaders().entrySet().stream()
- .filter(e -> e.getKey().equalsIgnoreCase(name))
- .map(java.util.Map.Entry::getValue)
- .findFirst()
- .orElse(null);
- }
-
- public static class AttachedItemAttachedItemsForItemItem {
-
- private AttachedItem attachedItem;
-
- public AttachedItem getAttachedItem() {
- return attachedItem;
- }
-
- public static AttachedItemAttachedItemsForItemItem fromJson(String json) {
- AttachedItemAttachedItemsForItemItem item = new AttachedItemAttachedItemsForItemItem();
-
- String __attachedItemJson = JsonUtil.getObject(json, "attached_item");
- if (__attachedItemJson != null) {
- item.attachedItem = AttachedItem.fromJson(__attachedItemJson);
- }
-
- return item;
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/responses/DeleteAttachedItemResponse.java b/src/main/java/com/chargebee/v4/models/attachedItem/responses/DeleteAttachedItemResponse.java
deleted file mode 100644
index d8d835dc..00000000
--- a/src/main/java/com/chargebee/v4/models/attachedItem/responses/DeleteAttachedItemResponse.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.chargebee.v4.models.attachedItem.responses;
-
-import com.chargebee.v4.models.attachedItem.AttachedItem;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for DeleteAttachedItem operation. Contains the response data from the
- * API.
- */
-public final class DeleteAttachedItemResponse extends BaseResponse {
- private final AttachedItem attachedItem;
-
- private DeleteAttachedItemResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.attachedItem = builder.attachedItem;
- }
-
- /** Parse JSON response into DeleteAttachedItemResponse object. */
- public static DeleteAttachedItemResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into DeleteAttachedItemResponse object with HTTP response. */
- public static DeleteAttachedItemResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __attachedItemJson = JsonUtil.getObject(json, "attached_item");
- if (__attachedItemJson != null) {
- builder.attachedItem(AttachedItem.fromJson(__attachedItemJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse DeleteAttachedItemResponse from JSON", e);
- }
- }
-
- /** Create a new builder for DeleteAttachedItemResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for DeleteAttachedItemResponse. */
- public static class Builder {
-
- private AttachedItem attachedItem;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder attachedItem(AttachedItem attachedItem) {
- this.attachedItem = attachedItem;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public DeleteAttachedItemResponse build() {
- return new DeleteAttachedItemResponse(this);
- }
- }
-
- /** Get the attachedItem from the response. */
- public AttachedItem getAttachedItem() {
- return attachedItem;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationExecuteParams.java b/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationExecuteParams.java
deleted file mode 100644
index 26bd3a4d..00000000
--- a/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationExecuteParams.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.brandConfiguration.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class BrandConfigurationExecuteParams {
-
- private final Map queryParams;
-
- private BrandConfigurationExecuteParams(BrandConfigurationExecuteBuilder builder) {
- this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
- }
-
- /** Get the query parameters for this request. */
- public Map toQueryParams() {
- return queryParams;
- }
-
- public BrandConfigurationExecuteBuilder toBuilder() {
- BrandConfigurationExecuteBuilder builder = new BrandConfigurationExecuteBuilder();
- builder.queryParams.putAll(queryParams);
- return builder;
- }
-
- /** Create a new builder for BrandConfigurationExecuteParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static BrandConfigurationExecuteBuilder builder() {
- return new BrandConfigurationExecuteBuilder();
- }
-
- public static final class BrandConfigurationExecuteBuilder {
- private final Map queryParams = new LinkedHashMap<>();
-
- private BrandConfigurationExecuteBuilder() {}
-
- public BrandConfigurationExecuteParams build() {
- return new BrandConfigurationExecuteParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java b/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java
new file mode 100644
index 00000000..dfeeec97
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/brandConfiguration/params/BrandConfigurationRetrieveParams.java
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+
+package com.chargebee.v4.models.brandConfiguration.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class BrandConfigurationRetrieveParams {
+
+ private final Map queryParams;
+
+ private BrandConfigurationRetrieveParams(BrandConfigurationRetrieveBuilder builder) {
+ this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
+ }
+
+ /** Get the query parameters for this request. */
+ public Map toQueryParams() {
+ return queryParams;
+ }
+
+ public BrandConfigurationRetrieveBuilder toBuilder() {
+ BrandConfigurationRetrieveBuilder builder = new BrandConfigurationRetrieveBuilder();
+ builder.queryParams.putAll(queryParams);
+ return builder;
+ }
+
+ /** Create a new builder for BrandConfigurationRetrieveParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static BrandConfigurationRetrieveBuilder builder() {
+ return new BrandConfigurationRetrieveBuilder();
+ }
+
+ public static final class BrandConfigurationRetrieveBuilder {
+ private final Map queryParams = new LinkedHashMap<>();
+
+ private BrandConfigurationRetrieveBuilder() {}
+
+ public BrandConfigurationRetrieveParams build() {
+ return new BrandConfigurationRetrieveParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/brandConfiguration/responses/BrandConfigurationExecuteResponse.java b/src/main/java/com/chargebee/v4/models/brandConfiguration/responses/BrandConfigurationExecuteResponse.java
deleted file mode 100644
index 30336cb1..00000000
--- a/src/main/java/com/chargebee/v4/models/brandConfiguration/responses/BrandConfigurationExecuteResponse.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.chargebee.v4.models.brandConfiguration.responses;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for BrandConfigurationExecute operation. Contains the response data
- * from a single resource get operation.
- */
-public final class BrandConfigurationExecuteResponse extends BaseResponse {
- private final Object brandConfiguration;
-
- private BrandConfigurationExecuteResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.brandConfiguration = builder.brandConfiguration;
- }
-
- /** Parse JSON response into BrandConfigurationExecuteResponse object. */
- public static BrandConfigurationExecuteResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into BrandConfigurationExecuteResponse object with HTTP response. */
- public static BrandConfigurationExecuteResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- builder.brandConfiguration(JsonUtil.getObject(json, "brand_configuration"));
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse BrandConfigurationExecuteResponse from JSON", e);
- }
- }
-
- /** Create a new builder for BrandConfigurationExecuteResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for BrandConfigurationExecuteResponse. */
- public static class Builder {
-
- private Object brandConfiguration;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder brandConfiguration(Object brandConfiguration) {
- this.brandConfiguration = brandConfiguration;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public BrandConfigurationExecuteResponse build() {
- return new BrandConfigurationExecuteResponse(this);
- }
- }
-
- /** Get the brandConfiguration from the response. */
- public Object getBrandConfiguration() {
- return brandConfiguration;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/brandConfiguration/responses/BrandConfigurationRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/brandConfiguration/responses/BrandConfigurationRetrieveResponse.java
new file mode 100644
index 00000000..3fd5d880
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/brandConfiguration/responses/BrandConfigurationRetrieveResponse.java
@@ -0,0 +1,72 @@
+package com.chargebee.v4.models.brandConfiguration.responses;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for BrandConfigurationRetrieve operation. Contains the response data
+ * from a single resource get operation.
+ */
+public final class BrandConfigurationRetrieveResponse extends BaseResponse {
+ private final Object brandConfiguration;
+
+ private BrandConfigurationRetrieveResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.brandConfiguration = builder.brandConfiguration;
+ }
+
+ /** Parse JSON response into BrandConfigurationRetrieveResponse object. */
+ public static BrandConfigurationRetrieveResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into BrandConfigurationRetrieveResponse object with HTTP response. */
+ public static BrandConfigurationRetrieveResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ builder.brandConfiguration(JsonUtil.getObject(json, "brand_configuration"));
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse BrandConfigurationRetrieveResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for BrandConfigurationRetrieveResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for BrandConfigurationRetrieveResponse. */
+ public static class Builder {
+
+ private Object brandConfiguration;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder brandConfiguration(Object brandConfiguration) {
+ this.brandConfiguration = brandConfiguration;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public BrandConfigurationRetrieveResponse build() {
+ return new BrandConfigurationRetrieveResponse(this);
+ }
+ }
+
+ /** Get the brandConfiguration from the response. */
+ public Object getBrandConfiguration() {
+ return brandConfiguration;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityCreateTransfersParams.java b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityCreateTransfersParams.java
new file mode 100644
index 00000000..21ccbaa2
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityCreateTransfersParams.java
@@ -0,0 +1,143 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.businessEntity.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.List;
+
+public final class BusinessEntityCreateTransfersParams {
+
+ private final List activeResourceIds;
+
+ private final List destinationBusinessEntityIds;
+
+ private final List sourceBusinessEntityIds;
+
+ private final List resourceTypes;
+
+ private final List reasonCodes;
+
+ private BusinessEntityCreateTransfersParams(BusinessEntityCreateTransfersBuilder builder) {
+
+ this.activeResourceIds = builder.activeResourceIds;
+
+ this.destinationBusinessEntityIds = builder.destinationBusinessEntityIds;
+
+ this.sourceBusinessEntityIds = builder.sourceBusinessEntityIds;
+
+ this.resourceTypes = builder.resourceTypes;
+
+ this.reasonCodes = builder.reasonCodes;
+ }
+
+ public List getActiveResourceIds() {
+ return activeResourceIds;
+ }
+
+ public List getDestinationBusinessEntityIds() {
+ return destinationBusinessEntityIds;
+ }
+
+ public List getSourceBusinessEntityIds() {
+ return sourceBusinessEntityIds;
+ }
+
+ public List getResourceTypes() {
+ return resourceTypes;
+ }
+
+ public List getReasonCodes() {
+ return reasonCodes;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.activeResourceIds != null) {
+
+ formData.put("active_resource_ids", this.activeResourceIds);
+ }
+
+ if (this.destinationBusinessEntityIds != null) {
+
+ formData.put("destination_business_entity_ids", this.destinationBusinessEntityIds);
+ }
+
+ if (this.sourceBusinessEntityIds != null) {
+
+ formData.put("source_business_entity_ids", this.sourceBusinessEntityIds);
+ }
+
+ if (this.resourceTypes != null) {
+
+ formData.put("resource_types", this.resourceTypes);
+ }
+
+ if (this.reasonCodes != null) {
+
+ formData.put("reason_codes", this.reasonCodes);
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for BusinessEntityCreateTransfersParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static BusinessEntityCreateTransfersBuilder builder() {
+ return new BusinessEntityCreateTransfersBuilder();
+ }
+
+ public static final class BusinessEntityCreateTransfersBuilder {
+
+ private List activeResourceIds;
+
+ private List destinationBusinessEntityIds;
+
+ private List sourceBusinessEntityIds;
+
+ private List resourceTypes;
+
+ private List reasonCodes;
+
+ private BusinessEntityCreateTransfersBuilder() {}
+
+ public BusinessEntityCreateTransfersBuilder activeResourceIds(List value) {
+ this.activeResourceIds = value;
+ return this;
+ }
+
+ public BusinessEntityCreateTransfersBuilder destinationBusinessEntityIds(List value) {
+ this.destinationBusinessEntityIds = value;
+ return this;
+ }
+
+ @Deprecated
+ public BusinessEntityCreateTransfersBuilder sourceBusinessEntityIds(List value) {
+ this.sourceBusinessEntityIds = value;
+ return this;
+ }
+
+ @Deprecated
+ public BusinessEntityCreateTransfersBuilder resourceTypes(List value) {
+ this.resourceTypes = value;
+ return this;
+ }
+
+ public BusinessEntityCreateTransfersBuilder reasonCodes(List value) {
+ this.reasonCodes = value;
+ return this;
+ }
+
+ public BusinessEntityCreateTransfersParams build() {
+ return new BusinessEntityCreateTransfersParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityGetTransfersParams.java b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityGetTransfersParams.java
new file mode 100644
index 00000000..7d0fad79
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityGetTransfersParams.java
@@ -0,0 +1,247 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+
+package com.chargebee.v4.models.businessEntity.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.sql.Timestamp;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class BusinessEntityGetTransfersParams {
+
+ private final Map queryParams;
+
+ private BusinessEntityGetTransfersParams(BusinessEntityGetTransfersBuilder builder) {
+ this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
+ }
+
+ /** Get the query parameters for this request. */
+ public Map toQueryParams() {
+ return queryParams;
+ }
+
+ public BusinessEntityGetTransfersBuilder toBuilder() {
+ BusinessEntityGetTransfersBuilder builder = new BusinessEntityGetTransfersBuilder();
+ builder.queryParams.putAll(queryParams);
+ return builder;
+ }
+
+ /** Create a new builder for BusinessEntityGetTransfersParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static BusinessEntityGetTransfersBuilder builder() {
+ return new BusinessEntityGetTransfersBuilder();
+ }
+
+ public static final class BusinessEntityGetTransfersBuilder {
+ private final Map queryParams = new LinkedHashMap<>();
+
+ private BusinessEntityGetTransfersBuilder() {}
+
+ public BusinessEntityGetTransfersBuilder limit(Integer value) {
+ queryParams.put("limit", value);
+ return this;
+ }
+
+ public BusinessEntityGetTransfersBuilder offset(String value) {
+ queryParams.put("offset", value);
+ return this;
+ }
+
+ public ResourceTypeFilter resourceType() {
+ return new ResourceTypeFilter("resource_type", this);
+ }
+
+ public ResourceIdFilter resourceId() {
+ return new ResourceIdFilter("resource_id", this);
+ }
+
+ public ActiveResourceIdFilter activeResourceId() {
+ return new ActiveResourceIdFilter("active_resource_id", this);
+ }
+
+ public CreatedAtFilter createdAt() {
+ return new CreatedAtFilter("created_at", this);
+ }
+
+ public SortBySortBuilder sortBy() {
+ return new SortBySortBuilder("sort_by", this);
+ }
+
+ public BusinessEntityGetTransfersParams build() {
+ return new BusinessEntityGetTransfersParams(this);
+ }
+
+ public static final class ResourceTypeFilter {
+ private final String fieldName;
+ private final BusinessEntityGetTransfersBuilder builder;
+
+ ResourceTypeFilter(String fieldName, BusinessEntityGetTransfersBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+ }
+
+ public static final class ResourceIdFilter {
+ private final String fieldName;
+ private final BusinessEntityGetTransfersBuilder builder;
+
+ ResourceIdFilter(String fieldName, BusinessEntityGetTransfersBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+ }
+
+ public static final class ActiveResourceIdFilter {
+ private final String fieldName;
+ private final BusinessEntityGetTransfersBuilder builder;
+
+ ActiveResourceIdFilter(String fieldName, BusinessEntityGetTransfersBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder is(String value) {
+ builder.queryParams.put(fieldName + "[is]", value);
+ return builder;
+ }
+ }
+
+ public static final class CreatedAtFilter {
+ private final String fieldName;
+ private final BusinessEntityGetTransfersBuilder builder;
+
+ CreatedAtFilter(String fieldName, BusinessEntityGetTransfersBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder after(Timestamp timestamp) {
+ builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000);
+ return builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder before(Timestamp timestamp) {
+ builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000);
+ return builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder on(Timestamp timestamp) {
+ builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000);
+ return builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder between(Timestamp start, Timestamp end) {
+ builder.queryParams.put(
+ fieldName + "[between]",
+ "[" + (start.getTime() / 1000) + "," + (end.getTime() / 1000) + "]");
+ return builder;
+ }
+ }
+
+ public static final class SortBySortBuilder {
+ private final String fieldName;
+ private final BusinessEntityGetTransfersBuilder builder;
+
+ SortBySortBuilder(String fieldName, BusinessEntityGetTransfersBuilder builder) {
+ this.fieldName = fieldName;
+ this.builder = builder;
+ }
+
+ public SortDirection created_at() {
+ return new SortDirection(fieldName, "created_at", builder);
+ }
+ }
+
+ public static final class SortDirection {
+ private final String fieldName;
+ private final String selectedField;
+ private final BusinessEntityGetTransfersBuilder builder;
+
+ SortDirection(
+ String fieldName, String selectedField, BusinessEntityGetTransfersBuilder builder) {
+ this.fieldName = fieldName;
+ this.selectedField = selectedField;
+ this.builder = builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder asc() {
+ builder.queryParams.put(fieldName + "[asc]", selectedField);
+ return builder;
+ }
+
+ public BusinessEntityGetTransfersBuilder desc() {
+ builder.queryParams.put(fieldName + "[desc]", selectedField);
+ return builder;
+ }
+ }
+ }
+
+ public enum SortByAsc {
+ CREATED_AT("created_at"),
+
+ /** An enum member indicating that SortByAsc was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ SortByAsc(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static SortByAsc fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (SortByAsc enumValue : SortByAsc.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum SortByDesc {
+ CREATED_AT("created_at"),
+
+ /** An enum member indicating that SortByDesc was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ SortByDesc(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static SortByDesc fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (SortByDesc enumValue : SortByDesc.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityListTransfersParams.java b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityListTransfersParams.java
deleted file mode 100644
index 00a799b8..00000000
--- a/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityListTransfersParams.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.businessEntity.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.sql.Timestamp;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class BusinessEntityListTransfersParams {
-
- private final Map queryParams;
-
- private BusinessEntityListTransfersParams(BusinessEntityListTransfersBuilder builder) {
- this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
- }
-
- /** Get the query parameters for this request. */
- public Map toQueryParams() {
- return queryParams;
- }
-
- public BusinessEntityListTransfersBuilder toBuilder() {
- BusinessEntityListTransfersBuilder builder = new BusinessEntityListTransfersBuilder();
- builder.queryParams.putAll(queryParams);
- return builder;
- }
-
- /** Create a new builder for BusinessEntityListTransfersParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static BusinessEntityListTransfersBuilder builder() {
- return new BusinessEntityListTransfersBuilder();
- }
-
- public static final class BusinessEntityListTransfersBuilder {
- private final Map queryParams = new LinkedHashMap<>();
-
- private BusinessEntityListTransfersBuilder() {}
-
- public BusinessEntityListTransfersBuilder limit(Integer value) {
- queryParams.put("limit", value);
- return this;
- }
-
- public BusinessEntityListTransfersBuilder offset(String value) {
- queryParams.put("offset", value);
- return this;
- }
-
- public ResourceTypeFilter resourceType() {
- return new ResourceTypeFilter("resource_type", this);
- }
-
- public ResourceIdFilter resourceId() {
- return new ResourceIdFilter("resource_id", this);
- }
-
- public ActiveResourceIdFilter activeResourceId() {
- return new ActiveResourceIdFilter("active_resource_id", this);
- }
-
- public CreatedAtFilter createdAt() {
- return new CreatedAtFilter("created_at", this);
- }
-
- public SortBySortBuilder sortBy() {
- return new SortBySortBuilder("sort_by", this);
- }
-
- public BusinessEntityListTransfersParams build() {
- return new BusinessEntityListTransfersParams(this);
- }
-
- public static final class ResourceTypeFilter {
- private final String fieldName;
- private final BusinessEntityListTransfersBuilder builder;
-
- ResourceTypeFilter(String fieldName, BusinessEntityListTransfersBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public BusinessEntityListTransfersBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
- }
-
- public static final class ResourceIdFilter {
- private final String fieldName;
- private final BusinessEntityListTransfersBuilder builder;
-
- ResourceIdFilter(String fieldName, BusinessEntityListTransfersBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public BusinessEntityListTransfersBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
- }
-
- public static final class ActiveResourceIdFilter {
- private final String fieldName;
- private final BusinessEntityListTransfersBuilder builder;
-
- ActiveResourceIdFilter(String fieldName, BusinessEntityListTransfersBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public BusinessEntityListTransfersBuilder is(String value) {
- builder.queryParams.put(fieldName + "[is]", value);
- return builder;
- }
- }
-
- public static final class CreatedAtFilter {
- private final String fieldName;
- private final BusinessEntityListTransfersBuilder builder;
-
- CreatedAtFilter(String fieldName, BusinessEntityListTransfersBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public BusinessEntityListTransfersBuilder after(Timestamp timestamp) {
- builder.queryParams.put(fieldName + "[after]", timestamp.getTime() / 1000);
- return builder;
- }
-
- public BusinessEntityListTransfersBuilder before(Timestamp timestamp) {
- builder.queryParams.put(fieldName + "[before]", timestamp.getTime() / 1000);
- return builder;
- }
-
- public BusinessEntityListTransfersBuilder on(Timestamp timestamp) {
- builder.queryParams.put(fieldName + "[on]", timestamp.getTime() / 1000);
- return builder;
- }
-
- public BusinessEntityListTransfersBuilder between(Timestamp start, Timestamp end) {
- builder.queryParams.put(
- fieldName + "[between]",
- "[" + (start.getTime() / 1000) + "," + (end.getTime() / 1000) + "]");
- return builder;
- }
- }
-
- public static final class SortBySortBuilder {
- private final String fieldName;
- private final BusinessEntityListTransfersBuilder builder;
-
- SortBySortBuilder(String fieldName, BusinessEntityListTransfersBuilder builder) {
- this.fieldName = fieldName;
- this.builder = builder;
- }
-
- public SortDirection created_at() {
- return new SortDirection(fieldName, "created_at", builder);
- }
- }
-
- public static final class SortDirection {
- private final String fieldName;
- private final String selectedField;
- private final BusinessEntityListTransfersBuilder builder;
-
- SortDirection(
- String fieldName, String selectedField, BusinessEntityListTransfersBuilder builder) {
- this.fieldName = fieldName;
- this.selectedField = selectedField;
- this.builder = builder;
- }
-
- public BusinessEntityListTransfersBuilder asc() {
- builder.queryParams.put(fieldName + "[asc]", selectedField);
- return builder;
- }
-
- public BusinessEntityListTransfersBuilder desc() {
- builder.queryParams.put(fieldName + "[desc]", selectedField);
- return builder;
- }
- }
- }
-
- public enum SortByAsc {
- CREATED_AT("created_at"),
-
- /** An enum member indicating that SortByAsc was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- SortByAsc(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static SortByAsc fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (SortByAsc enumValue : SortByAsc.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum SortByDesc {
- CREATED_AT("created_at"),
-
- /** An enum member indicating that SortByDesc was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- SortByDesc(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static SortByDesc fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (SortByDesc enumValue : SortByDesc.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityTransfersParams.java b/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityTransfersParams.java
deleted file mode 100644
index 8536aeb4..00000000
--- a/src/main/java/com/chargebee/v4/models/businessEntity/params/BusinessEntityTransfersParams.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.businessEntity.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.List;
-
-public final class BusinessEntityTransfersParams {
-
- private final List activeResourceIds;
-
- private final List destinationBusinessEntityIds;
-
- private final List sourceBusinessEntityIds;
-
- private final List resourceTypes;
-
- private final List reasonCodes;
-
- private BusinessEntityTransfersParams(BusinessEntityTransfersBuilder builder) {
-
- this.activeResourceIds = builder.activeResourceIds;
-
- this.destinationBusinessEntityIds = builder.destinationBusinessEntityIds;
-
- this.sourceBusinessEntityIds = builder.sourceBusinessEntityIds;
-
- this.resourceTypes = builder.resourceTypes;
-
- this.reasonCodes = builder.reasonCodes;
- }
-
- public List getActiveResourceIds() {
- return activeResourceIds;
- }
-
- public List getDestinationBusinessEntityIds() {
- return destinationBusinessEntityIds;
- }
-
- public List getSourceBusinessEntityIds() {
- return sourceBusinessEntityIds;
- }
-
- public List getResourceTypes() {
- return resourceTypes;
- }
-
- public List getReasonCodes() {
- return reasonCodes;
- }
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- if (this.activeResourceIds != null) {
-
- formData.put("active_resource_ids", this.activeResourceIds);
- }
-
- if (this.destinationBusinessEntityIds != null) {
-
- formData.put("destination_business_entity_ids", this.destinationBusinessEntityIds);
- }
-
- if (this.sourceBusinessEntityIds != null) {
-
- formData.put("source_business_entity_ids", this.sourceBusinessEntityIds);
- }
-
- if (this.resourceTypes != null) {
-
- formData.put("resource_types", this.resourceTypes);
- }
-
- if (this.reasonCodes != null) {
-
- formData.put("reason_codes", this.reasonCodes);
- }
-
- return formData;
- }
-
- /** Create a new builder for BusinessEntityTransfersParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static BusinessEntityTransfersBuilder builder() {
- return new BusinessEntityTransfersBuilder();
- }
-
- public static final class BusinessEntityTransfersBuilder {
-
- private List activeResourceIds;
-
- private List destinationBusinessEntityIds;
-
- private List sourceBusinessEntityIds;
-
- private List resourceTypes;
-
- private List reasonCodes;
-
- private BusinessEntityTransfersBuilder() {}
-
- public BusinessEntityTransfersBuilder activeResourceIds(List value) {
- this.activeResourceIds = value;
- return this;
- }
-
- public BusinessEntityTransfersBuilder destinationBusinessEntityIds(List value) {
- this.destinationBusinessEntityIds = value;
- return this;
- }
-
- @Deprecated
- public BusinessEntityTransfersBuilder sourceBusinessEntityIds(List value) {
- this.sourceBusinessEntityIds = value;
- return this;
- }
-
- @Deprecated
- public BusinessEntityTransfersBuilder resourceTypes(List value) {
- this.resourceTypes = value;
- return this;
- }
-
- public BusinessEntityTransfersBuilder reasonCodes(List value) {
- this.reasonCodes = value;
- return this;
- }
-
- public BusinessEntityTransfersParams build() {
- return new BusinessEntityTransfersParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityCreateTransfersResponse.java b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityCreateTransfersResponse.java
new file mode 100644
index 00000000..470bc95d
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityCreateTransfersResponse.java
@@ -0,0 +1,79 @@
+package com.chargebee.v4.models.businessEntity.responses;
+
+import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for BusinessEntityCreateTransfers operation. Contains the response data
+ * from the API.
+ */
+public final class BusinessEntityCreateTransfersResponse extends BaseResponse {
+ private final BusinessEntityTransfer businessEntityTransfer;
+
+ private BusinessEntityCreateTransfersResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.businessEntityTransfer = builder.businessEntityTransfer;
+ }
+
+ /** Parse JSON response into BusinessEntityCreateTransfersResponse object. */
+ public static BusinessEntityCreateTransfersResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into BusinessEntityCreateTransfersResponse object with HTTP response. */
+ public static BusinessEntityCreateTransfersResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __businessEntityTransferJson = JsonUtil.getObject(json, "business_entity_transfer");
+ if (__businessEntityTransferJson != null) {
+ builder.businessEntityTransfer(
+ BusinessEntityTransfer.fromJson(__businessEntityTransferJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException(
+ "Failed to parse BusinessEntityCreateTransfersResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for BusinessEntityCreateTransfersResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for BusinessEntityCreateTransfersResponse. */
+ public static class Builder {
+
+ private BusinessEntityTransfer businessEntityTransfer;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder businessEntityTransfer(BusinessEntityTransfer businessEntityTransfer) {
+ this.businessEntityTransfer = businessEntityTransfer;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public BusinessEntityCreateTransfersResponse build() {
+ return new BusinessEntityCreateTransfersResponse(this);
+ }
+ }
+
+ /** Get the businessEntityTransfer from the response. */
+ public BusinessEntityTransfer getBusinessEntityTransfer() {
+ return businessEntityTransfer;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityGetTransfersResponse.java b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityGetTransfersResponse.java
new file mode 100644
index 00000000..7a748ecc
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityGetTransfersResponse.java
@@ -0,0 +1,170 @@
+package com.chargebee.v4.models.businessEntity.responses;
+
+import java.util.List;
+
+import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer;
+
+import com.chargebee.v4.exceptions.ChargebeeException;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+import com.chargebee.v4.services.BusinessEntityService;
+import com.chargebee.v4.models.businessEntity.params.BusinessEntityGetTransfersParams;
+
+/**
+ * Immutable response object for BusinessEntityGetTransfers operation. Contains paginated list data.
+ */
+public final class BusinessEntityGetTransfersResponse {
+
+ private final List list;
+
+ private final String nextOffset;
+
+ private final BusinessEntityService service;
+ private final BusinessEntityGetTransfersParams originalParams;
+ private final Response httpResponse;
+
+ private BusinessEntityGetTransfersResponse(
+ List list,
+ String nextOffset,
+ BusinessEntityService service,
+ BusinessEntityGetTransfersParams originalParams,
+ Response httpResponse) {
+
+ this.list = list;
+
+ this.nextOffset = nextOffset;
+
+ this.service = service;
+ this.originalParams = originalParams;
+ this.httpResponse = httpResponse;
+ }
+
+ /**
+ * Parse JSON response into BusinessEntityGetTransfersResponse object (no service context). Use
+ * this when you only need to read a single page (no nextPage()).
+ */
+ public static BusinessEntityGetTransfersResponse fromJson(String json) {
+ try {
+
+ List list =
+ JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
+ .map(BusinessEntityGetTransfersItem::fromJson)
+ .collect(java.util.stream.Collectors.toList());
+
+ String nextOffset = JsonUtil.getString(json, "next_offset");
+
+ return new BusinessEntityGetTransfersResponse(list, nextOffset, null, null, null);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse BusinessEntityGetTransfersResponse from JSON", e);
+ }
+ }
+
+ /**
+ * Parse JSON response into BusinessEntityGetTransfersResponse object with service context for
+ * pagination (enables nextPage()).
+ */
+ public static BusinessEntityGetTransfersResponse fromJson(
+ String json,
+ BusinessEntityService service,
+ BusinessEntityGetTransfersParams originalParams,
+ Response httpResponse) {
+ try {
+
+ List list =
+ JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
+ .map(BusinessEntityGetTransfersItem::fromJson)
+ .collect(java.util.stream.Collectors.toList());
+
+ String nextOffset = JsonUtil.getString(json, "next_offset");
+
+ return new BusinessEntityGetTransfersResponse(
+ list, nextOffset, service, originalParams, httpResponse);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse BusinessEntityGetTransfersResponse from JSON", e);
+ }
+ }
+
+ /** Get the list from the response. */
+ public List getList() {
+ return list;
+ }
+
+ /** Get the nextOffset from the response. */
+ public String getNextOffset() {
+ return nextOffset;
+ }
+
+ /** Check if there are more pages available. */
+ public boolean hasNextPage() {
+ return nextOffset != null && !nextOffset.isEmpty();
+ }
+
+ /**
+ * Get the next page of results.
+ *
+ * @throws ChargebeeException if unable to fetch next page
+ */
+ public BusinessEntityGetTransfersResponse nextPage() throws ChargebeeException {
+ if (!hasNextPage()) {
+ throw new IllegalStateException("No more pages available");
+ }
+ if (service == null) {
+ throw new UnsupportedOperationException(
+ "nextPage() requires service context. Use fromJson(json, service, originalParams, httpResponse).");
+ }
+
+ BusinessEntityGetTransfersParams nextParams =
+ (originalParams != null
+ ? originalParams.toBuilder()
+ : BusinessEntityGetTransfersParams.builder())
+ .offset(nextOffset)
+ .build();
+
+ return service.getTransfers(nextParams);
+ }
+
+ /** Get the raw response payload as JSON string. */
+ public String responsePayload() {
+ return httpResponse != null ? httpResponse.getBodyAsString() : null;
+ }
+
+ /** Get the HTTP status code. */
+ public int httpStatus() {
+ return httpResponse != null ? httpResponse.getStatusCode() : 0;
+ }
+
+ /** Get response headers. */
+ public java.util.Map> headers() {
+ return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap();
+ }
+
+ /** Get a specific header value. */
+ public java.util.List header(String name) {
+ if (httpResponse == null) return null;
+ return httpResponse.getHeaders().entrySet().stream()
+ .filter(e -> e.getKey().equalsIgnoreCase(name))
+ .map(java.util.Map.Entry::getValue)
+ .findFirst()
+ .orElse(null);
+ }
+
+ public static class BusinessEntityGetTransfersItem {
+
+ private BusinessEntityTransfer businessEntityTransfer;
+
+ public BusinessEntityTransfer getBusinessEntityTransfer() {
+ return businessEntityTransfer;
+ }
+
+ public static BusinessEntityGetTransfersItem fromJson(String json) {
+ BusinessEntityGetTransfersItem item = new BusinessEntityGetTransfersItem();
+
+ String __businessEntityTransferJson = JsonUtil.getObject(json, "business_entity_transfer");
+ if (__businessEntityTransferJson != null) {
+ item.businessEntityTransfer = BusinessEntityTransfer.fromJson(__businessEntityTransferJson);
+ }
+
+ return item;
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityListTransfersResponse.java b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityListTransfersResponse.java
deleted file mode 100644
index f1fb6fcc..00000000
--- a/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityListTransfersResponse.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package com.chargebee.v4.models.businessEntity.responses;
-
-import java.util.List;
-
-import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer;
-
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-import com.chargebee.v4.services.BusinessEntityService;
-import com.chargebee.v4.models.businessEntity.params.BusinessEntityListTransfersParams;
-
-/**
- * Immutable response object for BusinessEntityListTransfers operation. Contains paginated list
- * data.
- */
-public final class BusinessEntityListTransfersResponse {
-
- private final List list;
-
- private final String nextOffset;
-
- private final BusinessEntityService service;
- private final BusinessEntityListTransfersParams originalParams;
- private final Response httpResponse;
-
- private BusinessEntityListTransfersResponse(
- List list,
- String nextOffset,
- BusinessEntityService service,
- BusinessEntityListTransfersParams originalParams,
- Response httpResponse) {
-
- this.list = list;
-
- this.nextOffset = nextOffset;
-
- this.service = service;
- this.originalParams = originalParams;
- this.httpResponse = httpResponse;
- }
-
- /**
- * Parse JSON response into BusinessEntityListTransfersResponse object (no service context). Use
- * this when you only need to read a single page (no nextPage()).
- */
- public static BusinessEntityListTransfersResponse fromJson(String json) {
- try {
-
- List list =
- JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
- .map(BusinessEntityListTransfersItem::fromJson)
- .collect(java.util.stream.Collectors.toList());
-
- String nextOffset = JsonUtil.getString(json, "next_offset");
-
- return new BusinessEntityListTransfersResponse(list, nextOffset, null, null, null);
- } catch (Exception e) {
- throw new RuntimeException(
- "Failed to parse BusinessEntityListTransfersResponse from JSON", e);
- }
- }
-
- /**
- * Parse JSON response into BusinessEntityListTransfersResponse object with service context for
- * pagination (enables nextPage()).
- */
- public static BusinessEntityListTransfersResponse fromJson(
- String json,
- BusinessEntityService service,
- BusinessEntityListTransfersParams originalParams,
- Response httpResponse) {
- try {
-
- List list =
- JsonUtil.parseObjectArray(JsonUtil.getArray(json, "list")).stream()
- .map(BusinessEntityListTransfersItem::fromJson)
- .collect(java.util.stream.Collectors.toList());
-
- String nextOffset = JsonUtil.getString(json, "next_offset");
-
- return new BusinessEntityListTransfersResponse(
- list, nextOffset, service, originalParams, httpResponse);
- } catch (Exception e) {
- throw new RuntimeException(
- "Failed to parse BusinessEntityListTransfersResponse from JSON", e);
- }
- }
-
- /** Get the list from the response. */
- public List getList() {
- return list;
- }
-
- /** Get the nextOffset from the response. */
- public String getNextOffset() {
- return nextOffset;
- }
-
- /** Check if there are more pages available. */
- public boolean hasNextPage() {
- return nextOffset != null && !nextOffset.isEmpty();
- }
-
- /**
- * Get the next page of results.
- *
- * @throws Exception if unable to fetch next page
- */
- public BusinessEntityListTransfersResponse nextPage() throws Exception {
- if (!hasNextPage()) {
- throw new IllegalStateException("No more pages available");
- }
- if (service == null) {
- throw new UnsupportedOperationException(
- "nextPage() requires service context. Use fromJson(json, service, originalParams, httpResponse).");
- }
-
- BusinessEntityListTransfersParams nextParams =
- (originalParams != null
- ? originalParams.toBuilder()
- : BusinessEntityListTransfersParams.builder())
- .offset(nextOffset)
- .build();
-
- return service.listTransfers(nextParams);
- }
-
- /** Get the raw response payload as JSON string. */
- public String responsePayload() {
- return httpResponse != null ? httpResponse.getBodyAsString() : null;
- }
-
- /** Get the HTTP status code. */
- public int httpStatus() {
- return httpResponse != null ? httpResponse.getStatusCode() : 0;
- }
-
- /** Get response headers. */
- public java.util.Map> headers() {
- return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap();
- }
-
- /** Get a specific header value. */
- public java.util.List header(String name) {
- if (httpResponse == null) return null;
- return httpResponse.getHeaders().entrySet().stream()
- .filter(e -> e.getKey().equalsIgnoreCase(name))
- .map(java.util.Map.Entry::getValue)
- .findFirst()
- .orElse(null);
- }
-
- public static class BusinessEntityListTransfersItem {
-
- private BusinessEntityTransfer businessEntityTransfer;
-
- public BusinessEntityTransfer getBusinessEntityTransfer() {
- return businessEntityTransfer;
- }
-
- public static BusinessEntityListTransfersItem fromJson(String json) {
- BusinessEntityListTransfersItem item = new BusinessEntityListTransfersItem();
-
- String __businessEntityTransferJson = JsonUtil.getObject(json, "business_entity_transfer");
- if (__businessEntityTransferJson != null) {
- item.businessEntityTransfer = BusinessEntityTransfer.fromJson(__businessEntityTransferJson);
- }
-
- return item;
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityTransfersResponse.java b/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityTransfersResponse.java
deleted file mode 100644
index ea4c85fd..00000000
--- a/src/main/java/com/chargebee/v4/models/businessEntity/responses/BusinessEntityTransfersResponse.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.chargebee.v4.models.businessEntity.responses;
-
-import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for BusinessEntityTransfers operation. Contains the response data from
- * the API.
- */
-public final class BusinessEntityTransfersResponse extends BaseResponse {
- private final BusinessEntityTransfer businessEntityTransfer;
-
- private BusinessEntityTransfersResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.businessEntityTransfer = builder.businessEntityTransfer;
- }
-
- /** Parse JSON response into BusinessEntityTransfersResponse object. */
- public static BusinessEntityTransfersResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into BusinessEntityTransfersResponse object with HTTP response. */
- public static BusinessEntityTransfersResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __businessEntityTransferJson = JsonUtil.getObject(json, "business_entity_transfer");
- if (__businessEntityTransferJson != null) {
- builder.businessEntityTransfer(
- BusinessEntityTransfer.fromJson(__businessEntityTransferJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse BusinessEntityTransfersResponse from JSON", e);
- }
- }
-
- /** Create a new builder for BusinessEntityTransfersResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for BusinessEntityTransfersResponse. */
- public static class Builder {
-
- private BusinessEntityTransfer businessEntityTransfer;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder businessEntityTransfer(BusinessEntityTransfer businessEntityTransfer) {
- this.businessEntityTransfer = businessEntityTransfer;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public BusinessEntityTransfersResponse build() {
- return new BusinessEntityTransfersResponse(this);
- }
- }
-
- /** Get the businessEntityTransfer from the response. */
- public BusinessEntityTransfer getBusinessEntityTransfer() {
- return businessEntityTransfer;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/businessEntityChange/BusinessEntityChange.java b/src/main/java/com/chargebee/v4/models/businessEntityChange/BusinessEntityChange.java
deleted file mode 100644
index 71bff604..00000000
--- a/src/main/java/com/chargebee/v4/models/businessEntityChange/BusinessEntityChange.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.businessEntityChange;
-
-import com.chargebee.v4.internal.JsonUtil;
-import java.sql.Timestamp;
-
-public class BusinessEntityChange {
-
- private String id;
- private String businessEntityId;
- private Reason reason;
- private Timestamp activeFrom;
- private Timestamp activeTo;
- private ResourceType resourceType;
- private Timestamp modifiedAt;
- private String resourceId;
- private String activeResourceId;
-
- public String getId() {
- return id;
- }
-
- public String getBusinessEntityId() {
- return businessEntityId;
- }
-
- public Reason getReason() {
- return reason;
- }
-
- public Timestamp getActiveFrom() {
- return activeFrom;
- }
-
- public Timestamp getActiveTo() {
- return activeTo;
- }
-
- public ResourceType getResourceType() {
- return resourceType;
- }
-
- public Timestamp getModifiedAt() {
- return modifiedAt;
- }
-
- public String getResourceId() {
- return resourceId;
- }
-
- public String getActiveResourceId() {
- return activeResourceId;
- }
-
- public enum Reason {
- CORRECTION("correction"),
-
- /** An enum member indicating that Reason was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- Reason(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static Reason fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (Reason enumValue : Reason.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum ResourceType {
- CUSTOMER("customer"),
-
- SUBSCRIPTION("subscription"),
-
- /** An enum member indicating that ResourceType was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ResourceType(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ResourceType fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ResourceType enumValue : ResourceType.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public static BusinessEntityChange fromJson(String json) {
- BusinessEntityChange obj = new BusinessEntityChange();
-
- obj.id = JsonUtil.getString(json, "id");
-
- obj.businessEntityId = JsonUtil.getString(json, "business_entity_id");
-
- obj.reason = Reason.fromString(JsonUtil.getString(json, "reason"));
-
- obj.activeFrom = JsonUtil.getTimestamp(json, "active_from");
-
- obj.activeTo = JsonUtil.getTimestamp(json, "active_to");
-
- obj.resourceType = ResourceType.fromString(JsonUtil.getString(json, "resource_type"));
-
- obj.modifiedAt = JsonUtil.getTimestamp(json, "modified_at");
-
- obj.resourceId = JsonUtil.getString(json, "resource_id");
-
- obj.activeResourceId = JsonUtil.getString(json, "active_resource_id");
-
- return obj;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileExecuteParams.java b/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileExecuteParams.java
deleted file mode 100644
index f9aa06d8..00000000
--- a/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileExecuteParams.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.businessProfile.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class BusinessProfileExecuteParams {
-
- private final Map queryParams;
-
- private BusinessProfileExecuteParams(BusinessProfileExecuteBuilder builder) {
- this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
- }
-
- /** Get the query parameters for this request. */
- public Map toQueryParams() {
- return queryParams;
- }
-
- public BusinessProfileExecuteBuilder toBuilder() {
- BusinessProfileExecuteBuilder builder = new BusinessProfileExecuteBuilder();
- builder.queryParams.putAll(queryParams);
- return builder;
- }
-
- /** Create a new builder for BusinessProfileExecuteParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static BusinessProfileExecuteBuilder builder() {
- return new BusinessProfileExecuteBuilder();
- }
-
- public static final class BusinessProfileExecuteBuilder {
- private final Map queryParams = new LinkedHashMap<>();
-
- private BusinessProfileExecuteBuilder() {}
-
- public BusinessProfileExecuteParams build() {
- return new BusinessProfileExecuteParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileRetrieveParams.java b/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileRetrieveParams.java
new file mode 100644
index 00000000..2b576bdb
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/businessProfile/params/BusinessProfileRetrieveParams.java
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+
+package com.chargebee.v4.models.businessProfile.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class BusinessProfileRetrieveParams {
+
+ private final Map queryParams;
+
+ private BusinessProfileRetrieveParams(BusinessProfileRetrieveBuilder builder) {
+ this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
+ }
+
+ /** Get the query parameters for this request. */
+ public Map toQueryParams() {
+ return queryParams;
+ }
+
+ public BusinessProfileRetrieveBuilder toBuilder() {
+ BusinessProfileRetrieveBuilder builder = new BusinessProfileRetrieveBuilder();
+ builder.queryParams.putAll(queryParams);
+ return builder;
+ }
+
+ /** Create a new builder for BusinessProfileRetrieveParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static BusinessProfileRetrieveBuilder builder() {
+ return new BusinessProfileRetrieveBuilder();
+ }
+
+ public static final class BusinessProfileRetrieveBuilder {
+ private final Map queryParams = new LinkedHashMap<>();
+
+ private BusinessProfileRetrieveBuilder() {}
+
+ public BusinessProfileRetrieveParams build() {
+ return new BusinessProfileRetrieveParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/businessProfile/responses/BusinessProfileExecuteResponse.java b/src/main/java/com/chargebee/v4/models/businessProfile/responses/BusinessProfileExecuteResponse.java
deleted file mode 100644
index 81789c4e..00000000
--- a/src/main/java/com/chargebee/v4/models/businessProfile/responses/BusinessProfileExecuteResponse.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.chargebee.v4.models.businessProfile.responses;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for BusinessProfileExecute operation. Contains the response data from a
- * single resource get operation.
- */
-public final class BusinessProfileExecuteResponse extends BaseResponse {
- private final Object businessProfile;
-
- private BusinessProfileExecuteResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.businessProfile = builder.businessProfile;
- }
-
- /** Parse JSON response into BusinessProfileExecuteResponse object. */
- public static BusinessProfileExecuteResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into BusinessProfileExecuteResponse object with HTTP response. */
- public static BusinessProfileExecuteResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- builder.businessProfile(JsonUtil.getObject(json, "business_profile"));
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse BusinessProfileExecuteResponse from JSON", e);
- }
- }
-
- /** Create a new builder for BusinessProfileExecuteResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for BusinessProfileExecuteResponse. */
- public static class Builder {
-
- private Object businessProfile;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder businessProfile(Object businessProfile) {
- this.businessProfile = businessProfile;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public BusinessProfileExecuteResponse build() {
- return new BusinessProfileExecuteResponse(this);
- }
- }
-
- /** Get the businessProfile from the response. */
- public Object getBusinessProfile() {
- return businessProfile;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/businessProfile/responses/BusinessProfileRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/businessProfile/responses/BusinessProfileRetrieveResponse.java
new file mode 100644
index 00000000..6ba38700
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/businessProfile/responses/BusinessProfileRetrieveResponse.java
@@ -0,0 +1,72 @@
+package com.chargebee.v4.models.businessProfile.responses;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for BusinessProfileRetrieve operation. Contains the response data from
+ * a single resource get operation.
+ */
+public final class BusinessProfileRetrieveResponse extends BaseResponse {
+ private final Object businessProfile;
+
+ private BusinessProfileRetrieveResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.businessProfile = builder.businessProfile;
+ }
+
+ /** Parse JSON response into BusinessProfileRetrieveResponse object. */
+ public static BusinessProfileRetrieveResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into BusinessProfileRetrieveResponse object with HTTP response. */
+ public static BusinessProfileRetrieveResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ builder.businessProfile(JsonUtil.getObject(json, "business_profile"));
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse BusinessProfileRetrieveResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for BusinessProfileRetrieveResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for BusinessProfileRetrieveResponse. */
+ public static class Builder {
+
+ private Object businessProfile;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder businessProfile(Object businessProfile) {
+ this.businessProfile = businessProfile;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public BusinessProfileRetrieveResponse build() {
+ return new BusinessProfileRetrieveResponse(this);
+ }
+ }
+
+ /** Get the businessProfile from the response. */
+ public Object getBusinessProfile() {
+ return businessProfile;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/card/params/CreditCardForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/CreditCardForCustomerParams.java
deleted file mode 100644
index a6e51397..00000000
--- a/src/main/java/com/chargebee/v4/models/card/params/CreditCardForCustomerParams.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.card.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class CreditCardForCustomerParams {
-
- private final Gateway gateway;
-
- private final String gatewayAccountId;
-
- private final String tmpToken;
-
- private final String firstName;
-
- private final String lastName;
-
- private final String number;
-
- private final Integer expiryMonth;
-
- private final Integer expiryYear;
-
- private final String cvv;
-
- private final PreferredScheme preferredScheme;
-
- private final String billingAddr1;
-
- private final String billingAddr2;
-
- private final String billingCity;
-
- private final String billingStateCode;
-
- private final String billingState;
-
- private final String billingZip;
-
- private final String billingCountry;
-
- private final String ipAddress;
-
- private final CustomerParams customer;
-
- private CreditCardForCustomerParams(CreditCardForCustomerBuilder builder) {
-
- this.gateway = builder.gateway;
-
- this.gatewayAccountId = builder.gatewayAccountId;
-
- this.tmpToken = builder.tmpToken;
-
- this.firstName = builder.firstName;
-
- this.lastName = builder.lastName;
-
- this.number = builder.number;
-
- this.expiryMonth = builder.expiryMonth;
-
- this.expiryYear = builder.expiryYear;
-
- this.cvv = builder.cvv;
-
- this.preferredScheme = builder.preferredScheme;
-
- this.billingAddr1 = builder.billingAddr1;
-
- this.billingAddr2 = builder.billingAddr2;
-
- this.billingCity = builder.billingCity;
-
- this.billingStateCode = builder.billingStateCode;
-
- this.billingState = builder.billingState;
-
- this.billingZip = builder.billingZip;
-
- this.billingCountry = builder.billingCountry;
-
- this.ipAddress = builder.ipAddress;
-
- this.customer = builder.customer;
- }
-
- public Gateway getGateway() {
- return gateway;
- }
-
- public String getGatewayAccountId() {
- return gatewayAccountId;
- }
-
- public String getTmpToken() {
- return tmpToken;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public String getNumber() {
- return number;
- }
-
- public Integer getExpiryMonth() {
- return expiryMonth;
- }
-
- public Integer getExpiryYear() {
- return expiryYear;
- }
-
- public String getCvv() {
- return cvv;
- }
-
- public PreferredScheme getPreferredScheme() {
- return preferredScheme;
- }
-
- public String getBillingAddr1() {
- return billingAddr1;
- }
-
- public String getBillingAddr2() {
- return billingAddr2;
- }
-
- public String getBillingCity() {
- return billingCity;
- }
-
- public String getBillingStateCode() {
- return billingStateCode;
- }
-
- public String getBillingState() {
- return billingState;
- }
-
- public String getBillingZip() {
- return billingZip;
- }
-
- public String getBillingCountry() {
- return billingCountry;
- }
-
- public String getIpAddress() {
- return ipAddress;
- }
-
- public CustomerParams getCustomer() {
- return customer;
- }
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- if (this.gateway != null) {
-
- formData.put("gateway", this.gateway);
- }
-
- if (this.gatewayAccountId != null) {
-
- formData.put("gateway_account_id", this.gatewayAccountId);
- }
-
- if (this.tmpToken != null) {
-
- formData.put("tmp_token", this.tmpToken);
- }
-
- if (this.firstName != null) {
-
- formData.put("first_name", this.firstName);
- }
-
- if (this.lastName != null) {
-
- formData.put("last_name", this.lastName);
- }
-
- if (this.number != null) {
-
- formData.put("number", this.number);
- }
-
- if (this.expiryMonth != null) {
-
- formData.put("expiry_month", this.expiryMonth);
- }
-
- if (this.expiryYear != null) {
-
- formData.put("expiry_year", this.expiryYear);
- }
-
- if (this.cvv != null) {
-
- formData.put("cvv", this.cvv);
- }
-
- if (this.preferredScheme != null) {
-
- formData.put("preferred_scheme", this.preferredScheme);
- }
-
- if (this.billingAddr1 != null) {
-
- formData.put("billing_addr1", this.billingAddr1);
- }
-
- if (this.billingAddr2 != null) {
-
- formData.put("billing_addr2", this.billingAddr2);
- }
-
- if (this.billingCity != null) {
-
- formData.put("billing_city", this.billingCity);
- }
-
- if (this.billingStateCode != null) {
-
- formData.put("billing_state_code", this.billingStateCode);
- }
-
- if (this.billingState != null) {
-
- formData.put("billing_state", this.billingState);
- }
-
- if (this.billingZip != null) {
-
- formData.put("billing_zip", this.billingZip);
- }
-
- if (this.billingCountry != null) {
-
- formData.put("billing_country", this.billingCountry);
- }
-
- if (this.ipAddress != null) {
-
- formData.put("ip_address", this.ipAddress);
- }
-
- if (this.customer != null) {
-
- // Single object
- Map nestedData = this.customer.toFormData();
- for (Map.Entry entry : nestedData.entrySet()) {
- String nestedKey = "customer[" + entry.getKey() + "]";
- formData.put(nestedKey, entry.getValue());
- }
- }
-
- return formData;
- }
-
- /** Create a new builder for CreditCardForCustomerParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static CreditCardForCustomerBuilder builder() {
- return new CreditCardForCustomerBuilder();
- }
-
- public static final class CreditCardForCustomerBuilder {
-
- private Gateway gateway;
-
- private String gatewayAccountId;
-
- private String tmpToken;
-
- private String firstName;
-
- private String lastName;
-
- private String number;
-
- private Integer expiryMonth;
-
- private Integer expiryYear;
-
- private String cvv;
-
- private PreferredScheme preferredScheme;
-
- private String billingAddr1;
-
- private String billingAddr2;
-
- private String billingCity;
-
- private String billingStateCode;
-
- private String billingState;
-
- private String billingZip;
-
- private String billingCountry;
-
- private String ipAddress;
-
- private CustomerParams customer;
-
- private CreditCardForCustomerBuilder() {}
-
- @Deprecated
- public CreditCardForCustomerBuilder gateway(Gateway value) {
- this.gateway = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder gatewayAccountId(String value) {
- this.gatewayAccountId = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder tmpToken(String value) {
- this.tmpToken = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder firstName(String value) {
- this.firstName = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder lastName(String value) {
- this.lastName = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder number(String value) {
- this.number = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder expiryMonth(Integer value) {
- this.expiryMonth = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder expiryYear(Integer value) {
- this.expiryYear = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder cvv(String value) {
- this.cvv = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder preferredScheme(PreferredScheme value) {
- this.preferredScheme = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder billingAddr1(String value) {
- this.billingAddr1 = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder billingAddr2(String value) {
- this.billingAddr2 = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder billingCity(String value) {
- this.billingCity = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder billingStateCode(String value) {
- this.billingStateCode = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder billingState(String value) {
- this.billingState = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder billingZip(String value) {
- this.billingZip = value;
- return this;
- }
-
- public CreditCardForCustomerBuilder billingCountry(String value) {
- this.billingCountry = value;
- return this;
- }
-
- @Deprecated
- public CreditCardForCustomerBuilder ipAddress(String value) {
- this.ipAddress = value;
- return this;
- }
-
- @Deprecated
- public CreditCardForCustomerBuilder customer(CustomerParams value) {
- this.customer = value;
- return this;
- }
-
- public CreditCardForCustomerParams build() {
- return new CreditCardForCustomerParams(this);
- }
- }
-
- public enum Gateway {
- CHARGEBEE("chargebee"),
-
- CHARGEBEE_PAYMENTS("chargebee_payments"),
-
- ADYEN("adyen"),
-
- STRIPE("stripe"),
-
- WEPAY("wepay"),
-
- BRAINTREE("braintree"),
-
- AUTHORIZE_NET("authorize_net"),
-
- PAYPAL_PRO("paypal_pro"),
-
- PIN("pin"),
-
- EWAY("eway"),
-
- EWAY_RAPID("eway_rapid"),
-
- WORLDPAY("worldpay"),
-
- BALANCED_PAYMENTS("balanced_payments"),
-
- BEANSTREAM("beanstream"),
-
- BLUEPAY("bluepay"),
-
- ELAVON("elavon"),
-
- FIRST_DATA_GLOBAL("first_data_global"),
-
- HDFC("hdfc"),
-
- MIGS("migs"),
-
- NMI("nmi"),
-
- OGONE("ogone"),
-
- PAYMILL("paymill"),
-
- PAYPAL_PAYFLOW_PRO("paypal_payflow_pro"),
-
- SAGE_PAY("sage_pay"),
-
- TCO("tco"),
-
- WIRECARD("wirecard"),
-
- AMAZON_PAYMENTS("amazon_payments"),
-
- PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"),
-
- ORBITAL("orbital"),
-
- MONERIS_US("moneris_us"),
-
- MONERIS("moneris"),
-
- BLUESNAP("bluesnap"),
-
- CYBERSOURCE("cybersource"),
-
- VANTIV("vantiv"),
-
- CHECKOUT_COM("checkout_com"),
-
- PAYPAL("paypal"),
-
- INGENICO_DIRECT("ingenico_direct"),
-
- EXACT("exact"),
-
- MOLLIE("mollie"),
-
- QUICKBOOKS("quickbooks"),
-
- RAZORPAY("razorpay"),
-
- GLOBAL_PAYMENTS("global_payments"),
-
- BANK_OF_AMERICA("bank_of_america"),
-
- ECENTRIC("ecentric"),
-
- METRICS_GLOBAL("metrics_global"),
-
- WINDCAVE("windcave"),
-
- PAY_COM("pay_com"),
-
- EBANX("ebanx"),
-
- DLOCAL("dlocal"),
-
- NUVEI("nuvei"),
-
- SOLIDGATE("solidgate"),
-
- PAYSTACK("paystack"),
-
- JP_MORGAN("jp_morgan"),
-
- DEUTSCHE_BANK("deutsche_bank"),
-
- EZIDEBIT("ezidebit"),
-
- /** An enum member indicating that Gateway was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- Gateway(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static Gateway fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (Gateway enumValue : Gateway.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum PreferredScheme {
- CARTES_BANCAIRES("cartes_bancaires"),
-
- MASTERCARD("mastercard"),
-
- VISA("visa"),
-
- /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- PreferredScheme(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static PreferredScheme fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (PreferredScheme enumValue : PreferredScheme.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public static final class CustomerParams {
-
- private final String vatNumber;
-
- private CustomerParams(CustomerBuilder builder) {
-
- this.vatNumber = builder.vatNumber;
- }
-
- public String getVatNumber() {
- return vatNumber;
- }
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- if (this.vatNumber != null) {
-
- formData.put("vat_number", this.vatNumber);
- }
-
- return formData;
- }
-
- /** Create a new builder for CustomerParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static CustomerBuilder builder() {
- return new CustomerBuilder();
- }
-
- public static final class CustomerBuilder {
-
- private String vatNumber;
-
- private CustomerBuilder() {}
-
- @Deprecated
- public CustomerBuilder vatNumber(String value) {
- this.vatNumber = value;
- return this;
- }
-
- public CustomerParams build() {
- return new CustomerParams(this);
- }
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java
new file mode 100644
index 00000000..9f2e076f
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java
@@ -0,0 +1,641 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.card.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class UpdateCardForCustomerParams {
+
+ private final Gateway gateway;
+
+ private final String gatewayAccountId;
+
+ private final String tmpToken;
+
+ private final String firstName;
+
+ private final String lastName;
+
+ private final String number;
+
+ private final Integer expiryMonth;
+
+ private final Integer expiryYear;
+
+ private final String cvv;
+
+ private final PreferredScheme preferredScheme;
+
+ private final String billingAddr1;
+
+ private final String billingAddr2;
+
+ private final String billingCity;
+
+ private final String billingStateCode;
+
+ private final String billingState;
+
+ private final String billingZip;
+
+ private final String billingCountry;
+
+ private final String ipAddress;
+
+ private final CustomerParams customer;
+
+ private UpdateCardForCustomerParams(UpdateCardForCustomerBuilder builder) {
+
+ this.gateway = builder.gateway;
+
+ this.gatewayAccountId = builder.gatewayAccountId;
+
+ this.tmpToken = builder.tmpToken;
+
+ this.firstName = builder.firstName;
+
+ this.lastName = builder.lastName;
+
+ this.number = builder.number;
+
+ this.expiryMonth = builder.expiryMonth;
+
+ this.expiryYear = builder.expiryYear;
+
+ this.cvv = builder.cvv;
+
+ this.preferredScheme = builder.preferredScheme;
+
+ this.billingAddr1 = builder.billingAddr1;
+
+ this.billingAddr2 = builder.billingAddr2;
+
+ this.billingCity = builder.billingCity;
+
+ this.billingStateCode = builder.billingStateCode;
+
+ this.billingState = builder.billingState;
+
+ this.billingZip = builder.billingZip;
+
+ this.billingCountry = builder.billingCountry;
+
+ this.ipAddress = builder.ipAddress;
+
+ this.customer = builder.customer;
+ }
+
+ public Gateway getGateway() {
+ return gateway;
+ }
+
+ public String getGatewayAccountId() {
+ return gatewayAccountId;
+ }
+
+ public String getTmpToken() {
+ return tmpToken;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getNumber() {
+ return number;
+ }
+
+ public Integer getExpiryMonth() {
+ return expiryMonth;
+ }
+
+ public Integer getExpiryYear() {
+ return expiryYear;
+ }
+
+ public String getCvv() {
+ return cvv;
+ }
+
+ public PreferredScheme getPreferredScheme() {
+ return preferredScheme;
+ }
+
+ public String getBillingAddr1() {
+ return billingAddr1;
+ }
+
+ public String getBillingAddr2() {
+ return billingAddr2;
+ }
+
+ public String getBillingCity() {
+ return billingCity;
+ }
+
+ public String getBillingStateCode() {
+ return billingStateCode;
+ }
+
+ public String getBillingState() {
+ return billingState;
+ }
+
+ public String getBillingZip() {
+ return billingZip;
+ }
+
+ public String getBillingCountry() {
+ return billingCountry;
+ }
+
+ public String getIpAddress() {
+ return ipAddress;
+ }
+
+ public CustomerParams getCustomer() {
+ return customer;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.gateway != null) {
+
+ formData.put("gateway", this.gateway);
+ }
+
+ if (this.gatewayAccountId != null) {
+
+ formData.put("gateway_account_id", this.gatewayAccountId);
+ }
+
+ if (this.tmpToken != null) {
+
+ formData.put("tmp_token", this.tmpToken);
+ }
+
+ if (this.firstName != null) {
+
+ formData.put("first_name", this.firstName);
+ }
+
+ if (this.lastName != null) {
+
+ formData.put("last_name", this.lastName);
+ }
+
+ if (this.number != null) {
+
+ formData.put("number", this.number);
+ }
+
+ if (this.expiryMonth != null) {
+
+ formData.put("expiry_month", this.expiryMonth);
+ }
+
+ if (this.expiryYear != null) {
+
+ formData.put("expiry_year", this.expiryYear);
+ }
+
+ if (this.cvv != null) {
+
+ formData.put("cvv", this.cvv);
+ }
+
+ if (this.preferredScheme != null) {
+
+ formData.put("preferred_scheme", this.preferredScheme);
+ }
+
+ if (this.billingAddr1 != null) {
+
+ formData.put("billing_addr1", this.billingAddr1);
+ }
+
+ if (this.billingAddr2 != null) {
+
+ formData.put("billing_addr2", this.billingAddr2);
+ }
+
+ if (this.billingCity != null) {
+
+ formData.put("billing_city", this.billingCity);
+ }
+
+ if (this.billingStateCode != null) {
+
+ formData.put("billing_state_code", this.billingStateCode);
+ }
+
+ if (this.billingState != null) {
+
+ formData.put("billing_state", this.billingState);
+ }
+
+ if (this.billingZip != null) {
+
+ formData.put("billing_zip", this.billingZip);
+ }
+
+ if (this.billingCountry != null) {
+
+ formData.put("billing_country", this.billingCountry);
+ }
+
+ if (this.ipAddress != null) {
+
+ formData.put("ip_address", this.ipAddress);
+ }
+
+ if (this.customer != null) {
+
+ // Single object
+ Map nestedData = this.customer.toFormData();
+ for (Map.Entry entry : nestedData.entrySet()) {
+ String nestedKey = "customer[" + entry.getKey() + "]";
+ formData.put(nestedKey, entry.getValue());
+ }
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for UpdateCardForCustomerParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static UpdateCardForCustomerBuilder builder() {
+ return new UpdateCardForCustomerBuilder();
+ }
+
+ public static final class UpdateCardForCustomerBuilder {
+
+ private Gateway gateway;
+
+ private String gatewayAccountId;
+
+ private String tmpToken;
+
+ private String firstName;
+
+ private String lastName;
+
+ private String number;
+
+ private Integer expiryMonth;
+
+ private Integer expiryYear;
+
+ private String cvv;
+
+ private PreferredScheme preferredScheme;
+
+ private String billingAddr1;
+
+ private String billingAddr2;
+
+ private String billingCity;
+
+ private String billingStateCode;
+
+ private String billingState;
+
+ private String billingZip;
+
+ private String billingCountry;
+
+ private String ipAddress;
+
+ private CustomerParams customer;
+
+ private UpdateCardForCustomerBuilder() {}
+
+ @Deprecated
+ public UpdateCardForCustomerBuilder gateway(Gateway value) {
+ this.gateway = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder gatewayAccountId(String value) {
+ this.gatewayAccountId = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder tmpToken(String value) {
+ this.tmpToken = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder firstName(String value) {
+ this.firstName = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder lastName(String value) {
+ this.lastName = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder number(String value) {
+ this.number = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder expiryMonth(Integer value) {
+ this.expiryMonth = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder expiryYear(Integer value) {
+ this.expiryYear = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder cvv(String value) {
+ this.cvv = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder preferredScheme(PreferredScheme value) {
+ this.preferredScheme = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder billingAddr1(String value) {
+ this.billingAddr1 = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder billingAddr2(String value) {
+ this.billingAddr2 = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder billingCity(String value) {
+ this.billingCity = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder billingStateCode(String value) {
+ this.billingStateCode = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder billingState(String value) {
+ this.billingState = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder billingZip(String value) {
+ this.billingZip = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerBuilder billingCountry(String value) {
+ this.billingCountry = value;
+ return this;
+ }
+
+ @Deprecated
+ public UpdateCardForCustomerBuilder ipAddress(String value) {
+ this.ipAddress = value;
+ return this;
+ }
+
+ @Deprecated
+ public UpdateCardForCustomerBuilder customer(CustomerParams value) {
+ this.customer = value;
+ return this;
+ }
+
+ public UpdateCardForCustomerParams build() {
+ return new UpdateCardForCustomerParams(this);
+ }
+ }
+
+ public enum Gateway {
+ CHARGEBEE("chargebee"),
+
+ CHARGEBEE_PAYMENTS("chargebee_payments"),
+
+ ADYEN("adyen"),
+
+ STRIPE("stripe"),
+
+ WEPAY("wepay"),
+
+ BRAINTREE("braintree"),
+
+ AUTHORIZE_NET("authorize_net"),
+
+ PAYPAL_PRO("paypal_pro"),
+
+ PIN("pin"),
+
+ EWAY("eway"),
+
+ EWAY_RAPID("eway_rapid"),
+
+ WORLDPAY("worldpay"),
+
+ BALANCED_PAYMENTS("balanced_payments"),
+
+ BEANSTREAM("beanstream"),
+
+ BLUEPAY("bluepay"),
+
+ ELAVON("elavon"),
+
+ FIRST_DATA_GLOBAL("first_data_global"),
+
+ HDFC("hdfc"),
+
+ MIGS("migs"),
+
+ NMI("nmi"),
+
+ OGONE("ogone"),
+
+ PAYMILL("paymill"),
+
+ PAYPAL_PAYFLOW_PRO("paypal_payflow_pro"),
+
+ SAGE_PAY("sage_pay"),
+
+ TCO("tco"),
+
+ WIRECARD("wirecard"),
+
+ AMAZON_PAYMENTS("amazon_payments"),
+
+ PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"),
+
+ ORBITAL("orbital"),
+
+ MONERIS_US("moneris_us"),
+
+ MONERIS("moneris"),
+
+ BLUESNAP("bluesnap"),
+
+ CYBERSOURCE("cybersource"),
+
+ VANTIV("vantiv"),
+
+ CHECKOUT_COM("checkout_com"),
+
+ PAYPAL("paypal"),
+
+ INGENICO_DIRECT("ingenico_direct"),
+
+ EXACT("exact"),
+
+ MOLLIE("mollie"),
+
+ QUICKBOOKS("quickbooks"),
+
+ RAZORPAY("razorpay"),
+
+ GLOBAL_PAYMENTS("global_payments"),
+
+ BANK_OF_AMERICA("bank_of_america"),
+
+ ECENTRIC("ecentric"),
+
+ METRICS_GLOBAL("metrics_global"),
+
+ WINDCAVE("windcave"),
+
+ PAY_COM("pay_com"),
+
+ EBANX("ebanx"),
+
+ DLOCAL("dlocal"),
+
+ NUVEI("nuvei"),
+
+ SOLIDGATE("solidgate"),
+
+ PAYSTACK("paystack"),
+
+ JP_MORGAN("jp_morgan"),
+
+ DEUTSCHE_BANK("deutsche_bank"),
+
+ EZIDEBIT("ezidebit"),
+
+ /** An enum member indicating that Gateway was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ Gateway(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static Gateway fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (Gateway enumValue : Gateway.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum PreferredScheme {
+ CARTES_BANCAIRES("cartes_bancaires"),
+
+ MASTERCARD("mastercard"),
+
+ VISA("visa"),
+
+ /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ PreferredScheme(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static PreferredScheme fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (PreferredScheme enumValue : PreferredScheme.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public static final class CustomerParams {
+
+ private final String vatNumber;
+
+ private CustomerParams(CustomerBuilder builder) {
+
+ this.vatNumber = builder.vatNumber;
+ }
+
+ public String getVatNumber() {
+ return vatNumber;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.vatNumber != null) {
+
+ formData.put("vat_number", this.vatNumber);
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for CustomerParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static CustomerBuilder builder() {
+ return new CustomerBuilder();
+ }
+
+ public static final class CustomerBuilder {
+
+ private String vatNumber;
+
+ private CustomerBuilder() {}
+
+ @Deprecated
+ public CustomerBuilder vatNumber(String value) {
+ this.vatNumber = value;
+ return this;
+ }
+
+ public CustomerParams build() {
+ return new CustomerParams(this);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/card/responses/CreditCardForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/card/responses/CreditCardForCustomerResponse.java
deleted file mode 100644
index 7fa1bc4a..00000000
--- a/src/main/java/com/chargebee/v4/models/card/responses/CreditCardForCustomerResponse.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package com.chargebee.v4.models.card.responses;
-
-import com.chargebee.v4.models.customer.Customer;
-
-import com.chargebee.v4.models.card.Card;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for CreditCardForCustomer operation. Contains the response data from
- * the API.
- */
-public final class CreditCardForCustomerResponse extends BaseResponse {
- private final Customer customer;
-
- private final Card card;
-
- private CreditCardForCustomerResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.customer = builder.customer;
-
- this.card = builder.card;
- }
-
- /** Parse JSON response into CreditCardForCustomerResponse object. */
- public static CreditCardForCustomerResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into CreditCardForCustomerResponse object with HTTP response. */
- public static CreditCardForCustomerResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __customerJson = JsonUtil.getObject(json, "customer");
- if (__customerJson != null) {
- builder.customer(Customer.fromJson(__customerJson));
- }
-
- String __cardJson = JsonUtil.getObject(json, "card");
- if (__cardJson != null) {
- builder.card(Card.fromJson(__cardJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse CreditCardForCustomerResponse from JSON", e);
- }
- }
-
- /** Create a new builder for CreditCardForCustomerResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for CreditCardForCustomerResponse. */
- public static class Builder {
-
- private Customer customer;
-
- private Card card;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder customer(Customer customer) {
- this.customer = customer;
- return this;
- }
-
- public Builder card(Card card) {
- this.card = card;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public CreditCardForCustomerResponse build() {
- return new CreditCardForCustomerResponse(this);
- }
- }
-
- /** Get the customer from the response. */
- public Customer getCustomer() {
- return customer;
- }
-
- /** Get the card from the response. */
- public Card getCard() {
- return card;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/card/responses/UpdateCardForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/card/responses/UpdateCardForCustomerResponse.java
new file mode 100644
index 00000000..740131bd
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/card/responses/UpdateCardForCustomerResponse.java
@@ -0,0 +1,100 @@
+package com.chargebee.v4.models.card.responses;
+
+import com.chargebee.v4.models.customer.Customer;
+
+import com.chargebee.v4.models.card.Card;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for UpdateCardForCustomer operation. Contains the response data from
+ * the API.
+ */
+public final class UpdateCardForCustomerResponse extends BaseResponse {
+ private final Customer customer;
+
+ private final Card card;
+
+ private UpdateCardForCustomerResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.customer = builder.customer;
+
+ this.card = builder.card;
+ }
+
+ /** Parse JSON response into UpdateCardForCustomerResponse object. */
+ public static UpdateCardForCustomerResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into UpdateCardForCustomerResponse object with HTTP response. */
+ public static UpdateCardForCustomerResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __customerJson = JsonUtil.getObject(json, "customer");
+ if (__customerJson != null) {
+ builder.customer(Customer.fromJson(__customerJson));
+ }
+
+ String __cardJson = JsonUtil.getObject(json, "card");
+ if (__cardJson != null) {
+ builder.card(Card.fromJson(__cardJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse UpdateCardForCustomerResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for UpdateCardForCustomerResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for UpdateCardForCustomerResponse. */
+ public static class Builder {
+
+ private Customer customer;
+
+ private Card card;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder customer(Customer customer) {
+ this.customer = customer;
+ return this;
+ }
+
+ public Builder card(Card card) {
+ this.card = card;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public UpdateCardForCustomerResponse build() {
+ return new UpdateCardForCustomerResponse(this);
+ }
+ }
+
+ /** Get the customer from the response. */
+ public Customer getCustomer() {
+ return customer;
+ }
+
+ /** Get the card from the response. */
+ public Card getCard() {
+ return card;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/comment/params/CommentDeleteParams.java b/src/main/java/com/chargebee/v4/models/comment/params/CommentDeleteParams.java
new file mode 100644
index 00000000..5a9699c2
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/comment/params/CommentDeleteParams.java
@@ -0,0 +1,39 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.comment.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class CommentDeleteParams {
+
+ private CommentDeleteParams(CommentDeleteBuilder builder) {}
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ return formData;
+ }
+
+ /** Create a new builder for CommentDeleteParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static CommentDeleteBuilder builder() {
+ return new CommentDeleteBuilder();
+ }
+
+ public static final class CommentDeleteBuilder {
+
+ private CommentDeleteBuilder() {}
+
+ public CommentDeleteParams build() {
+ return new CommentDeleteParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/comment/params/DeleteCommentParams.java b/src/main/java/com/chargebee/v4/models/comment/params/DeleteCommentParams.java
deleted file mode 100644
index ccde52bb..00000000
--- a/src/main/java/com/chargebee/v4/models/comment/params/DeleteCommentParams.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.comment.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class DeleteCommentParams {
-
- private DeleteCommentParams(DeleteCommentBuilder builder) {}
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- return formData;
- }
-
- /** Create a new builder for DeleteCommentParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static DeleteCommentBuilder builder() {
- return new DeleteCommentBuilder();
- }
-
- public static final class DeleteCommentBuilder {
-
- private DeleteCommentBuilder() {}
-
- public DeleteCommentParams build() {
- return new DeleteCommentParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/comment/responses/CommentDeleteResponse.java b/src/main/java/com/chargebee/v4/models/comment/responses/CommentDeleteResponse.java
new file mode 100644
index 00000000..1a3692d3
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/comment/responses/CommentDeleteResponse.java
@@ -0,0 +1,76 @@
+package com.chargebee.v4.models.comment.responses;
+
+import com.chargebee.v4.models.comment.Comment;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+
+/**
+ * Immutable response object for CommentDelete operation. Contains the response data from the API.
+ */
+public final class CommentDeleteResponse extends BaseResponse {
+ private final Comment comment;
+
+ private CommentDeleteResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.comment = builder.comment;
+ }
+
+ /** Parse JSON response into CommentDeleteResponse object. */
+ public static CommentDeleteResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into CommentDeleteResponse object with HTTP response. */
+ public static CommentDeleteResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __commentJson = JsonUtil.getObject(json, "comment");
+ if (__commentJson != null) {
+ builder.comment(Comment.fromJson(__commentJson));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse CommentDeleteResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for CommentDeleteResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for CommentDeleteResponse. */
+ public static class Builder {
+
+ private Comment comment;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder comment(Comment comment) {
+ this.comment = comment;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public CommentDeleteResponse build() {
+ return new CommentDeleteResponse(this);
+ }
+ }
+
+ /** Get the comment from the response. */
+ public Comment getComment() {
+ return comment;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/comment/responses/CommentListResponse.java b/src/main/java/com/chargebee/v4/models/comment/responses/CommentListResponse.java
index 8cfd35bd..2df463d7 100644
--- a/src/main/java/com/chargebee/v4/models/comment/responses/CommentListResponse.java
+++ b/src/main/java/com/chargebee/v4/models/comment/responses/CommentListResponse.java
@@ -4,6 +4,7 @@
import com.chargebee.v4.models.comment.Comment;
+import com.chargebee.v4.exceptions.ChargebeeException;
import com.chargebee.v4.internal.JsonUtil;
import com.chargebee.v4.transport.Response;
import com.chargebee.v4.services.CommentService;
@@ -98,9 +99,9 @@ public boolean hasNextPage() {
/**
* Get the next page of results.
*
- * @throws Exception if unable to fetch next page
+ * @throws ChargebeeException if unable to fetch next page
*/
- public CommentListResponse nextPage() throws Exception {
+ public CommentListResponse nextPage() throws ChargebeeException {
if (!hasNextPage()) {
throw new IllegalStateException("No more pages available");
}
diff --git a/src/main/java/com/chargebee/v4/models/comment/responses/DeleteCommentResponse.java b/src/main/java/com/chargebee/v4/models/comment/responses/DeleteCommentResponse.java
deleted file mode 100644
index bc77ad55..00000000
--- a/src/main/java/com/chargebee/v4/models/comment/responses/DeleteCommentResponse.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.chargebee.v4.models.comment.responses;
-
-import com.chargebee.v4.models.comment.Comment;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-
-/**
- * Immutable response object for DeleteComment operation. Contains the response data from the API.
- */
-public final class DeleteCommentResponse extends BaseResponse {
- private final Comment comment;
-
- private DeleteCommentResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.comment = builder.comment;
- }
-
- /** Parse JSON response into DeleteCommentResponse object. */
- public static DeleteCommentResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into DeleteCommentResponse object with HTTP response. */
- public static DeleteCommentResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __commentJson = JsonUtil.getObject(json, "comment");
- if (__commentJson != null) {
- builder.comment(Comment.fromJson(__commentJson));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse DeleteCommentResponse from JSON", e);
- }
- }
-
- /** Create a new builder for DeleteCommentResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for DeleteCommentResponse. */
- public static class Builder {
-
- private Comment comment;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder comment(Comment comment) {
- this.comment = comment;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public DeleteCommentResponse build() {
- return new DeleteCommentResponse(this);
- }
- }
-
- /** Get the comment from the response. */
- public Comment getComment() {
- return comment;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationExecuteParams.java b/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationExecuteParams.java
deleted file mode 100644
index 280a3511..00000000
--- a/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationExecuteParams.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-
-package com.chargebee.v4.models.configuration.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class ConfigurationExecuteParams {
-
- private final Map queryParams;
-
- private ConfigurationExecuteParams(ConfigurationExecuteBuilder builder) {
- this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
- }
-
- /** Get the query parameters for this request. */
- public Map toQueryParams() {
- return queryParams;
- }
-
- public ConfigurationExecuteBuilder toBuilder() {
- ConfigurationExecuteBuilder builder = new ConfigurationExecuteBuilder();
- builder.queryParams.putAll(queryParams);
- return builder;
- }
-
- /** Create a new builder for ConfigurationExecuteParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static ConfigurationExecuteBuilder builder() {
- return new ConfigurationExecuteBuilder();
- }
-
- public static final class ConfigurationExecuteBuilder {
- private final Map queryParams = new LinkedHashMap<>();
-
- private ConfigurationExecuteBuilder() {}
-
- public ConfigurationExecuteParams build() {
- return new ConfigurationExecuteParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationListParams.java b/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationListParams.java
new file mode 100644
index 00000000..a036accc
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/configuration/params/ConfigurationListParams.java
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+
+package com.chargebee.v4.models.configuration.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class ConfigurationListParams {
+
+ private final Map queryParams;
+
+ private ConfigurationListParams(ConfigurationListBuilder builder) {
+ this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams));
+ }
+
+ /** Get the query parameters for this request. */
+ public Map toQueryParams() {
+ return queryParams;
+ }
+
+ public ConfigurationListBuilder toBuilder() {
+ ConfigurationListBuilder builder = new ConfigurationListBuilder();
+ builder.queryParams.putAll(queryParams);
+ return builder;
+ }
+
+ /** Create a new builder for ConfigurationListParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static ConfigurationListBuilder builder() {
+ return new ConfigurationListBuilder();
+ }
+
+ public static final class ConfigurationListBuilder {
+ private final Map queryParams = new LinkedHashMap<>();
+
+ private ConfigurationListBuilder() {}
+
+ public ConfigurationListParams build() {
+ return new ConfigurationListParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/configuration/responses/ConfigurationExecuteResponse.java b/src/main/java/com/chargebee/v4/models/configuration/responses/ConfigurationExecuteResponse.java
deleted file mode 100644
index 28861001..00000000
--- a/src/main/java/com/chargebee/v4/models/configuration/responses/ConfigurationExecuteResponse.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.chargebee.v4.models.configuration.responses;
-
-import com.chargebee.v4.models.configuration.Configuration;
-
-import com.chargebee.v4.models.BaseResponse;
-import com.chargebee.v4.internal.JsonUtil;
-import com.chargebee.v4.transport.Response;
-import java.util.List;
-
-/**
- * Immutable response object for ConfigurationExecute operation. Contains the response data from a
- * single resource get operation.
- */
-public final class ConfigurationExecuteResponse extends BaseResponse {
- private final List configurations;
-
- private ConfigurationExecuteResponse(Builder builder) {
- super(builder.httpResponse);
-
- this.configurations = builder.configurations;
- }
-
- /** Parse JSON response into ConfigurationExecuteResponse object. */
- public static ConfigurationExecuteResponse fromJson(String json) {
- return fromJson(json, null);
- }
-
- /** Parse JSON response into ConfigurationExecuteResponse object with HTTP response. */
- public static ConfigurationExecuteResponse fromJson(String json, Response httpResponse) {
- try {
- Builder builder = builder();
-
- String __configurationsJson = JsonUtil.getArray(json, "configurations");
- if (__configurationsJson != null) {
- builder.configurations(
- JsonUtil.parseObjectArray(__configurationsJson).stream()
- .map(Configuration::fromJson)
- .collect(java.util.stream.Collectors.toList()));
- }
-
- builder.httpResponse(httpResponse);
- return builder.build();
- } catch (Exception e) {
- throw new RuntimeException("Failed to parse ConfigurationExecuteResponse from JSON", e);
- }
- }
-
- /** Create a new builder for ConfigurationExecuteResponse. */
- public static Builder builder() {
- return new Builder();
- }
-
- /** Builder for ConfigurationExecuteResponse. */
- public static class Builder {
-
- private List configurations;
-
- private Response httpResponse;
-
- private Builder() {}
-
- public Builder configurations(List configurations) {
- this.configurations = configurations;
- return this;
- }
-
- public Builder httpResponse(Response httpResponse) {
- this.httpResponse = httpResponse;
- return this;
- }
-
- public ConfigurationExecuteResponse build() {
- return new ConfigurationExecuteResponse(this);
- }
- }
-
- /** Get the configurations from the response. */
- public List getConfigurations() {
- return configurations;
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/configuration/responses/ConfigurationListResponse.java b/src/main/java/com/chargebee/v4/models/configuration/responses/ConfigurationListResponse.java
new file mode 100644
index 00000000..b10b121f
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/configuration/responses/ConfigurationListResponse.java
@@ -0,0 +1,81 @@
+package com.chargebee.v4.models.configuration.responses;
+
+import com.chargebee.v4.models.configuration.Configuration;
+
+import com.chargebee.v4.models.BaseResponse;
+import com.chargebee.v4.internal.JsonUtil;
+import com.chargebee.v4.transport.Response;
+import java.util.List;
+
+/**
+ * Immutable response object for ConfigurationList operation. Contains the response data from a
+ * single resource get operation.
+ */
+public final class ConfigurationListResponse extends BaseResponse {
+ private final List configurations;
+
+ private ConfigurationListResponse(Builder builder) {
+ super(builder.httpResponse);
+
+ this.configurations = builder.configurations;
+ }
+
+ /** Parse JSON response into ConfigurationListResponse object. */
+ public static ConfigurationListResponse fromJson(String json) {
+ return fromJson(json, null);
+ }
+
+ /** Parse JSON response into ConfigurationListResponse object with HTTP response. */
+ public static ConfigurationListResponse fromJson(String json, Response httpResponse) {
+ try {
+ Builder builder = builder();
+
+ String __configurationsJson = JsonUtil.getArray(json, "configurations");
+ if (__configurationsJson != null) {
+ builder.configurations(
+ JsonUtil.parseObjectArray(__configurationsJson).stream()
+ .map(Configuration::fromJson)
+ .collect(java.util.stream.Collectors.toList()));
+ }
+
+ builder.httpResponse(httpResponse);
+ return builder.build();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to parse ConfigurationListResponse from JSON", e);
+ }
+ }
+
+ /** Create a new builder for ConfigurationListResponse. */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Builder for ConfigurationListResponse. */
+ public static class Builder {
+
+ private List configurations;
+
+ private Response httpResponse;
+
+ private Builder() {}
+
+ public Builder configurations(List configurations) {
+ this.configurations = configurations;
+ return this;
+ }
+
+ public Builder httpResponse(Response httpResponse) {
+ this.httpResponse = httpResponse;
+ return this;
+ }
+
+ public ConfigurationListResponse build() {
+ return new ConfigurationListResponse(this);
+ }
+ }
+
+ /** Get the configurations from the response. */
+ public List getConfigurations() {
+ return configurations;
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/CouponDeleteParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponDeleteParams.java
new file mode 100644
index 00000000..59b03b04
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponDeleteParams.java
@@ -0,0 +1,39 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.coupon.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class CouponDeleteParams {
+
+ private CouponDeleteParams(CouponDeleteBuilder builder) {}
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ return formData;
+ }
+
+ /** Create a new builder for CouponDeleteParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static CouponDeleteBuilder builder() {
+ return new CouponDeleteBuilder();
+ }
+
+ public static final class CouponDeleteBuilder {
+
+ private CouponDeleteBuilder() {}
+
+ public CouponDeleteParams build() {
+ return new CouponDeleteParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/CouponUnarchiveParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUnarchiveParams.java
new file mode 100644
index 00000000..9a7586ab
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUnarchiveParams.java
@@ -0,0 +1,39 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.coupon.params;
+
+import com.chargebee.v4.internal.Recommended;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public final class CouponUnarchiveParams {
+
+ private CouponUnarchiveParams(CouponUnarchiveBuilder builder) {}
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ return formData;
+ }
+
+ /** Create a new builder for CouponUnarchiveParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static CouponUnarchiveBuilder builder() {
+ return new CouponUnarchiveBuilder();
+ }
+
+ public static final class CouponUnarchiveBuilder {
+
+ private CouponUnarchiveBuilder() {}
+
+ public CouponUnarchiveParams build() {
+ return new CouponUnarchiveParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/CouponUpdateForItemsParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUpdateForItemsParams.java
new file mode 100644
index 00000000..a2036436
--- /dev/null
+++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponUpdateForItemsParams.java
@@ -0,0 +1,1104 @@
+/*
+ * This file is auto-generated by Chargebee.
+ * For more information on how to make changes to this file, please see the README.
+ * Reach out to dx@chargebee.com for any questions.
+ * Copyright 2025 Chargebee Inc.
+ */
+package com.chargebee.v4.models.coupon.params;
+
+import com.chargebee.v4.internal.Recommended;
+import com.chargebee.v4.internal.JsonUtil;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.List;
+import java.sql.Timestamp;
+
+public final class CouponUpdateForItemsParams {
+
+ private final String name;
+
+ private final String invoiceName;
+
+ private final DiscountType discountType;
+
+ private final Long discountAmount;
+
+ private final String currencyCode;
+
+ private final Number discountPercentage;
+
+ private final Integer discountQuantity;
+
+ private final ApplyOn applyOn;
+
+ private final DurationType durationType;
+
+ private final Integer durationMonth;
+
+ private final Timestamp validFrom;
+
+ private final Timestamp validTill;
+
+ private final Integer maxRedemptions;
+
+ private final String invoiceNotes;
+
+ private final java.util.Map metaData;
+
+ private final Boolean includedInMrr;
+
+ private final Integer period;
+
+ private final PeriodUnit periodUnit;
+
+ private final List itemConstraints;
+
+ private final List itemConstraintCriteria;
+
+ private final List couponConstraints;
+
+ private final Map customFields;
+
+ private CouponUpdateForItemsParams(CouponUpdateForItemsBuilder builder) {
+
+ this.name = builder.name;
+
+ this.invoiceName = builder.invoiceName;
+
+ this.discountType = builder.discountType;
+
+ this.discountAmount = builder.discountAmount;
+
+ this.currencyCode = builder.currencyCode;
+
+ this.discountPercentage = builder.discountPercentage;
+
+ this.discountQuantity = builder.discountQuantity;
+
+ this.applyOn = builder.applyOn;
+
+ this.durationType = builder.durationType;
+
+ this.durationMonth = builder.durationMonth;
+
+ this.validFrom = builder.validFrom;
+
+ this.validTill = builder.validTill;
+
+ this.maxRedemptions = builder.maxRedemptions;
+
+ this.invoiceNotes = builder.invoiceNotes;
+
+ this.metaData = builder.metaData;
+
+ this.includedInMrr = builder.includedInMrr;
+
+ this.period = builder.period;
+
+ this.periodUnit = builder.periodUnit;
+
+ this.itemConstraints = builder.itemConstraints;
+
+ this.itemConstraintCriteria = builder.itemConstraintCriteria;
+
+ this.couponConstraints = builder.couponConstraints;
+
+ this.customFields =
+ builder.customFields.isEmpty()
+ ? Collections.emptyMap()
+ : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields));
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getInvoiceName() {
+ return invoiceName;
+ }
+
+ public DiscountType getDiscountType() {
+ return discountType;
+ }
+
+ public Long getDiscountAmount() {
+ return discountAmount;
+ }
+
+ public String getCurrencyCode() {
+ return currencyCode;
+ }
+
+ public Number getDiscountPercentage() {
+ return discountPercentage;
+ }
+
+ public Integer getDiscountQuantity() {
+ return discountQuantity;
+ }
+
+ public ApplyOn getApplyOn() {
+ return applyOn;
+ }
+
+ public DurationType getDurationType() {
+ return durationType;
+ }
+
+ public Integer getDurationMonth() {
+ return durationMonth;
+ }
+
+ public Timestamp getValidFrom() {
+ return validFrom;
+ }
+
+ public Timestamp getValidTill() {
+ return validTill;
+ }
+
+ public Integer getMaxRedemptions() {
+ return maxRedemptions;
+ }
+
+ public String getInvoiceNotes() {
+ return invoiceNotes;
+ }
+
+ public java.util.Map getMetaData() {
+ return metaData;
+ }
+
+ public Boolean getIncludedInMrr() {
+ return includedInMrr;
+ }
+
+ public Integer getPeriod() {
+ return period;
+ }
+
+ public PeriodUnit getPeriodUnit() {
+ return periodUnit;
+ }
+
+ public List getItemConstraints() {
+ return itemConstraints;
+ }
+
+ public List getItemConstraintCriteria() {
+ return itemConstraintCriteria;
+ }
+
+ public List getCouponConstraints() {
+ return couponConstraints;
+ }
+
+ public Map customFields() {
+ return customFields;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.name != null) {
+
+ formData.put("name", this.name);
+ }
+
+ if (this.invoiceName != null) {
+
+ formData.put("invoice_name", this.invoiceName);
+ }
+
+ if (this.discountType != null) {
+
+ formData.put("discount_type", this.discountType);
+ }
+
+ if (this.discountAmount != null) {
+
+ formData.put("discount_amount", this.discountAmount);
+ }
+
+ if (this.currencyCode != null) {
+
+ formData.put("currency_code", this.currencyCode);
+ }
+
+ if (this.discountPercentage != null) {
+
+ formData.put("discount_percentage", this.discountPercentage);
+ }
+
+ if (this.discountQuantity != null) {
+
+ formData.put("discount_quantity", this.discountQuantity);
+ }
+
+ if (this.applyOn != null) {
+
+ formData.put("apply_on", this.applyOn);
+ }
+
+ if (this.durationType != null) {
+
+ formData.put("duration_type", this.durationType);
+ }
+
+ if (this.durationMonth != null) {
+
+ formData.put("duration_month", this.durationMonth);
+ }
+
+ if (this.validFrom != null) {
+
+ formData.put("valid_from", this.validFrom);
+ }
+
+ if (this.validTill != null) {
+
+ formData.put("valid_till", this.validTill);
+ }
+
+ if (this.maxRedemptions != null) {
+
+ formData.put("max_redemptions", this.maxRedemptions);
+ }
+
+ if (this.invoiceNotes != null) {
+
+ formData.put("invoice_notes", this.invoiceNotes);
+ }
+
+ if (this.metaData != null) {
+
+ formData.put("meta_data", JsonUtil.toJson(this.metaData));
+ }
+
+ if (this.includedInMrr != null) {
+
+ formData.put("included_in_mrr", this.includedInMrr);
+ }
+
+ if (this.period != null) {
+
+ formData.put("period", this.period);
+ }
+
+ if (this.periodUnit != null) {
+
+ formData.put("period_unit", this.periodUnit);
+ }
+
+ if (this.itemConstraints != null) {
+
+ // List of objects
+ for (int i = 0; i < this.itemConstraints.size(); i++) {
+ ItemConstraintsParams item = this.itemConstraints.get(i);
+ if (item != null) {
+ Map itemData = item.toFormData();
+ for (Map.Entry entry : itemData.entrySet()) {
+ String indexedKey = "item_constraints[" + entry.getKey() + "][" + i + "]";
+ formData.put(indexedKey, entry.getValue());
+ }
+ }
+ }
+ }
+
+ if (this.itemConstraintCriteria != null) {
+
+ // List of objects
+ for (int i = 0; i < this.itemConstraintCriteria.size(); i++) {
+ ItemConstraintCriteriaParams item = this.itemConstraintCriteria.get(i);
+ if (item != null) {
+ Map itemData = item.toFormData();
+ for (Map.Entry entry : itemData.entrySet()) {
+ String indexedKey = "item_constraint_criteria[" + entry.getKey() + "][" + i + "]";
+ formData.put(indexedKey, entry.getValue());
+ }
+ }
+ }
+ }
+
+ if (this.couponConstraints != null) {
+
+ // List of objects
+ for (int i = 0; i < this.couponConstraints.size(); i++) {
+ CouponConstraintsParams item = this.couponConstraints.get(i);
+ if (item != null) {
+ Map itemData = item.toFormData();
+ for (Map.Entry entry : itemData.entrySet()) {
+ String indexedKey = "coupon_constraints[" + entry.getKey() + "][" + i + "]";
+ formData.put(indexedKey, entry.getValue());
+ }
+ }
+ }
+ }
+
+ formData.putAll(customFields);
+
+ return formData;
+ }
+
+ /** Create a new builder for CouponUpdateForItemsParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static CouponUpdateForItemsBuilder builder() {
+ return new CouponUpdateForItemsBuilder();
+ }
+
+ public static final class CouponUpdateForItemsBuilder {
+
+ private String name;
+
+ private String invoiceName;
+
+ private DiscountType discountType;
+
+ private Long discountAmount;
+
+ private String currencyCode;
+
+ private Number discountPercentage;
+
+ private Integer discountQuantity;
+
+ private ApplyOn applyOn;
+
+ private DurationType durationType;
+
+ private Integer durationMonth;
+
+ private Timestamp validFrom;
+
+ private Timestamp validTill;
+
+ private Integer maxRedemptions;
+
+ private String invoiceNotes;
+
+ private java.util.Map metaData;
+
+ private Boolean includedInMrr;
+
+ private Integer period;
+
+ private PeriodUnit periodUnit;
+
+ private List itemConstraints;
+
+ private List itemConstraintCriteria;
+
+ private List couponConstraints;
+
+ private Map customFields = new LinkedHashMap<>();
+
+ private CouponUpdateForItemsBuilder() {}
+
+ public CouponUpdateForItemsBuilder name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder invoiceName(String value) {
+ this.invoiceName = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder discountType(DiscountType value) {
+ this.discountType = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder discountAmount(Long value) {
+ this.discountAmount = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder currencyCode(String value) {
+ this.currencyCode = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder discountPercentage(Number value) {
+ this.discountPercentage = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder discountQuantity(Integer value) {
+ this.discountQuantity = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder applyOn(ApplyOn value) {
+ this.applyOn = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder durationType(DurationType value) {
+ this.durationType = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder durationMonth(Integer value) {
+ this.durationMonth = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder validFrom(Timestamp value) {
+ this.validFrom = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder validTill(Timestamp value) {
+ this.validTill = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder maxRedemptions(Integer value) {
+ this.maxRedemptions = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder invoiceNotes(String value) {
+ this.invoiceNotes = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder metaData(java.util.Map value) {
+ this.metaData = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder includedInMrr(Boolean value) {
+ this.includedInMrr = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder period(Integer value) {
+ this.period = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder periodUnit(PeriodUnit value) {
+ this.periodUnit = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder itemConstraints(List value) {
+ this.itemConstraints = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder itemConstraintCriteria(
+ List value) {
+ this.itemConstraintCriteria = value;
+ return this;
+ }
+
+ public CouponUpdateForItemsBuilder couponConstraints(List value) {
+ this.couponConstraints = value;
+ return this;
+ }
+
+ /**
+ * Add a custom field to the request. Custom fields must start with "cf_".
+ *
+ * @param fieldName the name of the custom field (e.g., "cf_custom_field_name")
+ * @param value the value of the custom field
+ * @return this builder
+ * @throws IllegalArgumentException if fieldName doesn't start with "cf_"
+ */
+ public CouponUpdateForItemsBuilder customField(String fieldName, String value) {
+ if (fieldName == null || !fieldName.startsWith("cf_")) {
+ throw new IllegalArgumentException("Custom field name must start with 'cf_'");
+ }
+ this.customFields.put(fieldName, value);
+ return this;
+ }
+
+ /**
+ * Add multiple custom fields to the request. All field names must start with "cf_".
+ *
+ * @param customFields map of custom field names to values
+ * @return this builder
+ * @throws IllegalArgumentException if any field name doesn't start with "cf_"
+ */
+ public CouponUpdateForItemsBuilder customFields(Map customFields) {
+ if (customFields != null) {
+ for (Map.Entry entry : customFields.entrySet()) {
+ if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) {
+ throw new IllegalArgumentException(
+ "Custom field name must start with 'cf_': " + entry.getKey());
+ }
+ this.customFields.put(entry.getKey(), entry.getValue());
+ }
+ }
+ return this;
+ }
+
+ public CouponUpdateForItemsParams build() {
+ return new CouponUpdateForItemsParams(this);
+ }
+ }
+
+ public enum DiscountType {
+ FIXED_AMOUNT("fixed_amount"),
+
+ PERCENTAGE("percentage"),
+
+ OFFER_QUANTITY("offer_quantity"),
+
+ /** An enum member indicating that DiscountType was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ DiscountType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static DiscountType fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (DiscountType enumValue : DiscountType.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum ApplyOn {
+ INVOICE_AMOUNT("invoice_amount"),
+
+ SPECIFIED_ITEMS_TOTAL("specified_items_total"),
+
+ EACH_SPECIFIED_ITEM("each_specified_item"),
+
+ EACH_UNIT_OF_SPECIFIED_ITEMS("each_unit_of_specified_items"),
+
+ /** An enum member indicating that ApplyOn was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ApplyOn(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ApplyOn fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ApplyOn enumValue : ApplyOn.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum DurationType {
+ ONE_TIME("one_time"),
+
+ FOREVER("forever"),
+
+ LIMITED_PERIOD("limited_period"),
+
+ /** An enum member indicating that DurationType was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ DurationType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static DurationType fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (DurationType enumValue : DurationType.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum PeriodUnit {
+ DAY("day"),
+
+ WEEK("week"),
+
+ MONTH("month"),
+
+ YEAR("year"),
+
+ /** An enum member indicating that PeriodUnit was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ PeriodUnit(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static PeriodUnit fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (PeriodUnit enumValue : PeriodUnit.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public static final class ItemConstraintsParams {
+
+ private final Constraint constraint;
+
+ private final ItemType itemType;
+
+ private final List itemPriceIds;
+
+ private ItemConstraintsParams(ItemConstraintsBuilder builder) {
+
+ this.constraint = builder.constraint;
+
+ this.itemType = builder.itemType;
+
+ this.itemPriceIds = builder.itemPriceIds;
+ }
+
+ public Constraint getConstraint() {
+ return constraint;
+ }
+
+ public ItemType getItemType() {
+ return itemType;
+ }
+
+ public List getItemPriceIds() {
+ return itemPriceIds;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.constraint != null) {
+
+ formData.put("constraint", this.constraint);
+ }
+
+ if (this.itemType != null) {
+
+ formData.put("item_type", this.itemType);
+ }
+
+ if (this.itemPriceIds != null) {
+
+ formData.put("item_price_ids", JsonUtil.toJson(this.itemPriceIds));
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for ItemConstraintsParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static ItemConstraintsBuilder builder() {
+ return new ItemConstraintsBuilder();
+ }
+
+ public static final class ItemConstraintsBuilder {
+
+ private Constraint constraint;
+
+ private ItemType itemType;
+
+ private List itemPriceIds;
+
+ private ItemConstraintsBuilder() {}
+
+ public ItemConstraintsBuilder constraint(Constraint value) {
+ this.constraint = value;
+ return this;
+ }
+
+ public ItemConstraintsBuilder itemType(ItemType value) {
+ this.itemType = value;
+ return this;
+ }
+
+ public ItemConstraintsBuilder itemPriceIds(List value) {
+ this.itemPriceIds = value;
+ return this;
+ }
+
+ public ItemConstraintsParams build() {
+ return new ItemConstraintsParams(this);
+ }
+ }
+
+ public enum Constraint {
+ NONE("none"),
+
+ ALL("all"),
+
+ SPECIFIC("specific"),
+
+ CRITERIA("criteria"),
+
+ /** An enum member indicating that Constraint was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ Constraint(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static Constraint fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (Constraint enumValue : Constraint.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum ItemType {
+ PLAN("plan"),
+
+ ADDON("addon"),
+
+ CHARGE("charge"),
+
+ /** An enum member indicating that ItemType was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ItemType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ItemType fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ItemType enumValue : ItemType.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+ }
+
+ public static final class ItemConstraintCriteriaParams {
+
+ private final ItemType itemType;
+
+ private final List itemFamilyIds;
+
+ private final List currencies;
+
+ private final List itemPricePeriods;
+
+ private ItemConstraintCriteriaParams(ItemConstraintCriteriaBuilder builder) {
+
+ this.itemType = builder.itemType;
+
+ this.itemFamilyIds = builder.itemFamilyIds;
+
+ this.currencies = builder.currencies;
+
+ this.itemPricePeriods = builder.itemPricePeriods;
+ }
+
+ public ItemType getItemType() {
+ return itemType;
+ }
+
+ public List getItemFamilyIds() {
+ return itemFamilyIds;
+ }
+
+ public List getCurrencies() {
+ return currencies;
+ }
+
+ public List getItemPricePeriods() {
+ return itemPricePeriods;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.itemType != null) {
+
+ formData.put("item_type", this.itemType);
+ }
+
+ if (this.itemFamilyIds != null) {
+
+ formData.put("item_family_ids", JsonUtil.toJson(this.itemFamilyIds));
+ }
+
+ if (this.currencies != null) {
+
+ formData.put("currencies", JsonUtil.toJson(this.currencies));
+ }
+
+ if (this.itemPricePeriods != null) {
+
+ formData.put("item_price_periods", JsonUtil.toJson(this.itemPricePeriods));
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for ItemConstraintCriteriaParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static ItemConstraintCriteriaBuilder builder() {
+ return new ItemConstraintCriteriaBuilder();
+ }
+
+ public static final class ItemConstraintCriteriaBuilder {
+
+ private ItemType itemType;
+
+ private List itemFamilyIds;
+
+ private List currencies;
+
+ private List itemPricePeriods;
+
+ private ItemConstraintCriteriaBuilder() {}
+
+ public ItemConstraintCriteriaBuilder itemType(ItemType value) {
+ this.itemType = value;
+ return this;
+ }
+
+ public ItemConstraintCriteriaBuilder itemFamilyIds(List value) {
+ this.itemFamilyIds = value;
+ return this;
+ }
+
+ public ItemConstraintCriteriaBuilder currencies(List value) {
+ this.currencies = value;
+ return this;
+ }
+
+ public ItemConstraintCriteriaBuilder itemPricePeriods(List value) {
+ this.itemPricePeriods = value;
+ return this;
+ }
+
+ public ItemConstraintCriteriaParams build() {
+ return new ItemConstraintCriteriaParams(this);
+ }
+ }
+
+ public enum ItemType {
+ PLAN("plan"),
+
+ ADDON("addon"),
+
+ CHARGE("charge"),
+
+ /** An enum member indicating that ItemType was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ ItemType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static ItemType fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (ItemType enumValue : ItemType.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+ }
+
+ public static final class CouponConstraintsParams {
+
+ private final EntityType entityType;
+
+ private final Type type;
+
+ private final String value;
+
+ private CouponConstraintsParams(CouponConstraintsBuilder builder) {
+
+ this.entityType = builder.entityType;
+
+ this.type = builder.type;
+
+ this.value = builder.value;
+ }
+
+ public EntityType getEntityType() {
+ return entityType;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ /** Get the form data for this request. */
+ public Map toFormData() {
+ Map formData = new LinkedHashMap<>();
+
+ if (this.entityType != null) {
+
+ formData.put("entity_type", this.entityType);
+ }
+
+ if (this.type != null) {
+
+ formData.put("type", this.type);
+ }
+
+ if (this.value != null) {
+
+ formData.put("value", this.value);
+ }
+
+ return formData;
+ }
+
+ /** Create a new builder for CouponConstraintsParams. */
+ @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
+ public static CouponConstraintsBuilder builder() {
+ return new CouponConstraintsBuilder();
+ }
+
+ public static final class CouponConstraintsBuilder {
+
+ private EntityType entityType;
+
+ private Type type;
+
+ private String value;
+
+ private CouponConstraintsBuilder() {}
+
+ public CouponConstraintsBuilder entityType(EntityType value) {
+ this.entityType = value;
+ return this;
+ }
+
+ public CouponConstraintsBuilder type(Type value) {
+ this.type = value;
+ return this;
+ }
+
+ public CouponConstraintsBuilder value(String value) {
+ this.value = value;
+ return this;
+ }
+
+ public CouponConstraintsParams build() {
+ return new CouponConstraintsParams(this);
+ }
+ }
+
+ public enum EntityType {
+ CUSTOMER("customer"),
+
+ /** An enum member indicating that EntityType was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ EntityType(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static EntityType fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (EntityType enumValue : EntityType.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+
+ public enum Type {
+ MAX_REDEMPTIONS("max_redemptions"),
+
+ UNIQUE_BY("unique_by"),
+
+ EXISTING_CUSTOMER("existing_customer"),
+
+ NEW_CUSTOMER("new_customer"),
+
+ /** An enum member indicating that Type was instantiated with an unknown value. */
+ _UNKNOWN(null);
+ private final String value;
+
+ Type(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static Type fromString(String value) {
+ if (value == null) return _UNKNOWN;
+ for (Type enumValue : Type.values()) {
+ if (enumValue.value != null && enumValue.value.equals(value)) {
+ return enumValue;
+ }
+ }
+ return _UNKNOWN;
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/DeleteCouponParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/DeleteCouponParams.java
deleted file mode 100644
index 7bd0d56d..00000000
--- a/src/main/java/com/chargebee/v4/models/coupon/params/DeleteCouponParams.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.coupon.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class DeleteCouponParams {
-
- private DeleteCouponParams(DeleteCouponBuilder builder) {}
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- return formData;
- }
-
- /** Create a new builder for DeleteCouponParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static DeleteCouponBuilder builder() {
- return new DeleteCouponBuilder();
- }
-
- public static final class DeleteCouponBuilder {
-
- private DeleteCouponBuilder() {}
-
- public DeleteCouponParams build() {
- return new DeleteCouponParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/UnarchiveForCouponParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/UnarchiveForCouponParams.java
deleted file mode 100644
index b96a3868..00000000
--- a/src/main/java/com/chargebee/v4/models/coupon/params/UnarchiveForCouponParams.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.coupon.params;
-
-import com.chargebee.v4.internal.Recommended;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public final class UnarchiveForCouponParams {
-
- private UnarchiveForCouponParams(UnarchiveForCouponBuilder builder) {}
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- return formData;
- }
-
- /** Create a new builder for UnarchiveForCouponParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static UnarchiveForCouponBuilder builder() {
- return new UnarchiveForCouponBuilder();
- }
-
- public static final class UnarchiveForCouponBuilder {
-
- private UnarchiveForCouponBuilder() {}
-
- public UnarchiveForCouponParams build() {
- return new UnarchiveForCouponParams(this);
- }
- }
-}
diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/UpdateForItemsForCouponParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/UpdateForItemsForCouponParams.java
deleted file mode 100644
index 59d26b63..00000000
--- a/src/main/java/com/chargebee/v4/models/coupon/params/UpdateForItemsForCouponParams.java
+++ /dev/null
@@ -1,1104 +0,0 @@
-/*
- * This file is auto-generated by Chargebee.
- * For more information on how to make changes to this file, please see the README.
- * Reach out to dx@chargebee.com for any questions.
- * Copyright 2025 Chargebee Inc.
- */
-package com.chargebee.v4.models.coupon.params;
-
-import com.chargebee.v4.internal.Recommended;
-import com.chargebee.v4.internal.JsonUtil;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.List;
-import java.sql.Timestamp;
-
-public final class UpdateForItemsForCouponParams {
-
- private final String name;
-
- private final String invoiceName;
-
- private final DiscountType discountType;
-
- private final Long discountAmount;
-
- private final String currencyCode;
-
- private final Number discountPercentage;
-
- private final Integer discountQuantity;
-
- private final ApplyOn applyOn;
-
- private final DurationType durationType;
-
- private final Integer durationMonth;
-
- private final Timestamp validFrom;
-
- private final Timestamp validTill;
-
- private final Integer maxRedemptions;
-
- private final String invoiceNotes;
-
- private final java.util.Map metaData;
-
- private final Boolean includedInMrr;
-
- private final Integer period;
-
- private final PeriodUnit periodUnit;
-
- private final List itemConstraints;
-
- private final List itemConstraintCriteria;
-
- private final List couponConstraints;
-
- private final Map customFields;
-
- private UpdateForItemsForCouponParams(UpdateForItemsForCouponBuilder builder) {
-
- this.name = builder.name;
-
- this.invoiceName = builder.invoiceName;
-
- this.discountType = builder.discountType;
-
- this.discountAmount = builder.discountAmount;
-
- this.currencyCode = builder.currencyCode;
-
- this.discountPercentage = builder.discountPercentage;
-
- this.discountQuantity = builder.discountQuantity;
-
- this.applyOn = builder.applyOn;
-
- this.durationType = builder.durationType;
-
- this.durationMonth = builder.durationMonth;
-
- this.validFrom = builder.validFrom;
-
- this.validTill = builder.validTill;
-
- this.maxRedemptions = builder.maxRedemptions;
-
- this.invoiceNotes = builder.invoiceNotes;
-
- this.metaData = builder.metaData;
-
- this.includedInMrr = builder.includedInMrr;
-
- this.period = builder.period;
-
- this.periodUnit = builder.periodUnit;
-
- this.itemConstraints = builder.itemConstraints;
-
- this.itemConstraintCriteria = builder.itemConstraintCriteria;
-
- this.couponConstraints = builder.couponConstraints;
-
- this.customFields =
- builder.customFields.isEmpty()
- ? Collections.emptyMap()
- : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields));
- }
-
- public String getName() {
- return name;
- }
-
- public String getInvoiceName() {
- return invoiceName;
- }
-
- public DiscountType getDiscountType() {
- return discountType;
- }
-
- public Long getDiscountAmount() {
- return discountAmount;
- }
-
- public String getCurrencyCode() {
- return currencyCode;
- }
-
- public Number getDiscountPercentage() {
- return discountPercentage;
- }
-
- public Integer getDiscountQuantity() {
- return discountQuantity;
- }
-
- public ApplyOn getApplyOn() {
- return applyOn;
- }
-
- public DurationType getDurationType() {
- return durationType;
- }
-
- public Integer getDurationMonth() {
- return durationMonth;
- }
-
- public Timestamp getValidFrom() {
- return validFrom;
- }
-
- public Timestamp getValidTill() {
- return validTill;
- }
-
- public Integer getMaxRedemptions() {
- return maxRedemptions;
- }
-
- public String getInvoiceNotes() {
- return invoiceNotes;
- }
-
- public java.util.Map getMetaData() {
- return metaData;
- }
-
- public Boolean getIncludedInMrr() {
- return includedInMrr;
- }
-
- public Integer getPeriod() {
- return period;
- }
-
- public PeriodUnit getPeriodUnit() {
- return periodUnit;
- }
-
- public List getItemConstraints() {
- return itemConstraints;
- }
-
- public List getItemConstraintCriteria() {
- return itemConstraintCriteria;
- }
-
- public List getCouponConstraints() {
- return couponConstraints;
- }
-
- public Map customFields() {
- return customFields;
- }
-
- /** Get the form data for this request. */
- public Map toFormData() {
- Map formData = new LinkedHashMap<>();
-
- if (this.name != null) {
-
- formData.put("name", this.name);
- }
-
- if (this.invoiceName != null) {
-
- formData.put("invoice_name", this.invoiceName);
- }
-
- if (this.discountType != null) {
-
- formData.put("discount_type", this.discountType);
- }
-
- if (this.discountAmount != null) {
-
- formData.put("discount_amount", this.discountAmount);
- }
-
- if (this.currencyCode != null) {
-
- formData.put("currency_code", this.currencyCode);
- }
-
- if (this.discountPercentage != null) {
-
- formData.put("discount_percentage", this.discountPercentage);
- }
-
- if (this.discountQuantity != null) {
-
- formData.put("discount_quantity", this.discountQuantity);
- }
-
- if (this.applyOn != null) {
-
- formData.put("apply_on", this.applyOn);
- }
-
- if (this.durationType != null) {
-
- formData.put("duration_type", this.durationType);
- }
-
- if (this.durationMonth != null) {
-
- formData.put("duration_month", this.durationMonth);
- }
-
- if (this.validFrom != null) {
-
- formData.put("valid_from", this.validFrom);
- }
-
- if (this.validTill != null) {
-
- formData.put("valid_till", this.validTill);
- }
-
- if (this.maxRedemptions != null) {
-
- formData.put("max_redemptions", this.maxRedemptions);
- }
-
- if (this.invoiceNotes != null) {
-
- formData.put("invoice_notes", this.invoiceNotes);
- }
-
- if (this.metaData != null) {
-
- formData.put("meta_data", JsonUtil.toJson(this.metaData));
- }
-
- if (this.includedInMrr != null) {
-
- formData.put("included_in_mrr", this.includedInMrr);
- }
-
- if (this.period != null) {
-
- formData.put("period", this.period);
- }
-
- if (this.periodUnit != null) {
-
- formData.put("period_unit", this.periodUnit);
- }
-
- if (this.itemConstraints != null) {
-
- // List of objects
- for (int i = 0; i < this.itemConstraints.size(); i++) {
- ItemConstraintsParams item = this.itemConstraints.get(i);
- if (item != null) {
- Map itemData = item.toFormData();
- for (Map.Entry entry : itemData.entrySet()) {
- String indexedKey = "item_constraints[" + entry.getKey() + "][" + i + "]";
- formData.put(indexedKey, entry.getValue());
- }
- }
- }
- }
-
- if (this.itemConstraintCriteria != null) {
-
- // List of objects
- for (int i = 0; i < this.itemConstraintCriteria.size(); i++) {
- ItemConstraintCriteriaParams item = this.itemConstraintCriteria.get(i);
- if (item != null) {
- Map itemData = item.toFormData();
- for (Map.Entry entry : itemData.entrySet()) {
- String indexedKey = "item_constraint_criteria[" + entry.getKey() + "][" + i + "]";
- formData.put(indexedKey, entry.getValue());
- }
- }
- }
- }
-
- if (this.couponConstraints != null) {
-
- // List of objects
- for (int i = 0; i < this.couponConstraints.size(); i++) {
- CouponConstraintsParams item = this.couponConstraints.get(i);
- if (item != null) {
- Map itemData = item.toFormData();
- for (Map.Entry entry : itemData.entrySet()) {
- String indexedKey = "coupon_constraints[" + entry.getKey() + "][" + i + "]";
- formData.put(indexedKey, entry.getValue());
- }
- }
- }
- }
-
- formData.putAll(customFields);
-
- return formData;
- }
-
- /** Create a new builder for UpdateForItemsForCouponParams. */
- @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness")
- public static UpdateForItemsForCouponBuilder builder() {
- return new UpdateForItemsForCouponBuilder();
- }
-
- public static final class UpdateForItemsForCouponBuilder {
-
- private String name;
-
- private String invoiceName;
-
- private DiscountType discountType;
-
- private Long discountAmount;
-
- private String currencyCode;
-
- private Number discountPercentage;
-
- private Integer discountQuantity;
-
- private ApplyOn applyOn;
-
- private DurationType durationType;
-
- private Integer durationMonth;
-
- private Timestamp validFrom;
-
- private Timestamp validTill;
-
- private Integer maxRedemptions;
-
- private String invoiceNotes;
-
- private java.util.Map metaData;
-
- private Boolean includedInMrr;
-
- private Integer period;
-
- private PeriodUnit periodUnit;
-
- private List itemConstraints;
-
- private List itemConstraintCriteria;
-
- private List couponConstraints;
-
- private Map customFields = new LinkedHashMap<>();
-
- private UpdateForItemsForCouponBuilder() {}
-
- public UpdateForItemsForCouponBuilder name(String value) {
- this.name = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder invoiceName(String value) {
- this.invoiceName = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder discountType(DiscountType value) {
- this.discountType = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder discountAmount(Long value) {
- this.discountAmount = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder currencyCode(String value) {
- this.currencyCode = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder discountPercentage(Number value) {
- this.discountPercentage = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder discountQuantity(Integer value) {
- this.discountQuantity = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder applyOn(ApplyOn value) {
- this.applyOn = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder durationType(DurationType value) {
- this.durationType = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder durationMonth(Integer value) {
- this.durationMonth = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder validFrom(Timestamp value) {
- this.validFrom = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder validTill(Timestamp value) {
- this.validTill = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder maxRedemptions(Integer value) {
- this.maxRedemptions = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder invoiceNotes(String value) {
- this.invoiceNotes = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder metaData(java.util.Map value) {
- this.metaData = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder includedInMrr(Boolean value) {
- this.includedInMrr = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder period(Integer value) {
- this.period = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder periodUnit(PeriodUnit value) {
- this.periodUnit = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder itemConstraints(List value) {
- this.itemConstraints = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder itemConstraintCriteria(
- List value) {
- this.itemConstraintCriteria = value;
- return this;
- }
-
- public UpdateForItemsForCouponBuilder couponConstraints(List value) {
- this.couponConstraints = value;
- return this;
- }
-
- /**
- * Add a custom field to the request. Custom fields must start with "cf_".
- *
- * @param fieldName the name of the custom field (e.g., "cf_custom_field_name")
- * @param value the value of the custom field
- * @return this builder
- * @throws IllegalArgumentException if fieldName doesn't start with "cf_"
- */
- public UpdateForItemsForCouponBuilder customField(String fieldName, String value) {
- if (fieldName == null || !fieldName.startsWith("cf_")) {
- throw new IllegalArgumentException("Custom field name must start with 'cf_'");
- }
- this.customFields.put(fieldName, value);
- return this;
- }
-
- /**
- * Add multiple custom fields to the request. All field names must start with "cf_".
- *
- * @param customFields map of custom field names to values
- * @return this builder
- * @throws IllegalArgumentException if any field name doesn't start with "cf_"
- */
- public UpdateForItemsForCouponBuilder customFields(Map customFields) {
- if (customFields != null) {
- for (Map.Entry entry : customFields.entrySet()) {
- if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) {
- throw new IllegalArgumentException(
- "Custom field name must start with 'cf_': " + entry.getKey());
- }
- this.customFields.put(entry.getKey(), entry.getValue());
- }
- }
- return this;
- }
-
- public UpdateForItemsForCouponParams build() {
- return new UpdateForItemsForCouponParams(this);
- }
- }
-
- public enum DiscountType {
- FIXED_AMOUNT("fixed_amount"),
-
- PERCENTAGE("percentage"),
-
- OFFER_QUANTITY("offer_quantity"),
-
- /** An enum member indicating that DiscountType was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- DiscountType(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static DiscountType fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (DiscountType enumValue : DiscountType.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum ApplyOn {
- INVOICE_AMOUNT("invoice_amount"),
-
- SPECIFIED_ITEMS_TOTAL("specified_items_total"),
-
- EACH_SPECIFIED_ITEM("each_specified_item"),
-
- EACH_UNIT_OF_SPECIFIED_ITEMS("each_unit_of_specified_items"),
-
- /** An enum member indicating that ApplyOn was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- ApplyOn(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static ApplyOn fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (ApplyOn enumValue : ApplyOn.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum DurationType {
- ONE_TIME("one_time"),
-
- FOREVER("forever"),
-
- LIMITED_PERIOD("limited_period"),
-
- /** An enum member indicating that DurationType was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- DurationType(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static DurationType fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (DurationType enumValue : DurationType.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public enum PeriodUnit {
- DAY("day"),
-
- WEEK("week"),
-
- MONTH("month"),
-
- YEAR("year"),
-
- /** An enum member indicating that PeriodUnit was instantiated with an unknown value. */
- _UNKNOWN(null);
- private final String value;
-
- PeriodUnit(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static PeriodUnit fromString(String value) {
- if (value == null) return _UNKNOWN;
- for (PeriodUnit enumValue : PeriodUnit.values()) {
- if (enumValue.value != null && enumValue.value.equals(value)) {
- return enumValue;
- }
- }
- return _UNKNOWN;
- }
- }
-
- public static final class ItemConstraintsParams {
-
- private final Constraint constraint;
-
- private final ItemType itemType;
-
- private final List itemPriceIds;
-
- private ItemConstraintsParams(ItemConstraintsBuilder builder) {
-
- this.constraint = builder.constraint;
-
- this.itemType = builder.itemType;
-
- this.itemPriceIds = builder.itemPriceIds;
- }
-
- public Constraint getConstraint() {
- return constraint;
- }
-
- public ItemType getItemType() {
- return itemType;
- }
-
- public List getItemPriceIds() {
- return itemPriceIds;
- }
-
- /** Get the form data for this request. */
- public Map